Browse Source

Added ftdetect files for vim to detect shell scripts from shebang line.

master
Daniel Sissom 5 years ago
parent
commit
fcb7f8db75
Signed by untrusted user who does not match committer: djsissom GPG Key ID: 2C30FFB796852389
3 changed files with 21 additions and 0 deletions
  1. + 7
    - 0
      vim/vim/ftdetect/bash.vim
  2. + 7
    - 0
      vim/vim/ftdetect/sh.vim
  3. + 7
    - 0
      vim/vim/ftdetect/zsh.vim

+ 7
- 0
vim/vim/ftdetect/bash.vim

@ -0,0 +1,7 @@
fun! s:DetectNode()
if getline(1) == '#!/usr/bin/env bash'
set ft=sh
endif
endfun
autocmd BufNewFile,BufRead * call s:DetectNode()

+ 7
- 0
vim/vim/ftdetect/sh.vim

@ -0,0 +1,7 @@
fun! s:DetectNode()
if getline(1) == '#!/usr/bin/env sh'
set ft=sh
endif
endfun
autocmd BufNewFile,BufRead * call s:DetectNode()

+ 7
- 0
vim/vim/ftdetect/zsh.vim

@ -0,0 +1,7 @@
fun! s:DetectNode()
if getline(1) == '#!/usr/bin/env zsh'
set ft=sh
endif
endfun
autocmd BufNewFile,BufRead * call s:DetectNode()

Loading…
Cancel
Save