Add some gitsigns keymaps

This commit is contained in:
Evie Litherland-Smith 2022-11-02 11:47:57 +00:00
parent f956b5d049
commit d6d3c40192
2 changed files with 4 additions and 1 deletions

View file

@ -7,6 +7,9 @@ require('gitsigns').setup{
-- Setup keymaps
vim.api.nvim_buf_set_keymap(bufnr, 'n', '[g', '<cmd>Gitsigns prev_hunk<CR>', {})
vim.api.nvim_buf_set_keymap(bufnr, 'n', ']g', '<cmd>Gitsigns next_hunk<CR>', {})
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>gd', '<cmd>Gitsigns diffthis<CR>', {})
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>gq', '<cmd>Gitsigns setqflist<CR>', {})
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>gl', '<cmd>Gitsigns setloclist<CR>', {})
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>hp', '<cmd>Gitsigns preview_hunk<CR>', {})
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>hs', '<cmd>Gitsigns stage_hunk<CR>', {})
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>hr', '<cmd>Gitsigns reset_hunk<CR>', {})

View file

@ -14,7 +14,7 @@ vim.g.mapleader=' '
-- Misc
imap('jk','<Esc>')
nmap('<leader>sr', ':SnipRun<cr>')
nmap('<leader>g', ':G<cr>')
nmap('<leader>G', ':G<cr>')
-- Telescope
nmap('<leader>;', '<cmd>Telescope builtin<cr>')