Neovim: configured lsp saga (this plugin is amazing, has a bunch of Intellij-like features)
This commit is contained in:
@@ -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" },
|
||||
|
||||
49
.config/nvim/lua/plugins/lsp-saga.lua
Normal file
49
.config/nvim/lua/plugins/lsp-saga.lua
Normal file
@@ -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<cr>', { desc = 'Display Docs' })
|
||||
vim.keymap.set('n', 'R', ':Lspsaga rename<cr>', { desc = '[R]ename' })
|
||||
|
||||
vim.keymap.set({ 'n', 'i' }, '<M-Enter>', '<cmd>Lspsaga code_action<cr><Esc>', { desc = 'Code Actions' })
|
||||
vim.keymap.set('n', '<leader>ca', ':Lspsaga code_action<cr><Esc>', { 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',
|
||||
'<leader>dw',
|
||||
'<cmd>Lspsaga show_workspace_diagnostics ++normal<cr>',
|
||||
{ desc = '[D]iagnostics for [W]orkspace' }
|
||||
)
|
||||
|
||||
vim.keymap.set({ 'n', 't' }, '<A-t>', '<cmd>Lspsaga term_toggle<cr>', { 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,
|
||||
}
|
||||
@@ -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('<cword>')
|
||||
end, { expr = true })
|
||||
end,
|
||||
}
|
||||
@@ -19,7 +19,6 @@ return {
|
||||
vim.keymap.set('n', '<leader>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', '<leader>ds', builtin.lsp_document_symbols, { desc = '[D]ocument [S]symbols' })
|
||||
vim.keymap.set('n', '<leader>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', '<leader>st', ':TodoTelescope<cr>', { desc = '[S]earch [T]odos' })
|
||||
vim.keymap.set('n', '<leader>ca', vim.lsp.buf.code_action, { desc = '[C]ode [A]ction' })
|
||||
vim.keymap.set('n', '<M-Enter>', 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
|
||||
|
||||
Reference in New Issue
Block a user