This commit is contained in:
Andrew Haynes
2026-03-25 08:34:02 -04:00
parent e3f660a4e4
commit 436d28b6d2
4 changed files with 35 additions and 17 deletions
+26 -5
View File
@@ -10,13 +10,15 @@ vim.pack.add({
{ src = "git@moo:dmm/polydev.git", version = "main" },
{ src = "https://github.com/nvim-treesitter/nvim-treesitter", build = ":TSUpdate" },
{ src = "https://github.com/alexghergh/nvim-tmux-navigation" },
{ src = "https://github.com/mason-org/mason.nvim" },
{ src = "https://github.com/stevearc/conform.nvim" },
})
require'nvim-tmux-navigation'.setup {
disable_when_zoomed = true -- defaults to false
require("mason").setup()
require 'nvim-tmux-navigation'.setup {
disable_when_zoomed = true -- defaults to false
}
require('nvim-treesitter').install { 'rust', 'c', 'cpp', 'lua' }
require('nvim-treesitter').install { 'rust', 'c', 'cpp', 'lua', 'nix' }
vim.api.nvim_create_autocmd('FileType', {
pattern = { 'c', 'cpp', 'rust', 'lua' },
callback = function()
@@ -24,6 +26,24 @@ vim.api.nvim_create_autocmd('FileType', {
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
end,
})
require("conform").setup({
formatters_by_ft = {
nix = { "alejandra" },
-- Conform will run multiple formatters sequentially
-- You can customize some of the format options for the filetype (:help conform.format)
rust = { "rustfmt", lsp_format = "fallback" },
-- Conform will run the first available formatter
-- javascript = { "prettierd", "prettier", stop_after_first = true },
-- -- Use a "*" to run formatters on all filetypes
["*"] = { "codespell" },
-- Use "_" to run formatters on filetypes that don't have other formatters
["_"] = { "trim_whitespace" },
},
format_on_save = {
timeout_ms = 500,
lsp_format = "fallback",
},
})
require('colorizer').setup()
require("Polydev").setup({
@@ -125,7 +145,7 @@ vim.lsp.config("lua_ls", {
},
},
})
vim.lsp.enable({ "lua_ls", "clangd", "rust-analyzer" })
vim.lsp.enable({ "lua_ls", "clangd", "rust-analyzer", "nil_ls" })
vim.api.nvim_set_hl(0, "Normal", { bg = "none" })
vim.api.nvim_set_hl(0, "NormalFloat", { link = 'Normal' })
vim.api.nvim_set_hl(0, "StatusLine", { link = 'Normal' })
@@ -170,3 +190,4 @@ vim.keymap.set("n", "<C-h>", ":NvimTmuxNavigateLeft<CR>", { silent = true })
vim.keymap.set("n", "<C-j>", ":NvimTmuxNavigateDown<CR>", { silent = true })
vim.keymap.set("n", "<C-k>", ":NvimTmuxNavigateUp<CR>", { silent = true })
vim.keymap.set("n", "<C-l>", ":NvimTmuxNavigateRight<CR>", { silent = true })