From 363170e4adeb6d0ea7319336da4b63bc6d844561 Mon Sep 17 00:00:00 2001 From: Ray Andrew Date: Thu, 20 Nov 2025 01:38:42 -0600 Subject: [PATCH] add git keybinds --- home/neovim/config/init.lua | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/home/neovim/config/init.lua b/home/neovim/config/init.lua index bfd9e2f..575d2f1 100644 --- a/home/neovim/config/init.lua +++ b/home/neovim/config/init.lua @@ -478,7 +478,10 @@ end map('n', 'ex', function() require('fyler').toggle { kind = 'split_left_most' } end, 'Toggle file tree') map('n', 'fs', 'w', 'Save file') -map('n', 'ff', function() require('find-file').open() end, 'Find file (emacs-style)') +map('n', 'ff', function() require('find-file').open() end, 'Find file') +map('n', 'fr', function() require('snacks').picker.recent() end, 'Find recent file') +map('n', ':', function() require('snacks').picker.command_history() end, 'Command history') +-- map('n', 'ex', function() require('snacks').explorer() end, 'Toggle file tree') map('n', 'bb', function() require('snacks').picker.buffers() end, 'List buffers') map('n', 'bd', function() require('snacks').bufdelete() end, 'Buffer delete') map('n', '.', function() require('snacks').scratch() end, 'Scratch buffer') @@ -498,7 +501,20 @@ map('n', 'ce', 'edit $MYVIMRC', 'Edit config') map('n', 'ch', 'checkhealth', 'Check health') map('n', 'cf', 'Format', 'Format buffer') +-- git map('n', 'gg', function() require('neogit').open() end, 'Open Neogit') +map('n', 'gb', function() require('snacks').picker.git_branches() end, 'Git Branches') +map('n', 'gl', function() require('snacks').picker.git_log() end, 'Git Log') +map('n', 'gL', function() require('snacks').picker.git_log_file() end, 'Git Log File') +map('n', 'gs', function() require('snacks').picker.git_status() end, 'Git Status') +map('n', 'gS', function() require('snacks').picker.git_stash() end, 'Git Stash') +-- gh +map('n', 'gd', function() require('snacks').picker.git_diff() end, 'Git Diff (Hunks)') +map('n', 'gi', function() require('snacks').picker.gh_issue() end, 'GitHub Issues (open)') +map('n', 'gI', function() require('snacks').picker.gh_issue { state = 'all' } end, 'GitHub Issues (all)') +map('n', 'gp', function() require('snacks').picker.gh_pr() end, 'GitHub Pull Requests (open)') +map('n', 'gP', function() require('snacks').picker.gh_pr { state = 'all' } end, 'GitHub Pull Requests (all)') + map('n', 'ut', 'UndotreeToggle', 'Toggle undotree') -- Grapple keymaps (harpoon-style)