mirror of
https://github.com/kossLAN/nvim-flake.git
synced 2025-11-04 17:59:50 -05:00
lsp: added rust and some notification management
This commit is contained in:
parent
a5108f68c1
commit
f7ae8e97b0
6 changed files with 59 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
40
nvim/ftplugin/rust.lua
Normal file
40
nvim/ftplugin/rust.lua
Normal file
|
|
@ -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,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -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')
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
1
nvim/plugin/fidget.lua
Normal file
1
nvim/plugin/fidget.lua
Normal file
|
|
@ -0,0 +1 @@
|
|||
require('fidget').setup {}
|
||||
9
nvim/plugin/notify.lua
Normal file
9
nvim/plugin/notify.lua
Normal file
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue