Am 2015-05-13 09:23, schrieb David Bialik:
Am Dienstag, 12. Mai 2015 17:25:15 UTC+2 schrieb Daniel Hahler:
It could be made to only match the filename, yes.

You can do it in a filetype.vim file for yourself:

Cheers,
Daniel.

I am currently figuring out if my current approach is OK, or has
flaws, maybe you can point me in the right direction.
In my /.vimrc file I have the following lines at the end:

au BufNewFile,BufRead COMMIT_EDITMSG set filetype=gitcommit
au BufNewFile,BufRead MERGE_MSG set filetype=gitcommit

What is the difference between "au!" and "au"?

au! will clear all previously defined events (see :h autocmd-remove)
The better approach is usually to put this into an explicit group,
so that sourcing your vimrc several times won't keep on adding autocommands
for those names.
Also see the faq:
http://vimhelp.appspot.com/vim_faq.txt.html#faq-26.8

In the filetype.vim they use "...setf gitcommit" which does not work
for me in /.vimrc
what is the meaning of this?

In short, :setfiletype only sets the filetype, if the current buffer does not have a filetype, while :set ft= will set it unconditionally and override any
previously set filetype.
See :h :setfiletype


Best,
Christian

--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui