Skip to content

Instantly share code, notes, and snippets.

@katsuma
Created June 29, 2014 12:44
Show Gist options
  • Save katsuma/931035b7a2817bb63c09 to your computer and use it in GitHub Desktop.
Save katsuma/931035b7a2817bb63c09 to your computer and use it in GitHub Desktop.
e や o の結果をhistoryに残しておく
pe() { peco | while read LINE; do $@ $LINE; print -s "$@ $LINE"; done }
alias o='git ls-files | pe open'
alias e='ghq list -p | pe cd'
zshaddhistory() {
local line=${1%%$'\n'}
local cmd=${line%% *}
[[ ${cmd} != (l|l[sal])
&& ${cmd} != (m|man)
&& ${cmd} != (p|print)
&& ${cmd} != (e)
&& ${cmd} != (o)
]]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment