commit f7aa8195f484aea61584c9bf6e99a8dda7cb67cd
parent e38d48b34b453044b82561b6d6a26104a4e0a658
Author: Alex Balgavy <alexander.balgavy@spaceapplications.com>
Date: Thu, 18 Apr 2024 18:54:45 +0200
nvim: misc settings
Diffstat:
5 files changed, 100 insertions(+), 37 deletions(-)
diff --git a/nvim/lua/config/mason-lspconfig.lua b/nvim/lua/config/mason-lspconfig.lua
@@ -13,38 +13,43 @@ local servers = {
allFeatures = true,
loadOutDirsFromCheck = true,
runBuildScripts = true,
+ -- extraEnv = {
+ -- RUSTFLAGS = "--cfg tokio_unstable",
+ -- },
},
-- Add clippy lints for Rust.
checkOnSave = {
allFeatures = true,
- -- command = "clippy",
- -- extraArgs = {
- -- "--no-deps",
- -- "--",
- -- "-D", "clippy::pedantic",
- -- "-D", "clippy::nursery",
- -- "-D", "clippy::restriction",
- -- "-A", "clippy::blanket_clippy_restriction_lints",
- -- "-A", "clippy::missing_docs_in_private_items",
- -- "-A", "clippy::implicit_return",
- -- "-A", "clippy::question_mark_used",
- -- "-A", "clippy::min_ident_chars",
- -- "-A", "clippy::pattern_type_mismatch",
- -- "-A", "clippy::single_call_fn",
- -- "-A", "clippy::as_conversions",
- -- "-A", "clippy::pub_with_shorthand",
- -- "-A", "clippy::shadow_reuse",
- -- "-A", "clippy::separated_literal_suffix",
- -- "-A", "clippy::float_arithmetic",
- -- "-A", "clippy::pub_use",
- -- "-A", "clippy::single_char_lifetime_names",
- -- "-A", "clippy::missing_trait_methods",
- -- "-A", "clippy::multiple_unsafe_ops_per_block", -- broken on 0.1.74
- -- "-D", "rust_2018_idioms",
- -- "-D", "missing_docs",
- -- "-D", "warnings",
- -- "-A", "clippy::too_many_lines"},
- command = "check",
+ command = "clippy",
+ extraArgs = {
+ -- "--no-deps",
+ "--",
+ "-D", "clippy::pedantic",
+ "-D", "clippy::nursery",
+ "-D", "clippy::restriction",
+ "-A", "clippy::blanket_clippy_restriction_lints",
+ "-A", "clippy::missing_docs_in_private_items",
+ "-A", "clippy::implicit_return",
+ "-A", "clippy::question_mark_used",
+ "-A", "clippy::min_ident_chars",
+ "-A", "clippy::pattern_type_mismatch",
+ "-A", "clippy::single_call_fn",
+ "-A", "clippy::as_conversions",
+ "-A", "clippy::pub_with_shorthand",
+ "-A", "clippy::shadow_reuse",
+ "-A", "clippy::separated_literal_suffix",
+ "-A", "clippy::float_arithmetic",
+ "-A", "clippy::pub_use",
+ "-A", "clippy::single_char_lifetime_names",
+ "-A", "clippy::missing_trait_methods",
+ "-A", "clippy::multiple_unsafe_ops_per_block", -- broken on 0.1.74
+ "-A", "clippy::mod_module_files",
+ "-A", "clippy::std_instead_of_alloc",
+ "-D", "rust_2018_idioms",
+ "-D", "missing_docs",
+ "-D", "warnings",
+ "-A", "clippy::too_many_lines"},
+ -- command = "check" },
-- extraArgs = { "--no-deps" },
},
procMacro = {
@@ -57,9 +62,9 @@ local servers = {
},
},
},
+ pyright = {},
-- solargraph = {},
-- bashls = {},
- -- pyright = {},
-- jdtls = {},
-- jsonls = {},
-- texlab = {},
diff --git a/nvim/lua/config/nvim-treesitter.lua b/nvim/lua/config/nvim-treesitter.lua
@@ -1,7 +1,7 @@
require('nvim-treesitter.configs').setup {
-- Add languages to be installed here that you want installed for treesitter
ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'typescript', 'vim', 'vimdoc', 'bash', 'ledger', 'ruby',
- 'python', 'java', 'sql'},
+ 'python', 'java', 'sql', 'markdown_inline'},
highlight = { enable = true },
indent = { enable = true, disable = { 'python' } },
diff --git a/nvim/lua/config/telescope.lua b/nvim/lua/config/telescope.lua
@@ -18,8 +18,9 @@ vim.keymap.set('n', '<leader>sw', require('telescope.builtin').grep_string, { de
vim.keymap.set('n', '<leader>sg', require('telescope.builtin').live_grep, { desc = '[S]earch by [G]rep' })
vim.keymap.set('n', '<leader>sd', require('telescope.builtin').diagnostics, { desc = '[S]earch [D]iagnostics' })
vim.keymap.set('n', '<leader>sr', require('telescope.builtin').lsp_references, { desc = '[S]earch [R]eferences' })
-vim.keymap.set('n', '<leader>si', require('telescope.builtin').lsp_incoming_calls, { desc = '[S]earch [I]ncoming calls' })
-vim.keymap.set('n', '<leader>so', require('telescope.builtin').lsp_outgoing_calls, { desc = '[S]earch [O]utgoing calls' })
+vim.keymap.set('n', '<leader>sI', require('telescope.builtin').lsp_incoming_calls, { desc = '[S]earch [I]ncoming calls' })
+vim.keymap.set('n', '<leader>sO', require('telescope.builtin').lsp_outgoing_calls, { desc = '[S]earch [O]utgoing calls' })
+vim.keymap.set('n', '<leader>si', require('telescope.builtin').lsp_implementations, { desc = '[S]earch [i]mplementations' })
vim.keymap.set('n', '<leader>ss', function()
local ok, lsp_buf = pcall(require, 'vim.lsp.buf')
if ok and lsp_buf.server_ready() then
diff --git a/nvim/lua/plugins.lua b/nvim/lua/plugins.lua
@@ -35,7 +35,14 @@ return {
'jose-elias-alvarez/null-ls.nvim',
config = function()
local null_ls = require('null-ls')
- null_ls.setup { sources = { null_ls.builtins.diagnostics.shellcheck, null_ls.builtins.code_actions.shellcheck, null_ls.builtins.diagnostics.vacuum, null_ls.builtins.diagnostics.checkmake } }
+ null_ls.setup { sources = {
+ null_ls.builtins.diagnostics.shellcheck,
+ null_ls.builtins.code_actions.shellcheck,
+ null_ls.builtins.diagnostics.vacuum,
+ null_ls.builtins.diagnostics.checkmake,
+ null_ls.builtins.diagnostics.flake8,
+ -- null_ls.builtins.diagnostics.pylint,
+ } }
end,
},
@@ -178,7 +185,7 @@ return {
require('dap-python').setup(vim.fn.stdpath("data") .. "/mason/packages/debugpy/venv/bin/python")
end
},
- { "rcarriga/nvim-dap-ui", dependencies = {"mfussenegger/nvim-dap"}, config = function()
+ { "rcarriga/nvim-dap-ui", dependencies = {"mfussenegger/nvim-dap", "nvim-neotest/nvim-nio"}, config = function()
require 'config.nvim-dap-ui'
end
},
@@ -257,4 +264,54 @@ return {
{ "<leader>to", "<cmd>AerialOpen<cr>", desc = "Open and jump to tagbar" },
},
},
+ {
+ "nvim-treesitter/nvim-treesitter-context",
+ dependencies = {"nvim-treesitter/nvim-treesitter"},
+ config = function()
+ require("treesitter-context").setup()
+ end
+ },
+
+ -- diagnostics
+ {
+ "folke/trouble.nvim",
+ branch = "dev", -- IMPORTANT!
+ keys = {
+ {
+ "<leader>xx",
+ "<cmd>Trouble diagnostics toggle<cr>",
+ desc = "Diagnostics (Trouble)",
+ },
+ {
+ "<leader>xb",
+ "<cmd>Trouble diagnostics toggle filter.buf=0<cr>",
+ desc = "Buffer Diagnostics (Trouble)",
+ },
+ {
+ "<leader>xs",
+ "<cmd>Trouble symbols toggle focus=false<cr>",
+ desc = "Symbols (Trouble)",
+ },
+ {
+ "<leader>xd",
+ "<cmd>Trouble lsp toggle focus=false win.position=right<cr>",
+ desc = "LSP Definitions / references / ... (Trouble)",
+ },
+ {
+ "<leader>xl",
+ "<cmd>Trouble loclist toggle<cr>",
+ desc = "Location List (Trouble)",
+ },
+ {
+ "<leader>xq",
+ "<cmd>Trouble qflist toggle<cr>",
+ desc = "Quickfix List (Trouble)",
+ },
+ },
+ opts = {}, -- for default options, refer to the configuration section for custom setup.
+ },
+ {
+ "echasnovski/mini.align",
+ config = function(_, opts) require'mini.align'.setup() end,
+ },
}
diff --git a/vim/vimrc b/vim/vimrc
@@ -68,9 +68,6 @@ Plug 'othree/html5.vim', { 'for': 'html' }
Plug 'vim-scripts/OmniCppComplete', { 'for': 'cpp' }
Plug 'vim-scripts/pythoncomplete', { 'for': 'python' }
-" Alignment
-Plug 'junegunn/vim-easy-align'
-"
" Peek contents of registers
Plug 'junegunn/vim-peekaboo'
@@ -133,6 +130,9 @@ Plug 'mbbill/undotree'
" Vim-only
if !has('nvim')
+ " Alignment
+ Plug 'junegunn/vim-easy-align'
+
" A tag overview on the right side
Plug 'majutsushi/tagbar'