- 论坛徽章:
- 0
|
添加以下语句到 /etc/vim/vimrc中
" 在行前显示行号。关闭显示请用"set nonu"
set nu
" 启用语法高亮
syntax on
" 根据文件类型启用缩进
filetype indent on
set autoindent
" 查找时忽略大小写
set ic
" 查找文本高亮
set hls
" Wrap text instead of being on one line
set lbr
" 更改缺省配色方案为delek
colorscheme delek
[color="#000000"]设置Windows风格的C/C++自动缩进(添加以下set语句到vimrc中)
[color="#000000"] 1[color="#000000"])[color="#000000"]设置(软)制表符宽度为[color="#000000"]4[color="#000000"]:[color="#000000"] set tabstop=4[color="#000000"] set softtabstop=4[color="#000000"] 2[color="#000000"])[color="#000000"]设置缩进的空格数为[color="#000000"]4[color="#000000"] set shiftwidth=4[color="#000000"] 3[color="#000000"])[color="#000000"]设置自动缩进[color="#000000"]:即每行的缩进值与上一行相等;使用[color="#000000"] noautoindent [color="#000000"]取消设置:[color="#000000"]set autoindent[color="#000000"] 4[color="#000000"])[color="#000000"]设置[color="#000000"]使用[color="#000000"] C/C++ [color="#000000"]语言的自动缩进方式:[color="#000000"] set cindent[color="#000000"] 5[color="#000000"])设置[color="#000000"]C/C++[color="#000000"]语言的具体缩进方式[color="#000000"]:[color="#000000"] set cinoptions={0,1s,t0,n-2,p2s,(03s,=.5s,>1s,=1s,:1s[color="#000000"] 6[color="#000000"])如果想在左侧显示文本的行号,可以用以下语句:[color="#000000"] set nu[color="#000000"] 7[color="#000000"])最后,如果没有下列语句,就加上吧:[color="#000000"]if &term=="xterm"[color="#000000"]set t_Co=8[color="#000000"] set t_Sb=^[[4%dm[color="#000000"]set t_Sf=^[[3%dm[color="#000000"]endif
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/73410/showart_1082390.html |
|