-
Notifications
You must be signed in to change notification settings - Fork 0
/
osx-setup.sh
executable file
·103 lines (71 loc) · 2.52 KB
/
osx-setup.sh
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
#!/bin/bash
########### 1. Download softwares
# https://github.com/nithinbekal/setup-scripts
# install homebrew - this will also install xcode command line tools
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install ctags git htop zsh vim macvim elixir
brew install -q tmux reattach-to-user-namespace
# use cask for installing GUI apps
brew cask install iterm2 sublime-text --cask
# git
git config --global user.name "haoran"
git config --global user.email "[email protected]"
# configure zsh
touch ~/.env.local
chsh -s /bin/zsh
curl -L http://install.ohmyz.sh | sh
# install RVM
curl -sSL https://get.rvm.io | bash -s stable
rvm install ruby
# setup node.js
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.1/install.sh | bash
nvm install 6.2
# generate ssh keys
mkdir -p ~/.ssh
ssh-keygen -t rsa -C "[email protected]"
# set up postgresql
brew install postgresql
brew services start postgresql
initdb --locale=C -E UTF-8 /opt/homebrew/var/postgresql
# /opt/homebrew/opt/postgresql@14/bin/createuser -s postgres
# Snipaste WhatPluse
# Tencent Lemon
# vimac -> homerow
########### 2. Think you've already downloaded the softwares.
set -e
source ./scripts/script-funcs.sh
__current_status "linking dotfiles"
dotfiles=(.ctags .bashrc .zshrc .gitconfig)
for file in ${dotfiles[@]}; do
__current_status "linking ${file}"
rm -f ~/$file
link_file ~/dotfiles/$file ~/$file
done
__current_status "linking vim config"
link_file ~/dotfiles/vim/.vimrc ~/.vimrc
__current_status "linking neovim config"
link_file ~/dotfiles/nvim ~/.config/nvim
__current_status "installing neovim tools"
install_from_repo (ripgrep fzf)
# mason lazy sync
__current_status "installing ohmyzsh"
if [ -d ~/.oh-my-zsh ]; then
__current_status "found ~/.oh-my-zsh - skipping this step"
else
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended
__current_status "installing zsh plugins"
plugins=(autojump zsh-autosuggestions zsh-syntax-highlighting)
install_from_repo "${plugins[*]}"
fi
__current_status "linking lazygit config"
link_file ~/dotfiles/lazygit.yml ~/Library/Application\ Support/lazygit/config.yml
########### 3. Essential Fonts
brew tap homebrew/cask-fonts
brew install font-ubuntu
brew install font-fontawesome
brew install font-hack-nerd-font
brew install font-fira-code-nerd-font
__current_status "installation successful 🚀"
########### 4. Record the data to be migrated
# push repository commit
# rime data