Skip to content

Instantly share code, notes, and snippets.

@ctechols
ctechols / Page.vim
Last active May 15, 2018 10:48
Capture output from a vim command (like :version or :messages) into a split scratch buffer.
"Examples:
":Page version
":Page messages
":Page ls
"It also works with the :!cmd command and Ex special characters like % (cmdline-special)
":Page !wc %
"Capture and return the long output of a verbose command.
function! s:Redir(cmd)
let output = ""
redir =>> output
@ctechols
ctechols / compinit.zsh
Last active November 18, 2024 10:13
Speed up zsh compinit by only checking cache once a day.
# On slow systems, checking the cached .zcompdump file to see if it must be
# regenerated adds a noticable delay to zsh startup. This little hack restricts
# it to once a day. It should be pasted into your own completion file.
#
# The globbing is a little complicated here:
# - '#q' is an explicit glob qualifier that makes globbing work within zsh's [[ ]] construct.
# - 'N' makes the glob pattern evaluate to nothing when it doesn't match (rather than throw a globbing error)
# - '.' matches "regular files"
# - 'mh+24' matches files (or directories or whatever) that are older than 24 hours.
autoload -Uz compinit
@ctechols
ctechols / surfingkeys.js
Last active August 29, 2019 12:45
Personal SurfingKeys Config
removeSearchAliasX('b');
removeSearchAliasX('w');
removeSearchAliasX('h');
removeSearchAliasX('s');
removeSearchAliasX('h');
removeSearchAliasX('g');
removeSearchAliasX('y');
unmap("ob");
unmap("og");