This repository includes all of my opinionated configuration.
Assume that you already installed homebrew, git, zsh, rbenv, nvm, neovim, and tmux.
Clone this project at $HOME
:
git clone git@github.com:huyvohcmc/dotfiles.git
cd dotfiles
Use Homebrew to install some necessary packages defined in Brewfile
:
brew bundle
Create a backup of your existing dotfiles, remove them in $HOME
and install the new ones using stow:
make stow
To remove dotfiles:
make unstow
Install minpac, then open nvim
and install all plugins with :PackUpdate
. You should also run :checkhealth
to check your nvim condition.
Install Tmux plugin manager and press prefix
+ I
inside a tmux
session to fetch the plugins listed in .tmux.conf
.
To prevent people from accidentally committing under your name:
# ~/.gitconfig
[include]
path = ~/.gitconfig.local
Where ~/.gitconfig.local
is simply:
[user]
name = <your_name>
email = <your_email>
I also use a .gitmessage
template for co-authored commits on GitHub:
# ~/.gitmessage
Co-authored-by: Linus Torvalds <torvalds@transmeta.com>
# ~/.gitconfig
[commit]
verbose = true
template = ~/.gitmessage
I use Zplugin to manage Zsh plugins. The file .zshrc
will automatically install Zplugin if it's not installed and then load the plugins. I use a customized version of the theme Zeit. The only difference between them is my version doesn't contain any Oh-My-Zsh
functions.
$ for i in $(seq 1 10); do /usr/bin/time /bin/zsh -i -c exit; done
0.14 real 0.09 user 0.04 sys
0.14 real 0.09 user 0.04 sys
0.14 real 0.09 user 0.04 sys
0.14 real 0.09 user 0.04 sys
0.14 real 0.09 user 0.04 sys
0.14 real 0.09 user 0.04 sys
0.14 real 0.09 user 0.04 sys
0.14 real 0.09 user 0.04 sys
0.14 real 0.09 user 0.04 sys
0.14 real 0.09 user 0.04 sys
This can be achieved thanks to the lazy-loading mechanism applied to virtual environment loaders like Rbenv
and Nvm
:
# Rbenv
if [[ -s ~/.rbenv/shims/ruby ]]; then
PATH=$HOME/.rbenv/shims:$PATH
fi
rbenv() {
eval "$(command rbenv init - --no-rehash)"
rbenv "$@"
}
# Nvm
export NVM_DIR=$HOME/.nvm
if [ -f $HOME/.nvm/alias/default ]; then
PATH=${PATH}:${HOME}/.nvm/versions/node/v$(cat ~/.nvm/alias/default)/bin
fi
nvm() {
[ -s $NVM_DIR/nvm.sh ] && source $NVM_DIR/nvm.sh
nvm "$@"
}
Iosevka is one of the best font for programmers, it looks so good to the eye and supports ligatures. It also has many prebuilt variants, and if you build yourself you can customize the look of many different characters. Here is how I built an Iosevka version for my own:
- Clone the repository
- Ensure
nodejs
>= 8.4,ttfautohint
andotfcc
are installed - Install necessary libs by
npm install
npm run build -- contents::iosevka
(ornpm run build -- contents::iosevka-term
for term version)
Visit Iosevka's main repo for more build instructions.
and some other dotfiles on the internet.
This repository is available under the MIT license. Feel free to fork and modify the dotfiles as you please.