Improve neovim config for git

- Only start in insert mode when editing a commit message (and not when
  doing a rebase or something else)
- Add colorcolumn to indicate maximum line length
- Add spell check
This commit is contained in:
Jakob Lechner 2024-05-15 09:08:20 +00:00
parent 3fe20d2313
commit 123fcf6748
2 changed files with 7 additions and 1 deletions

View file

@ -13,7 +13,6 @@
extraConfig = {
init.defaultBranch = "main";
core.pager = "${pkgs.diff-so-fancy}/bin/diff-so-fancy | less --tabs=4 -RFX";
core.editor = "${pkgs.neovim}/bin/nvim +star";
diff.sops.textconv = "${pkgs.sops}/bin/sops -d";
pull.ff = "only";
alias.find-merge = "!sh -c 'commit=$0 && branch=\${1:-HEAD} && (git rev-list $commit..$branch --ancestry-path | cat -n; git rev-list $commit..$branch --first-parent | cat -n) | sort -k2 -s | uniq -f1 -d | sort -n | tail -1 | cut -f2'";

View file

@ -43,6 +43,8 @@
autocmd BufWinLeave * call clearmatches()
augroup END
autocmd BufRead COMMIT_EDITMSG startinsert
let g:deoplete#enable_at_startup = 1
sign define LspDiagnosticsSignError text=🟥
@ -183,4 +185,9 @@
)
)
);
xdg.configFile."nvim/ftplugin/gitcommit.vim".text = ''
setlocal spell
setlocal colorcolumn=73
'';
}