-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·97 lines (83 loc) · 2.87 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·97 lines (83 loc) · 2.87 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#/usr/bin/env sh
trap 'echo && exit' SIGINT
command -v git >/dev/null || { echo 'error: need git' >&2; exit; }
start=$(pwd)
if [ ! $(basename $start) = dotfiles ]; then
echo "error: run from 'dotfiles' repo" >&2
exit
fi
echo -ne '\e[96;1m> Install dotfiles? (y/[n]) \e[39;0m'
read user
if [ "_$user" = _y ]; then
cat vimrc >> $HOME/.vimrc
cat bashrc >> $HOME/.bashrc
cat tmux.conf >> $HOME/.tmux.conf
mkdir -p $HOME/.ssh && cat ssh-config >> $HOME/.ssh/config
fi
echo -ne '\e[96;1m> Install fzf? (y/[n]) \e[39;0m'
read user
if [ "_$user" = _y ]; then
git clone --depth 1 https://github.com/junegunn/fzf.git $HOME/.fzf
$HOME/.fzf/install --all
echo 'if command -v fzf >/dev/null; then
export FZF_DEFAULT_COMMAND="fd --hidden --no-ignore --exclude .git --exclude *.swp"
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
export FZF_ALT_C_COMMAND="fd --type d"
export FZF_DEFAULT_OPTS="--multi --no-reverse --inline-info --bind ctrl-f:page-down,ctrl-b:page-up"
bind "$(bind -s | grep '"'"'^"\\C-r"'"'"' | grep -v '"'"'\\C-m'"'"' | sed '"'"'s/^"\\C-r/\\C-f"/'"')\""'
bind "$(bind -s | grep '"'"'^"\\C-r"'"'"' | grep -v '"'"'\\C-m'"'"' | sed '"'"'s/"$/\\C-m"/'"')\""'
fi' >> $HOME/.bashrc
fi
echo -ne '\e[96;1m> Install vim plugins? (y/[n]) \e[39;0m'
read user
if [ "_$user" = _y ]; then
mkdir -p $HOME/.vim/undo $HOME/.vim/bundle
cd $HOME/.vim
# pathogen
git clone https://github.com/tpope/vim-pathogen
mv vim-pathogen/autoload .
rm -rf vim-pathogen
# plugins
cd bundle
git clone https://github.com/vim-scripts/AutoComplPop
git clone https://github.com/junegunn/fzf.vim
git clone https://github.com/pbogut/fzf-mru.vim
git clone https://github.com/justinmk/vim-sneak
git clone https://github.com/joshdick/onedark.vim
git clone https://github.com/mbbill/undotree
git clone https://github.com/preservim/tagbar
git clone https://github.com/preservim/indentLine
cd $start
fi
echo -ne '\e[96;1m> Install rust things? (y/[n]) \e[39;0m'
read user
if [ "_$user" = _y ]; then
# rust
if ! command -v cargo >/dev/null; then
if [ ! -f $HOME/.cargo/env ]; then
curl https://sh.rustup.rs -sSf | sh
fi
. $HOME/.cargo/env
fi
# utils
if command -v cargo >/dev/null; then
# ripgrep
if ! command -v rg >/dev/null; then
git clone https://github.com/BurntSushi/ripgrep $HOME/ripgrep
cd $HOME/ripgrep
cargo build --release
cargo install --path .
cd $start
rm -rf $HOME/ripgrep
fi
# fd
if ! command -v fd >/dev/null; then
git clone https://github.com/sharkdp/fd $HOME/fd
cd $HOME/fd
cargo build --release
cargo install --path .
cd $start
rm -rf $HOME/fd
fi
fi
fi