由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Unix版 - emacs中有什么键可以完成象vi中命令模式下的%的操作?
相关主题
[转载] emacs questionhow to kill a process in emacs?
how to display color for java or c mode in xemacstwo silly questions :-(
[转载] 写Thread Library遇到的问题Emacs mule
Re: Emacs高手帮忙定义几个热健Funny articles about emacs and vi. (Zhuan)
Re: 为什么emacs自动给我加^M.emacs .el files
Re: 这是为什么?a low_hand_question about emacs.
how to calculate number of letters in emacs?what is the short cut for repeat search in emacs?
emacs问题求教----有关C程序格式[转载] why it is so slow in linux?
相关话题的讨论汇总
话题: paren话题: insert话题: emacs话题: vi
进入Unix版参与讨论
1 (共1页)
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中命令模式下的%的操作?

1 (共1页)
进入Unix版参与讨论
相关主题
[转载] why it is so slow in linux?Re: 为什么emacs自动给我加^M.
关于emacs一问。Re: 这是为什么?
[转载] emacs problemhow to calculate number of letters in emacs?
Emacs question.emacs问题求教----有关C程序格式
[转载] emacs questionhow to kill a process in emacs?
how to display color for java or c mode in xemacstwo silly questions :-(
[转载] 写Thread Library遇到的问题Emacs mule
Re: Emacs高手帮忙定义几个热健Funny articles about emacs and vi. (Zhuan)
相关话题的讨论汇总
话题: paren话题: insert话题: emacs话题: vi