curl -s https://raw.githubusercontent.com/mlptv/setup/main/scripts/setup.sh | /bin/bash
MacOS is UNIX-based, unlike Windows, though Windows Subsystem for Linux (WSL) is a really big step forward.
The best option would be to install Linux on a Mac and configure the modifier keys (Cmd/Alt/Ctrl) to work like in MacOS, but who has time for that?
The Command key is used for MacOS keyboard shortcuts, limiting conflicts with Unix shortcuts that use Alt/Option or Control.
Macs are built to last. I am writing this in 2020 on a 2014 MacBook Air. No PC has ever lasted this long in my experience.
curl https://raw.githubusercontent.com/maptv/setup/main/macos.terminal -o ~/macos.terminal
sudo -v
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
defaults write -g KeyRepeat -int 1
defaults write -g InitialKeyRepeat -int 20
defaults write -g ApplePressAndHoldEnabled -bool false
defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false # For VS Code
defaults write com.microsoft.VSCodeInsiders ApplePressAndHoldEnabled -bool false # For VS Code Insider
defaults write com.visualstudio.code.oss ApplePressAndHoldEnabled -bool false # For VS Codium
defaults write NSGlobalDomain NSAutomaticCapitalizationEnabled -bool false
defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false
defaults write NSGlobalDomain NSAutomaticPeriodSubstitutionEnabled -bool false
defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false
defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3
defaults write NSGlobalDomain com.apple.trackpad.scaling -float 3
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool true defaults -currentHost write NSGlobalDomain com.apple.mouse.tapBehavior -int 1 defaults write NSGlobalDomain com.apple.mouse.tapBehavior -int 1
defaults write com.apple.dock persistent-apps -array
defaults write com.apple.dock static-only -bool true
defaults write com.apple.dock autohide -bool true
defaults write com.apple.Dock autohide-delay -float 0
defaults write com.apple.dock autohide-time-modifier -float 0
defaults write com.apple.dock enable-spring-load-actions-on-all-items -bool true
defaults write com.apple.dock autohide-delay -float 0
defaults write com.apple.dock autohide-time-modifier -float 0
defaults write com.apple.dock launchanim -bool false
Make Dock icons of hidden applications translucent
defaults write com.apple.dock showhidden -bool true
defaults write com.apple.dock show-recents -bool false
defaults write com.apple.dock minimize-to-application -bool true
defaults write com.apple.dock enable-spring-load-actions-on-all-items -bool true
defaults write com.apple.dock show-process-indicators -bool true
sudo nvram SystemAudioVolume=" "
defaults write "Apple Global Domain" com.apple.sound.uiaudio.enabled -int 0
defaults write com.apple.systemsound com.apple.sound.uiaudio.enabled -bool false
defaults write NSGlobalDomain com.apple.sound.beep.feedback -bool false
defaults write NSGlobalDomain com.apple.sound.beep.flash -bool false
defaults write com.apple.systemuiserver menuExtras -array
"/System/Library/CoreServices/Menu Extras/AirPort.menu"
"/System/Library/CoreServices/Menu Extras/Bluetooth.menu"
"/System/Library/CoreServices/Menu Extras/Displays.menu"
"/System/Library/CoreServices/Menu Extras/Volume.menu"
defaults write com.apple.finder ShowStatusBar -bool true
defaults write com.apple.finder ShowPathbar -bool true
defaults write com.apple.finder _FXSortFoldersFirst -bool true
defaults write com.apple.finder FXDefaultSearchScope -string "SCcf"
defaults write NSGlobalDomain com.apple.springing.enabled -bool true
defaults write NSGlobalDomain com.apple.springing.delay -float 0
defaults write com.apple.finder FXPreferredViewStyle -string "Nlsv"
defaults write com.apple.finder WarnOnEmptyTrash -bool false
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
defaults write com.apple.finder _FXShowPosixPathInTitle -bool true
defaults write NSGlobalDomain NSTableViewDefaultSizeMode -int 3
defaults write com.apple.finder QuitMenuItem -bool true
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3
defaults write com.apple.universalaccess closeViewScrollWheelToggle -bool true
defaults write com.apple.universalaccess HIDScrollZoomModifierMask -int 262144
defaults write com.apple.universalaccess closeViewZoomFollowsFocus -bool true
defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false
defaults write NSGlobalDomain KeyRepeat -int 1
defaults write NSGlobalDomain InitialKeyRepeat -int 20
defaults write NSGlobalDomain NSAutomaticCapitalizationEnabled -bool false
defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false
defaults write NSGlobalDomain NSAutomaticPeriodSubstitutionEnabled -bool false
defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false
defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false
defaults write NSGlobalDomain _HIHideMenuBar -bool true
defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false
defaults write NSGlobalDomain AppleMetricUnits -bool true
sudo defaults write /Library/Preferences/com.apple.loginwindow showInputMenu -bool true
defaults write com.apple.screencapture disable-shadow -bool true
defaults write com.apple.dock expose-animation-duration -float 0.1
defaults write NSGlobalDomain NSTableViewDefaultSizeMode -int 2
defaults write com.apple.LaunchServices LSQuarantine -bool false
defaults write NSGlobalDomain NSTextShowsControlCharacters -bool true
defaults write com.apple.systempreferences NSQuitAlwaysKeepsWindows -bool false
launchctl unload -w /System/Library/LaunchAgents/com.apple.notificationcenterui.plist 2> /dev/null
killall Finder
killall Dock
Download keyboard layout and icon files undead.keylayout
and undead.icns
to /Library/Keyboard Layouts/
sudo curl https://raw.githubusercontent.com/maptv/setup/main/undead.icns -o /Library/Keyboard\ Layouts/undead.icns
sudo curl https://raw.githubusercontent.com/maptv/setup/main/undead.keylayout -o /Library/Keyboard\ Layouts/undead.layout
curl https://raw.githubusercontent.com/maptv/setup/main/DefaultKeyBinding.dict -o ~/Library/KeyBindings/DefaultKeyBinding.dict --create-dirs
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
(echo; echo 'eval "$($(brew --prefix)/bin/brew shellenv)"') >> ~/.zprofile
eval "$($(brew --prefix)/bin/brew shellenv)"
git config --global user.email 13444106+maptv@users.noreply.github.com
curl https://raw.githubusercontent.com/maptv/setup/main/.Brewfile -o ~/.Brewfile
brew bundle install --global || true
model=$(sysctl hw.model | cut -d\ -f2)
yes y | ssh-keygen -t ed25519 -f ~/.ssh/$(whoami)$model -C $(whoami)$model -N ''
ssh-add ~/.ssh/$(whoami)_$model
cat ~/.ssh/$(whoami)_$model.pub | pbcopy
echo "Host *\n\tUseKeychain yes\n\tAddKeysToAgent yes\n\tIdentityFile ~/.ssh/$(whoami)_$model" >> ~/.ssh/config
git clone https://github.com/maptv/ewka ~/maptv/ewka
cp ~/maptv/ewka/nerd/* ~/Library/Fonts
Use brew install --cask r: https://rstats.wtf/set-up-an-r-dev-environment.html#what-about-homebrew
duti -s com.qvacua.VimR txt all
duti -s org.jupyter.jupyterlab-desktop ipynb all
curl https://raw.githubusercontent.com/maptv/setup/main/init.lua -o ~/.hammerspoon/init.lua --create-dirs
curl https://raw.githubusercontent.com/miromannino/miro-windows-manager/master/MiroWindowsManager.spoon.zip | tar -xf - -C ~/.hammerspoon/Spoons
curl https://raw.githubusercontent.com/maptv/setup/main/MiroWindowsManager.lua -o ~/.hammerspoon/Spoons/MiroWindowsManager.spoon/init.lua --create-dirs
curl https://raw.githubusercontent.com/maptv/setup/main/alacritty.yml -o ~/.config/alacritty/alacritty.yml --create-dirs
curl https://raw.githubusercontent.com/maptv/setup/main/kitty.conf -o ~/.config/kitty/kitty.conf --create-dirs
curl https://raw.githubusercontent.com/maptv/setup/main/.hyper.js -o ~/.hyper.js --create-dirs
curl https://raw.githubusercontent.com/maptv/setup/main/config.yaml -o ~/Library/Application\ Support/tabby/config.yaml --create-dirs
Set builtin "Move focus" macOS Keyboard shortcuts in System Preferences > Keyboard > Shortcuts > Keyboard
Move focus to window toolbar: Alt Cmd T
(mnemonic: toolbaR, works a bit like Alt R in Emacs in that it jumps back and forth)
curl https://raw.githubusercontent.com/maptv/setup/main/com.googlecode.iterm2.plist -o ~/Library/Preferences/com.googlecode.iterm2.plist
curl https://raw.githubusercontent.com/maptv/setup/main/iterm.json -o ~/iterm.json
In iterm2, set Profiles > General > Command > Send text at start: tmux attach || tmux new ; split-window -v ; select-pane -t :.+
curl https://raw.githubusercontent.com/maptv/setup/main/karabiner.json -o ~/.config/karabiner/karabiner.json --create-dirs
Change caps_lock to control if pressed with other keys, to escape if pressed alone. (from Change caps_lock key (rev 4))
Change return to control if pressed with other keys, to return if pressed alone (from Change return to control)
brew link --overwrite emacs
mkdir -p ~/.vim/undodir
mkdir -p ~/.local/share/nvim/undo
Install fzf key bindings and fuzzy completion using the install script which runs the commented out code below
$(brew --prefix)/opt/fzf/install --completion --key-bindings --no-fish --no-update-rc
curl https://raw.githubusercontent.com/maptv/setup/main/.bash_profile -o ~/.bash_profile
curl https://raw.githubusercontent.com/maptv/setup/main/.inputrc -o ~/.inputrc
curl https://raw.githubusercontent.com/maptv/setup/main/.zshrc -o ~/.zshrc
curl https://raw.githubusercontent.com/maptv/setup/main/.p10k.zsh -o ~/.p10k.zsh
curl https://raw.githubusercontent.com/maptv/setup/main/.gitconfig -o ~/.gitconfig
curl https://gist.githubusercontent.com/tekin/12500956bd56784728e490d8cef9cb81/raw/e474af61231687b0e1a4ec59d4becd97537ef6c0/.gitattributes -o ~/.gitattributes
curl https://raw.githubusercontent.com/maptv/setup/main/.gitignore -o ~/.gitignore
curl https://raw.githubusercontent.com/maptv/setup/main/.vimrc -o ~/.vimrc
curl https://raw.githubusercontent.com/maptv/setup/main/all.snippets -o ~/.config/coc/ultisnips/all.snippets --create-dirs
curl https://raw.githubusercontent.com/maptv/setup/main/init.vim -o ~/.config/nvim/init.vim --create-dirs
curl https://raw.githubusercontent.com/jalvesaq/Nvim-R/master/R/tmux_split.vim -o ~/tmux_split.vim
curl https://raw.githubusercontent.com/maptv/setup/main/ginit.vim -o ~/.config/nvim/ginit.vim --create-dirs
curl https://raw.githubusercontent.com/maptv/setup/main/coc-settings.json -o ~/.config/nvim/coc-settings.json --create-dirs
curl https://raw.githubusercontent.com/maptv/setup/main/coc-settings.json -o ~/.vim/coc-settings.json --create-dirs
git clone https://github.com/SpaceVim/SpaceVim.git ~/.SpaceVim
curl https://raw.githubusercontent.com/py4ds/setup/master/spacevim/init.toml -o ~/.SpaceVim.d/init.toml --create-dirs
curl https://raw.githubusercontent.com/py4ds/setup/master/spacevim/myspacevim.vim -o ~/.SpaceVim.d/autoload/myspacevim.vim --create-dirs
yes y | bash <(curl -s https://raw.githubusercontent.com/lunarvim/lunarvim/master/utils/installer/install.sh)
curl https://raw.githubusercontent.com/maptv/setup/main/config.lua -o ~/.config/lvim/config.lua --create-dirs
curl https://raw.githubusercontent.com/maptv/setup/main/.ideavimrc -o ~/.ideavimrc
git clone https://github.com/syl20bnr/spacemacs ~/spacemacs
curl https://raw.githubusercontent.com/maptv/setup/main/.spacemacs -o ~/.spacemacs
rm -rf ~/.emacs.d
git clone --depth 1 https://github.com/hlissner/doom-emacs ~/.emacs.d
curl https://raw.githubusercontent.com/maptv/setup/main/config.el -o ~/.config/doom/config.el
curl https://raw.githubusercontent.com/maptv/setup/main/packages.el -o ~/.config/doom/packages.el
curl https://raw.githubusercontent.com/gpakosz/.tmux/master/.tmux.conf -o ~/.tmux.conf
curl https://raw.githubusercontent.com/maptv/setup/main/.tmux.conf.local -o ~/.tmux.conf.local
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
curl https://raw.githubusercontent.com/maptv/setup/main/ipython_config.py -o ~/.ipython/profile_default/ipython_config.py --create-dirs
curl https://raw.githubusercontent.com/maptv/setup/main/keybindings.py -o ~/.ipython/profile_default/startup/keybindings.py --create-dirs
curl https://raw.githubusercontent.com/maptv/setup/main/config.py -o ~/Library/Application\ Support/ptpython/config.py --create-dirs
curl https://raw.githubusercontent.com/maptv/setup/main/.radian_profile -o ~/.radian_profile
ln -sf .radian_profile radian_profile.R
curl https://raw.githubusercontent.com/maptv/setup/main/bottom.toml -o ~/.config/bottom/bottom.toml --create-dirs
curl https://raw.githubusercontent.com/maptv/setup/main/tabnine_config.json -o ~/.config/TabNine/tabnine_config.json --create-dirs
$(brew --prefix)/Caskroom/mambaforge/base/bin/mamba install -yc conda-forge python neovim
$(brew --prefix)/Caskroom/mambaforge/base/bin/mamba create -yc conda-forge -n py python joblib jupyterlab seaborn neovim numpy pandas scikit-learn jupyterlab_vim scipy
$(brew --prefix)/Caskroom/mambaforge/base/envs/py/bin/python -m pip install jupyterlab-quarto
$(brew --prefix)/Caskroom/mambaforge/base/bin/mamba create -yc conda-forge -n r r-essentials r-tidyverse r-irkernel python neovim jupyterlab jupyterlab_vim r-quarto
$(brew --prefix)/Caskroom/mambaforge/base/envs/r/bin/python -m pip install jupyterlab-quarto
curl https://raw.githubusercontent.com/maptv/setup/main/shortcuts.jupyterlab-settings -o ~/.jupyter/lab/user-settings/@jupyterlab/shortcuts-extension/shortcuts.jupyterlab-settings --create-dirs
curl https://raw.githubusercontent.com/maptv/setup/main/vimrc.jupyterlab-settings -o ~/.jupyter/lab/user-settings/jupyterlab-vimrc/vimrc.jupyterlab-settings --create-dirs
curl https://raw.githubusercontent.com/maptv/setup/main/settings.zip -o ~/settings.zip
Sync settings from https://github.com/marskar/PyCharm
Using Cmd Shift A
or going to View > Appearance at the Top, enable Details in Tree Views, disable Tool Windows Bars and Navigation Bar
In MacOS System Preferences: Keyboard > Shortcuts > Services, uncheck Open man Page in Terminal (Cmd Shift M
) and Search man Page Index in Terminal (Cmd Shift A
)
In MacOS System Preferences: Keyboard > Shortcuts > Keyboard, uncheck Turn keyboard access on and off after making sure all of the other shortcuts are enabled
In MacOS System Preferences: Keyboard > Shortcuts > Keyboard, change ctrl function shortcuts to ctrl num shortcuts:
In Editor > Font, select Ewka Nerd Font size 16 as main and Jetbrains Mono as fallback and Enable font ligatures
If you use the Deep Ocean Editor theme from the Material UI plugin, change docstring (Doc comment > Text) color to 4cbb17
aka kelly green and line comment color to DF00FF
aka psychedelic purple under Editor > Color Scheme > Python and Editor > Color Scheme > Language Defaults, respectively
In Build, Execution, Deployment > Console, select Use existing console for "Run with Python Console"
Install IdeaVim plugin
Install BashSupport plugin
Install Markdown plugin
Install R Language Support plugin
When setting run configurations (Ctrl Alt r
), set working directory to project root under Environment and deselect Run with Python Console under Execution
curl https://raw.githubusercontent.com/maptv/setup/main/rstudio-prefs.json -o ~/.config/rstudio/rstudio-prefs.json --create-dirs
curl https://raw.githubusercontent.com/maptv/setup/main/editor_bindings.json -o ~/.config/rstudio/keybindings/editor_bindings.json --create-dirs
curl https://raw.githubusercontent.com/maptv/setup/main/rstudio_bindings.json -o ~/.config/rstudio/keybindings/rstudio_bindings.json --create-dirs
$(brew --prefix)/bin/mamba init zsh
curl https://raw.githubusercontent.com/maptv/setup/main/settings.json -o ~/Library/Application\ Support/Code/User/settings.json --create-dirs
curl https://raw.githubusercontent.com/maptv/setup/main/settings.json -o ~/Library/Application\ Support/VSCodium/User/settings.json --create-dirs
curl https://raw.githubusercontent.com/maptv/setup/main/keybindings.json -o ~/Library/Application\ Support/Code/User/keybindings.json --create-dirs
curl https://raw.githubusercontent.com/maptv/setup/main/keybindings.json -o ~/Library/Application\ Support/VSCodium/User/keybindings.json --create-dirs
$(brew --prefix)/bin/codium --install-extension asvetliakov.vscode-neovim
$(brew --prefix)/bin/codium --install-extension ms-python.python
$(brew --prefix)/bin/codium --install-extension ms-toolsai.jupyter
$(brew --prefix)/bin/codium --install-extension ms-toolsai.jupyter-keymap
$(brew --prefix)/bin/codium --install-extension ms-toolsai.jupyter-renderers
$(brew --prefix)/bin/codium --install-extension ms-toolsai.vscode-jupyter-cell-tags
$(brew --prefix)/bin/codium --install-extension ms-toolsai.vscode-jupyter-slideshow
$(brew --prefix)/bin/codium --install-extension quarto.quarto
$(brew --prefix)/bin/codium --install-extension REditorSupport.r
$(brew --prefix)/bin/codium --install-extension TabNine.tabnine-vscode
$(brew --prefix)/bin/code --install-extension asvetliakov.vscode-neovim
$(brew --prefix)/bin/code --install-extension ms-python.black-formatter
$(brew --prefix)/bin/code --install-extension ms-python.python
$(brew --prefix)/bin/code --install-extension ms-python.vscode-pylance
$(brew --prefix)/bin/code --install-extension ms-toolsai.jupyter
$(brew --prefix)/bin/code --install-extension ms-toolsai.jupyter-keymap
$(brew --prefix)/bin/code --install-extension ms-toolsai.jupyter-renderers
$(brew --prefix)/bin/code --install-extension ms-toolsai.vscode-jupyter-cell-tags
$(brew --prefix)/bin/code --install-extension ms-toolsai.vscode-jupyter-slideshow
$(brew --prefix)/bin/code --install-extension quarto.quarto
$(brew --prefix)/bin/code --install-extension REditorSupport.r
$(brew --prefix)/bin/code --install-extension TabNine.tabnine-vscode