From 956df69d7496081db5e7b3621a0bcc7b9d7f7dfc Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Wed, 8 Dec 2021 11:52:16 +0100 Subject: move to .config folder --- .config/nvim/lua/git.lua | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .config/nvim/lua/git.lua (limited to '.config/nvim/lua/git.lua') diff --git a/.config/nvim/lua/git.lua b/.config/nvim/lua/git.lua new file mode 100644 index 0000000..2f9cbc4 --- /dev/null +++ b/.config/nvim/lua/git.lua @@ -0,0 +1,29 @@ +require('gitsigns').setup { + signs = { + add = {hl = 'GitSignsAdd' , text = '│', numhl='GitSignsAddNr' , linehl='GitSignsAddLn'}, + change = {hl = 'GitSignsChange', text = '│', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn'}, + delete = {hl = 'GitSignsDelete', text = '_', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn'}, + topdelete = {hl = 'GitSignsDelete', text = '‾', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn'}, + changedelete = {hl = 'GitSignsChange', text = '~', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn'}, + }, + keymaps = { + -- Default keymap options + noremap = true, + + ['n ]c'] = { expr = true, "&diff ? ']c' : 'lua require\"gitsigns.actions\".next_hunk()'"}, + ['n [c'] = { expr = true, "&diff ? '[c' : 'lua require\"gitsigns.actions\".prev_hunk()'"}, + + ['n hs'] = 'lua require"gitsigns".stage_hunk()', + ['v hs'] = 'lua require"gitsigns".stage_hunk({vim.fn.line("."), vim.fn.line("v")})', + ['n hS'] = 'lua require"gitsigns".stage_buffer()', + ['n hu'] = 'lua require"gitsigns".undo_stage_hunk()', + ['n hp'] = 'lua require"gitsigns".preview_hunk()', + ['n hB'] = 'lua require"gitsigns".blame_line(true)', + }, + signcolumn = true, -- Toggle with `:Gitsigns toggle_signs` + numhl = true, -- Toggle with `:Gitsigns toggle_numhl` + watch_gitdir = { + interval = 1000, + follow_files = true + }, +} -- cgit v1.2.3-71-g8e6c