Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jidaikobo-shibata/ad27b19dd3779ccc1ff2 to your computer and use it in GitHub Desktop.
Save jidaikobo-shibata/ad27b19dd3779ccc1ff2 to your computer and use it in GitHub Desktop.
Emacs(Elisp): forward/backward-paragraphだとparagraph判定がおそらくシンタックステーブル依存になり、字義通りの「次の空行」にならないので、別途用意。
;;; ------------------------------------------------------------
;;; 次/前の空行
;; 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