algmyr/vcsigns.nvim
Sobre
Neovim sign gutter, designed to be mostly VCS agnostic
Ferramentas de desenvolvimentoO que você pode fazer
- Shows diffs compared to your current buffer, instant feedback.
- Easy switching of the target commit for the diff.
- Folding of non-diff areas.
- Navigating between hunks.
Crescimento medido de estrelas
- em 24 h
- 0
- em 7 dias
- 0
- em 15 dias
- 0
- em 1 mês
- Coletando histórico
Variações líquidas em períodos sobrepostos, não totais diários. Medições ausentes ficam em branco. Estrelas indicam interesse, não qualidade.
README.md
OriginalVCSigns.nvim
[!WARNING] While I use this heavily for personal and work use, but notably that only involves linux systems, so behavior on other systems could have issues. Fixes for such issues are welcome!
VCS agnostic vcs signs for your sign gutter, heavily inspired by vim-signify.
This plugin only relies on being able to ask for file contents at a specific commit to be able to construct a diff, this means that adding new vcs definitions should be straightforward.
Currently definitions for jujutsu, git and mercurial are included. The jujutsu one is the most well tested, but since very little logic of the vcs is depended on the core machinery should be robust across all of them.
Features
- Showing diff signs in your sign gutter.
- Shows diffs compared to your current buffer, instant feedback.
- Easy switching of the target commit for the diff.
- Folding of non-diff areas.
- Navigating between hunks.
- Undoing the hunk under the cursor.
- Showing inline diffs (plus lines and minus lines) for hunks, with fine grained diffs within hunks.
- Side-by-side diff view in a new tabpage with quickfix navigation.
Not yet implemented
- Custom fold text.
Example config
For a documented default config, have a look inside init.lua.
Lazy
{
'algmyr/vcsigns.nvim',
dependencies = {
"algmyr/vclib.nvim",
"lewis6991/async.nvim",
},
config = function()
require('vcsigns').setup {
target_commit = 1, -- Nice default for jj with new+squash flow.
}
local function map(mode, lhs, rhs, desc, opts)
local options = { noremap = true, silent = true, desc = desc }
if opts then options = vim.tbl_extend('force', options, opts) end
vim.keymap.set(mode, lhs, rhs, options)
end
map('n', '[r', function() require('vcsigns.actions').target_older_commit { steps = vim.v.count1 } end, 'Move diff target back')
map('n', ']r', function() require('vcsigns.actions').target_newer_commit { steps = vim.v.count1 } end, 'Move diff target forward')
map('n', '[c', function() require('vcsigns.actions').hunk_prev { count = vim.v.count1 } end, 'Go to previous hunk')
map('n', ']c', function() require('vcsigns.actions').hunk_next { count = vim.v.count1 } end, 'Go to next hunk')
map('n', '[C', function() require('vcsigns.actions').hunk_prev { count = 9999 } end, 'Go to first hunk')
map('n', ']C', function() require('vcsigns.actions').hunk_next { count = 9999 } end, 'Go to last hunk')
map('n', '<leader>su', function() require('vcsigns.actions').hunk_undo() end, 'Undo hunks under cursor')
map('v', '<leader>su', function() require('vcsigns.actions').hunk_undo() end, 'Undo hunks in range')
map('n', '<leader>sd', function() require('vcsigns.actions').toggle_hunk_diff() end, 'Show hunk diffs inline in the current buffer')
map('n', '<leader>sv', function() require('vcsigns.actions').diffview() end, 'Open native side-by-side diff view')
map('n', '<leader>sf', function() require('vcsigns.actions').toggle_fold() end, 'Fold outside hunks')
end,
}
As per https://lazy.folke.io/packages dependencies are specified in lazy.lua.
Screenshots
Screenshots are with my own theme
vim-wombat-lua
which has highlight groups overridden.
Gutter signs and lualine stats
Fold around diffs
Inline diff view
Explore projetos relacionados
Carregando…