Mercurial > vim
comparison runtime/filetype.vim @ 15527:963dd629d19a v8.1.0771
patch 8.1.0771: some shell filetype patterns end in a star
commit https://github.com/vim/vim/commit/147e7d0caba8b66ff11622e514142bcc3d24403a
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Jan 18 21:46:47 2019 +0100
patch 8.1.0771: some shell filetype patterns end in a star
Problem: Some shell filetype patterns end in a star.
Solution: Make sure that patterns not ending in a star are preferred.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 18 Jan 2019 22:00:06 +0100 |
parents | ebabd6fe3833 |
children | 45a159f62dd0 |
comparison
equal
deleted
inserted
replaced
15526:96e37f652ddd | 15527:963dd629d19a |
---|---|
1460 au BufNewFile,BufRead catalog setf catalog | 1460 au BufNewFile,BufRead catalog setf catalog |
1461 au BufNewFile,BufRead sgml.catalog* call s:StarSetf('catalog') | 1461 au BufNewFile,BufRead sgml.catalog* call s:StarSetf('catalog') |
1462 | 1462 |
1463 " Shell scripts (sh, ksh, bash, bash2, csh); Allow .profile_foo etc. | 1463 " Shell scripts (sh, ksh, bash, bash2, csh); Allow .profile_foo etc. |
1464 " Gentoo ebuilds and Arch Linux PKGBUILDs are actually bash scripts | 1464 " Gentoo ebuilds and Arch Linux PKGBUILDs are actually bash scripts |
1465 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") | 1465 " NOTE: Patterns ending in a star are further down, these have lower priority. |
1466 au BufNewFile,BufRead .kshrc*,*.ksh call dist#ft#SetFileTypeSH("ksh") | 1466 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") |
1467 au BufNewFile,BufRead */etc/profile,.profile*,*.sh,*.env call dist#ft#SetFileTypeSH(getline(1)) | 1467 au BufNewFile,BufRead .kshrc,*.ksh call dist#ft#SetFileTypeSH("ksh") |
1468 au BufNewFile,BufRead */etc/profile,.profile,*.sh,*.env call dist#ft#SetFileTypeSH(getline(1)) | |
1469 | |
1468 | 1470 |
1469 " Shell script (Arch Linux) or PHP file (Drupal) | 1471 " Shell script (Arch Linux) or PHP file (Drupal) |
1470 au BufNewFile,BufRead *.install | 1472 au BufNewFile,BufRead *.install |
1471 \ if getline(1) =~ '<?php' | | 1473 \ if getline(1) =~ '<?php' | |
1472 \ setf php | | 1474 \ setf php | |
1473 \ else | | 1475 \ else | |
1474 \ call dist#ft#SetFileTypeSH("bash") | | 1476 \ call dist#ft#SetFileTypeSH("bash") | |
1475 \ endif | 1477 \ endif |
1476 | 1478 |
1477 " tcsh scripts | 1479 " tcsh scripts |
1478 au BufNewFile,BufRead .tcshrc*,*.tcsh,tcsh.tcshrc,tcsh.login call dist#ft#SetFileTypeShell("tcsh") | 1480 au BufNewFile,BufRead .tcshrc,*.tcsh,tcsh.tcshrc,tcsh.login call dist#ft#SetFileTypeShell("tcsh") |
1479 | 1481 |
1480 " csh scripts, but might also be tcsh scripts (on some systems csh is tcsh) | 1482 " csh scripts, but might also be tcsh scripts (on some systems csh is tcsh) |
1481 au BufNewFile,BufRead .login*,.cshrc*,csh.cshrc,csh.login,csh.logout,*.csh,.alias call dist#ft#CSH() | 1483 au BufNewFile,BufRead .login,.cshrc,csh.cshrc,csh.login,csh.logout,*.csh,.alias call dist#ft#CSH() |
1482 | 1484 |
1483 " Z-Shell script | 1485 " Z-Shell script |
1484 au BufNewFile,BufRead .zprofile,*/etc/zprofile,.zfbfmarks setf zsh | 1486 au BufNewFile,BufRead .zprofile,*/etc/zprofile,.zfbfmarks setf zsh |
1485 au BufNewFile,BufRead .zsh*,.zlog*,.zcompdump* call s:StarSetf('zsh') | 1487 au BufNewFile,BufRead .zsh,.zlog,.zcompdump call s:StarSetf('zsh') |
1486 au BufNewFile,BufRead *.zsh setf zsh | 1488 au BufNewFile,BufRead *.zsh setf zsh |
1487 | 1489 |
1488 " Scheme | 1490 " Scheme |
1489 au BufNewFile,BufRead *.scm,*.ss,*.rkt setf scheme | 1491 au BufNewFile,BufRead *.scm,*.ss,*.rkt setf scheme |
1490 | 1492 |
2071 " Only used when the .rdf file was not detected to be XML. | 2073 " Only used when the .rdf file was not detected to be XML. |
2072 au BufRead,BufNewFile *.rdf call dist#ft#Redif() | 2074 au BufRead,BufNewFile *.rdf call dist#ft#Redif() |
2073 | 2075 |
2074 " Remind | 2076 " Remind |
2075 au BufNewFile,BufRead .reminders* call s:StarSetf('remind') | 2077 au BufNewFile,BufRead .reminders* call s:StarSetf('remind') |
2078 | |
2079 " Shell scripts ending in a star | |
2080 au BufNewFile,BufRead .bashrc*,.bash[_-]profile*,.bash[_-]logout*,.bash[_-]aliases*,bash-fc[-.]*,,PKGBUILD* call dist#ft#SetFileTypeSH("bash") | |
2081 au BufNewFile,BufRead .kshrc* call dist#ft#SetFileTypeSH("ksh") | |
2082 au BufNewFile,BufRead .profile* call dist#ft#SetFileTypeSH(getline(1)) | |
2083 | |
2084 " tcsh scripts ending in a star | |
2085 au BufNewFile,BufRead .tcshrc* call dist#ft#SetFileTypeShell("tcsh") | |
2086 | |
2087 " csh scripts ending in a star | |
2088 au BufNewFile,BufRead .login*,.cshrc* call dist#ft#CSH() | |
2089 | |
2090 " Z-Shell script ending in a star | |
2091 au BufNewFile,BufRead .zsh*,.zlog*,.zcompdump* call s:StarSetf('zsh') | |
2076 | 2092 |
2077 " Vim script | 2093 " Vim script |
2078 au BufNewFile,BufRead *vimrc* call s:StarSetf('vim') | 2094 au BufNewFile,BufRead *vimrc* call s:StarSetf('vim') |
2079 | 2095 |
2080 " Subversion commit file | 2096 " Subversion commit file |