Skip to content

Instantly share code, notes, and snippets.

View JohnLunzer's full-sized avatar
👾
Invading

John Lunzer JohnLunzer

👾
Invading
View GitHub Profile
@JohnLunzer
JohnLunzer / hippie.el
Created October 16, 2018 11:10
Hippie expansion menu using ivy (fallback to ido)
;; * IDO/IVY completion menu
;; This is originally from https://www.emacswiki.org/emacs/HippieExpand#toc10
;;
;; There are a few improvements:
;; - It is undo friendly with the addition of save-excursion
;; - It will use ivy for the expansion menu if ivy is available, falls back to ido
;; - Automatically expands if there is only one possible expansion
(defun my-hippie-expand-completions (&optional hippie-expand-function)
"Return list of completions generated by `hippie-expand'."
@JohnLunzer
JohnLunzer / emacs-tmux-integration.el
Created June 28, 2016 19:53
This snippet (which should go into your emacs config file) will update your tmux window name with the title of the buffer you're currently in which is usually the filename of the file you're editing.
(require 'deferred)
(defun rename-tmux-window()
(deferred:$
(deferred:process "tmux" "display-message" "-p" "'#I'")
(deferred:nextc it
(lambda (x)
(setq x (replace-regexp-in-string "\'" ""
(replace-regexp-in-string "\n\\'" "" x)))
(setq w
(replace-regexp-in-string "\*" ""