建议在用户家目录创建.vimrc文件:
文件格式如下:
set ignorecaseset autoindentset pasteautocmd BufNewFile *.sh exec \":.call SetTitle()\"func SetTitle()if expand(\"%:e\") == \'sh\'call setline(1,\"#!/bin/bash\")call setline(2,\"#***********************************************\")call setline(3,\"#Author: Tom\")call setline(4,\"#Mail: 123456789@qq.com\")call setline(5,\"#Version: 1.0\")call setline(6,\"#Date: \".strftime(\"%Y-%m-%d\"))call setline(7,\"#FileName: \".expand(\"%\"))call setline(8,\"#Description: The test script\")call setline(9,\"#***********************************************\")call setline(10,\"\")endifendfuncautocmd BufNewFile * normal G