Browse Source

nixpkgs/neovim: improve git bindings

Thomas Dy 2 years ago
parent
commit
3f2040e2a8
1 changed files with 5 additions and 2 deletions
  1. 5 2
      .config/nixpkgs/neovim/mappings.lua

+ 5 - 2
.config/nixpkgs/neovim/mappings.lua

@@ -25,8 +25,11 @@ vim.keymap.set('n', '<Leader>ff', '<cmd>Telescope live_grep<CR>', opts)
 vim.keymap.set('n', '<Leader>c', '<cmd>set cursorline! cursorcolumn!<CR>', opts)
 
 -- git
-vim.keymap.set('n', '<Leader>gs', '<cmd>Git<CR>', opts)
-vim.keymap.set('n', '<Leader>gll', '<cmd>Git log --oneline origin/HEAD..HEAD<CR>', opts)
+-- open status in current split without special flag (so navigating away closes it)
+-- https://github.com/tpope/vim-fugitive/issues/1296
+vim.keymap.set('n', '<Leader>gs', '<cmd>Gedit :<CR>', opts)
+-- open in reverse to match order when rebasing
+vim.keymap.set('n', '<Leader>gll', '<cmd>Git log --reverse --oneline origin/HEAD..HEAD<CR>', opts)
 vim.keymap.set('n', '<Leader>gb', '<cmd>Telescope git_branches<CR>', opts)
 
 -- undotree