-
Notifications
You must be signed in to change notification settings - Fork 0
/
.metaxrc
50 lines (38 loc) · 1.16 KB
/
.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
41
42
43
44
45
46
47
48
49
50
# common
export TERM=xterm-256color
export PATH=/home/xwu/.local/bin:$PATH
export XDG_CONFIG_HOME=/home/xwu/.config
export XDG_DATA_HOME=/home/xwu/.local/share
export XDG_STATE_HOME=/home/xwu/.local/state
export COLORTERM=truecolor
#source ~/.local/share/blesh/ble.sh
#source /home/xwu/.config/broot/launcher/bash/br
# alias icd='cd '
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)"