aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-06-03 01:11:54 +1200
committerTom Ryder <tom@sanctum.geek.nz>2018-06-03 01:13:29 +1200
commite63edd766461f191959c27ec8ced26cec3d197b4 (patch)
treecd6c0744024d970532168d347288fc7a865ad4e7
parent4b16fc4ecc4fdb002ad9c833af148918767ed806 (diff)
downloaddotfiles-e63edd766461f191959c27ec8ced26cec3d197b4.tar.gz
Refine shebangs in filetype detection
-rw-r--r--vim/ftdetect/awk.vim2
-rw-r--r--vim/ftdetect/perl.vim2
-rw-r--r--vim/ftdetect/perl6.vim2
-rw-r--r--vim/ftdetect/python.vim2
-rw-r--r--vim/ftdetect/sh.vim6
-rw-r--r--vim/ftdetect/zsh.vim2
6 files changed, 8 insertions, 8 deletions
diff --git a/vim/ftdetect/awk.vim b/vim/ftdetect/awk.vim
index ce845c52..9965235e 100644
--- a/vim/ftdetect/awk.vim
+++ b/vim/ftdetect/awk.vim
@@ -4,6 +4,6 @@ autocmd BufNewFile,BufRead
\ setfiletype awk
autocmd BufNewFile,BufRead
\ *
- \ if getline(1) =~ '^#!.*awk$'
+ \ if getline(1) =~# '\m^#!.*\<[gm]\?awk\>'
\ | setfiletype awk
\ | endif
diff --git a/vim/ftdetect/perl.vim b/vim/ftdetect/perl.vim
index 3e8ec3b9..571e4f58 100644
--- a/vim/ftdetect/perl.vim
+++ b/vim/ftdetect/perl.vim
@@ -4,6 +4,6 @@ autocmd BufNewFile,BufRead
\ setfiletype perl
autocmd BufNewFile,BufRead
\ *
- \ if getline(1) =~ '^#!.*perl$'
+ \ if getline(1) =~# '\m^#!.*\<perl\>'
\ | setfiletype perl
\ | endif
diff --git a/vim/ftdetect/perl6.vim b/vim/ftdetect/perl6.vim
index 2f7fce00..67e62c7c 100644
--- a/vim/ftdetect/perl6.vim
+++ b/vim/ftdetect/perl6.vim
@@ -4,6 +4,6 @@ autocmd BufNewFile,BufRead
\ setfiletype perl6
autocmd BufNewFile,BufRead
\ *
- \ if getline(1) =~ '^#!.*perl6$'
+ \ if getline(1) =~# '\m^#!.\<perl6\>'
\ | setfiletype perl6
\ | endif
diff --git a/vim/ftdetect/python.vim b/vim/ftdetect/python.vim
index 50055005..5c4a4a6f 100644
--- a/vim/ftdetect/python.vim
+++ b/vim/ftdetect/python.vim
@@ -4,6 +4,6 @@ autocmd BufNewFile,BufRead
\ setfiletype python
autocmd BufNewFile,BufRead
\ *
- \ if getline(1) =~ '^#!.*python[23]\?$'
+ \ if getline(1) =~# '\m^#!.*\<python[23]\?\>'
\ | setfiletype python
\ | endif
diff --git a/vim/ftdetect/sh.vim b/vim/ftdetect/sh.vim
index 1169b744..1427bc03 100644
--- a/vim/ftdetect/sh.vim
+++ b/vim/ftdetect/sh.vim
@@ -42,13 +42,13 @@ autocmd BufNewFile,BufRead
autocmd BufNewFile,BufRead
\ *
\ if !exists('b:is_bash') && !exists('b:is_kornshell')
- \ | if getline(1) =~ '^#!.*bash$'
+ \ | if getline(1) =~# '\m^#!.*\<bash\>'
\ | let b:is_bash = 1
\ | setfiletype sh
- \ | elseif getline(1) =~ '^#!.*ksh$'
+ \ | elseif getline(1) =~# '\m^#!.*\<ksh\>'
\ | let b:is_ksh = 1
\ | setfiletype sh
- \ | elseif getline(1) =~ '^#!.*sh$'
+ \ | elseif getline(1) =~# '\m^#!.*\<sh\>'
\ | let b:is_posix = 1
\ | setfiletype sh
\ | endif
diff --git a/vim/ftdetect/zsh.vim b/vim/ftdetect/zsh.vim
index 1bcde981..08556361 100644
--- a/vim/ftdetect/zsh.vim
+++ b/vim/ftdetect/zsh.vim
@@ -4,6 +4,6 @@ autocmd BufNewFile,BufRead
\ setfiletype zsh
autocmd BufNewFile,BufRead
\ *
- \ if getline(1) =~ '^#!.*zsh$'
+ \ if getline(1) =~# '^#!.*\<zsh\>'
\ | setfiletype zsh
\ | endif