-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall
More file actions
executable file
·137 lines (108 loc) · 4.56 KB
/
install
File metadata and controls
executable file
·137 lines (108 loc) · 4.56 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
#!/bin/bash
rm -rf ~/.vimrc ~/.gvimrc ~/.vimrc.bundles ~/.vim ~/.zshrc.pre-oh-my-zsh ~/.zshrc ~/.zsh_history ~/.shell.pre-oh-my-zsh .oh-my-zsh ~/.config/nvim
if [ "$(uname)" == "Darwin" ]; then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
brew install vim the_silver_searcher tmux go gh nvm neovim
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
if ! command -v sudo &> /dev/null; then
DEBIAN_FRONTEND=non_interactive apt install sudo -y
fi
if ! command -v ag &> /dev/null; then
DEBIAN_FRONTEND=non_interactive sudo apt install silversearcher-ag -y
fi
if ! command -v vim &> /dev/null; then
DEBIAN_FRONTEND=non_interactive sudo apt install vim -y
fi
if ! command -v tmux &> /dev/null; then
DEBIAN_FRONTEND=non_interactive sudo apt install tmux -y
fi
if ! command -v zsh &> /dev/null; then
DEBIAN_FRONTEND=non_interactive sudo apt install zsh -y
fi
if ! command -v wget &> /dev/null; then
DEBIAN_FRONTEND=non_interactive sudo apt install wget -y
fi
if ! command -v curl &> /dev/null; then
DEBIAN_FRONTEND=non_interactive sudo apt install curl -y
fi
if ! command -v go &> /dev/null; then
echo "Installing go..."
sudo snap install go --classic
fi
#if ripgrep is not installed, install it
if ! command -v rg &> /dev/null; then
echo "Installing ripgrep..."
curl -LO https://github.com/BurntSushi/ripgrep/releases/download/14.1.1/ripgrep_14.1.1-1_amd64.deb
sudo dpkg -i ripgrep_14.1.1-1_amd64.deb
rm ripgrep_14.1.1-1_amd64.deb
fi
# if fd is not installed, install it
if ! command -v fd &> /dev/null; then
echo "Installing fd..."
sudo apt install fd-find -y
sudo ln -s $(which fdfind) /usr/local/bin/fd
fi
fi
if [ -f "$HOME/.ralias" ] ; then
rm -f ~/.aliases
fi
if [ -f "$HOME/.gemrc" ] ; then
rm -f ~/.gemrc
fi
if [ -f "$HOME/.gitconfig" ] ; then
rm -f ~/.gitconfig
fi
if [ -f "$HOME/.tmux.conf" ] ; then
rm -f ~/.tmux.conf
fi
if [ -f "$HOME/.zshrc" ] ; then
rm -f ~/.zshrc
fi
if [ -f "$HOME/.gorc" ] ; then
rm -f ~/.gorc
fi
if [ -f "$HOME/.pryr" ] ; then
rm -f ~/.pryr
fi
cp $(pwd)/gemrc ~/.gemrc
cp $(pwd)/gitconfig ~/.gitconfig
cp $(pwd)/tmux.conf ~/.tmux.conf
cp $(pwd)/zshrc ~/.zshrc
cp $(pwd)/gorc ~/.gorc
cp $(pwd)/pryrc ~/.pryrc
cp $(pwd)/alias ~/.ralias
cp $(pwd)/nanorc ~/.nanorc
#cp $(pwd)/tmux-session-connect ~/.tmux-session-connect
grep -qxF 'if [ -f ~/.ralias ]; then . ~/.ralias; fi' ~/.bashrc || echo 'if [ -f ~/.ralias ]; then . ~/.ralias; fi' >> ~/.bashrc
grep -qxF 'if [ -f ~/.ralias ]; then . ~/.ralias; fi' ~/.zshrc || echo 'if [ -f ~/.ralias ]; then . ~/.ralias; fi' >> ~/.zshrc
# grep -qxF 'if [ -f ~/.tmux-session-connect ]; then . ~/.tmux-session-connect; fi' ~/.bashrc || echo 'if [ -f ~/.tmux-session-connect ]; then . ~/.tmux-session-connect; fi' >> ~/.bashrc
# grep -qxF 'if [ -f ~/.tmux-session-connect ]; then . ~/.tmux-session-connect; fi' ~/.zshrc || echo 'if [ -f ~/.tmux-session-connect ]; then . ~/.tmux-session-connect; fi' >> ~/.zshrc
# Clean up old unnecessary files or symlinks
#personal preference
git config --global pager.branch false
git config --global user.name Reinaldo
git config --global user.email "12644557+reinaldoacosta@users.noreply.github.com"
git config --global core.editor vim
git config --global pull.rebase true
#set autocrlf to false
git config --global core.autocrlf false
# Clone directly into ~/.vim
cp -r ./vim ~/.vim
# Install github copilot
# git clone https://github.com/github/copilot.vim.git ~/.vim/pack/github/start/copilot.vim
~/.vim/activate.sh
# Copy the init.vim file to the nvim config directory but first delete it if it already exists
mkdir -p ~/.config/nvim
cp ./init.vim ~/.config/nvim/init.vim
# Create the directory using your specific user ID (usually 1000)
sudo mkdir -p /run/user/$(id -u)
# Give yourself ownership of it
sudo chown -R $USER:$USER /run/user/$(id -u)
# Ensure it has the correct write permissions
sudo chmod 0700 /run/user/$(id -u)
sed -i 's/colorscheme default/colorscheme vscode/g' ~/.vim/vimrc
#download fonts and install them in the system
#the font URL is https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/AnonymousPro/complete/Anonymice%20Nerd%20Font%20Complete%20Mono.ttf
echo -e "\033[0;32mDownload the following font: https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/AnonymousPro/complete/Anonymice%20Nerd%20Font%20Complete%20Mono.ttf and install it in the system.\033[0m"
echo -e "\033[0;33mPlease restart your terminal and do not forget to log into Github Copilot in NeoVim.\033[0m"
echo -e "\033[0;32mDone!\033[0m"