From 66501fefe7ad7742a36cae147b7efa72a36e289b Mon Sep 17 00:00:00 2001 From: christianchiarulli Date: Sat, 29 May 2021 02:49:59 -0400 Subject: add some useful plugins to base config and a option to enable extras --- lua/lv-which-key/init.lua | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) (limited to 'lua/lv-which-key/init.lua') diff --git a/lua/lv-which-key/init.lua b/lua/lv-which-key/init.lua index 2840cc28..d51ba6a5 100644 --- a/lua/lv-which-key/init.lua +++ b/lua/lv-which-key/init.lua @@ -5,9 +5,9 @@ require("which-key").setup { -- the presets plugin, adds help for a bunch of default keybindings in Neovim -- No actual key bindings are created presets = { - operators = true, -- adds help for operators like d, y, ... - motions = true, -- adds help for motions - text_objects = true, -- help for text objects triggered after entering an operator + operators = false, -- adds help for operators like d, y, ... + motions = false, -- adds help for motions + text_objects = false, -- help for text objects triggered after entering an operator windows = true, -- default bindings on nav = true, -- misc bindings to work with windows z = true, -- bindings for folds, spelling and others prefixed with z @@ -66,6 +66,9 @@ vim.api.nvim_set_keymap("v", "/", ":CommentToggle", {noremap = true, -- close buffer vim.api.nvim_set_keymap("n", "c", ":BufferClose", {noremap = true, silent = true}) +-- open projects +vim.api.nvim_set_keymap('n', 'p', ":lua require'telescope'.extensions.project.project{}", + {noremap = true, silent = true}) -- TODO create entire treesitter section local mappings = { @@ -74,7 +77,17 @@ local mappings = { ["e"] = "Explorer", ["f"] = "Find File", ["h"] = "No Highlight", + ["p"] = "Projects", d = { + name = "+Diagnostics", + t = {"TroubleToggle", "trouble"}, + w = {"TroubleToggle lsp_workspace_diagnostics", "workspace"}, + d = {"TroubleToggle lsp_document_diagnostics", "document"}, + q = {"TroubleToggle quickfix", "quickfix"}, + l = {"TroubleToggle loclist", "loclist"}, + r = {"TroubleToggle lsp_references", "references"}, + }, + D = { name = "+Debug", b = {"DebugToggleBreakpoint", "Toggle Breakpoint"}, c = {"DebugContinue", "Continue"}, @@ -115,7 +128,6 @@ local mappings = { s = {"Telescope lsp_document_symbols", "Document Symbols"}, S = {"Telescope lsp_workspace_symbols", "Workspace Symbols"} }, - s = { name = "+Search", b = {"Telescope git_branches", "Checkout branch"}, @@ -129,7 +141,15 @@ local mappings = { R = {"Telescope registers", "Registers"}, t = {"Telescope live_grep", "Text"} }, - S = {name = "+Session", s = {"SessionSave", "Save Session"}, l = {"SessionLoad", "Load Session"}} + S = {name = "+Session", s = {"SessionSave", "Save Session"}, l = {"SessionLoad", "Load Session"}}, + + -- extras + z = { + name = "+Zen", + s = {"TZBottom", "toggle status line"}, + t = {"TZTop", "toggle tab bar"}, + z = {"TZAtaraxis", "toggle zen"}, + } } local wk = require("which-key") -- cgit v1.2.3