分页: 1 / 1
Emacs中编辑C文件,找到匹配的花括号,是按什么?
发表于 : 2006-10-08 11:14
由 Junalbert
除了双击鼠标(这个好像只能从前往后选),有没有按功能键的?
发表于 : 2006-10-08 16:50
由 xcity
你加一段代码到.emacs里面之后,就可以用%来找到对应的()
;; Use % for {} matching
(global-set-key "%" 'match-paren)
(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)))))
发表于 : 2006-10-09 19:05
由 lgfang
`C-M-n'
Move forward over a parenthetical group (`forward-list').
`C-M-p'
Move backward over a parenthetical group (`backward-list').
`C-M-u'
Move up in parenthesis structure (`backward-up-list').
`C-M-d'
Move down in parenthesis structure (`down-list').