vimdiff 的跳转

43 views
Skip to first unread message

闲耘(tm)

unread,
Aug 27, 2010, 10:26:58 AM8/27/10
to vim-cn, vim-taiwan
Vim diff 的跳转命令 [c 和 ]c 只能跳转到差异行的开始,
有没有办法直接将光标定位在差异列的开始(即深红色部分)?

tocer

unread,
Aug 27, 2010, 9:24:30 PM8/27/10
to vim...@googlegroups.com
2010/8/27 闲耘(tm) <hoto...@gmail.com>:

> Vim diff 的跳转命令 [c 和 ]c 只能跳转到差异行的开始,
> 有没有办法直接将光标定位在差异列的开始(即深红色部分)?

似乎没有现成的。

给你个思路,你看能不能实现,先手工查看“深红色部分”的语法项目名称A,然后移动光标,发现光标所在的位置的语法项目(使用
synIDattr(synID(line("."), col("."), 1), "name"))与A相同,则停下来,否则继续移动。

闲耘(tm)

unread,
Aug 29, 2010, 7:44:55 PM8/29/10
to vim...@googlegroups.com
谢谢。
这里初步实现了两个版本 http://gist.github.com/556810
2010/8/28 tocer <tocer...@gmail.com>
2010/8/27 闲耘(tm) <hotoo.cn@gmail.com>:

--
要退订此论坛,请发邮件至 Vim-cn-un...@googlegroups.com
 更多选项,请通过 http://groups.google.com/group/Vim-cn 访问该论坛

tocer

unread,
Aug 29, 2010, 8:41:23 PM8/29/10
to vim...@googlegroups.com
2010/8/30 闲耘(tm) <hoto...@gmail.com>:
> 谢谢。
> 这里初步实现了两个版本 http://gist.github.com/556810

Cool.

Reply all
Reply to author
Forward
0 new messages