summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSaumit Dinesan <justsaumit@protonmail.com>2023-07-22 16:06:15 +0530
committerSaumit Dinesan <justsaumit@protonmail.com>2023-07-22 16:06:15 +0530
commited9871ae0da11db8e1e8dfb8ff2966a9b98cea30 (patch)
tree88da4fe80c259d322a789f3ef14a5f84eda72ae4
parent0be61bf7b6167633079bb47264034a1f4e4ca5d5 (diff)
nvim: lspsaga and whichkey update
-rw-r--r--.config/nvim/init.lua1
-rw-r--r--.config/nvim/lua/justsaumit/lspsaga-config.lua49
-rw-r--r--.config/nvim/lua/justsaumit/plugins.lua6
-rw-r--r--.config/nvim/lua/justsaumit/which-key-config.lua37
-rw-r--r--.config/nvim/plugin/packer_compiled.lua2
5 files changed, 89 insertions, 6 deletions
diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua
index 99966ff..11ab069 100644
--- a/.config/nvim/init.lua
+++ b/.config/nvim/init.lua
@@ -13,6 +13,7 @@ require("justsaumit.telescope-config")
require("justsaumit.nvim-comment-config")
require("justsaumit.mason")
require("justsaumit.lsp-config")
+require("justsaumit.lspsaga-config")
require("justsaumit.cmp-config")
require("justsaumit.toggleterm-config")
print ("while(!(succeed = try() ) );")
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 = "<C-f>",
+ scroll_up = "<C-b>",
+ },
+ code_action_keys = {
+ quit = "q",
+ exec = "<CR>",
+ },
+ rename_action_keys = {
+ quit = "<C-c>",
+ exec = "<CR>",
+ },
+ 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<CR>", "Save"},
x ={":bdelete<CR>", "Close"},
E = { ":e ~/.config/nvim/init.lua<cr>", "Edit config" },
- f = { ":Telescope find_files<CR>", "Telescope Find Files" },
- h = { ":Telescope find_files hidden=true<CR>", "Telescope Find Files" },
- g = { ":Telescope live_grep<CR>", "Telescope Live Grep" },
+ f = {
+ name = "Telescope",
+ f = {":Telescope find_files<CR>", "Telescope Find Files" },
+ h = { ":Telescope find_files hidden=true<CR>", "Telescope Find Files" },
+ g = { ":Telescope live_grep<CR>", "Telescope Live Grep" },
+ },
r = { ":Telescope oldfiles<CR>", "Recent files" },
+ l = {
+ name = "LSP",
+ i = {":LspInfo<CR>", "Connected Language Servers"},
+ I = {'<cmd>LspInstallInfo<cr>', 'Install language server'},
+ f = {'<cmd>lua vim.lsp.buf.formatting()<CR>', "Format File"},
+ k = {"<cmd> lua vim.lsp.buf.signature_help()<CR>", "Signature Help"},
+ -- K = {'<cmd>lua vim.lsp.buf.hover()<CR>', "Hover"},
+ K = {"<cmd> Lspsaga hover_doc<CR>", "Hover Commands"},
+ w = {"<cmd> lua vim.lsp.add_workspace_folder()<CR>", "Add Workspace Folder"},
+ W = {"<cmd> lua vim.lsp.remove_workspace_folder()<CR>", "Remove Workspace Folder"},
+ l = {"<cmd> lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>", "List Workspace Folder"},
+ t = {'<cmd>lua vim.lsp.buf.type_definition()<CR>', "Type definition"},
+ d = {"<cmd> lua vim.lsp.buf.definition()<CR>", "Go to Definition"},
+ D = {"<cmd> lua vim.lsp.buf.declaration()<CR>", "Go to Declaration"},
+ r = {"<cmd> lua vim.lsp.buf.references()<CR>", "References"},
+ R = {"<cmd> Lspsaga rename<CR>", "Rename"},
+ -- R = {'<cmd>lua vim.lsp.buf.rename()<CR>', "Rename"},
+ a = {"<cmd> Lspsaga code_action<CR>", "Code Action"},
+ -- a = {'<cmd>lua vim.lsp.buf.code_action()<CR>', "Code actions"},
+ -- T = {'<cmd> Telescope diagnostics bufnr=0<CR>', "Get Diagnostics"}
+ go = {"<cmd>Lspsaga show_line_diagnostics<CR>","Show Line Diagnostic"},
+ -- e = {'<cmd>lua vim.diagnostic.show_line_diagnostics()<CR>', "Show line diagnostics"},
+ gj = {"<cmd>Lspsaga diagnostic_jump_next<CR>","Go to Next Diagnostic"},
+ -- n = {'<cmd>lua vim.diagnostic.goto_next()<CR>', "Go to next diagnostic"},
+ gk = {"<cmd>Lspsaga diagnostic_jump_prev<CR>","Go to Prev Diagnostic"},
+ -- N = {'<cmd>lua vim.diagnostic.goto_prev()<CR>', "Go to previous diagnostic"},
+ },
t = {
+ name = "ToggleTerm",
t = { ":ToggleTerm<cr>", "Split Below" },
f = { toggle_float, "Floating Terminal" },
l = { toggle_lazygit, "Lazygit" },
diff --git a/.config/nvim/plugin/packer_compiled.lua b/.config/nvim/plugin/packer_compiled.lua
index e90bab8..6627d81 100644
--- a/.config/nvim/plugin/packer_compiled.lua
+++ b/.config/nvim/plugin/packer_compiled.lua
@@ -122,7 +122,7 @@ _G.packer_plugins = {
["lspsaga.nvim"] = {
loaded = true,
path = "/home/saumit/.local/share/nvim/site/pack/packer/start/lspsaga.nvim",
- url = "https://github.com/tami5/lspsaga.nvim"
+ url = "https://github.com/kkharji/lspsaga.nvim"
},
["lualine.nvim"] = {
loaded = true,