mirror of
https://github.com/tpope/vim-rhubarb.git
synced 2025-12-07 20:54:27 +08:00
Set a filetype only if unset or wrong
It's possible that vim's built-in will notice the comment lines and set a filetype of `conf`. This makes using `setfiletype` impractical since `setfiletype` does not override an already set file type.
This commit is contained in:
@@ -44,7 +44,10 @@ augroup rhubarb
|
|||||||
\ if expand('%') ==# '' && &previewwindow && pumvisible() && getbufvar('#', '&omnifunc') ==# 'rhubarb#omnifunc' |
|
\ if expand('%') ==# '' && &previewwindow && pumvisible() && getbufvar('#', '&omnifunc') ==# 'rhubarb#omnifunc' |
|
||||||
\ setlocal nolist linebreak filetype=markdown |
|
\ setlocal nolist linebreak filetype=markdown |
|
||||||
\ endif
|
\ endif
|
||||||
autocmd BufNewFile,BufRead *.git/{PULLREQ_EDIT,ISSUE_EDIT,RELEASE_EDIT}MSG set ft=gitcommit
|
autocmd BufNewFile,BufRead *.git/{PULLREQ_EDIT,ISSUE_EDIT,RELEASE_EDIT}MSG
|
||||||
|
\ if &ft ==# '' || &ft ==# 'conf' |
|
||||||
|
\ set ft=gitcommit
|
||||||
|
\ endif
|
||||||
augroup END
|
augroup END
|
||||||
|
|
||||||
if !exists('g:fugitive_browse_handlers')
|
if !exists('g:fugitive_browse_handlers')
|
||||||
|
|||||||
Reference in New Issue
Block a user