aboutsummaryrefslogblamecommitdiff
path: root/vim/ftdetect/sh.vim
blob: 3df9c3ce47d742255b118eab7987d69f29c8aed3 (plain) (tree)
1
2
3
4
5
6
7
8
9
                                                                           
                            
          
 

                                                    


                                        
 

                                                    


                                          
 

                                                     


                                                                  
 
           
" Add automatic commands to choose shell flavours based on filename pattern
augroup dotfiles_ftdetect_sh
  autocmd!

  " Names/paths of things that are Bash shell script
  autocmd BufNewFile,BufRead
        \ **/.dotfiles/bash/**,bash-fc-*
        \ let b:is_bash = 1 |
        \ setfiletype sh

  " Names/paths of things that are Korn shell script
  autocmd BufNewFile,BufRead
        \ **/.dotfiles/ksh/**,.kshrc,*.ksh
        \ let b:is_kornshell = 1 |
        \ setfiletype sh

  " Names/paths of things that are POSIX shell script
  autocmd BufNewFile,BufRead
        \ **/.dotfiles/sh/**,.shinit,.shrc,.xinitrc,/etc/default/*
        \ let b:is_posix = 1 |
        \ setfiletype sh

augroup END