是否有内置或第三方elisp命令可以在cc-mode中移动到匹配的大括号?
我目前使用(paren-set-mode 'paren t)让XEmacs高亮显示匹配的大括号或paren,但是当带有嵌套的if块的代码段中的大括号不在屏幕上时,使用一个命令跳到匹配的大括号将非常有用。
类似于M-C-f和M-C-b,但用于{}而不是()。
发布于 2010-01-20 11:28:21
C-M-f和C-M-b应该也适用于{和}。
发布于 2012-05-31 19:57:54
我在XEmacs 21.5中安装了big-menubar.el。它添加了一个菜单项"Motion",并且在该菜单中有以下两个命令,并显示了它们的键绑定:
对齐括号C-M-n的结尾
平衡括号C-M-p的开头
我认为它们是Control-Meta-next和previous。
他们还有其他一些你可能感兴趣的move-to命令,这里是一个来自big-menubar.el的剪切和粘贴,显示了他们正在执行的命令(一旦你知道了命令是什么,你可以分配给任何你喜欢的键...):
(add-submenu
nil
'("Motion"
["Goto Mark" exchange-point-and-mark (mark t)]
["Goto Line..." goto-line t]
"---"
["End of Balanced Parentheses ( )" forward-list t]
["Beginning of Balanced Parentheses ( )" backward-list t]
["Next Opening Parenthesis (" down-list t]
["Previous Opening Parenthesis (" backward-up-list t]
["Next Closing Parenthesis )" up-list t]
"---"
["End of Balanced Expression" forward-sexp t]
["Beginning of Balanced Expression" backward-sexp t]
"---"
["End of Function" end-of-defun t]
["Beginning of Function" beginning-of-defun t]
"---"
["Next Page" forward-page t]
["Previous Page" backward-page t]
"---"
["End of Buffer" end-of-buffer t]
["Beginning of Buffer" beginning-of-buffer t]
"---"
["Save Current Position..." point-to-register t]
["Goto Saved Position..." register-to-point t]
"---"
["Set Marker..." set-user-marker t]
["Goto Marker..." goto-user-marker t]
["List Markers" list-markers t]
"---"
["Set Goal Column" set-goal-column t]
["Cancel Goal Column" (set-goal-column t) goal-column]))https://stackoverflow.com/questions/2098843
复制相似问题