Skip to content

dongminkim/dotfiles

Repository files navigation

A collection of dotfiles for developers using macOS and Linux.

screenshot Screenshot captured in iTerm2 with Vanity Dark Profile

Installation

Warning: Use at your own risk!

Using Git and the bootstrap script

  1. You can clone the repository wherever you want, and run the bootstrap script.

    git clone https://github.com/dongminkim/dotfiles.git ~/.dotfiles && ~/.dotfiles/bootstrap.sh
  2. You may be asked your password to do sudo once or twice.

  3. And after oh-my-zsh installed, in order to continue to the next steps, you should type exit in oh-my-zsh interactive shell prompt.

  4. When the bootstrap script finishes, you can see the instructions how to load iTerm2 profiles.

  5. Quit and restart iTerm2.

That's it!

What will be installed?

Customization

  • Shell rc files with .os.$(uname -s) prefix will be loaded
    • .os.$(uname -s)._shrc(for both zsh and bash), .os.$(uname -s).zshrc, .os.$(uname -s).bashrc
      • e.g. .os.Darwin.zshrc will be loaded in Mac OS X zsh
  • Shell rc files with .host.$(uname -n) prefix will be loaded
    • .host.$(uname -n)._shrc(for both zsh and bash), .host.$(uname -n).zshrc, .host.$(uname -n).bashrc
      • e.g. .host.github.com.bashrc will be loaded in bash at host github.com
  • Shell rc files with .local prefix will be loaded
    • .local._shrc(for both zsh and bash), .local.zshrc, .local.bashrc
  • Screen rc files with .host.$(uname -n) prefix will be loaded
    • .host.$(uname -n).screenrc
      • e.g. .host.github.com.screenrc will be used when run screen at host github.com
  • Vim rc files with .local prefix will be loaded
    • .local.plugins.vimrc will be loaded in Vundle's loading step
    • .local.pre.vimrc will be loaded just before the main .vimrc settings and just after vim-plug loading step
    • .local.vimrc will be loaded after the main .vimrc settings

Usage

tmux

tmux key bindings are heavily modified to be similar with GNU screen and vim.

First of all, prefix changed from C-b to C-a.

Here are all the modified key bindings:

key bindings action
a send-prefix
C-r reload conf
* list-clients
C-l refresh-client
d, C-d detach
M-s rename-session
M-q kill-session
c, C-c new-window
A rename-window
C-a last-window
C-n next-window
p, C-p, BSpace previous-window
w, C-w, ", Space choose-window
C-k kill-window
S split-window horizontally
V split-window vertically
T break-pane into new window
_, Enter resize-pane to zoom in & out
Tab, BTab select-pane next, previous
h, j, k, l select-pane left, down, up, right
M-h, M-j, M-k, M-l resize-pane left, down, up, right
L next-layout
C-x kill-pane
R respawn-pane
(copy mode) Space, v begin-selection
(copy mode) Enter, y copy-selection

And I made tmx shell function that does run the user-defined startup script, attach to existing session or duplicate and open duplicated session.

tmx -l
tmx ls
  • equivalent to tmux ls
tmx foo
  • if there is a tmux session with name foo,
    • attach to the existing foo session with detaching the old ttys
  • if there is no tmux session with name foo,
    • if there is a runnable function or command tmx-foo,
      • run tmx-foo foo that might make a tmux session with name foo
    • if there is no function or command tmx-foo,
      • just create new tmux session with name foo
tmx -a foo
  • if there is a tmux session with name foo,
    • attach to the existing foo session without detaching the old ttys
    • the attached ttys are synchronized
  • if there is no tmux session with name foo,
    • just print error message
tmx -d foo
  • if there is a tmux session with name foo,
    • duplicate the existing foo session and name it foo~1 and attach to it
  • if there is no tmux session with name foo,
    • just print error message

Here is a sample tmx startup script tmx-foo

function tmx-foo {
    local ses_name=foo
    local work_dirs="~/work:$HOME/tmp:/var/log"
    tmx-new -t $ses_name -r -w "$work_dirs"
}

License

MIT

Author

@dongminkim

aka vanity or diego