From 68b0320df76a5cbb82380dfe5c2600cd1b9e6a17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2EFernando=20S=C3=A1nchez?= Date: Sun, 2 Dec 2012 01:56:57 +0100 Subject: [PATCH] Tmux on zsh start --- not_dots/zshrc.orig | 73 +++++++++++++++++++++++++ not_dots/zshrc.pre-oh-my-zsh | 73 +++++++++++++++++++++++++ tmux.conf | 5 ++ vimrc | 4 +- zshrc | 100 ++++++++++++++--------------------- 5 files changed, 195 insertions(+), 60 deletions(-) create mode 100644 not_dots/zshrc.orig create mode 100644 not_dots/zshrc.pre-oh-my-zsh diff --git a/not_dots/zshrc.orig b/not_dots/zshrc.orig new file mode 100644 index 0000000..9d4284b --- /dev/null +++ b/not_dots/zshrc.orig @@ -0,0 +1,73 @@ +# Lines configured by zsh-newuser-install +HISTFILE=~/.histfile +HISTSIZE=1000 +SAVEHIST=1000 +setopt appendhistory autocd extendedglob nomatch notify share_history +bindkey -v +# End of lines configured by zsh-newuser-install +# The following lines were added by compinstall +zstyle :compinstall filename '/home/balkian/.zshrc' + +autoload -Uz compinit +compinit +# End of lines added by compinstall + +autoload -U colors +colors +setopt prompt_subst + +local smiley="%B%(?,%{$fg[green]%}☠%{$reset_color%},%{$fg[red]%}☠%{$reset_color%})%b" +PS0='${debian_chroot:+($debian_chroot)}%n@%M' + +parse_git_branch() +{ +git name-rev HEAD 2> /dev/null | sed 's#HEAD\ \(.*\)#(git::\1)#' +} + +if ( dircolors --help && ls --color ) &> /dev/null; then +# For some reason, the unixs machines need me to use $HOME instead of ~ +# List files from highest priority to lowest. As soon as the loop finds one that works, it will exit. +function precmd { +PROMPT="$PS0:%~ %{$fg[green]%}%B$(parse_git_branch)%b%{$reset_color%} +${smiley} "; +RPROMPT="%T"; +} + +for POSSIBLE_DIR_COLORS in "$HOME/.dir_colors" "/etc/DIR_COLORS"; do + [[ -f "$POSSIBLE_DIR_COLORS" ]] && [[ -r "$POSSIBLE_DIR_COLORS" ]] && eval `dircolors -b "$POSSIBLE_DIR_COLORS"` && break +done + +alias ls="ls --color=auto" +alias ll="ls --color=auto -l" +alias grep='grep --color=auto' +alias fgrep='fgrep --color=auto' +alias egrep='egrep --color=auto' +else +# No color, so put a slash at the end of directory names, etc. to differentiate. +alias ll="ls -lF" +fi +## Completions +#autoload -U compinit +#compinit -C +# +### case-insensitive (all),partial-word and then substring completion +zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' \ + 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' + +bindkey -M vicmd 'r' history-incremental-search-backward + +export PATH=$PATH:"/home/balkian/code/personal-scripts/" +#export CDPATH=$CDPATH:"/media/Data/" + +# TMUX +# if [[ -z "$KONSOLE_DBUS_SERVICE" & `which tmux` ]]; then + # if no session is started, start a new session + if [[ -z "$KONSOLE_DBUS_SERVICE" && -n $(which tmux) ]]; then + stty -ixon + test -z ${TMUX} && tmux attach + # when quitting tmux, try to attach + if [[ -z ${TMUX} ]]; then + exit; + fi + fi + diff --git a/not_dots/zshrc.pre-oh-my-zsh b/not_dots/zshrc.pre-oh-my-zsh new file mode 100644 index 0000000..9d4284b --- /dev/null +++ b/not_dots/zshrc.pre-oh-my-zsh @@ -0,0 +1,73 @@ +# Lines configured by zsh-newuser-install +HISTFILE=~/.histfile +HISTSIZE=1000 +SAVEHIST=1000 +setopt appendhistory autocd extendedglob nomatch notify share_history +bindkey -v +# End of lines configured by zsh-newuser-install +# The following lines were added by compinstall +zstyle :compinstall filename '/home/balkian/.zshrc' + +autoload -Uz compinit +compinit +# End of lines added by compinstall + +autoload -U colors +colors +setopt prompt_subst + +local smiley="%B%(?,%{$fg[green]%}☠%{$reset_color%},%{$fg[red]%}☠%{$reset_color%})%b" +PS0='${debian_chroot:+($debian_chroot)}%n@%M' + +parse_git_branch() +{ +git name-rev HEAD 2> /dev/null | sed 's#HEAD\ \(.*\)#(git::\1)#' +} + +if ( dircolors --help && ls --color ) &> /dev/null; then +# For some reason, the unixs machines need me to use $HOME instead of ~ +# List files from highest priority to lowest. As soon as the loop finds one that works, it will exit. +function precmd { +PROMPT="$PS0:%~ %{$fg[green]%}%B$(parse_git_branch)%b%{$reset_color%} +${smiley} "; +RPROMPT="%T"; +} + +for POSSIBLE_DIR_COLORS in "$HOME/.dir_colors" "/etc/DIR_COLORS"; do + [[ -f "$POSSIBLE_DIR_COLORS" ]] && [[ -r "$POSSIBLE_DIR_COLORS" ]] && eval `dircolors -b "$POSSIBLE_DIR_COLORS"` && break +done + +alias ls="ls --color=auto" +alias ll="ls --color=auto -l" +alias grep='grep --color=auto' +alias fgrep='fgrep --color=auto' +alias egrep='egrep --color=auto' +else +# No color, so put a slash at the end of directory names, etc. to differentiate. +alias ll="ls -lF" +fi +## Completions +#autoload -U compinit +#compinit -C +# +### case-insensitive (all),partial-word and then substring completion +zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' \ + 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' + +bindkey -M vicmd 'r' history-incremental-search-backward + +export PATH=$PATH:"/home/balkian/code/personal-scripts/" +#export CDPATH=$CDPATH:"/media/Data/" + +# TMUX +# if [[ -z "$KONSOLE_DBUS_SERVICE" & `which tmux` ]]; then + # if no session is started, start a new session + if [[ -z "$KONSOLE_DBUS_SERVICE" && -n $(which tmux) ]]; then + stty -ixon + test -z ${TMUX} && tmux attach + # when quitting tmux, try to attach + if [[ -z ${TMUX} ]]; then + exit; + fi + fi + diff --git a/tmux.conf b/tmux.conf index 3e2ed79..c298e38 100644 --- a/tmux.conf +++ b/tmux.conf @@ -86,3 +86,8 @@ bind-key -t vi-copy 'y' copy-selection unbind C-s # copy tmux buffer to clipboard #bind-key Y save-buffer ~/.tmux/buffer \; run-shell "xsel -i -p <~/.tmux/buffer && rm ~/.tmux/buffer" +# + +# Look better +# look good +set -g default-terminal "screen-256color" diff --git a/vimrc b/vimrc index 995c811..5d04224 100644 --- a/vimrc +++ b/vimrc @@ -117,7 +117,9 @@ nmap SO :so ~/.vim/Session.vim ":tab sball " Color and shit -"colo vividchalk +colo vividchalk +set background=dark +hi SpellBad ctermbg=Red ctermfg=White "Statusline diff --git a/zshrc b/zshrc index 3148b28..06d9c2a 100644 --- a/zshrc +++ b/zshrc @@ -1,70 +1,52 @@ -# Lines configured by zsh-newuser-install -HISTFILE=~/.histfile -HISTSIZE=1000 -SAVEHIST=1000 -setopt appendhistory autocd extendedglob nomatch notify share_history -bindkey -v -# End of lines configured by zsh-newuser-install -# The following lines were added by compinstall -zstyle :compinstall filename '/home/balkian/.zshrc' +# Path to your oh-my-zsh configuration. +ZSH=$HOME/.oh-my-zsh -autoload -Uz compinit -compinit -# End of lines added by compinstall +# Set name of the theme to load. +# Look in ~/.oh-my-zsh/themes/ +# Optionally, if you set this to "random", it'll load a random theme each +# time that oh-my-zsh is loaded. +ZSH_THEME="balkian" -autoload -U colors -colors -setopt prompt_subst +# Example aliases +# alias zshconfig="mate ~/.zshrc" +# alias ohmyzsh="mate ~/.oh-my-zsh" -local smiley="%B%(?,%{$fg[green]%}☠%{$reset_color%},%{$fg[red]%}☠%{$reset_color%})%b" -PS0='${debian_chroot:+($debian_chroot)}%n@%M' +# Set to this to use case-sensitive completion +# CASE_SENSITIVE="true" -parse_git_branch() -{ -git name-rev HEAD 2> /dev/null | sed 's#HEAD\ \(.*\)#(git::\1)#' -} +# Comment this out to disable weekly auto-update checks +# DISABLE_AUTO_UPDATE="true" -if ( dircolors --help && ls --color ) &> /dev/null; then -# For some reason, the unixs machines need me to use $HOME instead of ~ -# List files from highest priority to lowest. As soon as the loop finds one that works, it will exit. -function precmd { -PROMPT="%~ %{$fg[green]%}%B$(parse_git_branch)%b%{$reset_color%} -${smiley} $PS0: "; -RPROMPT="%T"; -} +# Change this value to set how frequently ZSH updates¬ +export UPDATE_ZSH_DAYS=13 -for POSSIBLE_DIR_COLORS in "$HOME/.dir_colors" "/etc/DIR_COLORS"; do - [[ -f "$POSSIBLE_DIR_COLORS" ]] && [[ -r "$POSSIBLE_DIR_COLORS" ]] && eval `dircolors -b "$POSSIBLE_DIR_COLORS"` && break -done +# Uncomment following line if you want to disable colors in ls +# DISABLE_LS_COLORS="true" -alias ls="ls --color=auto" -alias ll="ls --color=auto -l" -alias grep='grep --color=auto' -alias fgrep='fgrep --color=auto' -alias egrep='egrep --color=auto' -else -# No color, so put a slash at the end of directory names, etc. to differentiate. -alias ll="ls -lF" -fi -## Completions -#autoload -U compinit -#compinit -C -# -### case-insensitive (all),partial-word and then substring completion -zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' \ - 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' +# Uncomment following line if you want to disable autosetting terminal title. +# DISABLE_AUTO_TITLE="true" + +# Uncomment following line if you want red dots to be displayed while waiting for completion +# COMPLETION_WAITING_DOTS="true" + +# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*) +# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ +# Example format: plugins=(rails git textmate ruby lighthouse) +plugins=(git vi-mode) -bindkey -M vicmd 'r' history-incremental-search-backward +source $ZSH/oh-my-zsh.sh + +# Customize to your needs... +export PATH=/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/balkian/code/personal-scripts/ # TMUX # if [[ -z "$KONSOLE_DBUS_SERVICE" & `which tmux` ]]; then - # if no session is started, start a new session - if [[ -z "$KONSOLE_DBUS_SERVICE" && -n $(which tmux) ]]; then - stty -ixon - test -z ${TMUX} && tmux attach - # when quitting tmux, try to attach - if [[ -z ${TMUX} ]]; then - exit; - fi - fi - +# if no session is started, start a new session +if [[ -z "$KONSOLE_DBUS_SERVICE" && -n $(which tmux) ]]; then + stty -ixon + test -z ${TMUX} && tmux attach + # when quitting tmux, try to attach + if [[ -z ${TMUX} ]]; then + exit; + fi +fi