vimrc/vim/custom/functions.vim

12 lines
282 B
VimL

" my functions
autocmd BufNewFile *.sh,*.py exec ":call AutoSetFileHead()"
function! AutoSetFileHead()
if &filetype == 'sh'
call setline(1, "\#!/bin/bash")
endif
if &filetype == 'python'
call setline(1, "\# -*- coding: utf-8 -*-")
endif
endfunction