Reputation: 6181
I'm looking for something to add to my .vimrc that would tell MacVim to always use Markdown syntax highlighting with TXT files.
Currently, I can do this manually with set filetype=markdown
but I have to do that every time I open a file.
Upvotes: 5
Views: 1699
Reputation: 59607
You can automatically set the filetype for particular file extensions using autocmd
:
autocmd BufRead,BufNewFile *.txt,*.TXT set filetype=markdown
Add this line to your .vimrc
.
Type :help autocmd
within vim for more details; see also: :help autocmd-group
. See also: :help filetype
.
Upvotes: 6