在高亮括号下,我从 “{ ” 开始滚动屏幕想浏览至 “}”,然而光标却跟着翻页跑了,“}”还没找到“{ ”位置也跟丢了,这种情况大神是怎么解决的。
1
wd 2019-02-10 07:55:19 +08:00 via iPhone
我记得有一个按照括号移动的快捷键的 ctrl-alt-p/f 是不是看看
|
2
pimin 2019-02-10 08:14:28 +08:00 via Android
亲,我们这里建议您百度一下呢
|
5
wd 2019-02-10 12:15:57 +08:00 via iPhone
@frylkrttj #4 这个似乎没办法达成。往下移动的时候,光标会尽量保持同列,但是如果你的括号不在一列上 那是没有办法的。据我经验,应该没有哪个编辑器会按你说的做吧?
|
7
wd 2019-02-10 12:44:58 +08:00 via iPhone
不懂你这个需求。如果编辑器做成这样,那不是有人会觉得光标老自动跳吗?往下移动的时候会自动跳到括号那
|
11
wd 2019-02-10 15:43:28 +08:00 via iPhone
@frylkrttj #10 「 Emacs: scroll buffer not point - Stack Overflow 」 https://stackoverflow.com/questions/8993183/emacs-scroll-buffer-not-point 这个试过吗。
|
13
frylkrttj OP @wd 上面好像说的是 可以用绑定键来滚动缓冲区域,从而光标不跟着跑?如果没理解错,那我就是看不懂那些绑定的键是怎么做的
|
14
wd 2019-02-10 16:26:17 +08:00 via iPhone
你多按几次 Ctrl-u 1 Alt-v
|
16
wd 2019-02-11 10:15:23 +08:00
https://www.gnu.org/software/emacs/manual/html_node/emacs/Scrolling.html
Some users like scroll commands to keep point at the same screen position, so that scrolling back to the same screen conveniently returns point to its original position. You can enable this behavior via the variable scroll-preserve-screen-position. If the value is t, Emacs adjusts point to keep the cursor at the same screen position whenever a scroll command moves it off-window, rather than moving it to the topmost or bottommost line. With any other non-nil value, Emacs adjusts point this way even if the scroll command leaves point in the window. This variable affects all the scroll commands documented in this section, as well as scrolling with the mouse wheel (see Mouse Commands); in general, it affects any command that has a non-nil scroll-command property. See Property Lists. 查了一下,可能这个 scroll-preserve-screen-position 对你有用,让你在再次滚动回来的时候,光标位于滚动前的那个位置,我感觉应该满足你的需求。 在你的配置文件里面增加一行 (setq scroll-preserve-screen-position t) 或者 (setq scroll-preserve-screen-position 'always) 这两个据说效果不一样,你都可以试试看。 |
17
wisetc 2021-10-31 22:44:58 +08:00 via iPhone
%解决问题,evil mode
|