git-conventional-commit-ls-basic
Provides completion, linting, and formatting of conventional commits.
git commit
on the command-line opens a ${GIT_DIR}/COMMIT_EDITMSG
file in your $EDITOR
of choice.
cconvention
acts as a language server to provide completion, linting, and formatting.
Powered by the cconvention
's base language server.
Pairs well with git-cc
, a TUI for writing conventional commits.
Usage
First, make sure that code
is available on the command line:
command -v code || echo 'code needs to be set up on the command line'
If code
is missing, run "Shell Command: Install 'code' command in PATH" from the VScode command palette.
Then, configure git
to write git commit messages with code
.
You can do this several ways:
(recommended) Using command-line git:
# in your repo
git config \
core.editor 'code --wait'
# or globally:
git config --global \
core.editor 'code --wait'
By editing ${GIT_DIR}/config
or your global .gitconfig
file:
[core]
editor = code --wait
Running
export EDITOR='code --wait'
in your current shell or adding the command to a file that consistently gets run during your shell's lifecycle, such as .envrc
or ~/.profile
.
Now, when you run git commit
, code
will open ${GIT_DIR}/COMMIT_EDITMSG
and start the language server.