commit 7e0ae34877cff11db0150609c229fa7ba16d2f02
parent ae16694ff94b60535530a7534ce68c47889be9b9
Author: Alex Balgavy <alex@balgavy.eu>
Date: Sun, 11 Jun 2023 23:58:08 +0200
nvim: settings
Diffstat:
5 files changed, 50 insertions(+), 35 deletions(-)
diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json
@@ -1,26 +1,27 @@
{
- "Comment.nvim": { "branch": "master", "commit": "e1fe53117aab24c378d5e6deaad786789c360123" },
- "LuaSnip": { "branch": "master", "commit": "b4bc24c4925aeb05fd47d2ee9b24b7f73f5d7e32" },
+ "Comment.nvim": { "branch": "master", "commit": "c8043290f2d77f61025494d839d88e414608c460" },
+ "LuaSnip": { "branch": "master", "commit": "51ebb4b6637290e1b8e0fb0d6f38b605d3c24940" },
"cmp-nvim-lsp": { "branch": "main", "commit": "0e6b2ed705ddcff9738ec4ea838141654f12eeef" },
"cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" },
"fidget.nvim": { "branch": "main", "commit": "0ba1e16d07627532b6cae915cc992ecac249fb97" },
- "gitsigns.nvim": { "branch": "main", "commit": "814158f6c4b1724c039fcefe79b0be72c9131c2d" },
- "indent-blankline.nvim": { "branch": "master", "commit": "018bd04d80c9a73d399c1061fa0c3b14a7614399" },
- "lazy.nvim": { "branch": "main", "commit": "652b6febf8d5c99eb8cf4a1cec63da6db62e77d2" },
- "lsp-inlayhints.nvim": { "branch": "main", "commit": "62c7b8dd8ac9933b071912fe3c789ef2cb704672" },
- "mason-lspconfig.nvim": { "branch": "main", "commit": "90a8bbf106b85b76951a34c542058ffa807de2b1" },
- "mason.nvim": { "branch": "main", "commit": "e634134312bb936f472468a401c9cae6485ab54b" },
- "neodev.nvim": { "branch": "main", "commit": "6498a07601702349c31909005bb333003e4687d4" },
- "null-ls.nvim": { "branch": "main", "commit": "08bb00c7c2cd58c72e02cf54e4b9cbfe14b03e09" },
- "nvim-cmp": { "branch": "main", "commit": "d153771162bd9795d9f7142df5c674b61066a585" },
- "nvim-dap": { "branch": "master", "commit": "6cedcb527e264c8f25e86afa8dae74c6692dee51" },
- "nvim-dap-python": { "branch": "master", "commit": "51ecb08dbff57fca8add396b93dc765aba262e0a" },
- "nvim-dap-ui": { "branch": "master", "commit": "078972d39338a49ec13fc43a44e235cc43189276" },
- "nvim-lspconfig": { "branch": "master", "commit": "df58d91c9351a9dc5be6cf8d54f49ab0d9a64e73" },
- "nvim-treesitter": { "branch": "master", "commit": "7e1cb38c382dc1f1feb90a759a26dd600bd39841" },
- "nvim-treesitter-textobjects": { "branch": "master", "commit": "35a60f093fa15a303874975f963428a5cd24e4a0" },
- "plenary.nvim": { "branch": "master", "commit": "9ac3e9541bbabd9d73663d757e4fe48a675bb054" },
- "telescope-fzf-native.nvim": { "branch": "main", "commit": "580b6c48651cabb63455e97d7e131ed557b8c7e2" },
- "telescope.nvim": { "branch": "master", "commit": "d77b37f4520e5fc2cf4c74c12e42ed4b589bd367" },
- "which-key.nvim": { "branch": "main", "commit": "5a6c954a5a46023c19acc03a8b6d7c3e57964fc5" }
+ "gitsigns.nvim": { "branch": "main", "commit": "f868d82a36f7f7f5e110eb0a9659993984f59875" },
+ "indent-blankline.nvim": { "branch": "master", "commit": "7075d7861f7a6bbf0de0298c83f8a13195e6ec01" },
+ "lazy.nvim": { "branch": "main", "commit": "f145e6f42a56306c5536e9efbfe41f7efbec285d" },
+ "lsp-inlayhints.nvim": { "branch": "main", "commit": "3700e6458fb1702c12a7e33037fb17f649679552" },
+ "mason-lspconfig.nvim": { "branch": "main", "commit": "f0ce33f4794a2364eb08d09d09380e8b04ec5e6a" },
+ "mason.nvim": { "branch": "main", "commit": "7d7efc738e08fc5bee822857db45cb6103f0b0c1" },
+ "neodev.nvim": { "branch": "main", "commit": "91bebf70e2c50c1d298752b74a34ca9da3c04f85" },
+ "null-ls.nvim": { "branch": "main", "commit": "c89333e034a8daba654ebfcf9a4ec9f87765f01e" },
+ "nvim-cmp": { "branch": "main", "commit": "fc0f694af1a742ada77e5b1c91ff405c746f4a26" },
+ "nvim-dap": { "branch": "master", "commit": "7c1d47cf7188fc31acdf951f9eee22da9d479152" },
+ "nvim-dap-python": { "branch": "master", "commit": "37b4cba02e337a95cb62ad1609b3d1dccb2e5d42" },
+ "nvim-dap-ui": { "branch": "master", "commit": "c020f660b02772f9f3d11f599fefad3268628a9e" },
+ "nvim-dap-virtual-text": { "branch": "master", "commit": "57f1dbd0458dd84a286b27768c142e1567f3ce3b" },
+ "nvim-lspconfig": { "branch": "master", "commit": "664de12a7816dfa348bb475607edfa4fe0122025" },
+ "nvim-treesitter": { "branch": "master", "commit": "2d6e73ab2fd1daad1e8134f174d06a869cbc96b4" },
+ "nvim-treesitter-textobjects": { "branch": "master", "commit": "23e883b99228f8d438254e5ef8c897e5e60e75d1" },
+ "plenary.nvim": { "branch": "master", "commit": "499e0743cf5e8075cd32af68baa3946a1c76adf1" },
+ "telescope-fzf-native.nvim": { "branch": "main", "commit": "9bc8237565ded606e6c366a71c64c0af25cd7a50" },
+ "telescope.nvim": { "branch": "master", "commit": "6d3fbffe426794296a77bb0b37b6ae0f4f14f807" },
+ "which-key.nvim": { "branch": "main", "commit": "e271c28118998c93a14d189af3395812a1aa646c" }
}
\ No newline at end of file
diff --git a/nvim/lua/config/nvim-dap-ui.lua b/nvim/lua/config/nvim-dap-ui.lua
@@ -1,7 +1,7 @@
require('dapui').setup()
vim.keymap.set({'n', 'v'}, '<localleader>dh', function()
require('dapui').eval(nil, {})
-end)
+end, { desc = 'Eval current expression' })
vim.keymap.set('n', '<localleader>do', function()
require('dapui').toggle()
-end)
+end, { desc = '[D]ebug toggle UI' })
diff --git a/nvim/lua/config/nvim-dap.lua b/nvim/lua/config/nvim-dap.lua
@@ -23,15 +23,15 @@ dap.configurations.rust = {
stopOnEntry = false,
},
}
-vim.keymap.set('n', '<localleader>dc', function() require('dap').continue() end)
-vim.keymap.set('n', '<localleader>dn', function() require('dap').step_over() end)
-vim.keymap.set('n', '<localleader>di', function() require('dap').step_into() end)
-vim.keymap.set('n', '<localleader>df', function() require('dap').step_out() end)
-vim.keymap.set('n', '<localleader>db', function() require('dap').toggle_breakpoint() end)
-vim.keymap.set('n', '<localleader>dB', function() require('dap').set_breakpoint() end)
-vim.keymap.set('n', '<localleader>dm', function() require('dap').set_breakpoint(nil, nil, vim.fn.input('Log point message: ')) end)
-vim.keymap.set('n', '<localleader>dr', function() require('dap').repl.open() end)
-vim.keymap.set('n', '<localleader>dC', function() require('dap').run_last() end)
-vim.keymap.set('n', '<localleader>dj', function() require('dap').focus_frame() end)
-vim.keymap.set('n', '<localleader>dH', function() require('dap').goto_(nil) end)
-vim.keymap.set('n', '<localleader>dS', function() require('dap').close() end)
+vim.keymap.set('n', '<localleader>dc', function() require('dap').continue() end, { desc = '[D]ebug [c]ontinue' })
+vim.keymap.set('n', '<localleader>dn', function() require('dap').step_over() end, { desc = '[D]ebug [n]ext' })
+vim.keymap.set('n', '<localleader>di', function() require('dap').step_into() end, { desc = '[D]ebug [i]n' })
+vim.keymap.set('n', '<localleader>df', function() require('dap').step_out() end, { desc = '[D]ebug [f]inish' })
+vim.keymap.set('n', '<localleader>db', function() require('dap').toggle_breakpoint() end, { desc = '[D]ebug [b]reak toggle' })
+vim.keymap.set('n', '<localleader>dB', function() require('dap').set_breakpoint() end, { desc = '[D]ebug [B]reak set' })
+vim.keymap.set('n', '<localleader>dm', function() require('dap').set_breakpoint(nil, nil, vim.fn.input('Log point message: ')) end, { desc = '[D]ebug [m]essage' })
+vim.keymap.set('n', '<localleader>dr', function() require('dap').repl.open() end, { desc = '[D]ebug [r]epl' })
+vim.keymap.set('n', '<localleader>dC', function() require('dap').run_last() end, { desc = '[D]ebug last' })
+vim.keymap.set('n', '<localleader>dj', function() require('dap').focus_frame() end, { desc = '[D]ebug [j]ump to frame' })
+vim.keymap.set('n', '<localleader>dH', function() require('dap').goto_(nil) end, { desc = '[D]ebug [H]ere' })
+vim.keymap.set('n', '<localleader>dS', function() require('dap').close() end, { desc = '[D]ebug [S]top' })
diff --git a/nvim/lua/config/telescope.lua b/nvim/lua/config/telescope.lua
@@ -17,3 +17,13 @@ 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>ss', function()
+ local ok, lsp_buf = pcall(require, 'vim.lsp.buf')
+ if ok and lsp_buf.server_ready() then
+ require('telescope.builtin').lsp_dynamic_workspace_symbols()
+ else
+ require('telescope.builtin').treesitter()
+ end
+end, { desc = '[S]earch [S]ymbols' })
+vim.keymap.set('n', '<leader>sj', require('telescope.builtin').jumplist, { desc = '[S]earch [J]umplist' })
+vim.keymap.set('n', '<leader>T', require('telescope.builtin').tags, { desc = 'Telescope [T]ags' })
diff --git a/nvim/lua/plugins.lua b/nvim/lua/plugins.lua
@@ -122,6 +122,10 @@ return {
end
},
+ {'theHamsta/nvim-dap-virtual-text', dependencies = {"mfussenegger/nvim-dap", "nvim-treesitter/nvim-treesitter"}, config = function()
+ require("nvim-dap-virtual-text").setup()
+ end},
+
{ 'lvimuser/lsp-inlayhints.nvim', config = function()
require 'config.lsp-inlayhints'
end}