dotfiles/.config/nvim/lua/my/git.lua
tea 7689f8a270
nvim: more stuff ported from old config
- git
- more keybindings
- some fixes
2024-09-03 11:38:45 +02:00

28 lines
789 B
Lua

local wk = require('which-key')
wk.add({{ '<Leader>g', group = 'Git' }})
wk.add({{ '<Leader>gc', group = 'commit' }})
wk.add({{ '<Leader>gp', group = 'pull' }})
wk.add({{ '<Leader>ga', group = 'add' }})
local gitgroup = vim.api.nvim_create_augroup('config_git', { clear = true })
-- enable spell check
vim.api.nvim_create_autocmd({ 'FileType' }, {
group = gitgroup,
pattern = { 'gitcommit' },
command = [[setlocal spell]]
})
-- start in insert mode on line 1
vim.api.nvim_create_autocmd({ 'FileType' }, {
group = gitgroup,
pattern = { 'gitcommit', 'gitrebase' },
command = [[startinsert | 1]]
})
-- don't mark whitespace characters
vim.api.nvim_create_autocmd({ 'FileType' }, {
group = gitgroup,
pattern = { 'git' },
command = [[setlocal nolist]]
})