Personal MacOS setup
Trackpad settings
System Preferences -> Trackpad
:
Secondary click
: click in bottom right corner- Enable
Tap to Click
- Disable
Scroll Direction: Natural
Keyboard settings
System Preferences -> Keyboard
:
- Maximum
Key Repeat
- Maximum
Delay Until Repeat
- Enable
Use F1, F2, etc as standard
- Set
Touchbar shows
toExpanded Control Strip
CapsLock to switch languages
After High Sierra:
System Preferences -> Keyboard -> Input Sources
:- Enable
Use the CapsLock key to switch
- Enable
Before High Sierra:
Reference: stackoverflow
- Install Karabiner-elements: https://github.com/tekezo/Karabiner-Elements
- Remap CapsLock to f19
System Preferences -> Keyboard -> Key modifiers
: disable CapsLockSystem Preferences -> Keyboard -> Shortcuts -> Input Sources
: press CapsLock to change languages
Disable bouncing of icons in Dock
defaults write com.apple.dock no-bouncing -bool True
killall Dock
Reference: dicussions.apple.com
Configs
.ssh/config
Host dev # alias name
HostName <full host name>
User <user name>
.vimrc
git clone https://github.com/pankdm/configs.git
ln -s configs/.vimrc ~/.vimrc
.gitconfig
git clone https://github.com/pankdm/configs.git
ln -s configs/.gitconfig ~/.gitconfig
.bash_profile
if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi
To avoid confusion, consolidate everything in .bashrc
.
.bashrc
export CLICOLOR=1 # enable colored `ls`
Install brew
See http://brew.sh
Install mosh
brew install mosh
Install powerline
Reference:
- https://powerline.readthedocs.io/en/latest/installation.html
- http://khanh-ng.blogspot.com/2015/02/install-powerline-for-mac-os-x.html
pip install --user git+git://github.com/powerline/powerline
# find installed path
pip show powerline-status
# it will be something like
# /Users/${USER}/Library/Python/2.7/lib/python/site-packages
# pip installation is missing scripts so we need to copy them manually
POWERLINE_PATH=~/Library/Python/2.7/lib/python/site-packages/
git clone https://github.com/powerline/powerline.git
cp -r powerline/powerline/ $POWERLINE_PATH/powerline
cp -r powerline/scripts/ $POWERLINE_PATH/scripts
# create directory with configs
mkdir -p ~/.config/powerline
cp -r ./powerline/powerline/config_files/ .config/powerline/
Enable powerline for bash by adding the following line to ~/.bashrc
:
POWERLINE_PATH=~/Library/Python/2.7/lib/python/site-packages/
source $POWERLINE_PATH/powerline/bindings/bash/powerline.sh
Customize powerline config. In .config/powerline/config.json
switch to default_leftonly
theme.
Then in .config/powerline/themes/shell/default_leftonly.json
add time field:
{
"function": "powerline.segments.common.time.date",
"args": {
"istime": true,
"format": "%X"
}
},
Finally, install special symbols as fallback font. Reference:
- https://powerline.readthedocs.io/en/latest/installation.html#fonts-installation
- https://gitlab.com/zerustech/font-fallbacks-tutorial
pankdm.github.io
Install jekyll and dependencies:
gem install --user-install bundler jekyll redcarpet pygments.rb
Reference:
VSCode
- Multi-tab rows
"workbench.editor.wrapTabs": true
Before 1.53 version update:
Install Custom CSS Extension
Then reload the app:
sudo chown -R $(whoami) "/Applications/Visual Studio Code.app/Contents/MacOS/Electron"
Then Cmd + Shift + P
-> Reload Custom CSS
-> Restart
- Switch tabs with cmd-number:
In Preferences -> Keyboard ShortCuts
:
{ "key": "cmd+1","command": "workbench.action.openEditorAtIndex1" },
{ "key": "cmd+2","command": "workbench.action.openEditorAtIndex2" },
{ "key": "cmd+3","command": "workbench.action.openEditorAtIndex3" },
{ "key": "cmd+4","command": "workbench.action.openEditorAtIndex4" },
{ "key": "cmd+5","command": "workbench.action.openEditorAtIndex5" },
{ "key": "cmd+6","command": "workbench.action.openEditorAtIndex6" },
{ "key": "cmd+7","command": "workbench.action.openEditorAtIndex7" },
{ "key": "cmd+8","command": "workbench.action.openEditorAtIndex8" },
{ "key": "cmd+9","command": "workbench.action.openEditorAtIndex9" }
https://stackoverflow.com/questions/39245966/vs-code-possible-to-switch-tabs-files-with-cmdnumbers
- Add additional file associations:
In settings.json
:
"files.associations": {
"*requirements.3.in": "pip-requirements",
"*requirements.3.txt": "pip-requirements"
}
Iterm
Set keymaps
Tabs navigation:
Cmd + Option + Left
-> Previous TabCmd + Option + Right
-> Next Tab
Line navigation:
Cmd + Left
-> Send Hex Code ->0x01
(beginning of the line)Cmd + Right
-> Send Hex Code ->0x05
(end of line)