From e25677cbebfa2a9e4705de3d47610cd2026d0b56 Mon Sep 17 00:00:00 2001 From: Joe Date: Fri, 22 Sep 2023 11:20:53 +0200 Subject: up --- .config/nvim/after/plugin/whichkey.lua | 56 ++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .config/nvim/after/plugin/whichkey.lua (limited to '.config/nvim/after/plugin/whichkey.lua') diff --git a/.config/nvim/after/plugin/whichkey.lua b/.config/nvim/after/plugin/whichkey.lua new file mode 100644 index 0000000..71274e1 --- /dev/null +++ b/.config/nvim/after/plugin/whichkey.lua @@ -0,0 +1,56 @@ + +local ts = require('telescope.builtin') +local wk = require('which-key') +wk.register({ + b = { ':Buffers', 'buffers', noremap = true, silent = true }, + c = { name = '+nerd-commenter' }, + d = { ':bd', 'close buffer', noremap = true, silent = false }, + e = { ':Telescope find_files', 'find files', noremap = true, silent = true }, + G = { ':FloatermNew lazygit', 'lazygit', noremap = true, silent = true }, + h = { ':Startify', 'startify', noremap = true, silent = true }, + k = { ':w:bp:bd #', 'write and close buffer', noremap = true, silent = false }, + p = { ':CocList -A --normal yank', 'CoC paste', noremap = true, silent = true }, + u = { ':UndotreeShow', 'undotree', noremap = true, silent = true }, + v = { ':FloatermNew vifm', 'vifm', noremap = true, silent = true }, + w = { ':w', 'write buffer', noremap = true, silent = false }, + x = { ':w:bp:bd #', 'write and close buffer', noremap = true, silent = false }, + q = { name = '+coc-fix-current' }, + r = { name = '+coc-rename' }, + f = { + name = 'telescope', + -- f = { ':Telescope find_files', 'find files', noremap = true, silent = true }, + f = { ts.find_files, 'find files', noremap = true, silent = true }, + g = { ts.git_files, 'git files', noremap = true, silent = true }, + s = { function() + ts.grep_string({ search = vim.fn.input("Grep > ") }) + end, 'grep string', noremap = true, silent = true }, + }, + g = { + name = 'grep', + a = { ':Ag', 'the_silver_searcher', noremap = true, silent = true }, + g = { ':Grep', 'grep', noremap = true, silent = true }, + r = { ':Rg', 'ripgrep', noremap = true, silent = true }, + }, + v = { + name = 'nvim', + v = { vim.cmd.Ex, 'explorer', noremap = true, silent = true }, + u = { ':PlugUpgrade:PlugUpdate', 'upgrade', noremap = true, silent = true }, + }, +}, { prefix = '', }) +wk.setup({ + plugins = { + presets = { + operators = false, + motions = false, + text_objects = false, + window = false, + nav = false, + z = false, + g = false + }, + }, + triggers = { "" }, + triggers_nowait = { "d" }, +}) + +vim.keymap.set('n', '', ts.git_files) -- cgit v1.2.3