-
Notifications
You must be signed in to change notification settings - Fork 324
The vim-jjdescription
Vim plugin
provides highlighting of .jjdescription
files that jj
uses to edit commit messages.
vimdiff
comes as a pre-configured merge tool for jj
and can be used with jj resolve
out of the box. However, the default configuration for
vimdiff
as a diff editor (for jj split
, etc.) is barely useable.
To more conveniently use Vim as a difftool for jj
, try one of the following setups:
-
Install the
DirDiff
Vim plugin. -
Create a script in your
PATH
namedvimdirdiff
, with the following contents:
#!/bin/bash
# On Mac OS, you may need to replace `/bin/bash` with `/bin/zsh`.
# Shell-escape each path:
DIR1=$(printf '%q' "$1"); shift
DIR2=$(printf '%q' "$1"); shift
# The colorscheme is only important on Vim versions older than 9.0
vim "$@" -c "colorscheme murphy | DirDiff $DIR1 $DIR2"
- Make that script executable:
chmod +x vimdirdiff
. - In your
.jjconfig.toml
, setui.diff-editor="vimdirdiff"
.
-
Make sure you have Python installed. Optionally, check your Python version by running
python --version
. -
Install
vimtabdiff.py
as described here. Use the command for python <3.10 if you are not sure what your version of Python is.Make sure it is in your
PATH
and that you ranchmod +x
on it. -
In your
.jjconfig.toml
, setui.diff-editor="vimtabdiff.py"
.
- The UI if
DirDiff
is better if you have many files to compare, while thevimtabdiff.py
is better for fewer files - vimtabdiff.py requires having Python installed, while DirDiff doesn't.
- DirDiff requires installing a Vim plugin, while vimtabdiff.py doesn't.