在线咨询
eetop公众号 创芯大讲堂 创芯人才网
切换到宽版

EETOP 创芯网论坛 (原名:电子顶级开发网)

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
查看: 4245|回复: 12

[求助] 关于gvim的一个功能

[复制链接]
发表于 2015-5-11 21:26:59 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

x
想请教大家一个问题,就是关于怎么设置让gvim的光标能够在一个匹配的begin-end之间进行跳动,有的时候代码层级太多看着犯晕,看不清代码层次。
发表于 2015-5-12 16:27:17 | 显示全部楼层
用% 可跳到最近的{} 块里面
 楼主| 发表于 2015-5-12 22:31:03 | 显示全部楼层
回复 2# icfbicfb


   谢谢,记得好像可以在vimrc里面设置自定义关键字的,比如module-endmodule等,以前看别人弄过,现在找不到了。
发表于 2015-5-13 10:25:43 | 显示全部楼层




   楼上说的是matchit插件:Examples:        Suppose you >                :let b:match_words = '<:>,<tag>:</tag>'<        and hit "%" with the cursor on or before the "<" in "a <tag> is born".        The pattern '<' comes first, so it is preferred over '<tag>', which        also matches.  If the cursor is on the "t", however, then '<tag>' is        preferred, because this matches a bit of text containing the cursor.        If the two groups of patterns were reversed then '<' would never be        preferred.        Suppose you >                :let b:match_words = 'if:end if'<        (Note the space!) and hit "%" with the cursor at the end of "end if".        Then "if" matches, which is probably not what you want, but if the        cursor starts on the "end " then "end if" is chosen.  (You can avoid        this problem by using a more complicated pattern.)


http://ftp.stust.edu.tw/vim/runtime/macros/matchit.txt
发表于 2015-5-13 10:26:25 | 显示全部楼层


回复  icfbicfb


   谢谢,记得好像可以在vimrc里面设置自定义关键字的,比如module-endmodule等,以前 ...
logue 发表于 2015-5-12 22:31




   楼上说的是matchit插件:
Examples:        Suppose you >                :let b:match_words = '<:>,<tag>:</tag>'<        and hit "%" with the cursor on or before the "<" in "a <tag> is born".        The pattern '<' comes first, so it is preferred over '<tag>', which        also matches.  If the cursor is on the "t", however, then '<tag>' is        preferred, because this matches a bit of text containing the cursor.        If the two groups of patterns were reversed then '<' would never be        preferred.        Suppose you >                :let b:match_words = 'if:end if'<        (Note the space!) and hit "%" with the cursor at the end of "end if".        Then "if" matches, which is probably not what you want, but if the        cursor starts on the "end " then "end if" is chosen.  (You can avoid        this problem by using a more complicated pattern.)
发表于 2015-5-13 10:26:58 | 显示全部楼层


回复  icfbicfb


   谢谢,记得好像可以在vimrc里面设置自定义关键字的,比如module-endmodule等,以前 ...
logue 发表于 2015-5-12 22:31



楼上说的是matchit插件
 楼主| 发表于 2015-5-15 20:08:34 | 显示全部楼层
回复 6# sjtusonic

好的,我研究看看,非常感谢!
发表于 2015-7-23 16:07:19 | 显示全部楼层
普通模式用*
发表于 2015-8-1 21:11:55 | 显示全部楼层
谢谢分享~~
发表于 2018-1-19 02:24:04 | 显示全部楼层
學習了
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐 上一条 /2 下一条

×

小黑屋| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-4-26 05:18 , Processed in 0.032696 second(s), 6 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
快速回复 返回顶部 返回列表