Skip to content

Instantly share code, notes, and snippets.

@ctechols
ctechols / surfingkeys.js
Last active Aug 29, 2019
Personal SurfingKeys Config
View surfingkeys.js
removeSearchAliasX('b');
removeSearchAliasX('w');
removeSearchAliasX('h');
removeSearchAliasX('s');
removeSearchAliasX('h');
removeSearchAliasX('g');
removeSearchAliasX('y');
unmap("ob");
unmap("og");
@ctechols
ctechols / compinit.zsh
Last active Jun 18, 2021
Speed up zsh compinit by only checking cache once a day.
View compinit.zsh
# 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 / Page.vim
Last active May 15, 2018
Capture output from a vim command (like :version or :messages) into a split scratch buffer.
View Page.vim
"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