summaryrefslogtreecommitdiffstats
path: root/.config/nvim/after/plugin/whichkey.lua
diff options
context:
space:
mode:
authorJoe <rrbo@proton.me>2023-09-22 11:20:53 +0200
committerJoe <rrbo@proton.me>2023-09-22 11:20:53 +0200
commite25677cbebfa2a9e4705de3d47610cd2026d0b56 (patch)
tree924f5cda37599a221acddaa868a8f224627f6eee /.config/nvim/after/plugin/whichkey.lua
parentup (diff)
downloaddotfiles-bsd-e25677cbebfa2a9e4705de3d47610cd2026d0b56.tar.gz
dotfiles-bsd-e25677cbebfa2a9e4705de3d47610cd2026d0b56.tar.bz2
dotfiles-bsd-e25677cbebfa2a9e4705de3d47610cd2026d0b56.tar.xz
dotfiles-bsd-e25677cbebfa2a9e4705de3d47610cd2026d0b56.tar.zst
dotfiles-bsd-e25677cbebfa2a9e4705de3d47610cd2026d0b56.zip
up
Diffstat (limited to '.config/nvim/after/plugin/whichkey.lua')
-rw-r--r--.config/nvim/after/plugin/whichkey.lua56
1 files changed, 56 insertions, 0 deletions
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<CR>', 'buffers', noremap = true, silent = true },
+ c = { name = '+nerd-commenter' },
+ d = { ':bd<CR>', 'close buffer', noremap = true, silent = false },
+ e = { ':Telescope find_files<CR>', 'find files', noremap = true, silent = true },
+ G = { ':FloatermNew lazygit<CR>', 'lazygit', noremap = true, silent = true },
+ h = { ':Startify<CR>', 'startify', noremap = true, silent = true },
+ k = { ':w<CR>:bp<CR>:bd #<CR>', 'write and close buffer', noremap = true, silent = false },
+ p = { ':<C-u>CocList -A --normal yank<CR>', 'CoC paste', noremap = true, silent = true },
+ u = { ':UndotreeShow<CR>', 'undotree', noremap = true, silent = true },
+ v = { ':FloatermNew vifm<CR>', 'vifm', noremap = true, silent = true },
+ w = { ':w<CR>', 'write buffer', noremap = true, silent = false },
+ x = { ':w<CR>:bp<CR>:bd #<CR>', 'write and close buffer', noremap = true, silent = false },
+ q = { name = '+coc-fix-current' },
+ r = { name = '+coc-rename' },
+ f = {
+ name = 'telescope',
+ -- f = { ':Telescope find_files<CR>', '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<CR>', 'the_silver_searcher', noremap = true, silent = true },
+ g = { ':Grep<CR>', 'grep', noremap = true, silent = true },
+ r = { ':Rg<CR>', 'ripgrep', noremap = true, silent = true },
+ },
+ v = {
+ name = 'nvim',
+ v = { vim.cmd.Ex, 'explorer', noremap = true, silent = true },
+ u = { ':PlugUpgrade<CR>:PlugUpdate<CR>', 'upgrade', noremap = true, silent = true },
+ },
+}, { prefix = '<leader>', })
+wk.setup({
+ plugins = {
+ presets = {
+ operators = false,
+ motions = false,
+ text_objects = false,
+ window = false,
+ nav = false,
+ z = false,
+ g = false
+ },
+ },
+ triggers = { "<leader>" },
+ triggers_nowait = { "d" },
+})
+
+vim.keymap.set('n', '<C-p>', ts.git_files)