From ed9871ae0da11db8e1e8dfb8ff2966a9b98cea30 Mon Sep 17 00:00:00 2001 From: Saumit Dinesan Date: Sat, 22 Jul 2023 16:06:15 +0530 Subject: nvim: lspsaga and whichkey update --- .config/nvim/lua/justsaumit/lspsaga-config.lua | 49 ++++++++++++++++++++++++ .config/nvim/lua/justsaumit/plugins.lua | 6 ++- .config/nvim/lua/justsaumit/which-key-config.lua | 37 ++++++++++++++++-- 3 files changed, 87 insertions(+), 5 deletions(-) create mode 100644 .config/nvim/lua/justsaumit/lspsaga-config.lua (limited to '.config/nvim/lua/justsaumit') diff --git a/.config/nvim/lua/justsaumit/lspsaga-config.lua b/.config/nvim/lua/justsaumit/lspsaga-config.lua new file mode 100644 index 0000000..70d3d79 --- /dev/null +++ b/.config/nvim/lua/justsaumit/lspsaga-config.lua @@ -0,0 +1,49 @@ +local lspsaga = require 'lspsaga' +lspsaga.setup { -- defaults ... + debug = false, + use_saga_diagnostic_sign = true, + -- diagnostic sign + error_sign = " ", + warn_sign = " ", + hint_sign = " ", + infor_sign = " ", + diagnostic_header_icon = "  ", + -- code action title icon + code_action_icon = " ", + code_action_prompt = { + enable = true, + sign = true, + sign_priority = 40, + virtual_text = true, + }, + finder_definition_icon = "󰈞 ", + finder_reference_icon = "󰈞 ", + max_preview_lines = 10, + finder_action_keys = { + open = "o", + vsplit = "s", + split = "i", + quit = "q", + scroll_down = "", + scroll_up = "", + }, + code_action_keys = { + quit = "q", + exec = "", + }, + rename_action_keys = { + quit = "", + exec = "", + }, + definition_preview_icon = " ", + border_style = "single", + rename_prompt_prefix = "➤ ", + rename_output_qflist = { + enable = false, + auto_open_qflist = false, + }, + server_filetype_map = {}, + diagnostic_prefix_format = "%d. ", + diagnostic_message_format = "%m %c", + highlight_prefix = false, +} diff --git a/.config/nvim/lua/justsaumit/plugins.lua b/.config/nvim/lua/justsaumit/plugins.lua index 63aa83a..b00c57f 100644 --- a/.config/nvim/lua/justsaumit/plugins.lua +++ b/.config/nvim/lua/justsaumit/plugins.lua @@ -68,7 +68,7 @@ return packer.startup(function(use) --lsp use("williamboman/mason-lspconfig.nvim") use("neovim/nvim-lspconfig") --> Collection of configurations for built-in LSP client - use("tami5/lspsaga.nvim") --> icons for LSP diagnostics + use("kkharji/lspsaga.nvim") --> icons for LSP diagnostics use("onsails/lspkind-nvim") --> vscode-like pictograms for neovim lsp completion items --cmp - Autocompletions use("hrsh7th/nvim-cmp") --completion engine @@ -90,7 +90,9 @@ return packer.startup(function(use) use ('akinsho/toggleterm.nvim') -- use "rafamadriz/friendly-snippets" -- a bunch of snippets to use --- + +-- Dashboard + -- use {'glepnir/dashboard-nvim', event = 'Vimenter'} -- Comments - Toggle comments in Neovim use "terrortylor/nvim-comment" diff --git a/.config/nvim/lua/justsaumit/which-key-config.lua b/.config/nvim/lua/justsaumit/which-key-config.lua index 16ffedd..93a42fa 100644 --- a/.config/nvim/lua/justsaumit/which-key-config.lua +++ b/.config/nvim/lua/justsaumit/which-key-config.lua @@ -14,11 +14,42 @@ local mappings = { w = {":w", "Save"}, x ={":bdelete", "Close"}, E = { ":e ~/.config/nvim/init.lua", "Edit config" }, - f = { ":Telescope find_files", "Telescope Find Files" }, - h = { ":Telescope find_files hidden=true", "Telescope Find Files" }, - g = { ":Telescope live_grep", "Telescope Live Grep" }, + f = { + name = "Telescope", + f = {":Telescope find_files", "Telescope Find Files" }, + h = { ":Telescope find_files hidden=true", "Telescope Find Files" }, + g = { ":Telescope live_grep", "Telescope Live Grep" }, + }, r = { ":Telescope oldfiles", "Recent files" }, + l = { + name = "LSP", + i = {":LspInfo", "Connected Language Servers"}, + I = {'LspInstallInfo', 'Install language server'}, + f = {'lua vim.lsp.buf.formatting()', "Format File"}, + k = {" lua vim.lsp.buf.signature_help()", "Signature Help"}, + -- K = {'lua vim.lsp.buf.hover()', "Hover"}, + K = {" Lspsaga hover_doc", "Hover Commands"}, + w = {" lua vim.lsp.add_workspace_folder()", "Add Workspace Folder"}, + W = {" lua vim.lsp.remove_workspace_folder()", "Remove Workspace Folder"}, + l = {" lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))", "List Workspace Folder"}, + t = {'lua vim.lsp.buf.type_definition()', "Type definition"}, + d = {" lua vim.lsp.buf.definition()", "Go to Definition"}, + D = {" lua vim.lsp.buf.declaration()", "Go to Declaration"}, + r = {" lua vim.lsp.buf.references()", "References"}, + R = {" Lspsaga rename", "Rename"}, + -- R = {'lua vim.lsp.buf.rename()', "Rename"}, + a = {" Lspsaga code_action", "Code Action"}, + -- a = {'lua vim.lsp.buf.code_action()', "Code actions"}, + -- T = {' Telescope diagnostics bufnr=0', "Get Diagnostics"} + go = {"Lspsaga show_line_diagnostics","Show Line Diagnostic"}, + -- e = {'lua vim.diagnostic.show_line_diagnostics()', "Show line diagnostics"}, + gj = {"Lspsaga diagnostic_jump_next","Go to Next Diagnostic"}, + -- n = {'lua vim.diagnostic.goto_next()', "Go to next diagnostic"}, + gk = {"Lspsaga diagnostic_jump_prev","Go to Prev Diagnostic"}, + -- N = {'lua vim.diagnostic.goto_prev()', "Go to previous diagnostic"}, + }, t = { + name = "ToggleTerm", t = { ":ToggleTerm", "Split Below" }, f = { toggle_float, "Floating Terminal" }, l = { toggle_lazygit, "Lazygit" }, -- cgit v1.2.3