Skip to content

Instantly share code, notes, and snippets.

@f440
Created December 30, 2012 05:56
Show Gist options
  • Save f440/4411204 to your computer and use it in GitHub Desktop.
Save f440/4411204 to your computer and use it in GitHub Desktop.
# -*- sh -*-
zmodload zsh/parameter
function zaw-src-gisty() {
candidates=("${(ps:\n:)$(gisty list)}")
actions=("zaw-callback-gisty-append-to-buffer")
act_descriptions=("append to edit buffer")
}
zaw-register-src -n gisty zaw-src-gisty
function zaw-callback-gisty-append-to-buffer() {
local gitdir=`echo "${(j:; :)@}" | cut -d":" -f1`
local destpath=$GISTY_DIR/$gitdir
if [ -n "$gitdir" -a -d "$destpath" ]
then
LBUFFER="${BUFFER}${destpath}"
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment