This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun surround (start end txt) | |
"Wraps the specified region (or the current 'symbol / word' | |
with some textual markers that this function requests from the | |
user. Opening-type text, like parens and angle-brackets will | |
insert the matching closing symbol. | |
This function also supports some org-mode wrappers: | |
- `#s` wraps the region in a source code block | |
- `#e` wraps it in an example block |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun setup-windows () | |
"Setup my entire Emacs environment. Function is often called when I first start it up." | |
(interactive) | |
(frame-fullscreen) | |
(split-window-horizontally 168) ;; On this machine, I know how big | |
(split-window-horizontally 84) ;; my monitor is, so ... | |
(other-window 2) | |
(split-window-vertically) | |
(circe-connect-all) ;; Connect to all my IRC channels | |
(twit) ;; Start twitter in this window |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun eshell-here () | |
"Opens up a new shell in the directory associated with the current buffer's file." | |
(interactive) | |
(let* ((parent (if (buffer-file-name) | |
(file-name-directory (buffer-file-name)) | |
default-directory)) | |
(height (/ (window-total-height) 3)) | |
(name (car (last (split-string parent "/" t))))) | |
(split-window-vertically (- height)) | |
(other-window 1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun increment-decrement (amount) | |
(let* ((for-number "[0-9][0-9]*") | |
(end (re-search-forward for-number)) | |
(start (match-beginning 0)) | |
(str (buffer-substring start end)) | |
(num (+ amount (string-to-number str)))) | |
(delete-region start end) | |
(insert (number-to-string num)) | |
(goto-char start))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias e='emacsclient -q -a emacs' | |
EDITOR=emacsclient | |
function e { | |
tmux new-window -a -n "emacs" "$EDITOR $@" | |
} | |
function ee { | |
tmux split-window "$EDITOR $@" |
NewerOlder