diff --git a/nix/neovim-overlay.nix b/nix/neovim-overlay.nix index f825666..1c5065a 100644 --- a/nix/neovim-overlay.nix +++ b/nix/neovim-overlay.nix @@ -82,11 +82,14 @@ with final.pkgs.lib; let # Autoformatting conform-nvim # Theme for neovim - tokyonight-nvim + everforest # QOL Plugin for visuals mostly mini-nvim # https://github.com/echasnovski/mini.nvim/ # Debugging nvim-dap + # Notifications + nvim-notify + fidget-nvim # Copilot related plugins CopilotChat-nvim @@ -100,10 +103,12 @@ with final.pkgs.lib; let clang-tools # provides clangd which is a c/c++ lsp jdt-language-server # java ls nixd # nix LSP + rust-analyzer # rust LSP # autoformatters alejandra # amazing nix autoformatter stylua # lua formatter + rustfmt # rust formatter # google-java-format # java formatter based off google guidelines # misc diff --git a/nvim/ftplugin/rust.lua b/nvim/ftplugin/rust.lua new file mode 100644 index 0000000..806da62 --- /dev/null +++ b/nvim/ftplugin/rust.lua @@ -0,0 +1,40 @@ +-- Exit if the language server isn't available +if vim.fn.executable('rust-analyzer') ~= 1 then + return +end + +local root_files = { + 'Cargo.toml', + 'rust-project.json', +} + +-- Tab Width +vim.bo.tabstop = 2 +vim.bo.shiftwidth = 2 +vim.bo.expandtab = true + +vim.lsp.start { + name = 'rust-analyzer', + cmd = { 'rust-analyzer' }, + root_dir = vim.fs.dirname(vim.fs.find(root_files, { upward = true })[1]), + capabilities = require('user.lsp').make_client_capabilities(), + settings = { + ['rust-analyzer'] = { + diagnostics = { enable = false }, + imports = { + granularity = { + group = 'module', + }, + prefix = 'self', + }, + cargo = { + buildScripts = { + enable = true, + }, + }, + procMacro = { + enable = true, + }, + }, + }, +} diff --git a/nvim/init.lua b/nvim/init.lua index a38666f..0a1a79d 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -109,4 +109,5 @@ cmd.packadd('cfilter') -- Allows filtering the quickfix list with :cfdo vim.g.sqlite_clib_path = require('luv').os_getenv('LIBSQLITE') -- Vim Theme -vim.cmd.colorscheme('tokyonight-night') +vim.g.everforest_background = 'hard' +vim.cmd.colorscheme('everforest') diff --git a/nvim/plugin/conform.lua b/nvim/plugin/conform.lua index d091ea5..954dcd4 100644 --- a/nvim/plugin/conform.lua +++ b/nvim/plugin/conform.lua @@ -2,6 +2,7 @@ require('conform').setup { formatters_by_ft = { lua = { 'stylua' }, nix = { 'alejandra' }, + rust = { 'rustfmt' }, -- Conform will run multiple formatters sequentially -- python = { "isort", "black" }, -- You can customize some of the format options for the filetype (:help conform.format) diff --git a/nvim/plugin/fidget.lua b/nvim/plugin/fidget.lua new file mode 100644 index 0000000..b242379 --- /dev/null +++ b/nvim/plugin/fidget.lua @@ -0,0 +1 @@ +require('fidget').setup {} diff --git a/nvim/plugin/notify.lua b/nvim/plugin/notify.lua new file mode 100644 index 0000000..1919664 --- /dev/null +++ b/nvim/plugin/notify.lua @@ -0,0 +1,9 @@ +vim.notify = require('notify') +-- vim.notify = require('notify').setup { +-- -- Configuration options +-- level = vim.log.levels.INFO, -- Set the minimum level of messages to display +-- timeout = 3000, -- Duration to display notifications (in ms) +-- stages = 'fade', -- Animation style for notifications +-- } + +-- Set nvim-notify as the default notification handler