Browse Source

👌 IMPROVE: update keybindings for hunks

pull/174/head
Xin.Chen 3 years ago
parent
commit
965a7849b0
  1. 12
      lua/keybindings.lua

12
lua/keybindings.lua

@ -286,21 +286,23 @@ pluginKeys.gitsigns = {
-- Default keymap options
noremap = true,
["n ]c"] = { expr = true, "&diff ? ']c' : '<cmd>Gitsigns next_hunk<CR>'" },
["n [c"] = { expr = true, "&diff ? '[c' : '<cmd>Gitsigns prev_hunk<CR>'" },
["n <leader>hj"] = { expr = true, "&diff ? ']c' : '<cmd>Gitsigns next_hunk<CR>'" },
["n <leader>hk"] = { expr = true, "&diff ? '[c' : '<cmd>Gitsigns prev_hunk<CR>'" },
-- stage
["n <leader>hs"] = "<cmd>Gitsigns stage_hunk<CR>",
["v <leader>hs"] = ":Gitsigns stage_hunk<CR>",
["n <leader>hu"] = "<cmd>Gitsigns undo_stage_hunk<CR>",
["n <leader>hS"] = "<cmd>Gitsigns stage_buffer<CR>",
["n <leader>hU"] = "<cmd>Gitsigns reset_buffer_index<CR>",
-- reset
["n <leader>hr"] = "<cmd>Gitsigns reset_hunk<CR>",
["v <leader>hr"] = ":Gitsigns reset_hunk<CR>",
["n <leader>hR"] = "<cmd>Gitsigns reset_buffer<CR>",
["n <leader>hp"] = "<cmd>Gitsigns preview_hunk<CR>",
["n <leader>hb"] = '<cmd>lua require"gitsigns".blame_line{full=true}<CR>',
["n <leader>hS"] = "<cmd>Gitsigns stage_buffer<CR>",
["n <leader>hU"] = "<cmd>Gitsigns reset_buffer_index<CR>",
["n <leader>hb"] = '<cmd>lua require"gitsigns".blame_line{full=false}<CR>',
-- Text objects
["o ih"] = ":<C-U>Gitsigns select_hunk<CR>",

Loading…
Cancel
Save