简体   繁体   English

当我在Emacs中关闭括号时,如何防止光标跳跃?

[英]How can I prevent the cursor from jumping when I close parentheses in Emacs?

Is there a way to change Emacs' behavior when closing parentheses/bracket? 有没有办法在关闭括号/括号时改变Emacs的行为?

Right now, the cursor will jump to the opening bracket for a few seconds and will jump back after a while or when I start typing. 现在,光标将跳到开始括号几秒钟,并在一段时间后或我开始输入时跳回。 I find this jumping back and forth really annoying. 我发现这种来回跳跃真的很烦人。

Is there a way, to either 还有办法吗?

  • change the color/shape of the cursor when it's just marking the opening bracket, or 当光标刚刚标记开括号时,更改光标的颜色/形状,或
  • prevent the jumping at all, and just change the color of the matching pair? 完全阻止跳跃,只是改变匹配对的颜色?

Try putting 试试看

(show-paren-mode 1)
(setq blink-matching-delay 0.3)

in your .emacs or .emacs.d/init.el . .emacs.emacs.d/init.el

This prevents the jumping and highlights the matching pair. 这可以防止跳跃并突出显示匹配对。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 滚动页面时如何防止emacs更改光标位置 - how to prevent emacs from changing cursor position when scrolling the page 当启动emacs时与关闭时一样,如何打开该外观? - How can i open get that the appearance when i start emacs as same as when i close it? 如何在emacs中获得“彩虹括号”? - How do I get “rainbow parentheses” in emacs? 当我删除.emacs时,如何从Emacs写.emacs - How to write .emacs from Emacs when I've deleted .emacs 当光标进入emacs中的叠加层时,如何显示提示? - How do I display a prompt when the cursor enters an overlay in emacs? 如何在emacs中为光标所在的括号加下划线? - How to underline the scope of parentheses my cursor in, in emacs? 如何在php / html文件打开时使emacs加载nXhtml并阻止它在启动时加载 - How can I make emacs load nXhtml only when php/html files are open and prevent it from loading at startup 如何防止emacs为在此会话中已经打开的缓冲区打开新窗口? - How can I prevent emacs from opening a new window for a buffer I already have open in this session? 在emacs中使用sqlplus时,如何断开与数据库的连接? - How can i disconnect from the DB when using sqlplus in emacs? 当initial-buffer-choice有自动保存数据时,如何防止emacs挂起? - How can I prevent emacs hanging when initial-buffer-choice has auto save data?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM