4517db6acc6e4217a25aa353da37fb8de617bfc4

Author
Jeroen Janssens <jeroen.janssens@visualrevenue.com>
Committer
Jeroen Janssens <jeroen.janssens@visualrevenue.com>
Date

Message

Add _completemarks function as suggested by pielgrzym in https://github.com/robbyrussell/oh-my-zsh/pull/2045#issuecomment-22826540

Diff

 1diff --git a/plugins/jump/jump.plugin.zsh b/plugins/jump/jump.plugin.zsh
 2index 60eae85ad247f2a2ef113160380aa26898af23f5..1035191ac20df91e50c2a1ac1d33275c4c886996 100644
 3--- a/plugins/jump/jump.plugin.zsh
 4+++ b/plugins/jump/jump.plugin.zsh
 5@@ -7,15 +7,19 @@
 6 # marks: lists all marks
 7 #
 8 export MARKPATH=$HOME/.marks
 9+
10 function jump {
11 	cd -P "$MARKPATH/$1" 2>/dev/null || echo "No such mark: $1"
12 }
13+
14 function mark {
15 	mkdir -p "$MARKPATH"; ln -s "$(pwd)" $MARKPATH/$1
16 }
17+
18 function unmark {
19 	rm -i "$MARKPATH/$1"
20 }
21+
22 function marks {
23 	ls -l "$MARKPATH" | sed 's/  / /g' | cut -d' ' -f9- | sed 's/ -/\t-/g' && echo
24 }
25@@ -23,6 +27,13 @@ function marks {
26 function _completemarks {
27   reply=($(ls $MARKPATH/**/*(-) | grep : | sed -E 's/(.*)\/([_\da-zA-Z\-]*):$/\2/g'))
28 }
29-
30 compctl -K _completemarks jump
31 compctl -K _completemarks unmark
32+
33+_mark_expansion() {
34+	setopt extendedglob
35+	autoload -U modify-current-argument
36+	modify-current-argument '$(readlink "$MARKPATH/$ARG")'
37+}
38+zle -N _mark_expansion
39+bindkey "^g" _mark_expansion