mirror of
https://github.com/cap153/nvim.git
synced 2026-04-24 14:57:46 +08:00
30 lines
600 B
Lua
30 lines
600 B
Lua
-- ===
|
|
-- === git status/git状态
|
|
-- ===
|
|
|
|
return {
|
|
'lewis6991/gitsigns.nvim',
|
|
build = ':TSUpdate',
|
|
config = function()
|
|
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
|
|
-- Navigation
|
|
map('n', 't=', function()
|
|
gitsigns.nav_hunk('next')
|
|
end)
|
|
map('n', 't-', function()
|
|
gitsigns.nav_hunk('prev')
|
|
end)
|
|
-- show diff
|
|
map('n', '<leader>hd', gitsigns.diffthis)
|
|
end
|
|
}
|
|
end
|
|
}
|