[英]How to enable spellcheck in vim on git-commit
我正在嘗試在Vim中啟用拼寫,以編輯git commit消息。 文件名是固定的,因此autocmd將無濟於事。 我已經在初始消息中放入了modeline,但是ftpplugin/gitcommit.vim
禁用了modeline。
對git-commit大小寫具有自定義vim設置的方法是什么?
git commit msg的文件類型為gitcommit
。 您可以在該文件類型上添加autocmd,例如:
autocmd FileType gitcommit setlocal spell
vim中的所有提交消息均應激活拼寫檢查。
您可以使用after/ftplugin
目錄覆蓋ftplugins,所以我把
setlocal spell
在~/.vim/after/ftplugin/gitcommit.vim
。 不要忘記閱讀:help b:undo_ftplugin
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.