首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >使用emacs,如何转到配对(平衡)括号

使用emacs,如何转到配对(平衡)括号
EN

Stack Overflow用户
提问于 2012-03-24 03:51:46
回答 6查看 26.2K关注 0票数 70

当光标在一个括号上时,如何跳转到成对的括号。很高兴在emacs -nw中工作。

就像Vim中的%一样。

;;在得到@Lindy,@Francesco的提示后,我发现了更多:

代码语言:javascript
复制
  C-M-f     Move forward over a balanced expression
  C-M-b     Move backward over a balanced expression
  C-M-k     Kill balanced expression forward
  C-M-SPC   put the mark at the end of the sexp.
  C-M-n  Move forward over a parenthetical group 
  C-M-p  Move backward over a parenthetical group 
  ;; C-M key binding can also be done by --> ESC Control-key

  ;;And put this to .emacs, it will highlight opening/closing parens:
  (show-paren-mode 1)
EN

回答 6

Stack Overflow用户

回答已采纳

发布于 2012-03-24 04:00:17

使用C-M-rightC-M-left (分别为backward-sexpforward-sexp)转到当前表达式的开头或结尾。这适用于括号对,但也适用于普通单词。

票数 64
EN

Stack Overflow用户

发布于 2015-07-31 09:45:57

正如在emacs wiki (http://www.emacswiki.org/emacs/NavigatingParentheses)中提到的:

在括号内向前移动

  • C-M-n向后列表在括号内向前移动向后移动在括号内向前移动group
  • C-M-p向前移动在平衡expression
  • C-M-b上向前移动向后移动向后移动在平衡expression
  • C-M-k上向前移动kill-sexp杀死平衡表达式forward
  • C-M-SPC forward
  • C-M-SPC-sexp性爱末尾的标记。

https://superuser.com/questions/677516/how-do-i-jump-to-the-opening-or-closing-paren-brace-in-emacs

票数 28
EN

Stack Overflow用户

发布于 2012-03-24 03:56:53

对于圆括号、大括号和括号,只需在上面双击就行了。

票数 22
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/9845661

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档