From 7d1e8075b8f156f3f8c300326abf730a1a8f2875 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 31 May 2021 22:20:30 +0200 Subject: Copying of Luke's dots --- .config/nvim/lua/_which-key/init.lua | 38 +++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 11 deletions(-) (limited to '.config/nvim/lua/_which-key') diff --git a/.config/nvim/lua/_which-key/init.lua b/.config/nvim/lua/_which-key/init.lua index 1770356..8c300c3 100644 --- a/.config/nvim/lua/_which-key/init.lua +++ b/.config/nvim/lua/_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 @@ -48,7 +48,7 @@ vim.api.nvim_set_keymap('n', '', '', {noremap = true, silent = true} vim.g.mapleader = ' ' -- no hl -vim.api.nvim_set_keymap('n', 'n', ':set hlsearch!', {noremap = true, silent = true}) +vim.api.nvim_set_keymap('n', 'h', ':set hlsearch!', {noremap = true, silent = true}) -- explorer vim.api.nvim_set_keymap('n', 'e', ':NvimTreeToggle', {noremap = true, silent = true}) @@ -63,9 +63,6 @@ vim.api.nvim_set_keymap('n', ';', ':Dashboard', {noremap = true, sil vim.api.nvim_set_keymap("n", "k", ":CommentToggle", {noremap = true, silent = true}) vim.api.nvim_set_keymap("v", "k", ":CommentToggle", {noremap = true, silent = true}) --- Zen mode -vim.api.nvim_set_keymap("n", "z", ':TZAtaraxis', {noremap = true, silent = true}) - -- close buffer vim.api.nvim_set_keymap("n", "c", ":BufferClose", {noremap = true, silent = true}) @@ -73,18 +70,30 @@ vim.api.nvim_set_keymap("n", "c", ":BufferClose", {noremap = true, s vim.api.nvim_set_keymap("n", "v", ":vsplit", {noremap = true, silent = true}) vim.api.nvim_set_keymap("n", "h", ":split", {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 = { ["k"] = "Comment", ["c"] = "Close Buffer", - ["z"] = "Zen Mode", ["e"] = "Explorer", ["f"] = "Find File", + ["p"] = "Projects", ["n"] = "No Highlight", ["v"] = "Vertical Split", ["h"] = "Horizontal Split", 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"}, @@ -125,10 +134,9 @@ local mappings = { s = {"Telescope lsp_document_symbols", "Document Symbols"}, S = {"Telescope lsp_workspace_symbols", "Workspace Symbols"} }, - s = { name = "+Search", - b = {"Telescope git_branches", "File"}, + b = {"Telescope git_branches", "Checkout branch"}, c = {"Telescope colorscheme", "Colorscheme"}, d = {"Telescope lsp_document_diagnostics", "Document Diagnostics"}, D = {"Telescope lsp_workspace_diagnostics", "Workspace Diagnostics"}, @@ -139,7 +147,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-70-g09d2