Perl Shell Prolog Vim script Emacs Lisp Ruby Other
Switch branches/tags
Nothing to show
Permalink
Failed to load latest commit information.
.Xresources.d Xresources, Termite, Tmux, Vim: switch to seoul256 theme May 24, 2017
.bin tmx: refactor the special cases into an associative array May 24, 2017
.config X: move `xset r rate 200 30` to X arguments `-ardelay 200 -arinterval… May 24, 2017
.emacs.d emacs: adjust the settings for Publica Jan 4, 2017
.gnupg .gnupg: create an empty directory forcing rake to link file by file Aug 9, 2016
.irssi irssi: update scripts, replace notifier May 23, 2017
.lib
.local/share/applications relay-browser.desktop: xdg-settings updated the file May 10, 2017
.tmux/plugins
.vim Xresources, Termite, Tmux, Vim: switch to seoul256 theme May 24, 2017
.vimperator vimperator/openalternate: work in progress Apr 15, 2017
.zsh sp: personal no longer kills the profile May 23, 2017
Library LaunchAgents/Lemonade: fix the path to the log file Nov 6, 2016
.Xmodmap
.Xresources
.ca-bundle.crt
.gemrc Add .gemrc disallowing ri/rdoc installs Mar 26, 2012
.gitconfig.unsecure git: alias cbw to checkout a branch named after focused i3 workspace May 23, 2017
.githelpers Commit good changes Nov 1, 2012
.gitignore
.gitignore_global remove leftover google stuff Jun 12, 2015
.gitmodules Revert "remove my good working emacs.d" Dec 15, 2016
.gvimrc
.htoprc
.irbrc Add Pry and IRB config Feb 13, 2012
.iterm2_shell_integration.zsh zsh: update iterm shell integration May 24, 2016
.lesskey lesskey: add --no-init so less does not clear the screen May 15, 2017
.mostrc most: G for eob (end of buffer), k for find_next May 10, 2017
.nvim add nvim RC files Sep 28, 2015
.nvimrc
.osx osx: import Divvy's shortcuts Nov 9, 2016
.pryrc Add Pry and IRB config Feb 13, 2012
.sleep no longer running offlineimap myself Oct 28, 2015
.surfingkeys.js.erb
.synergy.conf
.taskrc task: add contexts home/publica May 10, 2017
.tmux.conf
.tmxrc tmx: add kalbasit/docker-images to the project list May 23, 2017
.todorc Initial import. Jan 17, 2011
.vimperatorrc
.vimrc Xresources, Termite, Tmux, Vim: switch to seoul256 theme May 24, 2017
.vrapperrc vrapper: add keybindings for vrapper Nov 6, 2016
.wakeup no longer running offlineimap myself Oct 28, 2015
.xbaserc X: move `xset b off` to X arguments `-f 0` May 24, 2017
.xinitrc
.xprofile
.xserverrc X: move `xset b off` to X arguments `-f 0` May 24, 2017
.zshrc
Brewfile Brewfile: install league-of-legends game Apr 15, 2017
README.md README: add instructions for computer naming May 23, 2016
Rakefile

README.md

Table of Contents

Kalbasit's dotfiles

Screenshot of my shell

Installation

Warning: If you want to give these dotfiles a try, you should first fork this repository, review the code, and remove things you don’t want or need. Don’t blindly use my settings unless you know what that entails. Use at your own risk!

You can clone the repository wherever you want, however the path should not include any spaces. I like to keep it in ~/.dotfiles. For the rest of the tutorial, we are going to refer to the clone dotfiles under the path ~/.dotfiles.

First installation

Before installing the dotfiles, you should rename the computer to your liking. sed -e 's:crator:mycomputer:g' -i ~/.dotfiles/.osx

On the first installation, you should run rake init which will:

  • Initialize OSX, only if ran on OSX. Thanks to @mathiasbynens for the idea!
    • Make sure to read over .osx and modify it to your liking.
    • The OSX script will:
      • Install XCode CLI.
      • Install rbenv, installs the latest ruby version and installs bundler and git-smart.
      • Install homebrew, homebrew-bundle and run brew bundle which will install everything mentioned in Brewfile.
      • Run ~/.dotfiles/.private/.osx if it exists. This allows you to add any extra setup steps that are private. I use this file to insert Divvy's License and add custom search domains to all interfaces.
  • Update submodules.
  • Switch to ZSH.
  • Link everything from ~/.dotfiles to the home directory.
  • Link everything from ~/.dotfiles/.private if it exists, this is the perfect place for you to keep private things. See Keeping things private private for more information.
  • Install all of Vim plugins, as specified in .vimrc
  • Install Go binaries, as specified in Rakefile

Subsequent linking

When adding a new file to the dotfiles, run rake to link any newly added file.

Keeping private things private

The dotfiles are not really the place for your private things. But it does fully support a .private sub-folder which you can track in any way you want. This is folder to keep your ~/.ssh and your ~/.gnupg.

Screenshot of .private

ZSH personal/work profiles

My dotfiles provides support for personal and work profiles. It allows me to separate personal from work (work being one or more profiles).

The personal profile is loaded by default, it's everything you include in your regular ~/.dotfiles.

Profiles live under ~/.zsh/profiles, it is advised to keep those under your private repository, ~/.dotfiles/.private/.zsh/profiles and let rake manage the linking.

Profile

A profile is defined by two functions:

  • pactivate() is called when the profile is activated. You can add alias, export variables or do anything possible from inside a ZSH function.
  • pdeactivate() is called when the profile is deactivated (or switched off). You should basically undo anything done in pactivate() above.

Example: ~/.dotfiles/.private/.zsh/profiles/dailymotion.zsh:

function pactivate() {
  alias dev='ssh -A dev'

  if [[ -x `which docker-machine 2>/dev/null` ]]; then
    export DMX_EVE_URL="//${DOCKER_MACHINE_DEV_IP}:1234"
    export DMX_JWT_SECRET="some-long-big-secret"
    export DMX_API_URL="//${DOCKER_MACHINE_DEV_IP}:5678"
  fi

  export AWS_CLI_PROFILE=dmx
  export AWS_PROFILE=dmx
  export DEIS_PROFILE=dmx
  export FLEETCTL_TUNNEL=1.2.3.4
  export DEISCTL_TUNNEL=$FLEETCTL_TUNNEL
}

function pdeactivate() {
  unalias dev 2> /dev/null
  unset DMX_EVE_URL DMX_JWT_SECRET DMX_API_URL \
  FLEETCTL_TUNNEL DEISCTL_TUNNEL AWS_PROFILE DEIS_PROFILE AWS_CLI_PROFILE
}

SSH Agents

The ssh agents is managed by ~/.bin/ssh-agents which is loaded on startup of ZSH. It assigns an agent for each profile, so when you switch profiles, you will also switch the ssh agent and the keys it manages.

The keys for a particular profile should live under ~/.ssh/<profile-name>, so your personal keys (for the default profile) should live under ~/.ssh/personal and not ~/.ssh.

My ~/.ssh folder

Author

twitter/kalbasit
Wael Nasreddine