L****i 发帖数: 94 | 1 想光标在"{"和"}"等中进行匹配移动,
请问在emacs中有什么键可以完成象vi中命令模式下的%的操作? | p****s 发帖数: 3184 | 2
(defun match-paren (arg)
"Go to the matching parenthesis if on parenthesis otherwise insert %."
(interactive "p")
(cond ((looking-at "\\s\(") (forward-list 1) (backward-char 1))
((looking-at "\\s\)") (forward-char 1) (backward-list 1))
(t (self-insert-command (or arg 1)))))
(global-set-key "%" 'match-paren)
; however, now you have to press C-q % if you want to insert a %
; when the cursor is at a parenthesis
【在 L****i 的大作中提到】 : 想光标在"{"和"}"等中进行匹配移动, : 请问在emacs中有什么键可以完成象vi中命令模式下的%的操作?
|
|