Skip to content

Commit fd1de65

Browse files
committed
Added configuration for bookmarking
1 parent 27b0085 commit fd1de65

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

.zsh/marks

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Source: http://jeroenjanssens.com/2013/08/16/quickly-navigate-your-filesystem-from-the-command-line.html
2+
export MARKPATH=$HOME/.marks
3+
function jump {
4+
cd -P "$MARKPATH/$1" 2>/dev/null || echo "No such mark: $1"
5+
}
6+
function mark {
7+
mkdir -p "$MARKPATH"; ln -s "$(pwd)" "$MARKPATH/$1"
8+
}
9+
function unmark {
10+
rm -i "$MARKPATH/$1"
11+
}
12+
function marks {
13+
ls -l "$MARKPATH" | sed 's/ / /g' | cut -d' ' -f9- | sed 's/ -/\t-/g' && echo
14+
}
15+
16+
function _completemarks {
17+
reply=($(ls $MARKPATH))
18+
}
19+
20+
compctl -K _completemarks jump
21+
compctl -K _completemarks unmark

.zshrc

+2
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,8 @@ get_space () {
291291

292292
#{{{ Functions
293293

294+
source .zsh/marks
295+
294296
_force_rehash() {
295297
(( CURRENT == 1 )) && rehash
296298
return 1 # Because we didn't really complete anything

0 commit comments

Comments
 (0)