Skip to content

Instantly share code, notes, and snippets.

@syl20bnr
Created April 18, 2013 21:05
Show Gist options
  • Save syl20bnr/5416218 to your computer and use it in GitHub Desktop.
Save syl20bnr/5416218 to your computer and use it in GitHub Desktop.
This gist add functions to insert lines above and below the current line without changing the current evil state and current point position.
;; insert one or several line below without changing current evil state
(defun evil-insert-line-below (count)
"Insert one of several lines below the current point's line without changing
the current state and point position."
(interactive "p")
(save-excursion
(evil-save-state (evil-open-below count))))
;; insert one or several line above without changing current evil state
(defun evil-insert-line-above (count)
"Insert one of several lines above the current point's line without changing
the current state and point position."
(interactive "p")
(save-excursion
(evil-save-state (evil-open-above count))))
@syl20bnr
Copy link
Author

TODO: remove whitespaces on the created lines

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment