-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
executable file
·213 lines (174 loc) · 7.01 KB
/
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
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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
#!/usr/bin/env sh
#
# vim: textwidth=0:filetype=sh
#
# This is a rough outline of the steps that are necessary to setup a new system
# with all my tools/settings on macos
#######################################################
#
# Install Xcode from App Store or download link
#
#######################################################
# install homebrew from https://brew.sh/
# install rustup from https://rustup.rs/
#######################################################
#
# This gets exported as above later, at some point, by homebrew (I think) so
# follow the same pattern
#
#######################################################
# HOMEBREW_PREFIX=$(brew --prefix)
HOMEBREW_PREFIX="/opt/homebrew"
brew tap homebrew/cask
brew bundle --verbose
brew link --force readline
# git clone https://github.com/junegunn/fzf.git ~/.fzf && ~/.fzf/install --all
#######################################################
#
# zsh as an allowed, and my default, shell
#
#######################################################
ZSH_FOUND=$(grep -c $HOMEBREW_PREFIX/bin/zsh /etc/shells)
if [ $ZSH_FOUND == 0 ]
then
echo "missing $HOMEBREW_PREFIX/bin/zsh, adding..."
sudo sh -c "echo $HOMEBREW_PREFIX/bin/zsh >> /etc/shells"
else
echo "found $HOMEBREW_PREFIX/bin/zsh, skipping..."
fi
echo $SHELL | grep -v zsh | while read
do
chsh -s $HOMEBREW_PREFIX/bin/zsh
done
mkdir -p ~/.zsh/git
git clone https://github.com/zsh-users/zsh-autosuggestions ~/.zsh/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-completions ~/.zsh/zsh-completions
git clone https://github.com/zsh-users/zsh-history-substring-search ~/.zsh/zsh-history-substring-search
git clone https://github.com/zsh-users/zsh-syntax-highlighting ~/.zsh/zsh-syntax-highlighting
git clone https://github.com/denisidoro/navi ~/.zsh/navi
git clone https://github.com/ellie/atuin ~/.zsh/atuin
curl https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/plugins/git/git.plugin.zsh -o ~/.zsh/git/git.plugin.zsh
#######################################################
#
# xcode & cli tools
#
#######################################################
xcode-select --install
sudo xcodebuild -license
# May also need to run below, from: https://nokogiri.org/tutorials/installing_nokogiri.html#unable-to-find-libraries-on-macos-mojave
# open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
#######################################################
#
# neovim/python stuff for deoplete, gundo, etc.
#
#######################################################
pip3 install --user --upgrade pip setuptools neovim wheel yamllint sqlparse pynvim iredis psutil graphtage
#######################################################
#
# asdf for programming language version management
#
#######################################################
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.8.1
~/.asdf/bin/asdf plugin-add ruby https://github.com/asdf-vm/asdf-ruby.git
~/.asdf/bin/asdf plugin-add nodejs https://github.com/asdf-vm/asdf-nodejs.git
# Required to install nodejs
bash ~/.asdf/plugins/nodejs/bin/import-release-team-keyring
#######################################################
#
# Neovim folders
#
#######################################################
mkdir -p ~/.vim/tmp
mkdir -p ~/.vim/backups
mkdir -p ~/.vim/colors
mkdir -p ~/.vim/autoload
mkdir -p ~/.vim/undo
mkdir -p ~/.vim/views
mkdir -p ~/.terminfo
mkdir -p ~/.config/yamllint
tic -o ~/.terminfo xterm-256color-italic.terminfo
echo "Use stow . to symlink all files/directories"
# This is where I put local exports, settings, etc.
echo "Symlink or create your ~/.localrc file"
# https://github.com/VSCodeVim/Vim#mac
defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false
defaults write -g ApplePressAndHoldEnabled -bool false
# Always make file finder open in expanded state
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode2 -bool true
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint2 -bool true
# Disable save new documents to cloud
defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false
# Don't write .DS_Store files on network drives
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
# Don't auto-substitute smart dashes
defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false
# Don't auto-substitute smart quotes
defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false
# Remove dock auto-hide delay
defaults write com.apple.Dock autohide-delay -float 0 && killall Dock
# Disable dock recent history
defaults write com.apple.dock show-recents -bool no
# Remove recent apps from dock
defaults write com.apple.dock recent-apps -array
# Always show hidden files in Finder
defaults write com.apple.finder AppleShowAllFiles -bool YES && killall Finder
# Turn on full keyboard access (tab thru system menu items)
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3
# Fastest key repeat rate, can't set via the clickable interface. Log out to activate
# defaults write -g KeyRepeat -int 1
# Fastesst initial repeat; can't set via interface. Log out to activate
# defaults write -g InitialKeyRepeat -int 10
cargo install atuin
cargo install bat
cargo install broot
cargo install cargo-update
cargo install cw
cargo install exa
cargo install git-delta
cargo install mise
cargo install ripgrep
cargo install tre-command
cargo install zoxide --locked
cargo install --locked yazi-fm yazi-cli
cargo install --locked difftastic
cargo install fd-find
npm install -g neovim yarn
npm install -g tree-sitter-cli
# Run this once
# https://build.betterup.com/one-weird-trick-that-will-speed-up-your-bundle-install/
# echo 'export MAKE="make -j$(nproc)"' >> $home/.localrc
# Generate tags for bundled gems. The grep ignores lines started with "The", which includes certain
# tzinfo warnings that's common
# /usr/local/bin/ctags -R --languages=ruby --exclude=.git --exclude=log . $(bundle list --paths | grep -v "^The" | sed 's/$/\/lib/')
#
# Typically, you want to run this command once, in the repo root:
#
# $HOMEBREW_PATH/bin/ctags . $(bundle list --paths)
#
# For unused tool, you'll want to run this from the root:
#
# unused --ignore /Users/jay.dorsey/.local/* > out.txt
#
# Then, you'll run git init to setup your git hooks & symlink the .ctags.d folder to your $HOME. Inside
# the git hooks is a command that will append the local code tags onto the tags file for you
#
# Ctags debugging
# ctags --verbose 2> out.txt
#
# Install the pg-extras plugin
# heroku plugins:install git://github.com/heroku/heroku-pg-extras.git
#
# Try run nvim with nvim -u NONE. Is it still slow?
#
# Try profiling when inside that file.
# :profile start profile.log
# :profile func *
# :profile file *.
# Now start doing what is slow
# :profile pause.
# Quit vim and open profile.log.
# At the end you should see sum of functions exec times and count of usage. Should point you.
#
# bot summon :help profile