darcs + neovim integration, similar to gitsigns
root
DarcsSigns.nvim
DarcsSigns.nvim is a Neovim plugin that brings the power of the Darcs Theory of Patches to your editor. It displays working tree changes in the sign column (via extmarks) and provides seamless hunk navigation and previewing.
Think of it as gitsigns.nvim, but for Darcs!
Git already won... Why Darcs anyway?
In case you don't know about Darcs, here's a quick primer:
If you are coming from Git, you are used to thinking of history as a rigid graph of snapshots. If you want to move a commit, you have to rewrite history, change hashes, and carefully manage a Directed Acyclic Graph (DAG).
Darcs takes a radically different approach based on the Theory of Patches:
A "Bag" of Patches: Darcs views your repository as an unordered set of patches rather than a linear tree.
True Cherry-Picking: Because patches are commutative (A + B = B + A), you can pull specific changes from a friend's repo without needing to pull their entire history or deal with complex rebasing.
Interactive by Design: Darcs is famous for its interactive interface. It asks you exactly what you want to record or pull, giving you granular control over your code. This also makes it easier to learn for beginners (yes it's easier than git), and easier to use.
We still want to use Darcs because it removes the "Git Anxiety" of managing branches and complex histories, letting you focus on simply sharing code.
Requirements
- Neovim 0.10+ (uses
vim.systemandvim.diff) darcsin$PATH
Install
Use your plugin manager of choice; the plugin entrypoint is require('darcssigns').setup().
Setup
For using default settings just call:
require('darcssigns').setup()
Optional settings you may want to customize:
require('darcssigns').setup({
enabled = true,
sign_style = 'minimal', -- 'ascii' | 'minimal'
debounce_ms = 200,
signs = {
add = { text = '+', hl = 'DarcsSignsAdd' },
change = { text = '~', hl = 'DarcsSignsChange' },
delete = { text = '_', hl = 'DarcsSignsDelete' },
untracked = { text = '┆', hl = 'DarcsSignsUntracked' },
},
show_deleted_anchor = true,
wrap_navigation = true,
backend = {
mode = 'auto', -- 'auto' | 'parse_diff' | 'pristine_diff'
look_for_adds = false,
},
darcs = {
ui = {
default = 'terminal', -- 'terminal' | 'scratch' | 'float'
overrides = {
log = 'scratch',
status = 'scratch',
whatsnew = 'scratch',
},
},
},
untracked = { mode = 'grey' }, -- 'grey' | 'ignore'
preview = { ui = { default = 'scratch' } }, -- 'scratch' | 'float'
})
sign_style = 'minimal' uses ┃/_ bar-style signs.
Suggested mappings (defaults are off):
vim.keymap.set('n', ']c', require('darcssigns').next_hunk)
vim.keymap.set('n', '[c', require('darcssigns').prev_hunk)
vim.keymap.set('n', '<leader>hp', require('darcssigns').preview_hunk)
Commands
:DarcsSigns toggle|enable|disable|refresh|next_hunk|prev_hunk|preview_hunk:Darcs {args...}runs in the repo root and chooses UI viadarcs.uiconfig (terminal by default).:D {args...}is an alias for:Darcs.
Argument expansion: - % expands to the current buffer file (repo-relative). - # expands to the alternate buffer file (repo-relative).
:Darcs uses the current buffer to detect the repo; if the current buffer has no path (e.g. [No Name]), it falls back to the current working directory.
:Darcs initialize / :D initialize works outside a repository (runs in the current working directory).