vim里怎样高亮显示匹配的括号

Vim、Emacs配置和使用
回复
xiaozhe2000
帖子: 23
注册时间: 2007-10-30 13:00
来自: 北京

vim里怎样高亮显示匹配的括号

#1

帖子 xiaozhe2000 » 2008-07-24 17:12

比如说两个大括号{ }
在正常模式下,光标移到第一个大括号时,自动高亮第二个大括号。
头像
kofshower
帖子: 1343
注册时间: 2007-03-13 11:23
联系:

#2

帖子 kofshower » 2008-07-25 12:21

设置showmatch
"We are all in the mud, but some of us are looking at the stars." (Oscar Wilde)
We are not born for ourselves.
人生天地间,并非为自己
Homepage:http://sites.google.com/site/polarisnotme/
xiaozhe2000
帖子: 23
注册时间: 2007-10-30 13:00
来自: 北京

#3

帖子 xiaozhe2000 » 2008-07-25 15:26

设置showmatch只能是在编辑模式下,敲入后一个},会高亮一下前面匹配的{ 。
我说的意思是在正常模式下,光标放在{ 上就能高亮匹配的 } 。
头像
solcomo
帖子: 2838
注册时间: 2007-04-25 13:12

#4

帖子 solcomo » 2008-07-25 15:41

只要开了高亮就行吧
syntax enable
♜♞♝♛♚♝♞♜
♟♟♟♟♟♟♟♟
♙♙♙♙♙♙♙♙
♖♘♗♕♔♗♘♖

☠☯⚔⚓☣☦☃☕
☹☻☪☭☬⚖⚛⚜
ℜℳℬ™ ℋℯℓ℘ ℳℭ
sƂɐʍ рǀɹoʍ əɥʇ oS
头像
kofshower
帖子: 1343
注册时间: 2007-03-13 11:23
联系:

#5

帖子 kofshower » 2008-07-25 15:49

回头试一试,现在这个机子上居然没有shift键,囗囗囗囗
"We are all in the mud, but some of us are looking at the stars." (Oscar Wilde)
We are not born for ourselves.
人生天地间,并非为自己
Homepage:http://sites.google.com/site/polarisnotme/
xiaozhe2000
帖子: 23
注册时间: 2007-10-30 13:00
来自: 北京

#6

帖子 xiaozhe2000 » 2008-07-25 15:51

syntax enable 只是语法加亮。
我这里试了一下,加了syntax enable 也不能高亮匹配的括号。
头像
kofshower
帖子: 1343
注册时间: 2007-03-13 11:23
联系:

#7

帖子 kofshower » 2008-07-25 15:55

xiaozhe2000 写了:syntax enable 只是语法加亮。
我这里试了一下,加了syntax enable 也不能高亮匹配的括号。
我之前是用百分号,估计这种高亮要自动的话得自己写脚本函数了。
"We are all in the mud, but some of us are looking at the stars." (Oscar Wilde)
We are not born for ourselves.
人生天地间,并非为自己
Homepage:http://sites.google.com/site/polarisnotme/
头像
solcomo
帖子: 2838
注册时间: 2007-04-25 13:12

#8

帖子 solcomo » 2008-07-25 15:58

....试了一下
我这不用.vimrc都可以

是不是vim版本的问题啊
♜♞♝♛♚♝♞♜
♟♟♟♟♟♟♟♟
♙♙♙♙♙♙♙♙
♖♘♗♕♔♗♘♖

☠☯⚔⚓☣☦☃☕
☹☻☪☭☬⚖⚛⚜
ℜℳℬ™ ℋℯℓ℘ ℳℭ
sƂɐʍ рǀɹoʍ əɥʇ oS
xiaozhe2000
帖子: 23
注册时间: 2007-10-30 13:00
来自: 北京

#9

帖子 xiaozhe2000 » 2008-07-25 16:02

请问楼上用的是哪个版本,我这个是有点老,6.3
头像
solcomo
帖子: 2838
注册时间: 2007-04-25 13:12

#10

帖子 solcomo » 2008-07-25 16:08

User:~>vim --version
VIM - Vi IMproved 7.1 (2007 May 12, compiled Jun 26 2008 12:58:25)
♜♞♝♛♚♝♞♜
♟♟♟♟♟♟♟♟
♙♙♙♙♙♙♙♙
♖♘♗♕♔♗♘♖

☠☯⚔⚓☣☦☃☕
☹☻☪☭☬⚖⚛⚜
ℜℳℬ™ ℋℯℓ℘ ℳℭ
sƂɐʍ рǀɹoʍ əɥʇ oS
xiaozhe2000
帖子: 23
注册时间: 2007-10-30 13:00
来自: 北京

#11

帖子 xiaozhe2000 » 2008-07-25 16:57

嗯,刚下了一个7.1版本的,已经实现这个功能了,谢谢楼上几位 :)
头像
kofshower
帖子: 1343
注册时间: 2007-03-13 11:23
联系:

