From c472be7bf6ca6109fe2d77e03be46516cf92ddb6 Mon Sep 17 00:00:00 2001 From: ruinivist Date: Sun, 26 Apr 2026 20:27:32 +0200 Subject: [PATCH] keybinds --- NOTES.md | 32 +++++++++++++++++++++++++++----- core/keymaps.lua | 10 ++++++++++ plugins/fugitive.lua | 8 +++++++- plugins/neo-tree.lua | 12 ++++++++++++ 4 files changed, 56 insertions(+), 6 deletions(-) diff --git a/NOTES.md b/NOTES.md index 9795851..c8a6b61 100644 --- a/NOTES.md +++ b/NOTES.md @@ -11,13 +11,31 @@ ## Tabs -There are :hsplit, :vsplit commands, also :tabnew +Pane movement: +- C-h : move to left pane +- C-j : move to lower pane +- C-k : move to upper pane +- C-l : move to right pane -Do leader-sf, C-t for new tab, C-v for vertical split, C-x for horizontal -These keybinds come from telescope defaults. The tab functionality is built into -neovim. +Pane management: +- C-q : close current pane +- C-\ : vertical split +- C-S-\ : horizontal split +- po : keep current pane only -Tab cycling: gt, gT +Tab management: +- tn : new tab +- tq : close tab +- to : keep current tab only +- th : previous tab +- tl : next tab + +Built-in tab cycling also works: +- gt : next tab +- gT : previous tab + +Neo-tree: +- C-n : toggle Neo-tree ## Autocompletes @@ -33,3 +51,7 @@ C-k to open "documentation" use - to stage use cc to commit write a message and then :wq + +Leader shortcuts: +- gd : vertical git diff +- gc : open fugitive git status diff --git a/core/keymaps.lua b/core/keymaps.lua index 2634ca5..2c7d322 100644 --- a/core/keymaps.lua +++ b/core/keymaps.lua @@ -8,3 +8,13 @@ vim.keymap.set('n', '', '', { desc = 'Move focus to the left wind vim.keymap.set('n', '', '', { desc = 'Move focus to the right window' }) vim.keymap.set('n', '', '', { desc = 'Move focus to the lower window' }) vim.keymap.set('n', '', '', { desc = 'Move focus to the upper window' }) +vim.keymap.set('n', '', 'close', { desc = 'Close window' }) +vim.keymap.set('n', '', 'vsplit', { desc = 'Vertical split' }) +vim.keymap.set('n', '', 'split', { desc = 'Horizontal split' }) +vim.keymap.set('n', 'po', 'only', { desc = 'Only pane' }) + +vim.keymap.set('n', 'tn', 'tabnew', { desc = 'New tab' }) +vim.keymap.set('n', 'tq', 'tabclose', { desc = 'Close tab' }) +vim.keymap.set('n', 'to', 'tabonly', { desc = 'Only tab' }) +vim.keymap.set('n', 'th', 'tabprevious', { desc = 'Previous tab' }) +vim.keymap.set('n', 'tl', 'tabnext', { desc = 'Next tab' }) diff --git a/plugins/fugitive.lua b/plugins/fugitive.lua index 0c9fe30..f14359d 100644 --- a/plugins/fugitive.lua +++ b/plugins/fugitive.lua @@ -1,3 +1,9 @@ ---@module 'lazy' ---@type LazySpec -return { 'tpope/vim-fugitive' } +return { + 'tpope/vim-fugitive', + keys = { + { 'gd', 'Gvdiffsplit', desc = 'Git vertical diff' }, + { 'gc', 'Git', desc = 'Git status' }, + }, +} diff --git a/plugins/neo-tree.lua b/plugins/neo-tree.lua index 9016fa5..568809a 100644 --- a/plugins/neo-tree.lua +++ b/plugins/neo-tree.lua @@ -9,4 +9,16 @@ return { 'nvim-tree/nvim-web-devicons', }, lazy = false, + keys = { + { '', 'Neotree toggle', desc = 'Toggle Neo-tree' }, + }, + ---@module 'neo-tree' + ---@type neotree.Config + opts = { + window = { + mappings = { + [''] = 'none', + }, + }, + }, }