curl -s https://raw.githubusercontent.com/NishantBharali/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 Command key is used for MacOS keyboard shortcuts, limiting conflicts with Unix shortcuts that use Alt/Option or Control.
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?
curl https://raw.githubusercontent.com/NishantBharali/setup/main/macos.terminal -o ~/macos.terminal
sudo -v
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
echo A | softwareupdate --install-rosetta
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.notificationcenterui bannerTime 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 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/NishantBharali/setup/main/undead.icns -o /Library/Keyboard\ Layouts/undead.icns
sudo curl https://raw.githubusercontent.com/NishantBharali/setup/main/undead.keylayout -o /Library/Keyboard\ Layouts/undead.layout
curl https://raw.githubusercontent.com/NishantBharali/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 "$(/opt/homebrew/bin/brew shellenv)"') >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
git config --global user.email 13444106+NishantBharali@users.noreply.github.com
curl https://raw.githubusercontent.com/NishantBharali/setup/main/Brewfile -o ~/.Brewfile
if brew bundle install --file ~/.Brewfile; then echo brew install OK; fi
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\tIdentityFile ~/.ssh/$(whoami)_$model" >> ~/.ssh/config
git clone --depth 1 https://github.com/NishantBharali/ewka ~/NishantBharali/ewka
cp ~/NishantBharali/ewka/nerd/* ~/Library/Fonts
duti -s com.qvacua.VimR txt all
duti -s org.jupyter.jupyterlab-desktop ipynb all
curl https://raw.githubusercontent.com/NishantBharali/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/NishantBharali/setup/main/MiroWindowsManager.lua -o ~/.hammerspoon/Spoons/MiroWindowsManager.spoon/init.lua --create-dirs
curl https://raw.githubusercontent.com/NishantBharali/setup/main/alacritty.yml -o ~/.config/alacritty/alacritty.yml --create-dirs
curl https://raw.githubusercontent.com/NishantBharali/setup/main/kitty.conf -o ~/.config/kitty/kitty.conf --create-dirs
curl https://raw.githubusercontent.com/NishantBharali/setup/main/.hyper.js -o ~/.hyper.js --create-dirs
curl https://raw.githubusercontent.com/NishantBharali/setup/main/config.yaml -o ~/Library/Application\ Support/tabby/config.yaml --create-dirs
curl https://raw.githubusercontent.com/NishantBharali/setup/main/com.googlecode.iterm2.plist -o ~/Library/Preferences/com.googlecode.iterm2.plist
curl https://raw.githubusercontent.com/NishantBharali/setup/main/karabiner.json -o ~/.config/karabiner/karabiner.json --create-dirs
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
/opt/homebrew/opt/fzf/install --completion --key-bindings --no-fish --no-update-rc
curl https://raw.githubusercontent.com/NishantBharali/setup/main/.bash_profile -o ~/.bash_profile
curl https://raw.githubusercontent.com/NishantBharali/setup/main/.inputrc -o ~/.inputrc
curl https://raw.githubusercontent.com/NishantBharali/setup/main/.zshrc -o ~/.zshrc
curl https://raw.githubusercontent.com/NishantBharali/setup/main/.p10k.zsh -o ~/.p10k.zsh
curl https://raw.githubusercontent.com/NishantBharali/setup/main/.gitconfig -o ~/.gitconfig
curl https://gist.githubusercontent.com/tekin/12500956bd56784728e490d8cef9cb81/raw/e474af61231687b0e1a4ec59d4becd97537ef6c0/.gitattributes -o ~/.gitattributes
curl https://raw.githubusercontent.com/NishantBharali/setup/main/.gitignore -o ~/.gitignore
curl https://raw.githubusercontent.com/NishantBharali/setup/main/.vimrc -o ~/.vimrc
curl https://raw.githubusercontent.com/NishantBharali/setup/main/all.snippets -o ~/.config/coc/ultisnips/all.snippets --create-dirs
curl https://raw.githubusercontent.com/NishantBharali/setup/main/init.vim -o ~/.config/nvim/init.vim --create-dirs
curl https://raw.githubusercontent.com/NishantBharali/setup/main/init.vim -o ~/.config/page/init.vim --create-dirs
echo 'let g:better_whitespace_enabled=0' >> ~/.config/page/init.vim
curl https://raw.githubusercontent.com/NishantBharali/setup/main/ginit.vim -o ~/.config/nvim/ginit.vim --create-dirs
curl https://raw.githubusercontent.com/NishantBharali/setup/main/coc-settings.json -o ~/.config/nvim/coc-settings.json --create-dirs
curl https://raw.githubusercontent.com/NishantBharali/setup/main/coc-settings.json -o ~/.vim/coc-settings.json --create-dirs
git clone --depth 1 https://github.com/SpaceVim/SpaceVim.git ~/.SpaceVim
curl https://raw.githubusercontent.com/NishantBharali/setup/main/spacevim/init.toml -o ~/.SpaceVim.d/init.toml --create-dirs
curl https://raw.githubusercontent.com/NishantBharali/setup/main/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/NishantBharali/setup/main/config.lua -o ~/.config/lvim/config.lua --create-dirs
curl https://raw.githubusercontent.com/NishantBharali/setup/main/zed.json -o ~/.config/zed/settings.json --create-dirs
curl https://raw.githubusercontent.com/NishantBharali/setup/main/.ideavimrc -o ~/.ideavimrc
curl https://raw.githubusercontent.com/gpakosz/.tmux/master/.tmux.conf -o ~/.tmux.conf
curl https://raw.githubusercontent.com/NishantBharali/setup/main/.tmux.conf.local -o ~/.tmux.conf.local
git clone --depth 1 https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
curl https://raw.githubusercontent.com/NishantBharali/setup/main/ipython_config.py -o ~/.ipython/profile_default/ipython_config.py --create-dirs
curl https://raw.githubusercontent.com/NishantBharali/setup/main/keybindings.py -o ~/.ipython/profile_default/startup/keybindings.py --create-dirs
curl https://raw.githubusercontent.com/NishantBharali/setup/main/config.py -o ~/Library/Application\ Support/ptpython/config.py --create-dirs
curl https://raw.githubusercontent.com/NishantBharali/setup/main/.radian_profile -o ~/.radian_profile
ln -sf .radian_profile radian_profile.R
curl https://raw.githubusercontent.com/NishantBharali/setup/main/bottom.toml -o ~/.config/bottom/bottom.toml --create-dirs
curl https://raw.githubusercontent.com/NishantBharali/setup/main/tabnine_config.json -o ~/.config/TabNine/tabnine_config.json --create-dirs
/opt/homebrew/Caskroom/mambaforge/base/bin/mamba install -yc conda-forge python neovim
/opt/homebrew/Caskroom/mambaforge/base/bin/mamba create -yc conda-forge -n py python neovim jupyterlab jupyterlab_vim jupyter-cache joblib seaborn numpy pandas scikit-learn scipy
/opt/homebrew/Caskroom/mambaforge/base/envs/py/bin/python -m pip install jupyterlab-quarto radian
curl https://raw.githubusercontent.com/NishantBharali/setup/main/shortcuts.jupyterlab-settings -o ~/.jupyter/lab/user-settings/@jupyterlab/shortcuts-extension/shortcuts.jupyterlab-settings --create-dirs
curl https://raw.githubusercontent.com/NishantBharali/setup/main/vimrc.jupyterlab-settings -o ~/.jupyter/lab/user-settings/jupyterlab-vimrc/vimrc.jupyterlab-settings --create-dirs
curl https://raw.githubusercontent.com/NishantBharali/setup/main/settings.zip -o ~/settings.zip
curl https://raw.githubusercontent.com/NishantBharali/setup/main/rstudio-prefs.json -o ~/.config/rstudio/rstudio-prefs.json --create-dirs
curl https://raw.githubusercontent.com/NishantBharali/setup/main/editor_bindings.json -o ~/.config/rstudio/keybindings/editor_bindings.json --create-dirs
curl https://raw.githubusercontent.com/NishantBharali/setup/main/rstudio_bindings.json -o ~/.config/rstudio/keybindings/rstudio_bindings.json --create-dirs
/opt/homebrew/bin/mamba init zsh
curl https://raw.githubusercontent.com/NishantBharali/setup/main/settings.json -o ~/Library/Application\ Support/Code/User/settings.json --create-dirs
curl https://raw.githubusercontent.com/NishantBharali/setup/main/settings.json -o ~/Library/Application\ Support/VSCodium/User/settings.json --create-dirs
curl https://raw.githubusercontent.com/NishantBharali/setup/main/keybindings.json -o ~/Library/Application\ Support/Code/User/keybindings.json --create-dirs
curl https://raw.githubusercontent.com/NishantBharali/setup/main/keybindings.json -o ~/Library/Application\ Support/VSCodium/User/keybindings.json --create-dirs
rm -rf ~/.emacs.d
git clone --depth 1 https://github.com/syl20bnr/spacemacs ~/.emacs.d
curl https://raw.githubusercontent.com/NishantBharali/setup/main/.spacemacs -o ~/.spacemacs
/opt/homebrew/bin/emacs --no-window-system --daemon --no-init-file --load ~/.emacs.d/init.el
export DOOMDIR=$HOME/.config/doom
git clone --depth 1 https://github.com/hlissner/doom-emacs ~/.config/emacs/
curl https://raw.githubusercontent.com/NishantBharali/setup/main/config.el -o ~/.config/doom/config.el --create-dirs
curl https://raw.githubusercontent.com/NishantBharali/setup/main/packages.el -o ~/.config/doom/packages.el
if yes y | ~/.config/emacs/bin/doom install; then echo doom install OK; fi
git clone --depth 1 https://github.com/whjvenyl/fasd.git whjvenyl/fasd && cd whjvenyl/fasd && sudo make install && cd
~/.config/emacs/bin/doom sync
Install R from https://cran.r-project.org/bin/macosx/
Rscript -e "install.packages('IRkernel', repos='https://cran.rstudio.com'); IRkernel::installspec()"
Add ssh key to GitHub by running gh auth login (alias: hai) and selecting SSH as my preferred protocol for Git operations
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)
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)
SurfingKeys extension with settings loaded from https://raw.githubusercontent.com/NishantBharali/setup/main/surfingkeys.js
Vimium extension with settings restored from https://raw.githubusercontent.com/NishantBharali/setup/main/vimium-options.json
Click "Arrange..." and Arrange the monitors so that the main monitor and the MacBook monitor line up with the dual link dual monitors
Move the white band from the top of MacBook monitor to the main monitor, the monitor order should now be:
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
The com.googlecode.iterm2.plist file makes it unnecessary to load iterm.json, which includes the settings below
curl https://raw.githubusercontent.com/NishantBharali/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 :.+
touch ~/bibliography.bib