-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.metaxrc
40 lines (30 loc) · 904 Bytes
/
.metaxrc
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
export TERM=xterm-256color
export COLORTERM=truecolor
ihis(){
his=$(history | awk '{$1=""; print $0}' | sed '/^ cd/d' | sort | uniq | fzf)
echo $his
}
ifd(){
if [ $# -eq 0 ]; then
file=$(fd --type f -I -a --full-path . $HOME| fzf --preview 'echo {}' --preview-window='down:3:wrap')
elif [ $# -eq 1 ]; then
file=$(fd --type f -I -a --full-path $1 $HOME| fzf --preview 'echo {}' --preview-window='down:3:wrap')
elif [ $# -eq 2 ]; then
file=$(fd --type f -I -a --full-path $1 $2 | fzf --preview 'echo {}' --preview-window='down:3:wrap')
fi
if [ -n $file ]; then
echo $file
fi
}
icd(){
if [ $# -eq 0 ]; then
dir=$(fd --type d -I -a --full-path . $HOME| fzf)
elif [ $# -eq 1 ]; then
dir=$(fd --type d -I -a --full-path . $1| fzf)
fi
if [ -n $dir ]; then
cd $dir
fi
}
eval "$(fzf --bash)"
eval -- "$(starship init bash --print-full-init)"