blob: 0dddc65da03c3964682d218bf3cf81117388ed4e (
plain)
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
|
#!/bin/bash
remove_line() {
echo "Remove from $2:"
echo " - $1"
line=$(grep -nF "$1" "$2" | sed 's/:.*//')
if [ -n "$line" ]; then
echo " - Remove line (line #$line)"
awk -v n=$line 'NR == n {next} {print}' $2 > $2.bak; mv $2.bak $2
else
echo " - Nothing found"
fi
echo
}
for shell in bash zsh; do
if [ -f ~/.fzf.${shell} ]
then
rm ~/.fzf.${shell}
fi
remove_line "source ~/.fzf.${shell}" ~/.${shell}rc
bind_file="~/.config/fish/functions/fish_user_key_bindings.fish"
if [ -f $bind_file ]
then
remove_line "fzf_key_bindings" "$bind_file"
fi
done
if [ -f ~/.config/fish/functions/fzf.fish ]
then
rm ~/.config/fish/functions/fzf.fish
fi
rmdir --ignore-fail-on-non-empty ~/.config/fish/functions
|