-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·164 lines (147 loc) · 5.35 KB
/
install.sh
File metadata and controls
executable file
·164 lines (147 loc) · 5.35 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
#!/bin/bash
# vim: set ts=4 sw=4 expandtab:
# Copyright (C) 2013-2024 Matthew Langbehn
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Install required pip packages
/usr/local/bin/python3 -m pip install pynvim --break-system-packages
# Install pathogen for vim plugin management
mkdir -p "$HOME"/.vim/bundle
if [[ -d "$HOME"/.vim/vim-pathogen ]]; then
pushd "$HOME"/.vim/vim-pathogen || exit 1
git checkout master
git fetch
git reset --hard origin/master
else
git clone git@github.com:tpope/vim-pathogen.git "$HOME"/.vim/vim-pathogen
fi
ln -sf "$HOME"/.vim/vim-pathogen/autoload "$HOME"/.vim/autoload
# Install ansible vim plugin
if [[ -d "$HOME"/.vim/bundle/ansible-vim ]]; then
pushd "$HOME"/.vim/bundle/ansible-vim || exit 1
git checkout master
git fetch
git reset --hard origin/master
else
git clone https://github.com/pearofducks/ansible-vim.git "$HOME"/.vim/bundle/ansible-vim
fi
# Install syntastic syntax checker
if [[ -d "$HOME"/.vim/bundle/syntastic ]]; then
pushd "$HOME"/.vim/bundle/syntastic || exit 1
git checkout master
git fetch
git reset --hard origin/master
else
git clone https://github.com/vim-syntastic/syntastic.git "$HOME"/.vim/bundle/syntastic
fi
# Install vim airline status bar
if [[ -d "$HOME"/.vim/bundle/vim-airline ]]; then
pushd "$HOME"/.vim/bundle/vim-airline || exit 1
git checkout master
git fetch
git reset --hard origin/master
else
git clone https://github.com/vim-airline/vim-airline "$HOME"/.vim/bundle/vim-airline
fi
# Install vim-ai, OpenAI assistant for vim
if [[ -d "$HOME"/.vim/bundle/vim-ai ]]; then
pushd "$HOME"/.vim/bundle/vim-ai || exit 1
git checkout master
git fetch
git reset --hard origin/master
else
git clone https://github.com/vim-airline/vim-ai "$HOME"/.vim/bundle/vim-ai
fi
# Check for existing ~/.vimrc and back it up if it exists
if [[ -f "$HOME"/.vimrc ]]; then
echo
echo "Existing ~/.vimrc found."
echo "Backing it up to ~/.vimrc.backup"
echo
cp "$HOME"/.vimrc{,.backup}
fi
curl https://raw.githubusercontent.com/mlangbehn/DotFiles/master/vimrc > "$HOME"/.vimrc
# Check for ~/.config/nvim, and create if it doesn't
if [[ ! -d "$HOME"/.config/nvim ]]; then
echo
echo "No ~/.config/nvim found."
echo "creating it."
echo
mkdir -p "$HOME"/.config/nvim
fi
# Check for existing ~/.comfig/nvim/init.vim and back it up if it exists
if [[ -f "$HOME"/.config/nvim/init.vim ]]; then
echo
echo "Existing ~/.config/nvim/init.vim found."
echo "Backing it up to ~/.config/nvim/init.vim.backup"
echo
cp "$HOME"/.config/nvim/init.vim{,.backup}
fi
curl https://raw.githubusercontent.com/mlangbehn/DotFiles/master/config/nvim/init.vim > "$HOME"/.config/nvim/init.vim
# Check for ~/.zsh, and create if it doesn't
if [[ ! -d "$HOME"/.zsh ]]; then
echo
echo "No ~/.zsh found."
echo "creating it."
echo
mkdir "$HOME"/.zsh
fi
# Check for existing ~/.zsh/git-completion.bash and back it up if it exists
if [[ -f "$HOME"/.zsh/git-completion.bash ]]; then
echo
echo "Existing ~/.zsh/git-completion.bash found."
echo "Backing it up to ~/.zsh/git-completion.bash.backup"
echo
cp "$HOME"/.zsh/git-completion.bash{,.backup}
fi
curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash > "$HOME"/.zsh/git-completion.bash
# Check for existing ~/.zsh/_git and back it up if it exists
if [[ -f "$HOME"/.zsh/_git ]]; then
echo
echo "Existing ~/.zsh/_git found."
echo "Backing it up to ~/.zsh/_git.backup"
echo
cp "$HOME"/.zsh/_git{,.backup}
fi
curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.zsh > "$HOME"/.zsh/_git
# Check for existing ~/.zsh/git-prompt.sh and back it up if it exists
if [[ -f "$HOME"/.zsh/git-prompt.sh ]]; then
echo
echo "Existing ~/.zsh/git-prompt.sh found."
echo "Backing it up to ~/.zsh/git-prompt.sh.backup"
echo
cp "$HOME"/.zsh/git-prompt.sh{,.backup}
fi
curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh > "$HOME"/.zsh/git-prompt.sh
# Check for existing ~/.zshrc and back it up if it exists
if [[ -f "$HOME"/.zshrc ]]; then
echo
echo "Existing ~/.zshrc found."
echo "Backing it up to ~/.zshrc.backup"
echo
cp "$HOME"/.zshrc{,.backup}
fi
curl https://raw.githubusercontent.com/mlangbehn/DotFiles/master/zshrc > "$HOME"/.zshrc
echo
echo "Installation complete."
echo "If zsh is not your current default shell, and you want it to be,"
echo "run the following:"
echo " chsh -s $(which zsh)"
echo "Then, to switch to it, run:"
echo " $(which zsh)"
echo
echo "If you are already running zsh, and you want to start using your"
echo "new configuration, either logout and back in, or run:"
echo " source ~/.zshrc"
echo