vim-signify => gitsigns.nvim
This commit is contained in:
parent
25814f6358
commit
c18b62f675
6
.gitmodules
vendored
6
.gitmodules
vendored
@ -28,9 +28,6 @@
|
|||||||
[submodule ".vim/bundle/vim-dirvish"]
|
[submodule ".vim/bundle/vim-dirvish"]
|
||||||
path = pack/plugins/start/vim-dirvish
|
path = pack/plugins/start/vim-dirvish
|
||||||
url = https://github.com/justinmk/vim-dirvish.git
|
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"]
|
[submodule ".vim/bundle/vim-angry"]
|
||||||
path = pack/plugins/start/vim-angry
|
path = pack/plugins/start/vim-angry
|
||||||
url = https://github.com/b4winckler/vim-angry.git
|
url = https://github.com/b4winckler/vim-angry.git
|
||||||
@ -97,3 +94,6 @@
|
|||||||
[submodule "pack/plugins/start/argonaut.nvim"]
|
[submodule "pack/plugins/start/argonaut.nvim"]
|
||||||
path = pack/plugins/start/argonaut.nvim
|
path = pack/plugins/start/argonaut.nvim
|
||||||
url = https://git.foosoft.net/alex/argonaut.nvim.git
|
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
|
||||||
|
@ -47,6 +47,51 @@ if vim.fn.executable('fzf') == 1 then
|
|||||||
vim.keymap.set('n', '<leader>fs', live_grep)
|
vim.keymap.set('n', '<leader>fs', live_grep)
|
||||||
end
|
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
|
-- guid.nvim
|
||||||
require('guid').setup({
|
require('guid').setup({
|
||||||
comma_space = true
|
comma_space = true
|
||||||
|
1
pack/plugins/start/gitsigns.nvim
Submodule
1
pack/plugins/start/gitsigns.nvim
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit 863903631e676b33e8be2acb17512fdc1b80b4fb
|
@ -1 +0,0 @@
|
|||||||
Subproject commit 8670143f9e12ed1cd3c9b2c54f345cdd9a4baac3
|
|
Loading…
Reference in New Issue
Block a user