è¿½è¨ ãã®è¨äºãå ã«æ¸ç±ãåºæ¥ã¾ããï¼
æéã¨å½ãåã£ã¦ããã詳細ã«è§£èª¬ãã¾ããã®ã§ãEmacs ã«èå³ããã人ã¯ãã²ä¸åº¦æã«åã£ã¦ã¿ã¦ä¸ããã
- ä½è : 大竹æºä¹
- åºç社/ã¡ã¼ã«ã¼: æè¡è©è«ç¤¾
- çºå£²æ¥: 2012/03/07
- ã¡ãã£ã¢: åè¡æ¬ï¼ã½ããã«ãã¼ï¼
- è³¼å ¥: 22人 ã¯ãªãã¯: 396å
- ãã®ååãå«ãããã° (1件) ãè¦ã
ãªã®ã§ãLisp ã¨ãããããã¡ããªäººããä»åã¯å¤§ä¸å¤«ãªã¯ãã§ãã
ãã¼ãã¤ã³ãã®èª¿ã¹æ¹ã
Emacs ã¨è¨ãã°ããããã®ç¹æ®ãªãã¼ãã¤ã³ããè¦ããããªããã¨ããæè¦ãå¤ãèããã¾ãã
éã«ãEmacs ããã£ã¨ä½¿ã£ã¦ãã人ã¯ããã¼ãã¤ã³ãã§ä½ã§ãåºæ¥ãããããããããªãããã¨ããæè¦ãå¤ãã§ãã
çµå±ãEmacs ã¯ãã®ãã¼ãã¤ã³ããä¹ãè¶ãã¦ããã® Emacs ã ã¨ããäºã«ã¯éããªãã®ã§ãããæåã¯ã«ã³ãã¨ãæ¬ã§è¦ããæãã«ãªãã§ããããããããè²ã
ãªã¡ã¸ã£ã¼ã¢ã¼ãã使ãã ãã¨ããããéçã«é¹ã£ãã¦ããã®ã§ãçµå±ã¯ Emacs ã§ãã¼ãã¤ã³ãã調ã¹ãã®ã常èã«ãªã£ã¦ãã¾ãã
Emacs ã§ãã¼ãã¤ã³ãã調ã¹ãã«ã¯ãM-x describe-bindings ã§èª¿ã¹ãäºãã§ãã¾ãã
describe-bindings ãå®è¡ããã¨ãç¾å¨ã®ã¡ã¸ã£ã¼ã¢ã¼ãã®ãã¼ãã¤ã³ãããããªãã® Emacs ã®å
¨ã¦ã®ã¢ã¼ãã§æå¹ãªã°ãã¼ãã«ãã¼ãã¤ã³ããªã©ãè¦ãäºãã§ãã¾ãã
describe-bindings ã¯æ°ããã¢ã¼ãã使ãã¨ãã¯ããã®åãå¤æ§ããã®ã§ãããã©ã«ãããã便å©ã«ããå¿
è¦ãããã¾ãã
ã¨ããããã§ãdescribe-bindings ã anything ã¤ã³ã¿ã¼ãã§ã¤ã¹ã«ç½®ãæãã descbinds-anything.el ã¯ã»ã¼å¿
é ãkey-chord.el ã使ã£ã¦ãdf åææ¼ãã¦ãåã rubikitch ãããå¼ã³åºãã¦ä½¿ã£ã¦ãã¾ãã
ãã¼ãã¤ã³ãã®è¦ãæ¹ã
describe-bindings ãè¦ã¦ä½¿ããªããè¦ããã®ãããã§ãããæä½ã®æµãã®ä¸ã§è¦ããæ¹æ³ãããã¾ãã
ãã¼ãã¤ã³ãå
¥åæã«ãã«ãã表示ããã one-key.el ã§ãã
å°å
¥ããå©ç¨ã¾ã§ãã£ããã¨æ¸ãã¦ãã rubikitch ããã®è¨äºãè¦ã¦ãããã°åããã¾ãããä½ãããã®ãã¼ãã¤ã³ããæ¼ããã¨ãã«ãç¶ãã®ãã¼ãã¤ã³ãã®ä¸è¦§ã表示ãã¦ããããã®ã§ãã
one-key.el ã§ã¯ããã³ãã¬ã¼ããèªåã§ä½ãå¿
è¦ãããã¾ãããåºæ¬æä½ã®ãã³ãã¬ã¼ããçºãã¦ããã¦ãã one-key-default.el ã¨ããã®ãããã®ã§ããã¡ãã試ãã¦ã¿ã¾ãããã
ä¾ãã°ãone-key.el 㨠one-key-default.el ãã¤ã³ã¹ãã¼ã«ãã¦ããç¶æ
ã§ãC-x ã§ããã«ç¶ããã¼ãã¤ã³ãã表示ãããè¨å®ããã¦ã¿ã¾ãããã
M-x install-elisp http://www.emacswiki.org/cgi-bin/wiki/download/one-key.el
M-x install-elisp http://www.emacswiki.org/cgi-bin/wiki/download/one-key-config.el
M-x install-elisp http://www.emacswiki.org/cgi-bin/wiki/download/one-key-default.el
.emacsã®æå¾å°¾ã«
(require 'one-key-default) ; one-key.el ãä¸ç·ã«èªã¿è¾¼ãã§ããã (require 'one-key-config) ; one-key.el ããã便å©ã«ãã (one-key-default-setup-keys) ; one-key- ã§å§ã¾ãã¡ãã¥ã¼ä½¿ããæ§ã«ãªã (define-key global-map "\C-x" 'one-key-menu-C-x) ;; C-x ã«ã³ãã³ããå®ç¾©
C-x ãã¿ã¤ãããã¨ãC-x ããç¶ããã¼ãã¤ã³ãã®ä¸è¦§ããããã¢ããããã¾ãã
åã®ãã¼ãã§ã¯è²ãå¾®å¦ã«è¦ã«ããã§ãããã¨ããããæ°ã«ãã¾ããã
M-x one-key ãããã§ã¿ããæ¼ãã¨ãå®ç¾©ããã¦ããã¡ãã¥ã¼ä¸è¦§ã表示ããã¾ãã
å
ç¨ã® (define-key global-map "\C-x" 'one-key-menu-C-x) ã¯ãC-x ã¨ãããã¼ãã¤ã³ãã«ãone-key-menu-C-x ã¨ããã³ãã³ããå²ãå½ã¦ãã¨ããããã§ãã
ãã¼ãã¤ã³ãã®å²ãå½ã¦æ¹ã
Emacs ã使ã£ã¦ããã¨ããã®ã³ãã³ãããã®ãã¼ãã¤ã³ãä¸çºã§å®è¡ãããã¨æã£ãããããã®ã§ãã
Emacs ã§ããã¼ãã¤ã³ããå¤æ´ãç»é²ããã®ã¯æ¥å¸¸è¶é£¯äºã§ãããããèªåã®ãã¼ãã¤ã³ããããããç»é²ãã¦ã«ã¹ã¿ãã¤ãºããã®ããEmacs ã®æ£ãã使ãæ¹ã§ãã
Emacs ã®ãã¼ãã¤ã³ãã¯å¤§ããåããã¨ã2ã¤ã«åãããã¨ãã§ãã¾ãã
- å ¨ã¦ã®ã¢ã¼ãã§ä½¿ãããã¼ãã¤ã³ã
- ç¹å®ã®ã¢ã¼ãã ãã§ä½¿ãããã¼ãã¤ã³ã
å
¨ã¦ã®ã¢ã¼ãã§ä½¿ãããã¼ãã¤ã³ãã¨ããã®ã¯ãæ£ç¢ºã«ã¯ã¢ã¼ãã«é¢ä¿ãªãå©ç¨ã§ãããã¼ãã¤ã³ãã§ãã°ãã¼ãã«ãã¼ãããï¼global-mapï¼ã¨è¨ãã¾ãã
ç¹å®ã®ã¢ã¼ãã ãã§ä½¿ãããã¼ãã¤ã³ãã¯ãã¢ã¼ãããã(*-mode-map)ã¨è¨ãã¾ãã
ãã¼ãããã¨ããã¯ãEmacs ã®ä¸ã§ãã¼ãã¤ã³ããå®ç¾©ãã¦ãã表ã¿ãããªãã®ã§ãããã«ãã¼ãã¤ã³ããç»é²ããäºã§ãEmacs ãããªãè²ã«æããäºãã§ããã¨ããããã§ãã
ãã¼ãããã«ãã¼ãã¤ã³ãã追å ããã«ã¯ãdefine-key é¢æ°ã使ã£ã¦ç»é²ãã¾ãã
(define-key keymap keys definition)
keymap ã«ã¯ç»é²ããããã¼ãããããã¢ã¼ãã«é¢ä¿ãªãå
¨ã¦ã§å©ç¨ãããå ´åã¯ãglobal-mapãã»ãã®ã¢ã¼ãã§ããã°ãé常 xxxx-mode-map ã¨ããååãã¤ãããã¦ããã®ã§ãemacs-lisp-mode-map, org-mode-map ãªã©ã«ãªãã¾ãã
keys ã®é¨åã«ãã¼ãã¤ã³ã(ãã¼ãã¤ã³ãã®æ¸ãæ¹ã¯ã次ã«ä¾ãç´¹ä»ãã¾ã)ããdefinition ã®é¨åã«å®è¡ãããä½ã(çµæ§è²ã
æ¸ãã¾ãã詳ããã¯ãdescribe-function define-key ãã©ãã)ãæ¸ãã¾ããé常ãé¢æ°ã®ã·ã³ãã«(ã·ã³ã°ã«ã¯ãªã¼ãããå§ã¾ãé¢æ°å 'function )ãæ¸ãäºã§ãã³ãã³ããå®è¡ã§ããæ§ã«ãªãã¾ãã
ä¾ãã°ãC-x k ã§ãããã¡ãéãã¾ãããCtr ãã¼ããæãé¢ããã®ãæãå ´åã§ã C-x C-k ã§ãåæ§ã«ãããã¡ãéããã人ãããã¨ãã¾ãã
(define-key global-map "\C-x\C-k" 'kill-buffer)
ããã§ãC-x C-k ã§ã C-x k ã¨åã kill-buffer ãå®è¡ããã¾ãã
keys ã®é¨åã®ãã¼ãã¤ã³ãã®å®ç¾©ã§ããããã®æ¸ãæ¹ã¯ã¡ãã£ã¨å¤ãã¦ããããããã¯ã¹ã©ãã·ã¥ã¨ã¹ã±ã¼ããæ¸ãã®ãé¢åãªã®ã§ãæè¿ã®Emacsã§ã¯ä»¥ä¸ã®æ¸ãæ¹ã®ã»ãããªã¹ã¹ã¡ã§ãã
(define-key global-map [(C x) (C k)] 'kill-buffer) (define-key global-map [(control x) (control k)] 'kill-buffer) (define-key global-map (kbd "C-x C-k") 'kill-buffer)
ã¾ããdefine-key ã® definition ã®é¨åã«ã¯ãã·ã³ãã«ãããªãããã¼ãã¼ããã¯ããè¨è¿°ãããã¨ãã§ããã®ã§ã
(define-key global-map [(control x) (control k)] "\C-xk") (define-key global-map [(control x) (control k)] (kbd "C-x k"))
ã¨ãã風ã«ãkill-buffer ãå®è¡ãããã¼ãã¤ã³ããè¨è¿°ãã¦ãè¯ãã§ãã
ããã«ã¯ã©ã¼ãã§ããã¼ãã¤ã³ããæ¸ãã¹ã¿ã¤ã«ã¯ãCtr ããå§ã¾ããã¼ãã¤ã³ããå®ç¾©ããããã§ãããShift ãªã©ã表ç¾ã§ããªãã®ã§ãShift ã使ãå ´åã¯ã[()] ã®ã¹ã¿ã¤ã«ãå©ç¨ããæ¹ãè¯ãã§ãããã
[()] ã¹ã¿ã¤ã«ã®ã¨ãã¯ãcontrol ã¯å¤§æåã® C ã¨ãã風ã«çç¥ã§ããã®ã§è¦ãã¦ããã¨ããã§ãã
control | alt | meta | hyper | shift |
C | A | M | H | S |
super ãå©ç¨ãã¦ãã人ã¯ãS 㧠super ãããªãã®ã§æ°ãã¤ãã¦ä¸ãã(ç¬)ã
ãã¼ãã¤ã³ãã«ã¤ãã¦ã®ã詳ãã解説㯠keybindingsã«è©°ã£ã¦ããã¾ãã
ã¨ããããã§ãé·ããªã£ã¦ããã®ã§ãä»æ¥ã¯ããã¾ã§ã«ãã¦ããã¾ãã