/.dotfiles

Primary LanguageVim Script

Keep dotfiles in git without symlinks.

This arrangement of dotfiles is based on ideas from here and here. The idea is to keep all the dotfiles in their original locations.

First time setup

git init --bare $HOME/.dotfiles
alias dot='/usr/local/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'
dot config --local status.showUntrackedFiles no
dot remote add origin git@github.com:${YOUR_GITHUB_REPOSITORY}/.dotfiles.git

You'll need to change the remote URL to your git repo. You should also add the dot alias command to your .bashrc or .zshrc. Now, you can use the dot command to do git operation from anywhere in your $HOME directory:

Operations (example)

cd $HOME
dot add .zshrc.conf
dot commit -m "Add .zshrc.conf"
dot push

New machine clone

To set up a new machine, clone the repo to a temporary directory. This is because you might have some default config files in your $HOME which will cause a normal clone to fail.

git clone --separate-git-dir=$HOME/.dotfiles https://github.com/olambo/.dotfiles.git tmpdotfiles
rsync --recursive --verbose --exclude '.git' tmpdotfiles/ $HOME/
rm -r tmpdotfiles

Apps used to modify keyboard mappings

Macos

Change capslock to be control key

  • esc when control pressed and immediately released

Some of the keys, remaped are listed below.

<control> j l p    -> down, right, up (all apps)
<control> ( )      -> begining or end of line (all apps)
<control> y        -> copy to system clipboard from remote machine (iTerm2 Vim)
<control> return   -> expand/contract pane (iTerm2, vscode, intellij) 
<control> spacebar -> pop list to select common applications via hotkey (all apps)