-
-
Save jidaikobo-shibata/ad27b19dd3779ccc1ff2 to your computer and use it in GitHub Desktop.
Emacs(Elisp): forward/backward-paragraphだとparagraph判定がおそらくシンタックステーブル依存になり、字義通りの「次の空行」にならないので、別途用意。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; ------------------------------------------------------------ | |
;;; 次/前の空行 | |
;; gist-description: Emacs(Elisp): forward/backward-paragraphだとparagraph判定がおそらくシンタックステーブル依存になり、字義通りの「次の空行」にならないので、別途用意。 | |
;; gist-id: ad27b19dd3779ccc1ff2 | |
;; gist-name: move(region)-to-next(previous)-blank-line.el | |
;; gist-private: nil | |
(defun move-to-previous-blank-line () | |
"Go to previous empty lines." | |
(interactive "^") | |
(goto-char | |
(or (save-excursion | |
(unless (bobp) | |
(backward-char) | |
(re-search-backward "^$" nil t))) | |
(point-min)))) | |
(defun move-to-next-blank-line () | |
"Go to next empty lines." | |
(interactive "^") | |
(goto-char | |
(or (save-excursion | |
(unless (eobp) | |
(forward-char) | |
(re-search-forward "^$" nil t))) | |
(point-max)))) | |
(global-set-key (kbd "<M-up>") 'move-to-previous-blank-line) | |
(global-set-key (kbd "<M-down>") 'move-to-next-blank-line) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment