Natjo
Natjo

Reputation: 2118

Stop vim from folding git commit

Vim automatically folds my code when I open a new file. How can I stop it from folding the text when I run git commit -a, since I don't want folding only in this specific case?

I currently have this line in my code setlocal foldmethod=syntax to fold all code automatically.

I tried to add this line before and after setting the foldmethod autocmd FileType gitcommit setlocal nofoldenable, but it did not changing anything.

Upvotes: 0

Views: 443

Answers (1)

Amadan
Amadan

Reputation: 198294

Put this into after/ftplugin/gitcommit.vim in your runtime (~/.vim) or a plugin:

setlocal nofoldenable

Alternately, in your .vimrc,

autocmd FileType gitcommit setlocal nofoldenable

Upvotes: 4

Related Questions