diff options
author | Luca Matei Pintilie <lucafulger@gmail.com> | 2023-04-10 19:43:30 +0000 |
---|---|---|
committer | Luca Matei Pintilie <lucafulger@gmail.com> | 2023-04-10 19:43:30 +0000 |
commit | c35810e74dab73c7eef14322cebbc9405037c3b0 (patch) | |
tree | 3577765706f2c471c4da9d0503f94d3d010902ad /.config/nvim | |
parent | a8b325d57a8a1084bf6f2bd660773873d174abae (diff) | |
download | dotfiles-c35810e74dab73c7eef14322cebbc9405037c3b0.tar dotfiles-c35810e74dab73c7eef14322cebbc9405037c3b0.tar.gz dotfiles-c35810e74dab73c7eef14322cebbc9405037c3b0.tar.bz2 dotfiles-c35810e74dab73c7eef14322cebbc9405037c3b0.tar.lz dotfiles-c35810e74dab73c7eef14322cebbc9405037c3b0.tar.xz dotfiles-c35810e74dab73c7eef14322cebbc9405037c3b0.tar.zst dotfiles-c35810e74dab73c7eef14322cebbc9405037c3b0.zip |
Bump neovim config to 0.9 and add undotree and test related commands
Diffstat (limited to '.config/nvim')
-rw-r--r-- | .config/nvim/lua/general.lua | 3 | ||||
-rw-r--r-- | .config/nvim/lua/keybinds.lua | 2 | ||||
-rw-r--r-- | .config/nvim/lua/lsp.lua | 13 | ||||
-rw-r--r-- | .config/nvim/lua/plugins.lua | 55 |
4 files changed, 47 insertions, 26 deletions
diff --git a/.config/nvim/lua/general.lua b/.config/nvim/lua/general.lua index 255a111..fc4eb88 100644 --- a/.config/nvim/lua/general.lua +++ b/.config/nvim/lua/general.lua @@ -11,7 +11,6 @@ vim.opt.wrap = false vim.opt.colorcolumn = "120" vim.opt.scrolloff = 5 vim.opt.spelllang = "en,nb" -vim.opt.spell = false vim.opt.cursorline = true -- vim.opt.tabstop = 4 @@ -41,6 +40,8 @@ vim.opt.listchars:append("tab:-->") vim.cmd [[colorscheme dracula]] vim.cmd [[hi Normal guibg=NONE ctermbg=NONE]] +vim.opt.spell = false + vim.g.markdown_fenced_languages = { "ts=typescript"; "xml"; diff --git a/.config/nvim/lua/keybinds.lua b/.config/nvim/lua/keybinds.lua index b017716..6f6351f 100644 --- a/.config/nvim/lua/keybinds.lua +++ b/.config/nvim/lua/keybinds.lua @@ -25,6 +25,7 @@ vim.keymap.set("n", "<Leader><TAB>", telescope.buffers) vim.keymap.set("n", "<Leader>D", telescope.lsp_definitions) vim.keymap.set("n", "<Leader>R", telescope.lsp_references) vim.keymap.set("n", "<Leader>S", telescope.lsp_document_symbols) +vim.keymap.set("n", "<Leader>U", vim.cmd.UndotreeToggle) vim.keymap.set("n", "<Leader>m", ":MinimapToggle<CR>") vim.keymap.set("n", "<Leader>b", ":Gitsigns blame_line<CR>") @@ -67,5 +68,6 @@ wk.register({ ["q"] = "Quit"; ["R"] = "Show References"; ["J"] = "Signature help"; + ["U"] = "Undo tree"; }, { prefix = "<leader>" }); diff --git a/.config/nvim/lua/lsp.lua b/.config/nvim/lua/lsp.lua index a2207d5..1a828ec 100644 --- a/.config/nvim/lua/lsp.lua +++ b/.config/nvim/lua/lsp.lua @@ -91,6 +91,9 @@ local on_attach = function(client, bufnr) lsp_signature.on_attach({ bind = true }, bufnr) require("lsp-inlayhints").setup() require("lsp-inlayhints").on_attach(client, bufnr, false) + if client.server_capabilities.semanticTokensProvider then + client.server_capabilities.semanticTokensProvider = nil + end end vim.api.nvim_create_augroup("LspAttach_inlayhints", {}) @@ -293,6 +296,11 @@ vim.lsp.handlers["textDocument/hover"] = -- Debugging local dap, dapui = require("dap"), require("dapui") +dap.adapters.netcoredbg = { + type = "executable"; + command = "netcoredbg"; + args = { "--interpreter=vscode" }; +} dapui.setup() dap.listeners.after.event_initialized["dapui_config"] = function() dapui.open() end @@ -300,6 +308,11 @@ dap.listeners.before.event_terminated["dapui_config"] = function() dapui.close() end dap.listeners.before.event_exited["dapui_config"] = function() dapui.close() end +vim.cmd [[ command! TestSingle :lua require("neotest").run.run() ]] +vim.cmd [[ command! TestFile :lua require("neotest").run.run(vim.fn.expand("%")) ]] +vim.cmd [[ command! TestDebugSingle :lua require("neotest").run.run({strategy = "dap"}) ]] +vim.cmd [[ command! TestDebugToggleBreakpoint :DapToggleBreakpoint ]] + vim.diagnostic.config({ virtual_text = false; signs = true; diff --git a/.config/nvim/lua/plugins.lua b/.config/nvim/lua/plugins.lua index b7e5071..721d875 100644 --- a/.config/nvim/lua/plugins.lua +++ b/.config/nvim/lua/plugins.lua @@ -20,6 +20,7 @@ local PKGS = { { url = "https://github.com/mg979/vim-visual-multi.git" }; { url = "https://github.com/echasnovski/mini.nvim.git" }; { url = "https://github.com/catppuccin/nvim.git" }; + { url = "https://github.com/mbbill/undotree.git" }; -- Status line { url = "https://github.com/akinsho/bufferline.nvim.git" }; @@ -69,6 +70,9 @@ local PKGS = { { url = "https://github.com/jose-elias-alvarez/null-ls.nvim.git" }; { url = "https://github.com/mfussenegger/nvim-dap.git" }; { url = "https://github.com/rcarriga/nvim-dap-ui.git" }; + { url = "https://github.com/antoinemadec/FixCursorHold.nvim.git" }; + { url = "https://github.com/nvim-neotest/neotest.git" }; + { url = "https://github.com/Issafalcon/neotest-dotnet.git" }; -- Dev container { url = "https://codeberg.org/esensar/nvim-dev-container.git" }; @@ -78,31 +82,6 @@ local PKGS = { { url = "https://github.com/seandewar/nvimesweeper.git" }; } -local function clone_paq() - local path = vim.fn.stdpath("data") .. "/site/pack/paqs/start/paq-nvim" - if vim.fn.empty(vim.fn.glob(path)) > 0 then - vim.fn.system { - "git"; - "clone"; - "--depth=1"; - "https://github.com/savq/paq-nvim.git"; - path; - } - return true - else - return false - end -end -local function bootstrap_paq() - clone_paq() - -- Load Paq - vim.cmd("packadd paq-nvim") - local paq = require("paq") - -- Read and install packages - paq(PKGS) - paq.install() -end - local function init_plugins() local paq = require("paq") paq(PKGS) @@ -332,6 +311,32 @@ local function init_plugins() mappings = {}; }) + require("neotest").setup({ adapters = { require("neotest-dotnet") } }) +end + +local function clone_paq() + local path = vim.fn.stdpath("data") .. "/site/pack/paqs/start/paq-nvim" + if vim.fn.empty(vim.fn.glob(path)) > 0 then + vim.fn.system { + "git"; + "clone"; + "--depth=1"; + "https://github.com/savq/paq-nvim.git"; + path; + } + return true + else + return false + end +end +local function bootstrap_paq() + clone_paq() + -- Load Paq + vim.cmd("packadd paq-nvim") + local paq = require("paq") + -- Read and install packages + paq(PKGS) + paq.install() end return { |