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
;; Turns out it's not necessary to define a new ibuffer column type. Both | |
;; `list-buffers' and `ibuffer' respect `list-buffers-directory', so just do | |
;; something like this: | |
(add-hook 'magit-mode-hook | |
(lambda () | |
(let ((dir (abbreviate-file-name default-directory))) | |
(setq list-buffers-directory dir)))) |
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
;; Just doodling on the topic of somewhat automatically initializing | |
;; `mc/cmds-to-run-for-all'. | |
;; | |
;; I always find the prompts a bit distracting when working on a new computer | |
;; but the file `multiple-cursors' maintains, .mc-lists.el, doesn't seem very | |
;; well-suited to version control. | |
(require 'pcase) | |
(defvar mc-paredit&sp-cmds-to-run-for-all-regexp |
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
(require 'pcase) | |
;; Based on Xah Lee's: http://ergoemacs.org/emacs/modernization_upcase-word.html | |
(defun cycle-case (beg end) | |
"Cycle the word case of the active region or word at point." | |
(interactive | |
(pcase-let ((`(,beg . ,end) (if (use-region-p) | |
(cons (region-beginning) (region-end)) | |
(bounds-of-thing-at-point 'word)))) |
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
;; An attempt at this Emacs SX question: | |
;; https://emacs.stackexchange.com/questions/10359/delete-portion-of-isearch-string-that-does-not-match-or-last-char-if-complete-m | |
(defun isearch-delete-something () | |
"Delete non-matching text or the last character." | |
;; Mostly copied from `isearch-del-char' and Drew's answer on the page above | |
(interactive) | |
(if (= 0 (length isearch-string)) | |
(ding) | |
(setq isearch-string |
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
" This is an updated, more powerful, version of the function discussed here: | |
" http://www.reddit.com/r/vim/comments/1rzvsm/do_any_of_you_redirect_results_of_i_to_the/ | |
" that shows ]I, [I, ]D, [D, :ilist and :dlist results in the quickfix window, even spanning multiple files. | |
function! List(command, selection, start_at_cursor, ...) | |
" derive the commands used below from the first argument | |
let excmd = a:command . "list" | |
let normcmd = toupper(a:command) | |
if a:selection |
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
;;; iterm.el - Send text to a running iTerm instance | |
(require 'pcase) | |
(require 'thingatpt) | |
;; To match SublimeText's key binding: | |
;; (global-set-key (kbd "<C-return>") 'iterm-send-text) | |
(defvar iterm-default-thing 'line | |
"The \"thing\" to send if no region is active. |
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
(require 'slime) | |
(require 'dash) | |
(require 'trident-mode) | |
(defvar trident-target-process nil | |
"The process that expansions will be sent to.") | |
(defun trident-list-process-buffers () | |
"Return a list of all buffers with an associated process." | |
(-filter #'get-buffer-process (buffer-list))) |
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
(defn filter-by-val-1 | |
[pred m] | |
(into {} (filter (fn [[k v]] (pred v)) | |
m))) | |
;; This one is a little faster | |
(defn filter-by-val-2 | |
[pred m] | |
(persistent! | |
(reduce-kv (fn [acc k v] |
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
;; -*- lexical-binding: t -*- | |
;; Some code I've been playing around with to automate the process of of | |
;; creating a new Octopress page or post, with appropriate metadata, from a | |
;; buffer's content. | |
;; The `octopress-rake`, `octopress-extract-filename`, and `octopress-new` | |
;; functions are derived from the octopress-emacs code here: | |
;; github.com/gfreezy/octopress-emacs |
NewerOlder