SecureCRT中vim代码高亮问题

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

<a href=”http://www.phpthinking.com/wp-content/uploads/2014/09/s.jpg”><img class=”alignnone size-medium wp-image-294″ src=”http://www.phpthinking.com/wp-content/uploads/2014/09/s-300×276.jpg” alt=”s” width=”300″ height=”276″ /></a>

&nbsp;

2.进入服务器根目录

# cd /etc/

查看vimrc文件中的内容

# vim vimrc

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


if v:lang =~ "utf8$" || v:lang =~ "UTF-8$"
set fileencodings=ucs-bom,utf-8,latin1
endif

set nocompatible " Use Vim defaults (much better!)
set bs=indent,eol,start " allow backspacing over everything in insert mode
"set ai " always set autoindenting on
"set backup " keep a backup file
set viminfo='20,\"50 " read/write a .viminfo file, don't store more
" than 50 lines of registers
set history=50 " keep 50 lines of command line history
set ruler " show the cursor position all the time

" Only do this part when compiled with support for autocommands
if has("autocmd")
augroup redhat
autocmd!
" In text files, always limit the width of text to 78 characters
autocmd BufRead *.txt set tw=78
" When editing a file, always jump to the last cursor position
autocmd BufReadPost *
\ if line("'\"") &gt; 0 &amp;&amp; line ("'\"") &lt;= line("$") |
\ exe "normal! g'\"" |
\ endif
" don't write swapfile on most commonly used directories for NFS mounts or USB sticks
autocmd BufNewFile,BufReadPre /media/*,/mnt/* set directory=~/tmp,/var/tmp,/tmp
" start with spec file template
autocmd BufNewFile *.spec 0r /usr/share/vim/vimfiles/template.spec
augroup END
endif

if has("cscope") &amp;&amp; filereadable("/usr/bin/cscope")
set csprg=/usr/bin/cscope
set csto=0
set cst
set nocsverb
" add any database in current directory
if filereadable("cscope.out")
cs add cscope.out
" else add database pointed to by environment
elseif $CSCOPE_DB != ""
cs add $CSCOPE_DB
endif
set csverb
endif

" Switch syntax highlighting on, when the terminal has colors
" Also switch on highlighting the last used search pattern.
if &amp;t_Co &gt; 2 || has("gui_running")
syntax on
set hlsearch
endif

filetype plugin on

if &amp;term=="xterm"
set t_Co=8
set t_Sb=[4%dm
set t_Sf=[3%dm
endif

" Don't wake up system with blinking cursor:
" http://www.linuxpowertop.org/known.php
let &amp;guicursor = &amp;guicursor . ",a:blinkon0"

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

打赏此文

如果您觉得本站的内容对您有所帮助,您可以扫描下面的二维码小额支付请我喝杯茶,感谢!打赏记录
支付宝
微信
承诺:凡打赏捐助的朋友,留言备注自己的邮箱,在打赏捐助时间点的6个月内,本站会每周邮件推送原创专业技术博文,供大家学习和参考!

8 条评论

  1. hello world说道:

    博主说的很细,试过可以!

  2. 明天说道:

    谢谢博主!

  3. 影魔说道:

    今天搜到篇博文,才发现这个博客,大神求带!!QQ:541578455

  4. 此时彼时说道:

    东西太好了,博主好人啊!

  5. 袁腾说道:

    太值得一看了。竟然比书上讲的还详细。

  6. PZ ..说道:

    写的很专业

  7. 刘宽说道:

    写的很专业

  8. 麻袋说道:

    很专业噢~

留下评论

All fields marked (*) are required