-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
f
executable file
·47 lines (43 loc) · 898 Bytes
/
f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/sh
######################################################################
# @author : Gavin Jaeger-Freeborn ([email protected])
# @file : f.sh
# @created : Fri 17 Jan 2020 09:35:29 AM MST
#
# @description : fzf shortcuts
######################################################################
fzedit(){
file=$(find "$@" -not -path "*/\.nnn*" -not -path "*/\.git*" -type f -print | fzf --bind "ctrl-o:execute-silent(setsid xdg-open {}&)")
[ -e "$file" ] && ${EDITOR:-vi} "$file"
}
# TODO: automate adding these
f() {
case "$*" in
d)
fzedit ~/Documents/
;;
D)
fzedit ~/Downloads/
;;
v)
fzedit ~/.vim/
;;
p)
fzedit ~/Programming/
;;
w)
fzedit ~/.local/Dropbox/DropsyncFiles/vimwiki/
;;
m)
fzedit ~/.config/nnn/mounts/
;;
s)
fzedit ~/.scripts/ ~/.config/
;;
*)
fzedit .
;;
esac
}
f "$*"
# vim: set tw=78 ts=2 et sw=2 sr: