diff options
| -rw-r--r-- | .bashrc | 10 | ||||
| -rw-r--r-- | .config/nvim/init.lua | 17 | ||||
| -rw-r--r-- | .config/nvim/lua/plugins/lsp.lua | 35 |
3 files changed, 50 insertions, 12 deletions
@@ -12,9 +12,9 @@ fi export PATH # Rust -if [ -d "$HOME/.cargo" ]; then - . "$HOME/.cargo/env" -fi +#if [ -d "$HOME/.cargo" ]; then +# . "$HOME/.cargo/env" +#fi # Uncomment the following line if you don't like systemctl's auto-paging feature: # export SYSTEMD_PAGER= @@ -34,8 +34,8 @@ PS1='\[\e[1m\][ \[\e[96m\]\w \[\e[39m\]]\\$ \[\e[0m\]' HISTCONTROL=ignoredups:erasedups shopt -s histappend shopt -s checkwinsize -export HISTFILESIZE=1000 -export HISTSIZE=500 +export HISTFILESIZE=10000 +export HISTSIZE=50 export VISUAL=nvim export EDITOR="$VISUAL" alias ls="ls -F --color"; diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 112ca25..a23bed7 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -27,6 +27,23 @@ vim.api.nvim_set_keymap('v', '<C-c>', '"+y', { noremap = true, silent = true }) -- end --}) +vim.diagnostic.config({ + virtual_text = false, -- Disable inline text diagnostics + signs = true, -- Keep signs in the sign column + update_in_insert = false, + underline = true, + severity_sort = true, +}) + +-- Show diagnostics on hover +vim.o.updatetime = 250 -- Faster update time for hover +vim.api.nvim_create_autocmd("CursorHold", { + pattern = "*", + callback = function() + vim.diagnostic.open_float(nil, { focus = false, scope = "cursor" }) + end, +}) + -- Install Lazy.vim local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" if not vim.loop.fs_stat(lazypath) then diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua index 4e9ef07..5080622 100644 --- a/.config/nvim/lua/plugins/lsp.lua +++ b/.config/nvim/lua/plugins/lsp.lua @@ -12,13 +12,13 @@ return { }, { - "williamboman/mason-lspconfig.nvim", - config = function() - require("mason-lspconfig").setup { - ensure_installed = { "bashls", "lua_ls", "clangd", "marksman", "pyright", "rust_analyzer" }, - automatic_installation = true, - } - end + "williamboman/mason-lspconfig.nvim", + config = function() + require("mason-lspconfig").setup { + ensure_installed = { "bashls", "lua_ls", "clangd", "marksman", "pyright", "rust_analyzer" }, + automatic_installation = true, + } + end }, { @@ -44,6 +44,27 @@ return { }) lspconfig.rust_analyzer.setup({ capabilities = capabilities, + settings = { + ['rust-analyzer'] = { + assist = { + importEnforceGranularity = true, + importPrefix = 'crate', + }, + cargo = { + allFeatures = true, + }, + checkOnSave = { + command = 'clippy', + }, + inlayHints = { locationLinks = false }, + diagnostics = { + enable = true, + experimental = { + enable = true, + }, + }, + }, + }, }) -- Key mapping |
