Weichu's yak-shaving dotfiles
# Clone git to ~/work/dots
$ cd ~
$ mkdir work
$ ( cd work && git clone https://github.com/weichuliu/dots.git )
# Link files to homedir
$ for dotfile in bash_profile \
gitconfig \
gitignore_global \
inputrc \
gemrc \
vimrc \
curlrc ; do
ln -s ~/work/dots/${dotfile} ~/.${dotfile}
done
unset dotfile
# Set git user
$ git config --global user.name #<user.name>
$ git config --global user.email #<user.email>
This repository works with iTerm2
+ bash 4.x
environment
bash 4.x
should be installed by Homebrew
and be set as default login shell:
brew install bash
- iTerm2:
Profiles -> General -> Command -> Commands
set to/usr/local/bin/bash --login
The inputrc
works with iTerm2
's xterm
Key Mappings:
- iTerm2:
Profiles -> Keys -> Load Preset...
selectxterm with Numeric Keypad
/path/to/dots/bin
is appended to PATH
to use some homemade handy commands:
google
: quick google/I_am_feeling_lucky from terminal. Runalias | grep google
to see somegoogle
shortcutsshelloverflow
: aliases assoso
, is ahow2
/socli
ish command (but much nicer) by@weichuliu
. Prints highlighted stackoverflow solution on terminal. Perfect for stackoverflow oriented programming- This requires some additional python libraries you need to manually install with
pip3
- This requires some additional python libraries you need to manually install with
iterm2_shell_integration
is automatically loaded from dots
directory, for convenience
There are two convenient keybindings:
C-x c
will copy the current command line buffer into pasteboard.C-x p
will auto join current pasteboard and insert to command line buffer.C-x e
will expand the current command into its result, similar to built-inCtrl-Alt-e
The bash-completion@2
claims to be a faster and better debian bash-completion
and this repository supports it. To use bash-completion@2
, just brew uninstall bash-completion; brew install bash-completion@2
Dotfiles
expects you use pyenv
/rbenv
to manage Python
/Ruby
versions. They are installed by Homebrew
, while actual Python
/Ruby
packages/libraries should be installed and managed manually using these two commands
If you are using ipython
and find Option(Alt) + Up/Down/Left/Right
throwing [1;9A
ish code, do the following:
dots $ ln -s "$(pwd)/ipython_startup_keybindings.py" ~/.ipython/profile_default/startup/
to have ipython correctly bind the sequence to word jump / history search
I tended not to use GNU tools e.g. coreutils mixed with BSD tools brought by macOS, because it may introduce confusing behaviors.
However I encountered a shocking behavior in macOS version grep
which is fixed in latest GNU version. So I decided to switch to ggrep
. GNU grep is installed by Homebrew and is aliased as grep
here.
brew_list
: Softwares I installed with Homebrewsublime-settings
: Sublime Settings (paste them in "Preference: Settings")sublime-keymap
: Sublime macOS keymap, fixesOption
key functions (paste them in "Preference: Key Bindings")ssh_config
: If you want, you can link it to ~/.ssh/configssh_config_vagrant
: linked from ~/.ssh/config.d/vagrant, to work with focal box