我想在编辑 git 提交时设置
textwidth=72
。如何在 Neovim 中加载 git commit ftplugin?我尝试定义 ftplugin/gitcommit.lua
文件,但没有效果。 (同一文件夹中的其他 ftplugins 按预期工作。)
我的旧 Vim 配置中有这个:
au BufRead */COMMIT_EDITMSG set tw=72
使用 lua,看起来像这样:
vim.api.nvim_create_autocmd({ "BufEnter" }, {
pattern = {
"*/COMMIT_EDITMSG",
},
command = "set tw=72",
})