(1)安装vim后,执行命令
whereis vim
你会看到返回结果:vim: /usr/bin/vim /usr/share/vim /usr/share/man/man1/vim.1.gz
注意:/usr/share/vim 为vim为用户提供的共享数据或设置方案选择
(2) 在你的家目录下建立.vimrc
set tabstop=4
set softtabstop=4
set shiftwidth=4
set autoindent
set cindent
set cinoptions={0,1s,t0,n-2,p2s,(03s,=.5s,>1s,=1s,:1s
set expandtab
www.2cto.com
(3)增长配色方案
首先查看你的系统中自带的有哪些,从(1)中咱们知道执行命令 ls -l /usr/share/vim/vim70/colors/
能够看到
-rw-r--r-- 1 root root 2588 2011-03-06 blue.vim
-rw-r--r-- 1 root root 2809 2011-03-06 darkblue.vim
-rw-r--r-- 1 root root 548 2011-03-06 default.vim
-rw-r--r-- 1 root root 2399 2011-03-06 delek.vim
-rw-r--r-- 1 root root 2812 2011-03-06 desert.vim
-rw-r--r-- 1 root root 1666 2011-03-06 elflord.vim
-rw-r--r-- 1 root root 2476 2011-03-06 evening.vim
-rw-r--r-- 1 root root 3238 2011-03-06 koehler.vim
-rw-r--r-- 1 root root 2460 2011-03-06 morning.vim
-rw-r--r-- 1 root root 2006 2011-03-06 murphy.vim
-rw-r--r-- 1 root root 1037 2011-03-06 pablo.vim
-rw-r--r-- 1 root root 2673 2011-03-06 peachpuff.vim
-rw-r--r-- 1 root root 2174 2011-03-06 README.txt
-rw-r--r-- 1 root root 1239 2011-03-06 ron.vim
-rw-r--r-- 1 root root 2720 2011-03-06 shine.vim
-rw-r--r-- 1 root root 2419 2011-03-06 slate.vim
-rw-r--r-- 1 root root 1627 2011-03-06 torte.vim
-rw-r--r-- 1 root root 1840 2011-03-06 zellner.vim
www.2cto.com
因此咱们知道配色方案的名字有morning,evening,desert等等,
若是咱们想要将配色方案改成evening,那么咱们只须要在.vimrc中增长一行 colorscheme evening便可。
(4)若是以为配色方案太少,能够从外部
下载配色方案,这里给出一个网址:
http://vimcolorschemetest.googlecode.com/svn/colors/
你能够使用工具wget下载下来,而后将.vim的文件放入/usr/share/vim/vim70/colors/目录下,而后更改.vimrc便可生效。