Skip to content

Instantly share code, notes, and snippets.

@nxtr
Created August 20, 2018 15:51
Show Gist options
  • Save nxtr/dc46f21342ee62943a8a7d27a09e2324 to your computer and use it in GitHub Desktop.
Save nxtr/dc46f21342ee62943a8a7d27a09e2324 to your computer and use it in GitHub Desktop.
Key binding of a lambda function as a uninterned symbol,
(define-key ivy-mode-map (kbd "C-s")
(defalias (make-symbol "swiper-or-swiper-all")
;; Wrapped in `defalias' with uninterned SYMBOL so `describe-key'
;; displays command as a proper symbol instead of byte-codes
(lambda ()
"Runs the command swiper.
With a prefix argument, run the command swiper-all."
(interactive)
(if current-prefix-arg
(swiper-all)
(swiper)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment