Skip to content

Instantly share code, notes, and snippets.

@agumonkey
Created June 30, 2014 13:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save agumonkey/8171b2095ea43f9867d7 to your computer and use it in GitHub Desktop.
Save agumonkey/8171b2095ea43f9867d7 to your computer and use it in GitHub Desktop.
virtual pseudo code for a simple differential line duplicator, turning some parts of the previous line as placeholders in a temporary yasnippet
(defun templicate ()
"duplicate the current line as a temporary
snippet to be filled on the fly.
"
(interactive)
(let ((line (current-line))
(placeholders (select-many "word:"))
(template (mk-yasnippet-from-string line placeholders)))
(progn
(open-line)
(yasnippet-expand template))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment