Skip to content

Instantly share code, notes, and snippets.

@dsjt
Last active August 29, 2015 14:02
Show Gist options
  • Save dsjt/d6f07743b3ec383af4c1 to your computer and use it in GitHub Desktop.
Save dsjt/d6f07743b3ec383af4c1 to your computer and use it in GitHub Desktop.
Emacs lisp like vim command "o" "O"
(defun c-add-new-line-below()
(interactive)
(move-end-of-line 1)
(newline-and-indent))
(defun c-add-new-line-above()
(interactive)
(back-to-indentation)
(split-line))
(define-key c-mode-map (kbd "C-o") 'c-add-new-line-below)
(define-key c-mode-map (kbd "M-o") 'c-add-new-line-above)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment