🌱 My dotfiles and scripts
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin
eclipse
git
mac
rime
scripts
vim
windows
.gitignore
README.md
ackrc
agignore
bash_profile
ctags
fzfrc
gemrc
irbrc
pryrc
railsrc
rspec
tmux-osx.conf
tmux-theme.conf
tmux.conf
zshenv
zshrc

README.md

Zhuochun's dotfiles

A set of files across Mac and Windows.

Table of Contents (click to expand)

Mac Setup

System Preferences

  • Dock -> Position Left, Enable Automatically hide and show.
  • Keyboard -> Keyboard -> Fastest Key Repeat, Shortest Delay, Enable Standard function keys.
  • Keyboard -> Keyboard -> Change Caps Lock to Command key.
  • Keyboard -> Shortcuts -> Screen Shots -> Disable picture of screen, Remap picture of selected area to <M-s> (File) and <M-S> (Clipboard).
  • Keyboard -> Input Sources -> Add Pinyin - Simplified.
  • Trackpad -> Enable Tap to click.
  • Accessibility -> Mouse & Trackpad -> Trackpad Options -> Enable dragging Three finger dragging.

Other preferences:

# Disable "press and hold" option
defaults write -g ApplePressAndHoldEnabled -bool false
# Display all file extensions in Finder
defaults write NSGlobalDomain AppleShowAllExtensions -bool true

Applications

git clone git@github.com:zhuochun/dotfiles.git ~/dotfiles

Install Homebrew:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

brew bundle install --file=~/dotfiles/scripts/Brewfile

Setup Zsh (guide) and oh-my-zsh:

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

ln -s ~/dotfiles/zshrc ~/.zshrc
ln -s ~/dotfiles/zshenv ~/.zshenv

touch ~/.localrc
touch ~/.localenv

Setup Tmux and Tmux-Plugins:

git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm

tmux new -s dev

ln -s ~/dotfiles/tmux.conf ~/.tmux.conf
ln -s ~/dotfiles/tmux-osx.conf ~/.tmux-osx.conf
ln -s ~/dotfiles/tmux-theme.conf ~/.tmux-theme.conf

# Reload Tmux environment to source TPM
# After source, Press prefix + I to install the plugins
tmux source ~/.tmux.conf

Keyboard Enhancements

Setup Karabiner:

cp ~/dotfiles/mac/karabiner.json ~/.config/karabiner/karabiner.json

To customise rules:

ln -s ~/dotfiles/mac/karabiner-rules ~/.config/karabiner/assets/complex_modifications

Refer to zhuochun/mac-keyboard and Ergodox-EZ/zhuochun.

Vim

Both my Mac/Windows use similar key mappings. For muscle memories, <D-*> mappings on Mac are <M-*> mappings on Windows.

  • Mac OS: Use vimrc with brew install neovim.
  • Windows: Use windows/_vimrc (Not actively updated).

Setup Shougo/dein.vim for plugins:

curl https://raw.githubusercontent.com/Shougo/dein.vim/master/bin/installer.sh > installer.sh
# Set `~/.vim/bundles` as installation directory
sh ./installer.sh ~/.vim/bundles

Setup vimrc configs:

ln -s ~/dotfiles/vim/rc ~/.vim/rc
# vim
ln -s ~/dotfiles/vim/vimrc ~/.vimrc
ln -s ~/dotfiles/vim/gvimrc ~/.gvimrc
# neovim
ln -s ~/dotfiles/vim/vimrc ~/.config/nvim/init.vim

Open vim and install plugins: :call dein#install().

Windows Setup

AutoHotkey

I use AutoHotkey in Windows to enhance productivity.

Refer to windows/AutoHotkey.ahk.

Others

Custom Scripts

Some useful/interesting scripts are under /bin, e.g. rename PDFs.

echo 'export PATH="$HOME/dotfiles/bin:$PATH"' >> ~/.zshrc

Fonts

Install Powerline Fonts.

Rime

Rime is a powerful Chinese Input Method Engine.

  • Use Ctrl + ~ to adjust Traditional/Simplified Chinese.
ln -s ~/dotfiles/rime/squirrel.custom.yaml ~/Library/Rime/squirrel.custom.yaml

Atom

  • Install Atom Plugins: apm install markdown-writer