Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

misc updates

* updated alias file
* added shell_theme
* updated tmux.conf
* updated zshrc with tmuxinator
  • Loading branch information...
commit f2b3ac4677eb5f4cde422c0da5dae63cb529136c 1 parent f520cb3
@chrsm authored
Showing with 163 additions and 47 deletions.
  1. +11 −4 alias
  2. +108 −0 shell_theme
  3. +30 −32 tmux.conf
  4. +14 −11 zshrc
View
15 alias
@@ -1,8 +1,15 @@
-alias urxvt="urxvtc"
-alias bsawatch="jung -r site -w 2000 -F '\\.((swp)|(tmp))$' -- ./scp.sh \\\$JUNG_FILE"
-alias emacs='emacs-snapshot -nw'
-alias gemacs='emacs-snapshot-gtk'
+# no more nano -w ok
+alias nano="vim"
+alias vi="vim"
+alias v="vim"
+
+# gat aliases
alias @="gat"
alias @s="gat --search"
+alias @v="gat --view"
+
alias gs="git status"
alias gc="git commit"
+
+# copy current timestamp to clipboard
+alias ts="date +%s|tr -d '\n'|xsel -i -b"
View
108 shell_theme
@@ -0,0 +1,108 @@
+
+function __promptline_last_exit_code {
+
+ [[ $last_exit_code -gt 0 ]] || return 1;
+
+ printf "%s" "${1}$last_exit_code${2}"
+}
+
+function __promptline_vcs_branch {
+ hash git 2>/dev/null || return 1
+
+ local branch=$( { git symbolic-ref --quiet HEAD || git rev-parse --short HEAD; } 2>/dev/null )
+ [[ -n $branch ]] || return 1;
+ branch=${branch##*/}
+
+ printf "%s" "${1}${vcs_branch}${branch:-unknown}${2}"
+}
+function __promptline_cwd {
+ local cwd="${PWD/#$HOME/~}"
+ local dir_limit=3
+ local parts
+
+ # get first char of the path, i.e. tilda or slash
+ if [[ -n ${ZSH_VERSION-} ]]; then
+ local root_char=$cwd[1,1]
+ else
+ local root_char=${cwd::1}
+ fi
+
+ # cleanup leading tilda and slash. replace slashes with spaces
+ cwd="${cwd#\~}"
+ cwd="${cwd#\/}"
+ cwd=${cwd//\// }
+
+ if [[ -n ${ZSH_VERSION-} ]]; then
+ parts=($root_char ${=cwd})
+ else
+ parts=($root_char $cwd)
+ fi
+
+ # truncate dirs to the limit
+ local parts_count=${#parts[@]}
+ if [ $parts_count -gt $dir_limit ] && [ $dir_limit -gt -0 ]; then
+ parts=($truncation ${parts[@]:(-3)})
+ fi
+
+ # join the dirs with the separator
+ local formatted_cwd=""
+ for part in "${parts[@]}"; do
+ formatted_cwd="$formatted_cwd$dir_sep$part"
+ done;
+ formatted_cwd="${formatted_cwd#$dir_sep}"
+
+ printf "%s" "$formatted_cwd"
+}
+
+function __promptline {
+ local last_exit_code="$?"
+
+ local esc=$'[' end_esc=m
+ if [[ -n ${ZSH_VERSION-} ]]; then
+ local noprint='%{' end_noprint='%}'
+ else
+ local noprint='\[' end_noprint='\]'
+ fi
+ local wrap="$noprint$esc" end_wrap="$end_esc$end_noprint"
+ local space=" "
+ local sep=""
+ local rsep=""
+ local alt_sep=""
+ local alt_rsep=""
+ local dir_sep="  "
+ local vcs_branch=" "
+ local truncation="⋯"
+ local bold="${wrap}1${end_wrap}"
+ local unbold="${wrap}22${end_wrap}"
+ local reset="${wrap}0${end_wrap}"
+ local reset_bg="${wrap}49${end_wrap}"
+ local a_fg="${wrap}38;5;231${end_wrap}"
+ local a_bg="${wrap}48;5;36${end_wrap}"
+ local a_sep_fg="${wrap}38;5;36${end_wrap}"
+ local b_fg="${wrap}38;5;231${end_wrap}"
+ local b_bg="${wrap}48;5;29${end_wrap}"
+ local b_sep_fg="${wrap}38;5;29${end_wrap}"
+ local c_fg="${wrap}38;5;231${end_wrap}"
+ local c_bg="${wrap}48;5;23${end_wrap}"
+ local c_sep_fg="${wrap}38;5;23${end_wrap}"
+ local warn_fg="${wrap}38;5;231${end_wrap}"
+ local warn_bg="${wrap}48;5;88${end_wrap}"
+ local warn_sep_fg="${wrap}38;5;88${end_wrap}"
+ local y_fg="${wrap}38;5;231${end_wrap}"
+ local y_bg="${wrap}48;5;29${end_wrap}"
+ local y_sep_fg="${wrap}38;5;29${end_wrap}"
+ if [[ -n ${ZSH_VERSION-} ]]; then
+ PROMPT=""${a_fg}${a_bg}${space}"$(if [[ -n ${ZSH_VERSION-} ]]; then print %m; else printf "%s" \\h; fi)"$space${a_sep_fg}""${b_bg}${sep}${b_fg}${b_bg}${space}"$USER"$space${b_sep_fg}""${c_bg}${sep}${c_fg}${c_bg}${space}"$(__promptline_cwd)"$space${c_sep_fg}"${reset_bg}${sep}$reset$space"
+ RPROMPT="$(__promptline_last_exit_code "${warn_sep_fg}${rsep}${warn_fg}${warn_bg}${space}" "$space${warn_sep_fg}")$(__promptline_vcs_branch "${y_sep_fg}${rsep}${y_fg}${y_bg}${space}" "$space${y_sep_fg}")${reset}"
+ else
+ PS1=""${a_fg}${a_bg}${space}"$(if [[ -n ${ZSH_VERSION-} ]]; then print %m; else printf "%s" \\h; fi)"$space${a_sep_fg}""${b_bg}${sep}${b_fg}${b_bg}${space}"$USER"$space${b_sep_fg}""${c_bg}${sep}${c_fg}${c_bg}${space}"$(__promptline_cwd)"$space${c_sep_fg}"$(__promptline_vcs_branch "${y_bg}${sep}${y_fg}${y_bg}${space}" "$space${y_sep_fg}")$(__promptline_last_exit_code "${warn_bg}${sep}${warn_fg}${warn_bg}${space}" "$space${warn_sep_fg}")${reset_bg}${sep}$reset$space"
+ fi
+}
+
+if [[ -n ${ZSH_VERSION-} ]]; then
+ if [[ ! ${precmd_functions[(r)__promptline]} == __promptline ]]; then
+ precmd_functions+=(__promptline)
+ fi
+else
+ PROMPT_COMMAND=__promptline
+fi
View
62 tmux.conf
@@ -1,33 +1,31 @@
+set-window-option -g mode-keys vi
+bind-key -t vi-copy 'v' begin-selection
+bind-key -t vi-copy 'y' copy-selection
set -g default-terminal "screen-256color"
-# --- colors (solarized dark)
-# default statusbar colors
-set -g status-bg black
-set -g status-fg yellow
-set -g status-attr default
-
-# default window title colors
-setw -g window-status-fg brightblue
-setw -g window-status-bg default
-
-# active window title colors
-setw -g window-status-current-fg yellow
-setw -g window-status-current-bg default
-setw -g window-status-current-attr dim
-
-# pane border
-set -g pane-border-fg black
-set -g pane-border-bg default
-set -g pane-active-border-fg yellow
-set -g pane-active-border-bg default
-
-# command line/message text
-set -g message-bg black
-set -g message-fg yellow
-
-# pane number display
-set -g display-panes-active-colour yellow
-set -g display-panes-colour brightblue
-
-# clock
-setw -g clock-mode-colour yellow
-# --- end colors
+set -g status-bg 'colour234'
+set -g message-command-fg 'colour144'
+set -g status-justify 'left'
+set -g status-left-length '100'
+set -g status 'on'
+set -g pane-active-border-fg 'colour27'
+set -g message-bg 'colour237'
+set -g status-right-length '100'
+set -g status-right-attr 'none'
+set -g message-fg 'colour144'
+set -g message-command-bg 'colour237'
+set -g status-attr 'none'
+set -g status-utf8 'on'
+set -g pane-border-fg 'colour237'
+set -g status-left-attr 'none'
+setw -g window-status-fg 'colour39'
+setw -g window-status-attr 'none'
+setw -g window-status-activity-bg 'colour234'
+setw -g window-status-activity-attr 'none'
+setw -g window-status-activity-fg 'colour27'
+#setw -g window-status-separator ''
+setw -g window-status-bg 'colour234'
+set -g status-left ''
+set -g status-right '#[fg=colour15,bg=colour27] %H:%M '
+setw -g window-status-format '#[fg=colour39,bg=colour234] #I #[fg=colour39,bg=colour234] #W '
+setw -g window-status-current-format '#[fg=colour234,bg=colour237,nobold,nounderscore,noitalics]#[fg=colour144,bg=colour237] #W #[fg=colour237,bg=colour234,nobold,nounderscore,noitalics]'
+
View
25 zshrc
@@ -1,19 +1,22 @@
ZSH=$HOME/.oh-my-zsh
ZSH_THEME="blinks"
-plugins=(git git-extras tmux)
-
-# tmux
-ZSH_TMUX_AUTOSTART=true
-#ZSH_TMUX_AUTOSTART_ONCE=false
-#ZSH_TMUX_FIXTERM=false
-
+plugins=(git git-extras tmux tmuxinator zsh-syntax-highlighting vagrant)
source $ZSH/oh-my-zsh.sh
+
source /usr/local/bin/virtualenvwrapper.sh
-source ~/bin/src/z-src/z.sh
+source /home/chrsm/bin/src/z/z.sh
+source /home/chrsm/.rvm/scripts/rvm
+[[ -s "$HOME/.gvm/scripts/gvm" ]] && source "$HOME/.gvm/scripts/gvm" && gvm use go1.2
+
+export EDITOR="vim"
+export DISABLE_AUTO_TITLE=true # tmux
+export NPM_PACKAGES="$HOME/.npm-packages" # who the fuck installs npm packages via sudo lol
+export NODE_PATH="$NPM_PACKAGES/lib/node_modules:$NODE_PATH"
+export PATH="$PATH:$HOME/bin:$HOME/.rvm/bin:$HOME/bin/src/elixir/bin:$NPM_PACKAGES/bin"
-# export GOPATH=$HOME/go
-[[ -s "$HOME/.gvm/scripts/gvm" ]] && source "$HOME/.gvm/scripts/gvm" && gvm use go1.2rc4
-export PATH=$PATH:/home/chrsm/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
# fucking gnome-keyring-dameon
unset GNOME_KEYRING_CONTROL
+# gs, gc, etc
source /home/chrsm/.alias
+source /home/chrsm/.shell_theme
+
Please sign in to comment.
Something went wrong with that request. Please try again.