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.
Another option might be to use a wrapper script via `GIT_EDITOR` (env var)
or `core.editor` (config setting).
I am using the following, which would still not work in your case, but you can
explicitly set "ft=gitcommit" from there, too:
https://github.com/blueyed/dotfiles/blob/ccf367ac2/usr/bin/vim-for-git
Cheers,
Daniel.
--
--
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.