emacs 怎么在匹配的括号间跳转
1个回答
展开全部
;;add the % jump function in vim
;;ref: http://docs.huihoo.com/homepage/shredderyin/emacs_elisp.html
;;ref: emacs FAQ info doc "Matching parentheses"
(defun match-paren (arg)
"Go to the matching paren if on a paren; 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)
vim % 功能的实现如上。不过习惯了emacs之后,C-M-f/b可以做这件事情。只是用了两个按键。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询