Skip to content

Lightweight snippets for emacs that work right out of the box

Notifications You must be signed in to change notification settings

julfy/emacs-light-snippets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Lightweight snippets for emacs that work right out of the box

Simply copy register-snippets macro to your .emacs, that's all.

Usage:

(register-snippets lisp-snippets
  (;; (<word to match> . (<commands>))
   ("let" .
    ((insert "(let (")
     (setq final-pos (point))
     (insert ")")
     (newline 2) (insert ")")
     (goto-char final-pos)))))
(define-key lisp-mode-map (kbd "C-t") 'lisp-snippets)

Essentially you can write any valid elisp expressions in <commands> block. The only special command provided is (newline <diff>), it inserts a new line and indents it by <previous line indent>+<diff>. Automatically on match only the matched string will be deleted, so if you choose to leave empty you will just end up with a fancy specific word remover. register-snippets is language agnostic, but only works with single words as matrch strings.

About

Lightweight snippets for emacs that work right out of the box

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published