#12

帖子 kofshower » 2008-07-25 19:11

昏,都用7.1了~
我编译去
"We are all in the mud, but some of us are looking at the stars." (Oscar Wilde)
We are not born for ourselves.
人生天地间,并非为自己
Homepage:http://sites.google.com/site/polarisnotme/
头像
kofshower
帖子: 1343
注册时间: 2007-03-13 11:23
联系:

#13

帖子 kofshower » 2008-07-27 11:27

solcomo 写了:User:~>vim --version
VIM - Vi IMproved 7.1 (2007 May 12, compiled Jun 26 2008 12:58:25)
archlinux?我感觉系统带的vim是这个:
VIM - Vi IMproved 7.1 (2007 May 12, compiled Jan 31 2008 12:00:11)
Patch: 1-138
+arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset +cindent
+clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments
+cryptv +cscope +cursorshape +dialog_con_gui +diff +digraphs +dnd -ebcdic
+emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path +find_in_path
+folding -footer +fork() +gettext -hangul_input +iconv +insert_expand +jumplist
+keymap +langmap +libcall +linebreak +lispindent +listcmds +localmap +menu
+mksession +modify_fname +mouse +mouseshape +mouse_dec +mouse_gpm
-mouse_jsbterm +mouse_netterm +mouse_xterm +multi_byte +multi_lang -mzscheme
+netbeans_intg -osfiletype +path_extra +perl +postscript +printer +profile
+python +quickfix +reltime +rightleft +ruby +scrollbind +signs +smartindent
-sniff +statusline -sun_workshop +syntax +tag_binary +tag_old_static
-tag_any_white -tcl +terminfo +termresponse +textobjects +title +toolbar
+user_commands +vertsplit +virtualedit +visual +visualextra +viminfo +vreplace
+wildignore +wildmenu +windows +writebackup +X11 -xfontset +xim +xsmp_interact
+xterm_clipboard -xterm_save
"We are all in the mud, but some of us are looking at the stars." (Oscar Wilde)
We are not born for ourselves.
人生天地间,并非为自己
Homepage:http://sites.google.com/site/polarisnotme/
头像
solcomo
帖子: 2838
注册时间: 2007-04-25 13:12

#14

帖子 solcomo » 2008-07-27 11:32

kofshower 写了:
solcomo 写了:User:~>vim --version
VIM - Vi IMproved 7.1 (2007 May 12, compiled Jun 26 2008 12:58:25)
archlinux?我感觉系统带的vim是这个:
VIM - Vi IMproved 7.1 (2007 May 12, compiled Jan 31 2008 12:00:11)
Patch: 1-138
+arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset +cindent
+clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments
+cryptv +cscope +cursorshape +dialog_con_gui +diff +digraphs +dnd -ebcdic
+emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path +find_in_path
+folding -footer +fork() +gettext -hangul_input +iconv +insert_expand +jumplist
+keymap +langmap +libcall +linebreak +lispindent +listcmds +localmap +menu
+mksession +modify_fname +mouse +mouseshape +mouse_dec +mouse_gpm
-mouse_jsbterm +mouse_netterm +mouse_xterm +multi_byte +multi_lang -mzscheme
+netbeans_intg -osfiletype +path_extra +perl +postscript +printer +profile
+python +quickfix +reltime +rightleft +ruby +scrollbind +signs +smartindent
-sniff +statusline -sun_workshop +syntax +tag_binary +tag_old_static
-tag_any_white -tcl +terminfo +termresponse +textobjects +title +toolbar
+user_commands +vertsplit +virtualedit +visual +visualextra +viminfo +vreplace
+wildignore +wildmenu +windows +writebackup +X11 -xfontset +xim +xsmp_interact
+xterm_clipboard -xterm_save
...换8.10源升级了几个软件
♜♞♝♛♚♝♞♜
♟♟♟♟♟♟♟♟
♙♙♙♙♙♙♙♙
♖♘♗♕♔♗♘♖

☠☯⚔⚓☣☦☃☕
☹☻☪☭☬⚖⚛⚜
ℜℳℬ™ ℋℯℓ℘ ℳℭ
sƂɐʍ рǀɹoʍ əɥʇ oS
回复