安装vim
yum -y install vim
写入vim配置
vi ~/.vimrc
输入
"如果新建python文件
autocmd BufNewFile *.py exec ":call NewPython()"
func NewPython()
call append(0, "\#\# -*- coding: utf-8 -*- ")
call append(1,"# *********************************")
call append(2,"# Author: Jieshao")
call append(3,"# Date: " .strftime("%Y-%m-%d"))
call append(4,"# Filename: " .expand("%:t"))
call append(5,"")
endfunc
"如果是python
autocmd FileType python exec ":call Pythonset()"
func Pythonset()
"设置tabstop为4空格
:set ts=4
"tab替换为空格,noexpandtab空格替换为TAB
:set expandtab
"自动缩进
:set autoindent
"显示行号
:set nu
"显示标号
:set ruler
"启用鼠标
:set mouse=a
"显示标尺
:set ruler
endfunc
保存
:wq
我的配置暂时是这样