-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.sh
More file actions
executable file
·92 lines (76 loc) · 3.08 KB
/
init.sh
File metadata and controls
executable file
·92 lines (76 loc) · 3.08 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
#!/bin/bash
DATE=$(date '+%Y-%m-%d_%H:%M:%S:%N')
dnfInstall() {
sudo dnf install -y zsh vim util-linux-user direnv tmux
# ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install)"
# PATH="$HOME/.linuxbrew/bin:$PATH"
# echo 'export PATH="$HOME/.linuxbrew/bin:$PATH"' >>~/.zshrc
}
aptInstall() {
sudo apt update
sudo apt install -y zsh vim direnv tmux
}
pacmanInstall() {
# TODO: add commands
return 0
}
backup() {
file=$1
[ -f $file ] && cp -L $file ${file}.bak.${DATE} && rm -f $file
}
os=''
if [ "$OSTYPE" = "linux-gnu" ]
then
os=$(tr '[:upper:]' '[:lower:]' <<< $(lsb_release -i | awk '{print $NF}'))
which dnf && dnfInstall
which apt-get && aptInstall
which pacman && pacmanInstall
elif [ "$OSTYPE" = "darwin"* ]
then
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install aria2 gcc go httpie micro openssl youtube-dl nvm tmux direnv
os=osx
fi
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
os_plugin='unknown_os'
if [[ -d ${HOME}/.oh-my-zsh/plugins/${os} ]]
then
os_plugin=$os
else
os_plugin=''
fi
backup ${HOME}/.zshrc
sed "s/__os_plugin__/${os_plugin}/" .zshrc > .zshrc_${os_plugin}
ln -sf $(pwd)/.zshrc_${os_plugin} ${HOME}/.zshrc
git clone https://github.com/djui/alias-tips.git ~/.oh-my-zsh/custom/plugins/alias-tips
#git clone https://github.com/supercrabtree/k ~/.oh-my-zsh/custom/plugins/k
git clone [email protected]:jonmosco/kube-ps1.git ~/.oh-my-zsh/custom/plugins/kube-ps1
git clone https://github.com/zsh-users/zsh-completions ~/.oh-my-zsh/custom/plugins/zsh-completions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting
git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
backup ${HOME}/.vimrc
ln -sf $(pwd)/.vimrc ${HOME}/.vimrc
vim +silent +VimEnter +PlugInstall +qall
git clone https://github.com/gpakosz/.tmux.git ~/.tmux
ln -s -f ~/.tmux/.tmux.conf ~/.tmux.conf
backup ${HOME}/.tmux.conf.local
ln -sf $(pwd)/.tmux.conf.local ${HOME}/.tmux.conf.local
#==> Next steps:
#- Install the Linuxbrew dependencies:
# Debian, Ubuntu, etc.
# sudo apt-get install build-essential
# Fedora, Red Hat, CentOS, etc.
# sudo yum groupinstall 'Development Tools'
# See http://linuxbrew.sh/#dependencies for more information.
#- Add Linuxbrew to your ~/.bash_profile by running
# echo 'export PATH="/home/echaouchna/.linuxbrew/bin:$PATH"' >>~/.bash_profile
# echo 'export MANPATH="/home/echaouchna/.linuxbrew/share/man:$MANPATH"' >>~/.bash_profile
# echo 'export INFOPATH="/home/echaouchna/.linuxbrew/share/info:$INFOPATH"' >>~/.bash_profile
#- Add Linuxbrew to your PATH
# PATH="$HOME/.linuxbrew/bin:$PATH"
#- We recommend that you install GCC by running:
# brew install gcc
#- Run `brew help` to get started
#- Further documentation:
# http://docs.brew.sh