diff --git a/dotfiles b/dotfiles index b6960bc..876b012 100755 --- a/dotfiles +++ b/dotfiles @@ -8,6 +8,10 @@ function link_file() { ln -sf ${2#$HOME/} ~/ } +function copy_file() { + cp -f $2 ~/ +} + function post_file() { source "$2" } @@ -17,7 +21,7 @@ function copy_or_link() { local cmd="find $HOME/dotfiles/$1 -mindepth 1 -maxdepth 1" # If no files, bail - if [ "x`${cmd}`" == "x" ]; then return; fi + if [ "x`${cmd}`" == "x" ]; then return; fi for file in `${cmd}`; do base="$(basename $file)" @@ -29,5 +33,5 @@ function copy_or_link() { } copy_or_link "link" -# copy_or_link "copy" -copy_or_link "post" +copy_or_link "copy" +# copy_or_link "post" diff --git a/link/.ruby-version b/link/.ruby-version new file mode 100644 index 0000000..e004074 --- /dev/null +++ b/link/.ruby-version @@ -0,0 +1 @@ +ruby-2.0 diff --git a/link/.tmux.conf b/link/.tmux.conf new file mode 100644 index 0000000..780a0fd --- /dev/null +++ b/link/.tmux.conf @@ -0,0 +1,121 @@ +set-option -g default-command "reattach-to-user-namespace -l zsh" + +# Set prefix to something easy +unbind C-b +set -g prefix C-a +bind a send-prefix + +# Lose the delay +set -sg escape-time 1 + +# Change base index to 1 +set -g base-index 1 +setw -g pane-base-index 1 + +# Reload config with prefix-r +bind r source-file ~/.tmux.conf \; display "Config Reloaded" + +# Last window rocks +bind C-a last-window + +# Easy keys for splitting panes +bind | split-window -h +bind - split-window -v + +# Move between panes vim style +bind h select-pane -L +bind j select-pane -D +bind k select-pane -U +bind l select-pane -R + +# Resize panes in a vim-ish style +bind -r H resize-pane -L 5 +bind -r J resize-pane -D 5 +bind -r K resize-pane -U 5 +bind -r L resize-pane -R 5 + +# Move between windows in a vim-ish style +bind -r C-h select-window -t :- +bind -r C-l select-window -t :+ + +# Disable mouse (for now) +setw -g mode-mouse off + +# Make sure 256 color and utf-8 is enabled +set -g default-terminal "screen-256color" +set -g status-utf8 on + +# Center the window list +set -g status-justify centre + +# Update the status bar every sixty seconds +set -g status-interval 60 + +# enable vi keys. +setw -g mode-keys vi +set-window-option -g xterm-keys on + +# Show changes in other windows +setw -g monitor-activity on +set -g visual-activity on + +# pane movement +bind-key j command-prompt -p "join pane from:" "join-pane -s '%%'" +bind-key s command-prompt -p "send pane to:" "join-pane -t '%%'" + +# Setup 'v' to begin selection as in Vim +bind-key -t vi-copy v begin-selection +bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy" + +# Update default binding of `Enter` to also use copy-pipe +unbind -t vi-copy Enter +bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy" + +#### COLOUR + +# default statusbar colors +set-option -g status-bg colour235 #base02 +set-option -g status-fg colour136 #yellow +set-option -g status-attr default + +set-window-option -g window-status-activity-fg colour1 #red +set-window-option -g window-status-activity-bg colour235 +#set-window-option -g window-status-activity-attr bright + +# default window title colors +set-window-option -g window-status-fg colour166 #orange +set-window-option -g window-status-bg default +#set-window-option -g window-status-attr dim + +# active window title colors +set-window-option -g window-status-current-fg colour166 #orange +set-window-option -g window-status-current-bg default +#set-window-option -g window-status-current-attr bright + +# pane border +set-option -g pane-border-fg colour235 #base02 +set-option -g pane-active-border-fg colour240 #base01 + +# message text +set-option -g message-bg colour235 #base02 +set-option -g message-fg colour166 #orange + +# pane number display +set-option -g display-panes-active-colour colour33 #blue +set-option -g display-panes-colour colour166 #orange + +# clock +set-window-option -g clock-mode-colour colour64 #green + +#### Status Bar + +# Powerline symbols: ⮂ ⮃ ⮀ ⮁ ⭤ +set -g status-left-length 32 +set -g status-right-length 150 +set -g status-interval 5 + +set -g status-left '#[reverse] Session: #S #[noreverse]⮀ #I ⮁ #P' +set -g status-right '%R ⮃ %d %b ⮂#[reverse] #h ' + +set -g window-status-format ' #I #W ' +set -g window-status-current-format '⮂#[reverse] #I #W #[noreverse]⮀' diff --git a/link/.zshrc b/link/.zshrc index b5cf506..87bca21 100644 --- a/link/.zshrc +++ b/link/.zshrc @@ -10,5 +10,22 @@ if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" fi +# Run all files in dotfiles source directory +if [[ -d "$HOME/dotfiles/source" ]]; then + if [ "$(ls -A $HOME/dotfiles/source)" ]; then + for file in ~/dotfiles/source/*; do + source "$file" + done + fi +fi + +# Run all files in local source directory +if [[ -d "$HOME/source" ]]; then + if [ "$(ls -A $HOME/source)" ]; then + for file in $HOME/source/*; do + source "$file" + done + fi +fi + # Customize to your needs... -export EDITOR="vim" diff --git a/source/aliases.zsh b/source/aliases.zsh new file mode 100644 index 0000000..5f5a96d --- /dev/null +++ b/source/aliases.zsh @@ -0,0 +1,2 @@ +alias myip='curl -s ifconfig.me | tee /dev/stderr | pbcopy' +alias be='bundle exec' diff --git a/source/chruby.zsh b/source/chruby.zsh new file mode 100644 index 0000000..5e72adb --- /dev/null +++ b/source/chruby.zsh @@ -0,0 +1,8 @@ +if [[ -d "/usr/local/opt/chruby" ]]; then + source /usr/local/opt/chruby/share/chruby/chruby.sh + source /usr/local/opt/chruby/share/chruby/auto.sh +else + echo "" + echo "You should install chruby and be much cooler..." + echo "https://github.com/postmodern/chruby" +fi diff --git a/source/editor.zsh b/source/editor.zsh new file mode 100644 index 0000000..615e260 --- /dev/null +++ b/source/editor.zsh @@ -0,0 +1,2 @@ +export EDITOR="vim" +export VISUAL="vim" diff --git a/source/knife.zsh b/source/knife.zsh new file mode 100644 index 0000000..6e10455 --- /dev/null +++ b/source/knife.zsh @@ -0,0 +1,7 @@ +ksr() { knife ssh "role:$1" $2 -x root -a ipaddress } +ksn() { knife ssh "name:$1" $2 -x root -a ipaddress } +ksa() { knife ssh "name:*" $1 -x root -a ipaddress -C 1 } +ksac() { knife ssh "name:*" $1 -x root -a ipaddress } +kua() { ksa "chef-client" } +kuac() { ksac "chef-client" } +kur() { ksr $1 "chef-client" } diff --git a/source/nocorrect.zsh b/source/nocorrect.zsh new file mode 100644 index 0000000..b641939 --- /dev/null +++ b/source/nocorrect.zsh @@ -0,0 +1,4 @@ +alias powify="nocorrect powify" +alias vagrant="nocorrect vagrant" +alias knife="nocorrect knife" +alias rspec="nocorrect rspec" diff --git a/source/nvm.zsh b/source/nvm.zsh new file mode 100644 index 0000000..d4a0026 --- /dev/null +++ b/source/nvm.zsh @@ -0,0 +1,6 @@ +if [[ -d $HOME/.nvm ]]; then + [ -s $HOME/.nvm/nvm.sh ] && . $HOME/.nvm/nvm.sh # This loads NVM +else + echo "" + echo "You don't have nvm installed. Get at it, buddy!" +fi diff --git a/source/path.zsh b/source/path.zsh new file mode 100644 index 0000000..91ab3eb --- /dev/null +++ b/source/path.zsh @@ -0,0 +1,2 @@ +# Add local bin paths in +export PATH=/Users/tedkulp/bin:/usr/local/bin:$PATH