1、语法高亮
syntax on
2、显示行号
set number
3、自动缩进
set autoindent
set cindent
4、自动加入文件头
autocmd BufNewFile *.py,*.sh, exec ":call SetTitle()" let $author_name = "Scott" let $author_email="Scott@163.com" func SetTitle() if &filetype == 'sh' call setline(1,"\#################################################") call append(line("."), "\# File Name: ".expand("%")) call append(line(".")+1,"\# Author:".$author_name) call append(line(".")+2,"\# mail:".$author_email) call append(line(".")+3,"\# Created Time:".strftime("%c")) call append(line(".")+4,"\#==================================================") call append(line(".")+5,"\#!/bin/bash") call append(line(".")+6,"") else call setline(1,"\#################################################") call append(line("."),"\# File Name:".expand("%")) call append(line(".")+1,"\# Author:".$author_name) call append(line(".")+2,"\# mail:".$author_email) call append(line(".")+3,"\# Created Time:".strftime("%c")) call append(line(".")+4,"\#==================================================") call append(line(".")+5,"\#!/usr/bin/python") call append(line(".")+6,"") endif endf autocmd BufNewFile * normal G |