Prev / Next

2010-02-02 / C-aで「行頭」と「インデントを飛ばした行頭」を行き来する

- C-aで「行頭」と「インデントを飛ばした行頭」を行き来する - ポロポロ
  http://d.hatena.ne.jp/kitokitoki/20100131/p4

(defun my-move-beginning-of-line ()
  (interactive)
  (if (bolp)
      (back-to-indentation)
    (beginning-of-line)))
(global-set-key "\C-a" 'my-move-beginning-of-line)


コメントに sequntial-command を使った方法があるけど,
「行頭」と「インデントを飛ばした行頭」の移動だけで十分だし,
他に sequencial-command を使うこともなさそうなので,
上の方法を使うことにする.

(define-sequential-command seq-home
  back-to-indentation beginning-of-line beginning-of-buffer seq-return)
(global-set-key "\C-a" 'seq-home)


comments powered by Disqus