zhuochun / dotfiles

🌱 My dotfiles and scripts

Home Page:https://github.com/zhuochun/dotfiles

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Zhuochun's dotfiles

A set of files across Mac and Windows.

Table of Contents (click to expand)

Mac Setup

System Preferences

  • Trackpad -> Enable Tap to click.
  • Accessibility -> Pointer Control -> Trackpad Options -> Enable dragging Three finger dragging.
  • Dock -> Position Left, Enable Automatically hide and show and Minimise windows into application icon, Disable Show recent applications in Dock.
  • Keyboard -> Keyboard
    • Fastest Key Repeat, Shortest Delay, Enable Standard function keys.
    • Modifier Keys... -> Change Caps Lock to Command key.
  • Keyboard -> Shortcuts -> Screen Shots
    • Disable "picture of screen" shortcuts.
    • Remap picture of selected area to <M-s> (File) and <M-S> (Clipboard).
  • Keyboard -> Input Sources -> Add Pinyin - Simplified.

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

Install GitHub Desktop and clone this repo (SSH Setup).

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)"

Review and install brew formulas:

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

Setup Zsh (guide):

# Check zsh PATH and whether it is in authorized shells list (/etc/shells)
which zsh
# Make zsh the default
chsh -s $(which zsh)

Setup 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
git clone https://github.com/zsh-users/zsh-completions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-completions

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

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

# Start a session
tmux new -s dev

# Reload Tmux environment to source TPM (Optional)
tmux source ~/.tmux.conf

# Press prefix (C-b) + I to install the plugins

Keyboard Enhancements

Open Karabiner and grant permissions.

Setup the rules and restart 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 layout (Mac/Win)

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).

Follow Shougo/dein.vim or Shougo/dein-installer.vim to setup the plugin system.

sh -c "$(wget -O- https://raw.githubusercontent.com/Shougo/dein-installer.vim/master/installer.sh)"

# it creates ~/.cache/dein directory

Setup vimrc files:

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

# vim
ln -s ~/dotfiles/vim/vimrc ~/.vimrc
ln -s ~/dotfiles/vim/rc ~/.vim/rc
ln -s ~/dotfiles/vim/gvimrc ~/.gvimrc

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.

Themes

Install gruvbox colorscheme for terminal.

Text Expander

Install Espanso.

ln -s ~/dotfiles/espanso/match.yml $HOME/Library/Application\ Support/espanso/match/base.yml

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

About

🌱 My dotfiles and scripts

https://github.com/zhuochun/dotfiles


Languages

Language:Vim Script 53.1%Language:Ruby 34.4%Language:Shell 6.6%Language:AutoHotkey 3.7%Language:HTML 2.2%