Daniel Hahler wrote:

> Am Montag, 11. Mai 2015 17:25:59 UTC+2 schrieb David Bialik:
> 
> > git init --separate-git-dir gitrepo code
> > 
> > now the filetype will be detected as conf instead of gitcommit.
> > 
> > This is because in filetype.vim the detection assumes .git/COMMIT_EDITMSG
> > Similar case for MERGE_MSG
> > 
> > Would it be possible to change this?
> 
> It could be made to only match the filename, yes.
> The current rules are:
> 
>     filetype.vim
>     779:au BufNewFile,BufRead *.git/COMMIT_EDITMSG    setf gitcommit
>     780:au BufNewFile,BufRead *.git/MERGE_MSG         setf gitcommit
>     782:au BufNewFile,BufRead *.git/modules/*/COMMIT_EDITMSG setf gitcommit
> 
> You can do it in a filetype.vim file for yourself:
> 
>     if exists("did_load_filetypes")
>       finish
>     endif
>     augroup filetypedetect
>       au! BufNewFile,BufRead */COMMIT_EDITMSG setf gitcommit
>       au! BufNewFile,BufRead */MERGE_MSG      setf gitcommit
>     augroup END
> 
> See also `:h new-filetype`.
> 
> I am not sure, if this uncommon case should be supported by default, but
> then the filenames itself are pretty unique already.

How about that?  Using gitcommit for COMMIT_EDITMSG and MERGE_MSG
would be fairly accurate.  The "*/" is not needed.

-- 
Everyone has a photographic memory. Some don't have film.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
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