diff options
| author | Thomas Vanbesien <tvanbesi@proton.me> | 2026-05-04 08:44:50 +0200 |
|---|---|---|
| committer | Thomas Vanbesien <tvanbesi@proton.me> | 2026-05-06 16:43:16 +0200 |
| commit | 34510ebc63ff65d51f6979a86169bfc52de6180c (patch) | |
| tree | 36c8b73c99a3c566ccee888818c60204398991fd /after/ftplugin/gitcommit.lua | |
| download | nvim-config-34510ebc63ff65d51f6979a86169bfc52de6180c.tar.gz nvim-config-34510ebc63ff65d51f6979a86169bfc52de6180c.zip | |
feat: initial setup
- `dotfiles` (this project's CLI)
- foot configuration
- tmux configuration
- bash configuration
- nvim (as a git submodule) + configuration
- ranger configuration
- fzf configuration
- KDE global shortcuts
- Other miscellaneous dependencies
Diffstat (limited to 'after/ftplugin/gitcommit.lua')
| -rw-r--r-- | after/ftplugin/gitcommit.lua | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/after/ftplugin/gitcommit.lua b/after/ftplugin/gitcommit.lua new file mode 100644 index 0000000..e52a2d8 --- /dev/null +++ b/after/ftplugin/gitcommit.lua @@ -0,0 +1,27 @@ +vim.opt_local.colorcolumn = "+1" -- Highlight one column after 'textwidth' +vim.opt_local.tabstop = 2 -- CommonMark expects two spaces for indentation +vim.opt_local.shiftwidth = 0 +vim.opt_local.softtabstop = -1 +vim.opt_local.expandtab = true -- Change tabs to spaces +vim.opt_local.spelllang = "en_us" +vim.opt_local.complete = { + "w", -- other windows + ".", -- current buffer +} + +vim.api.nvim_create_autocmd("BufWinEnter", { + desc = "Set up gitcommit buffer", + group = vim.g.dotfiles.augroup, + buffer = 0, + callback = function() + local gitcommit_window = vim.api.nvim_get_current_win() + -- Open cached diff window + vim.cmd.DiffGitCached() + vim.cmd.wincmd("L") + -- Enable English spell check in the original window + -- If `'spell'` is set before `:DiffGitChached` it propagates to the cached diff window + vim.api.nvim_set_option_value("spell", true, { win = gitcommit_window }) + -- The current window is the diff window + vim.o.filetype = "diff" + end, +}) |
