I want to configure Vim such that when the [No Name] buffer is open, the syntax is set to markdown. Is this possible? I couldn't see such kind of hook in Vim's help.
I'm using Vim 7.3, compiled with --with-features=huge.
This is mentioned on the vim tips wiki:
" default filetype
let g:do_filetype = 0
au GUIEnter,BufAdd * if expand('<afile>') == "" | let g:do_filetype = 1 | endif
au BufEnter * if g:do_filetype | setf markdown | let g:do_filetype = 0 | endif
Why the need to use a global variable, and not set the filetype immediately, is to my understanding, because the buffer hasn't been fully created when the autocmd is triggered.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With