diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2019-03-19 00:03:23 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-03-19 00:03:23 +0100 |
| commit | a077f53914ac0e8eadbe2de1ccb088ed174ef818 (patch) | |
| tree | 837587215eb7cc05d5291808d6b5e2e9397005c0 /runtime/filetype.vim | |
| parent | 29d6993ccdf1b5371cc11f7994a973a84bd9d40f (diff) | |
| parent | 14bfa0c578d8dfc3d82fe2b1ef39654bbf49b40d (diff) | |
| download | rneovim-a077f53914ac0e8eadbe2de1ccb088ed174ef818.tar.gz rneovim-a077f53914ac0e8eadbe2de1ccb088ed174ef818.tar.bz2 rneovim-a077f53914ac0e8eadbe2de1ccb088ed174ef818.zip | |
Merge #9749 from janlazo/vim-8.1.1017
Diffstat (limited to 'runtime/filetype.vim')
| -rw-r--r-- | runtime/filetype.vim | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/runtime/filetype.vim b/runtime/filetype.vim index a4d46fd842..1a08f5675f 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -1458,9 +1458,11 @@ au BufNewFile,BufRead sgml.catalog* call s:StarSetf('catalog') " Shell scripts (sh, ksh, bash, bash2, csh); Allow .profile_foo etc. " Gentoo ebuilds and Arch Linux PKGBUILDs are actually bash scripts -au BufNewFile,BufRead .bashrc*,bashrc,bash.bashrc,.bash[_-]profile*,.bash[_-]logout*,.bash[_-]aliases*,bash-fc[-.]*,*.bash,*/{,.}bash[_-]completion{,.d,.sh}{,/*},*.ebuild,*.eclass,PKGBUILD* call dist#ft#SetFileTypeSH("bash") -au BufNewFile,BufRead .kshrc*,*.ksh call dist#ft#SetFileTypeSH("ksh") -au BufNewFile,BufRead */etc/profile,.profile*,*.sh,*.env call dist#ft#SetFileTypeSH(getline(1)) +" NOTE: Patterns ending in a star are further down, these have lower priority. +au BufNewFile,BufRead .bashrc,bashrc,bash.bashrc,.bash[_-]profile,.bash[_-]logout,.bash[_-]aliases,bash-fc[-.],*.bash,*/{,.}bash[_-]completion{,.d,.sh}{,/*},*.ebuild,*.eclass,PKGBUILD call dist#ft#SetFileTypeSH("bash") +au BufNewFile,BufRead .kshrc,*.ksh call dist#ft#SetFileTypeSH("ksh") +au BufNewFile,BufRead */etc/profile,.profile,*.sh,*.env call dist#ft#SetFileTypeSH(getline(1)) + " Shell script (Arch Linux) or PHP file (Drupal) au BufNewFile,BufRead *.install @@ -1470,15 +1472,16 @@ au BufNewFile,BufRead *.install \ call dist#ft#SetFileTypeSH("bash") | \ endif -" tcsh scripts -au BufNewFile,BufRead .tcshrc*,*.tcsh,tcsh.tcshrc,tcsh.login call dist#ft#SetFileTypeShell("tcsh") +" tcsh scripts (patterns ending in a star further below) +au BufNewFile,BufRead .tcshrc,*.tcsh,tcsh.tcshrc,tcsh.login call dist#ft#SetFileTypeShell("tcsh") " csh scripts, but might also be tcsh scripts (on some systems csh is tcsh) -au BufNewFile,BufRead .login*,.cshrc*,csh.cshrc,csh.login,csh.logout,*.csh,.alias call dist#ft#CSH() +" (patterns ending in a start further below) +au BufNewFile,BufRead .login,.cshrc,csh.cshrc,csh.login,csh.logout,*.csh,.alias call dist#ft#CSH() -" Z-Shell script +" Z-Shell script (patterns ending in a star further below) au BufNewFile,BufRead .zprofile,*/etc/zprofile,.zfbfmarks setf zsh -au BufNewFile,BufRead .zsh*,.zlog*,.zcompdump* call s:StarSetf('zsh') +au BufNewFile,BufRead .zshrc,.zshenv,.zlogin,.zlogout,.zcompdump setf zsh au BufNewFile,BufRead *.zsh setf zsh " Scheme @@ -2073,6 +2076,17 @@ au BufRead,BufNewFile *.rdf call dist#ft#Redif() " Remind au BufNewFile,BufRead .reminders* call s:StarSetf('remind') +" Shell scripts ending in a star +au BufNewFile,BufRead .bashrc*,.bash[_-]profile*,.bash[_-]logout*,.bash[_-]aliases*,bash-fc[-.]*,,PKGBUILD* call dist#ft#SetFileTypeSH("bash") +au BufNewFile,BufRead .kshrc* call dist#ft#SetFileTypeSH("ksh") +au BufNewFile,BufRead .profile* call dist#ft#SetFileTypeSH(getline(1)) + +" tcsh scripts ending in a star +au BufNewFile,BufRead .tcshrc* call dist#ft#SetFileTypeShell("tcsh") + +" csh scripts ending in a star +au BufNewFile,BufRead .login*,.cshrc* call dist#ft#CSH() + " Vim script au BufNewFile,BufRead *vimrc* call s:StarSetf('vim') @@ -2100,7 +2114,8 @@ au BufNewFile,BufRead */etc/xinetd.d/* call s:StarSetf('xinetd') " yum conf (close enough to dosini) au BufNewFile,BufRead */etc/yum.repos.d/* call s:StarSetf('dosini') -" Z-Shell script +" Z-Shell script ending in a star +au BufNewFile,BufRead .zsh*,.zlog*,.zcompdump* call s:StarSetf('zsh') au BufNewFile,BufRead zsh*,zlog* call s:StarSetf('zsh') |