(每日一水)
第一步:vi /etc/vimrc
第二步:添加下列代码到末尾,保存退出
"#给sh文件添加头部注释
autocmd BufNewFile *.sh exec ":call WESTOS()"
function WESTOS()
call append(0,"#!/bin/bash")
endfunction
autocmd BufNewfile * normal G
之后每次vim 开启文件就自动生成#!/bin/bash
(每日一水)
第一步:vi /etc/vimrc
第二步:添加下列代码到末尾,保存退出
"#给sh文件添加头部注释
autocmd BufNewFile *.sh exec ":call WESTOS()"
function WESTOS()
call append(0,"#!/bin/bash")
endfunction
autocmd BufNewfile * normal G
之后每次vim 开启文件就自动生成#!/bin/bash