From 0dc3c5030b778d5256cad5d9529e9ecf7fbfb233 Mon Sep 17 00:00:00 2001 From: Christian Chiarulli Date: Sun, 14 Mar 2021 15:10:28 -0400 Subject: The Lua Journey Begins... --- lua/nv-gitsigns/init.lua | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 lua/nv-gitsigns/init.lua (limited to 'lua/nv-gitsigns/init.lua') diff --git a/lua/nv-gitsigns/init.lua b/lua/nv-gitsigns/init.lua new file mode 100644 index 00000000..7d183247 --- /dev/null +++ b/lua/nv-gitsigns/init.lua @@ -0,0 +1,37 @@ +require('gitsigns').setup { + signs = { + -- TODO add hl to colorscheme + 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'}, + }, + numhl = false, + linehl = false, + keymaps = { + -- Default keymap options + noremap = true, + buffer = true, + + ['n ]c'] = { expr = true, "&diff ? ']c' : 'lua require\"gitsigns\".next_hunk()'"}, + ['n [c'] = { expr = true, "&diff ? '[c' : 'lua require\"gitsigns\".prev_hunk()'"}, + + ['n hs'] = 'lua require"gitsigns".stage_hunk()', + ['n hu'] = 'lua require"gitsigns".undo_stage_hunk()', + ['n hr'] = 'lua require"gitsigns".reset_hunk()', + ['n hp'] = 'lua require"gitsigns".preview_hunk()', + ['n hb'] = 'lua require"gitsigns".blame_line()', + + -- Text objects + ['o ih'] = ':lua require"gitsigns".text_object()', + ['x ih'] = ':lua require"gitsigns".text_object()' + }, + watch_index = { + interval = 1000 + }, + sign_priority = 6, + update_debounce = 200, + status_formatter = nil, -- Use default + use_decoration_api = false +} -- cgit v1.2.3