diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 29ed1bc..6fe6b34 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -23,6 +23,7 @@ "lazy.nvim": { "branch": "main", "commit": "c501b429cf995c645454539b924aaefae45bb9eb" }, "lazydev.nvim": { "branch": "main", "commit": "6184ebbbc8045d70077659b7d30c705a588dc62f" }, "leap.nvim": { "branch": "main", "commit": "eca8108dcd5f41fbde2a674dceb58b81ed887dc8" }, + "lspsaga.nvim": { "branch": "main", "commit": "6f920cfabddb9b7de5a3a4d0b7cd4f0774ae23e2" }, "lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" }, "lush.nvim": { "branch": "main", "commit": "7c0e27f50901481fe83b974493c4ea67a4296aeb" }, "luvit-meta": { "branch": "main", "commit": "ce76f6f6cdc9201523a5875a4471dcfe0186eb60" }, diff --git a/.config/nvim/lua/plugins/lsp-saga.lua b/.config/nvim/lua/plugins/lsp-saga.lua new file mode 100644 index 0000000..28480b2 --- /dev/null +++ b/.config/nvim/lua/plugins/lsp-saga.lua @@ -0,0 +1,49 @@ +return { + 'nvimdev/lspsaga.nvim', + dependencies = { + 'nvim-treesitter/nvim-treesitter', + 'nvim-tree/nvim-web-devicons', + }, + config = function() + require('lspsaga').setup({ + lightbulb = { + sign = false, + virtual_text = true, + }, + implement = { + sign = false, + virtual_text = true, + }, + floaterm = { + height = 0.7, + width = 0.7, + }, + }) + local diagnostic = require('lspsaga.diagnostic') + local unused = 5 + + vim.keymap.set('n', 'K', ':Lspsaga hover_doc', { desc = 'Display Docs' }) + vim.keymap.set('n', 'R', ':Lspsaga rename', { desc = '[R]ename' }) + + vim.keymap.set({ 'n', 'i' }, '', 'Lspsaga code_action', { desc = 'Code Actions' }) + vim.keymap.set('n', 'ca', ':Lspsaga code_action', { desc = '[C]ode [A]ctions' }) + + vim.keymap.set('n', 'ge', function() + diagnostic:goto_next({ severity = vim.diagnostic.severity.WARN }) + end, { desc = '[G]oto [E]rror' }) + vim.keymap.set('n', 'gE', function() + diagnostic:goto_prev({ severity = vim.diagnostic.severity.WARN }) + end, { desc = '[G]oto [E]rror (prev)' }) + vim.keymap.set( + 'n', + 'dw', + 'Lspsaga show_workspace_diagnostics ++normal', + { desc = '[D]iagnostics for [W]orkspace' } + ) + + vim.keymap.set({ 'n', 't' }, '', 'Lspsaga term_toggle', { desc = '[T]erminal' }) + + -- TODO: use require(lspsaga.symbol.winbar).get_bar() + -- and add it to lualine rather than have it at the top of the screen which is a bit annoying + end, +} diff --git a/.config/nvim/lua/plugins/rename.lua b/.config/nvim/lua/plugins/rename.lua deleted file mode 100644 index 8b4fc8d..0000000 --- a/.config/nvim/lua/plugins/rename.lua +++ /dev/null @@ -1,14 +0,0 @@ -return { - 'smjonas/inc-rename.nvim', - config = function() - require('inc_rename').setup({}) - - local test = 5 - print(test) - - vim.keymap.set('n', 'R', ':IncRename ') - vim.keymap.set('n', 'rr', function() - return ':IncRename ' .. vim.fn.expand('') - end, { expr = true }) - end, -} diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua index 5389ac4..f62cce0 100644 --- a/.config/nvim/lua/plugins/telescope.lua +++ b/.config/nvim/lua/plugins/telescope.lua @@ -19,7 +19,6 @@ return { vim.keymap.set('n', 'f.', builtin.oldfiles, { desc = '[F]ind Recent Files ("." for old)' }) vim.keymap.set('n', 'gd', builtin.lsp_definitions, { desc = '[G]oto [D]efinition' }) - vim.keymap.set('n', 'gh', vim.lsp.buf.hover, { desc = '[G]oto [H]over' }) vim.keymap.set('n', 'gu', builtin.lsp_references, { desc = '[G]oto [U]sages' }) vim.keymap.set('n', 'gi', builtin.lsp_implementations, { desc = '[G]oto [I]mplementations' }) vim.keymap.set('n', 'gt', builtin.lsp_type_definitions, { desc = '[G]oto [T]ype Definitions' }) @@ -27,13 +26,8 @@ return { vim.keymap.set('n', 'ds', builtin.lsp_document_symbols, { desc = '[D]ocument [S]symbols' }) vim.keymap.set('n', 'ps', builtin.lsp_workspace_symbols, { desc = '[P]roject [S]ymbols' }) + -- TODO: Add filtering to TodoTelescope so it only shows "bad" things like TODOs, fixmes etc and not notes vim.keymap.set('n', 'st', ':TodoTelescope', { desc = '[S]earch [T]odos' }) - vim.keymap.set('n', 'ca', vim.lsp.buf.code_action, { desc = '[C]ode [A]ction' }) - vim.keymap.set('n', '', vim.lsp.buf.code_action, { desc = 'Code Actions' }) - - -- TODO: Use some cool plugin to have IntelliJ-like renaming - -- Make sure to include a rr version for normal renaming and Shift+R for ciw + rr - -- vim.keymap.set('n', 'R', vim.lsp.buf.rename, { desc = '[R]ename' }) -- TODO: Look into the following -- builtin.git_commits