SecureCRT中vim代码高亮问题

来源:互联网 发布:淘宝商城汽车音响 编辑:程序博客网 时间:2024/05/17 03:45

原创网址:http://www.phpthinking.com/archives/289


1.首先,点击SecureCRT的Options->Session Options->Terminal->Emulation,选择右侧选项框中Terminal为Linux,点击ANSI Color选项(中文SecureCRT为:选项->会话选项->终端->仿真,右侧的仿真选框)

s

 

2.进入服务器根目录

# cd /etc/

查看vimrc文件中的内容

# vim vimrc

将vimrc中的内容,替换为如下代码!

01if v:lang =~ "utf8$" || v:lang =~ "UTF-8$"
02set fileencodings=ucs-bom,utf-8,latin1
03endif
04 
05set nocompatible " Use Vim defaults (much better!)
06set bs=indent,eol,start " allow backspacing over everything in insert mode
07"set ai " always set autoindenting on
08"set backup " keep a backup file
09set viminfo='20,\"50 " read/write a .viminfo file, don't store more
10" than 50 lines of registers
11set history=50 " keep 50 lines of command line history
12set ruler " show the cursor position all the time
13 
14" Only do this part when compiled with support for autocommands
15if has("autocmd")
16augroup redhat
17autocmd!
18" In text files, always limit the width of text to 78 characters
19autocmd BufRead *.txt set tw=78
20" When editing a file, always jump to the last cursor position
21autocmd BufReadPost *
22if line("'\"") > 0 && line ("'\"") <= line("$") |
23\ exe "normal! g'\"" |
24endif
25" don't write swapfile on most commonly used directories for NFS mounts or USB sticks
26autocmd BufNewFile,BufReadPre /media/*,/mnt/* set directory=~/tmp,/var/tmp,/tmp
27" start with spec file template
28autocmd BufNewFile *.spec 0r /usr/share/vim/vimfiles/template.spec
29augroup END
30endif
31 
32if has("cscope") && filereadable("/usr/bin/cscope")
33set csprg=/usr/bin/cscope
34set csto=0
35set cst
36set nocsverb
37" add any database in current directory
38if filereadable("cscope.out")
39cs add cscope.out
40else add database pointed to by environment
41elseif $CSCOPE_DB != ""
42cs add $CSCOPE_DB
43endif
44set csverb
45endif
46 
47" Switch syntax highlighting on, when the terminal has colors
48" Also switch on highlighting the last used search pattern.
49if &t_Co > 2 || has("gui_running")
50syntax on
51set hlsearch
52endif
53 
54filetype plugin on
55 
56if &term=="xterm"
57set t_Co=8
58set t_Sb=[4%dm
59set t_Sf=[3%dm
60endif
61 
62" Don't wake up system with blinking cursor:
63" http://www.linuxpowertop.org/known.php
64let &guicursor = &guicursor . ",a:blinkon0"

3.重启SecureCRT,即可看到代码高亮效果,多次试验,无一例外!

2 0
原创粉丝点击