diff --git a/.vim/nvim.lua b/.vim/nvim.lua index f60287d..aec34b8 100644 --- a/.vim/nvim.lua +++ b/.vim/nvim.lua @@ -73,8 +73,7 @@ saga_cfg = { virtual_text = false, }, } -require'lspsaga'.init_lsp_saga(saga_cfg) - +-- require'lspsaga'.init_lsp_saga(saga_cfg) local t = function(str) return vim.api.nvim_replace_termcodes(str, true, true, true) @@ -149,7 +148,24 @@ require('lspkind').init({ }) require('telescope').setup { - + defaults = { + mappings = { + n = { + ["q"] = require('telescope.actions').close, + }, + }, + }, + pickers = { + lsp_code_actions = { + theme = "ivy", + }, + lsp_range_code_actions = { + theme = "ivy", + }, + lsp_references = { + theme = "ivy", + }, + }, } local builtin = require'telescope.builtin' @@ -178,8 +194,10 @@ live_grep_repo = function(conf) end git_grep_word = function(conf) - local opt = dropdown - opt.cwd = vim.fn.systemlist("git rev-parse --show-toplevel")[1] + --local opt = dropdown + local opt = { + cwd = vim.fn.systemlist("git rev-parse --show-toplevel")[1] + } for k,v in pairs(conf) do opt[k] = v end builtin.grep_string(opt) end diff --git a/.vimrc b/.vimrc index 7493ea5..ba939b2 100644 --- a/.vimrc +++ b/.vimrc @@ -211,7 +211,10 @@ Plug 'kyazdani42/nvim-web-devicons' " for file icons "Plug 'kyazdani42/nvim-tree.lua' Plug 'ray-x/lsp_signature.nvim' -Plug 'glepnir/lspsaga.nvim' + +Plug 'RishabhRD/popfix' +Plug 'RishabhRD/nvim-lsputils' + " Plugins that do specific things "Plug 'Shougo/vimproc.vim' "Plug 'Shougo/vimfiler.vim' @@ -289,17 +292,16 @@ luafile $HOME/.vim/nvim.lua nnoremap gd lua vim.lsp.buf.definition() nnoremap gi lua vim.lsp.buf.implementation() nnoremap gy lua vim.lsp.buf.type_definition() -"nnoremap K lua vim.lsp.buf.hover() -nnoremap K lua require('lspsaga.hover').render_hover_doc() +nnoremap K lua vim.lsp.buf.hover() nnoremap gK lua vim.lsp.buf.signature_help() -nnoremap gr lua vim.lsp.buf.references() -nnoremap gR lua require('lspsaga.rename').rename() +"nnoremap gr lua vim.lsp.buf.references() +nnoremap gr lua require('telescope.builtin').lsp_references({initial_mode = "normal"}) nnoremap g0 lua vim.lsp.buf.document_symbol() nnoremap gW lua vim.lsp.buf.workspace_symbol() "nnoremap gd lua vim.lsp.buf.declaration() "nnoremap ga lua vim.lsp.buf.code_action() -nnoremap ga lua require('lspsaga.codeaction').code_action() -vnoremap ga :lua require('lspsaga.codeaction').range_code_action() +nnoremap ga lua require('telescope.builtin').lsp_code_actions({initial_mode = "normal"}) +vnoremap ga :lua require('telescope.builtin').lsp_range_code_actions({initial_mode = "normal"}) nnoremap ge lua vim.lsp.diagnostic.show_line_diagnostics({show_header = false, focusable = false}) " Set updatetime for CursorHold @@ -1013,7 +1015,7 @@ nnoremap aa :RgRoot! "nnoremap :GFiles nnoremap lua require('telescope.builtin').git_files() nnoremap ag lua live_grep_repo{ word_match = "-w", only_sort_text = true, search = ''} -nnoremap aw lua git_grep_word{ word_match = "-w", only_sort_text = true } +nnoremap aw lua git_grep_word{ word_match = "-w", only_sort_text = true, initial_mode = "normal" } " For C++ -- A is a great plugin which allows you to jump from the c file to the " header and vice-versa. Mneumonic here is headerheader.