vim-signify => gitsigns.nvim

This commit is contained in:
Alex Yatskov 2024-10-01 09:34:25 -07:00
parent 25814f6358
commit c18b62f675
4 changed files with 49 additions and 4 deletions

6
.gitmodules vendored
View File

@ -28,9 +28,6 @@
[submodule ".vim/bundle/vim-dirvish"]
path = pack/plugins/start/vim-dirvish
url = https://github.com/justinmk/vim-dirvish.git
[submodule ".vim/bundle/vim-signify"]
path = pack/plugins/start/vim-signify
url = https://github.com/mhinz/vim-signify.git
[submodule ".vim/bundle/vim-angry"]
path = pack/plugins/start/vim-angry
url = https://github.com/b4winckler/vim-angry.git
@ -97,3 +94,6 @@
[submodule "pack/plugins/start/argonaut.nvim"]
path = pack/plugins/start/argonaut.nvim
url = https://git.foosoft.net/alex/argonaut.nvim.git
[submodule "pack/plugins/start/gitsigns.nvim"]
path = pack/plugins/start/gitsigns.nvim
url = https://github.com/lewis6991/gitsigns.nvim.git

View File

@ -47,6 +47,51 @@ if vim.fn.executable('fzf') == 1 then
vim.keymap.set('n', '<leader>fs', live_grep)
end
-- gitsigns.nvim
require('gitsigns').setup({
on_attach = function(bufnr)
local gitsigns = require('gitsigns')
local function map(mode, l, r, opts)
opts = opts or {}
opts.buffer = bufnr
vim.keymap.set(mode, l, r, opts)
end
map('n', ']c', function()
if vim.wo.diff then
vim.cmd.normal({']c', bang = true})
else
gitsigns.nav_hunk('next')
end
end)
map('n', '[c', function()
if vim.wo.diff then
vim.cmd.normal({'[c', bang = true})
else
gitsigns.nav_hunk('prev')
end
end)
map('n', '<leader>hs', gitsigns.stage_hunk)
map('n', '<leader>hr', gitsigns.reset_hunk)
map('v', '<leader>hs', function() gitsigns.stage_hunk {vim.fn.line('.'), vim.fn.line('v')} end)
map('v', '<leader>hr', function() gitsigns.reset_hunk {vim.fn.line('.'), vim.fn.line('v')} end)
map('n', '<leader>hS', gitsigns.stage_buffer)
map('n', '<leader>hu', gitsigns.undo_stage_hunk)
map('n', '<leader>hR', gitsigns.reset_buffer)
map('n', '<leader>hp', gitsigns.preview_hunk)
map('n', '<leader>hb', function() gitsigns.blame_line{full=true} end)
map('n', '<leader>tb', gitsigns.toggle_current_line_blame)
map('n', '<leader>hd', gitsigns.diffthis)
map('n', '<leader>hD', function() gitsigns.diffthis('~') end)
map('n', '<leader>td', gitsigns.toggle_deleted)
map({'o', 'x'}, 'ih', ':<C-U>Gitsigns select_hunk<CR>')
end
})
-- guid.nvim
require('guid').setup({
comma_space = true

@ -0,0 +1 @@
Subproject commit 863903631e676b33e8be2acb17512fdc1b80b4fb

@ -1 +0,0 @@
Subproject commit 8670143f9e12ed1cd3c9b2c54f345cdd9a4baac3