Skip to content

Instantly share code, notes, and snippets.

@yaotti
Created November 7, 2009 15:39
Show Gist options
  • Save yaotti/228742 to your computer and use it in GitHub Desktop.
Save yaotti/228742 to your computer and use it in GitHub Desktop.
;; はてな記法のリスト(-)をいい感じに挿入してくれる
;; C-lを押すたびに深いリストになっていく
(defun insert-list()
(interactive)
(let* ((end-point (point))
(start-point (- end-point 2))
(str (buffer-substring start-point end-point)))
(if (string-equal "- " str)
(delete-backward-char 1))
(insert "- ")))
(define-key global-map "\C-l" '(lambda () (interactive) (insert-list)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment