diff --git a/.gitmodules b/.gitmodules index 1672245..5ba94a7 100644 --- a/.gitmodules +++ b/.gitmodules @@ -40,9 +40,6 @@ [submodule "pack/general/start/vim-markdown"] path = pack/general/start/vim-markdown url = https://github.com/plasticboy/vim-markdown -[submodule "pack/general/start/vim-signify"] - path = pack/general/start/vim-signify - url = https://github.com/mhinz/vim-signify [submodule "pack/general/start/vim-snippets"] path = pack/general/start/vim-snippets url = https://github.com/honza/vim-snippets @@ -58,3 +55,6 @@ [submodule "pack/general/start/nerdcommenter"] path = pack/general/start/nerdcommenter url = https://github.com/preservim/nerdcommenter +[submodule "pack/general/start/gitsigns.nvim"] + path = pack/general/start/gitsigns.nvim + url = https://github.com/lewis6991/gitsigns.nvim diff --git a/init.lua b/init.lua index a311c74..4979dc3 100644 --- a/init.lua +++ b/init.lua @@ -175,7 +175,47 @@ g.completion_chain_complete_list = { cmd [[autocmd FileType *\(TelescopePrompt\)\@' + end, {expr=true}) + + map('n', '[c', function() + if vim.wo.diff then return '[c' end + vim.schedule(function() gs.prev_hunk() end) + return '' + end, {expr=true}) + + -- Actions + map({'n', 'v'}, 'hs', ':Gitsigns stage_hunk') + map({'n', 'v'}, 'hr', ':Gitsigns reset_hunk') + map('n', 'hS', gs.stage_buffer) + map('n', 'hu', gs.undo_stage_hunk) + map('n', 'hR', gs.reset_buffer) + map('n', 'hp', gs.preview_hunk) + map('n', 'hb', function() gs.blame_line{full=true} end) + map('n', 'tb', gs.toggle_current_line_blame) + map('n', 'hd', gs.diffthis) + map('n', 'hD', function() gs.diffthis('~') end) + map('n', 'td', gs.toggle_deleted) + + -- Text object + map({'o', 'x'}, 'ih', ':Gitsigns select_hunk') + end +} g.signify_vcs_list = {'git'} ---- vim-markdown g.vim_markdown_no_default_key_mappings = 1 diff --git a/pack/general/start/gitsigns.nvim b/pack/general/start/gitsigns.nvim new file mode 160000 index 0000000..3543443 --- /dev/null +++ b/pack/general/start/gitsigns.nvim @@ -0,0 +1 @@ +Subproject commit 3543443eb3856fbe4a9d70f3fe8dc73e007199a1 diff --git a/pack/general/start/vim-signify b/pack/general/start/vim-signify deleted file mode 160000 index 69498f6..0000000 --- a/pack/general/start/vim-signify +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 69498f6d49f3eeac06870012416dd9bf867b84f3