Skip to content

Instantly share code, notes, and snippets.

Greg Lucas glucas

Block or report user

Report or block glucas

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:309fe3d43bd9cf00533f
(defun my/fix-space ()
"Delete all spaces and tabs around point, leaving one space except at the beginning of a line."
(when (looking-back "^[[:space:]]+") (delete-horizontal-space)))
(defun my/delete-backward ()
"When there is an active region, delete it and then fix up the whitespace."
(when (use-region-p)
glucas / gist:09aea018251cf85c7290
Last active Aug 29, 2015
View gist:09aea018251cf85c7290
(defun ace-command-other-window (cmd &optional one-win-cmd)
"Execute CMD in another window.
If provided, call ONE-WIN-CMD instead when there is only one window."
(interactive "CM-x (other window) ")
(catch 'done
(when (and one-win-cmd
(not (window-parent)))
(call-interactively one-win-cmd)
(throw 'done t))
(let ((start-window (selected-window))

Keybase proof

I hereby claim:

  • I am glucas on github.
  • I am glucas ( on keybase.
  • I have a public key whose fingerprint is ABF8 9DF2 6AC9 D152 72E8 81A0 7934 B82B D272 9051

To claim this, I am signing this object:

glucas / gist:6730692
Created Sep 27, 2013
Elisp snippets for defining ibuffer filter groups for all known projectile projects.
View gist:6730692
(defun my/define-projectile-filter-groups ()
(when (boundp 'projectile-known-projects)
(setq my/project-filter-groups
(--map (list
(concat "Project: " (file-name-nondirectory (directory-file-name it)))
`(filename . ,it))
View rejeep-projectile-completion-fn.el
(defun rejeep-projectile-completion-fn (prompt choises)
"Projectile completion function that only shows file name.
If two files have same name, new completion appears to select between
them. These include the path relative to the project root."
(let* ((stripped-choises
(-uniq (--map (file-name-nondirectory it) choises)))
(ido-completing-read prompt stripped-choises))
glucas / gist:4506530
Created Jan 10, 2013
Jumping to the most recent buffer.
View gist:4506530
(defalias 'last-buffer 'mode-line-other-buffer)
(global-set-key (kbd "M-O") 'last-buffer)
(defun my/split-window()
"Split the window to see the most recent buffer in the other window.
Call a second time to restore the original window configuration."
(if (eq last-command 'my/split-window)
You can’t perform that action at this time.