使用SecureCRT连接服务器时,常常会使用vi或vim打开一些文件。但是打开的文件看起来比较吃力,因为颜色没有像在linux使用vim的那样设置好
Linux的控制台颜色很好设置:Options ->Session Options -> Terminal -> Emulation 中Terminal选择ANSI or linux or xterm,必须钩上 ANSI Colour
vi的颜色设置,编辑/etc/vimrc文件,
进入编辑 vimrc 后 按 ctrl+G 跳到末尾 复制以下内容,黏贴进去 如下:
- " ==============================================
- " General settings
- " ==============================================
- set nocp
- set ru
- set nu
- "set cin
- "set cino = :0g0t0(sus
- set sm
- set ai
- set sw=4
- set ts=4
- set noet
- set lbr
- set hls
- "set backspace = indent , eol , start
- "set whichwrap = b , s , < , > , [ , ]
- "set fo+ = mB
- set selectmode =
- "set mousemodel = popup
- set keymodel =
- "set selection = inclusive
- "set matchpairs+ =
- " ==============================================
- " Cursor movement
- " ==============================================
- "nnoremap gj
- "nnoremap gk
- "vnoremap gj
- "vnoremap gk
- "inoremap gj
- "inoremap gk
- "nnoremap g$
- "nnoremap g0
- "vnoremap g$
- "vnoremap g0
- "inoremap g$
- "inoremap g0
- "nmap :confirm bd
- "vmap :confirm bd
- "omap :confirm bd
- "map! :confirm bd
- syntax on
- set foldmethod=syntax
- if (has( " gui_running " ))
- set nowrap
- set guioptions+=b
- colo inkpot
- else
- set wrap
- colo ron
- endif
- "let mapleader = " , "
- if !has("gui_running")
- set t_Co=8
- set t_Sf=^[[3%p1%dm
- set t_Sb=^[[4%p1%dm
- endif