From a3ff10265a9c01103ff9829a1ee06c6c0e6a147b Mon Sep 17 00:00:00 2001 From: Steven Lu Date: Wed, 13 Feb 2013 02:08:43 -0500 Subject: [PATCH 01/39] my zsh theme. It rocks --- themes/lust.zsh-theme | 118 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 themes/lust.zsh-theme diff --git a/themes/lust.zsh-theme b/themes/lust.zsh-theme new file mode 100644 index 000000000..4948e73d9 --- /dev/null +++ b/themes/lust.zsh-theme @@ -0,0 +1,118 @@ +# ------------------------------------------------------------------------------ +# FILE: lust.zsh-theme +# DESCRIPTION: oh-my-zsh theme file. +# AUTHOR: Steven Lu, based on kphoen.zsh-theme by Kévin Gomez (geek63@gmail.com) +# VERSION: 0.1 +# ------------------------------------------------------------------------------ + + +if [[ "$TERM" != "dumb" ]] && [[ "$DISABLE_LS_COLORS" != "true" ]]; then + PROMPT='%{$fg[red]%}%n%{$reset_color%}@%{$fg[green]%}%m%{$reset_color%}:%{$fg[blue]%}%~%{$reset_color%} %{$fg[yellow]%}%*%{$reset_color%} +%(!.%{$fg[red]%}#.%{$fg[cyan]%}❯)%{$reset_color%} ' + + ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}" + ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" + + ZSH_THEME_GIT_PROMPT_SHA_BEFORE="%{$fg[blue]%}" + ZSH_THEME_GIT_PROMPT_SHA_AFTER="%{$reset_color%}" + + ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[grey]%}[%{$fg[yellow]%}⚡%{$fg[grey]%}]%{$reset_color%}" + ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[grey]%}[%{$fg[green]%}✓%{$fg[grey]%}]%{$reset_color%}" + + ZSH_THEME_GIT_PROMPT_AHEAD="%{$fg[red]%}↑%{$reset_color%}" + ZSH_THEME_GIT_PROMPT_BEHIND="%{$fg[red]%}↓%{$reset_color%}" + ZSH_THEME_GIT_PROMPT_DIVERGED="%{$fg[red]%}↕%{$reset_color%}" + + ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[green]%}✚" + ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[yellow]%}✎" + ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%}✖" + ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[cyan]%}➜" + ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[magenta]%}♦" + ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[blue]%}✭" + ZSH_THEME_GIT_PROMPT_STASHED="%{$fg[cyan]%}$" + + # Colors vary depending on time lapsed. + ZSH_THEME_GIT_TIME_SINCE_COMMIT_SHORT="%{$fg[green]%}" + ZSH_THEME_GIT_TIME_SHORT_COMMIT_MEDIUM="%{$fg[yellow]%}" + ZSH_THEME_GIT_TIME_SINCE_COMMIT_LONG="%{$fg[red]%}" + ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL="%{$fg[cyan]%}" + + # Determine the time since last commit. If branch is clean, + # use a neutral color, otherwise colors will vary according to time. + function git_time_since_commit() { + if git rev-parse --git-dir > /dev/null 2>&1; then + # Only proceed if there is actually a commit. + if [[ $(git log 2>&1 > /dev/null | grep -c "^fatal: bad default revision") == 0 ]]; then + # Get the last commit. + last_commit=`git log --pretty=format:'%at' -1 2> /dev/null` + now=`date +%s` + seconds_since_last_commit=$((now-last_commit)) + + # Totals + MINUTES=$((seconds_since_last_commit / 60)) + HOURS=$((seconds_since_last_commit/3600)) + + # Sub-hours and sub-minutes + DAYS=$((seconds_since_last_commit / 86400)) + SUB_HOURS=$((HOURS % 24)) + SUB_MINUTES=$((MINUTES % 60)) + + if [[ -n $(git status -s 2> /dev/null) ]]; then + if [ "$MINUTES" -gt 30 ]; then + COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_LONG" + elif [ "$MINUTES" -gt 10 ]; then + COLOR="$ZSH_THEME_GIT_TIME_SHORT_COMMIT_MEDIUM" + else + COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_SHORT" + fi + else + COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL" + fi + + if [ "$HOURS" -gt 24 ]; then + echo "$COLOR${DAYS}d${SUB_HOURS}h${SUB_MINUTES}m%{$reset_color%}" + elif [ "$MINUTES" -gt 60 ]; then + echo "$COLOR${HOURS}h${SUB_MINUTES}m%{$reset_color%}" + else + echo "$COLOR${MINUTES}m%{$reset_color%}" + fi + else + COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL" + echo "$COLOR~" + fi + fi + } + function my_git_prompt_status() { + #wrap git prompt status with stuff + NOW_GIT_PROMPT_STATUS="$(git_prompt_status)" + if [[ -n $NOW_GIT_PROMPT_STATUS ]]; then + echo "%{$fg[grey]%}[$NOW_GIT_PROMPT_STATUS%{$fg[grey]%}]%{$reset_color%}" + fi + } + + # display exitcode on the right when >0 + return_code="%(?..%{$fg[magenta]%}%? ↲ %{$reset_color%}) " + + RPROMPT='${return_code}$(git_prompt_info)$(git_prompt_short_sha)$(my_git_prompt_status)$(git_time_since_commit)%{$reset_color%}' + +else + PROMPT='[%n@%m:%~$(git_prompt_info)] +%# ' + + ZSH_THEME_GIT_PROMPT_PREFIX=" on" + ZSH_THEME_GIT_PROMPT_SUFFIX="" + ZSH_THEME_GIT_PROMPT_DIRTY="" + ZSH_THEME_GIT_PROMPT_CLEAN="" + + # display exitcode on the right when >0 + return_code="%(?..%? ↵)" + + RPROMPT='${return_code}$(git_prompt_status)' + + ZSH_THEME_GIT_PROMPT_ADDED=" ✚" + ZSH_THEME_GIT_PROMPT_MODIFIED=" ✹" + ZSH_THEME_GIT_PROMPT_DELETED=" ✖" + ZSH_THEME_GIT_PROMPT_RENAMED=" ➜" + ZSH_THEME_GIT_PROMPT_UNMERGED=" ═" + ZSH_THEME_GIT_PROMPT_UNTRACKED=" ✭" +fi \ No newline at end of file From 46e0fb25aa1852f2375dd1c694db1e416e0a3161 Mon Sep 17 00:00:00 2001 From: Steven Lu Date: Wed, 13 Feb 2013 02:39:53 -0500 Subject: [PATCH 02/39] fixing the situation where no git status tags are shown producing ugly right-prompt --- themes/lust.zsh-theme | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/themes/lust.zsh-theme b/themes/lust.zsh-theme index 4948e73d9..1efe768b5 100644 --- a/themes/lust.zsh-theme +++ b/themes/lust.zsh-theme @@ -82,18 +82,23 @@ if [[ "$TERM" != "dumb" ]] && [[ "$DISABLE_LS_COLORS" != "true" ]]; then fi fi } - function my_git_prompt_status() { + function my_git_prompt_status_and_time() { #wrap git prompt status with stuff NOW_GIT_PROMPT_STATUS="$(git_prompt_status)" + NOW_GIT_TIME_SINCE="$(git_time_since_commit)" if [[ -n $NOW_GIT_PROMPT_STATUS ]]; then - echo "%{$fg[grey]%}[$NOW_GIT_PROMPT_STATUS%{$fg[grey]%}]%{$reset_color%}" + echo "%{$fg[grey]%}[$NOW_GIT_PROMPT_STATUS%{$fg[grey]%}]$NOW_GIT_TIME_SINCE%{$reset_color%}" + else + if [[ -n $NOW_GIT_TIME_SINCE ]]; then + echo "%{$fg[grey]%}‖$NOW_GIT_TIME_SINCE%{$reset_color%}" + fi fi } # display exitcode on the right when >0 return_code="%(?..%{$fg[magenta]%}%? ↲ %{$reset_color%}) " - RPROMPT='${return_code}$(git_prompt_info)$(git_prompt_short_sha)$(my_git_prompt_status)$(git_time_since_commit)%{$reset_color%}' + RPROMPT='${return_code}$(git_prompt_info)$(git_prompt_short_sha)$(my_git_prompt_status_and_time)' else PROMPT='[%n@%m:%~$(git_prompt_info)] From 7c4318c6122bb156067f734326a7ef5396b57377 Mon Sep 17 00:00:00 2001 From: Steven Lu Date: Wed, 20 Feb 2013 11:56:47 -0500 Subject: [PATCH 03/39] updated some colors. added constant reminder of running jobs --- themes/lust.zsh-theme | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/themes/lust.zsh-theme b/themes/lust.zsh-theme index 1efe768b5..66215ba77 100644 --- a/themes/lust.zsh-theme +++ b/themes/lust.zsh-theme @@ -2,13 +2,19 @@ # FILE: lust.zsh-theme # DESCRIPTION: oh-my-zsh theme file. # AUTHOR: Steven Lu, based on kphoen.zsh-theme by Kévin Gomez (geek63@gmail.com) -# VERSION: 0.1 +# VERSION: 0.2 # ------------------------------------------------------------------------------ +function myjobs() { + JOBS=`jobs -l` + if [[ -n $JOBS ]]; then + print "$JOBS%{\n%}" + fi +} if [[ "$TERM" != "dumb" ]] && [[ "$DISABLE_LS_COLORS" != "true" ]]; then PROMPT='%{$fg[red]%}%n%{$reset_color%}@%{$fg[green]%}%m%{$reset_color%}:%{$fg[blue]%}%~%{$reset_color%} %{$fg[yellow]%}%*%{$reset_color%} -%(!.%{$fg[red]%}#.%{$fg[cyan]%}❯)%{$reset_color%} ' +$(myjobs)%(!.%{$fg[red]%}#.%{$fg[cyan]%}❯)%{$reset_color%} ' ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}" ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" @@ -19,9 +25,9 @@ if [[ "$TERM" != "dumb" ]] && [[ "$DISABLE_LS_COLORS" != "true" ]]; then ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[grey]%}[%{$fg[yellow]%}⚡%{$fg[grey]%}]%{$reset_color%}" ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[grey]%}[%{$fg[green]%}✓%{$fg[grey]%}]%{$reset_color%}" - ZSH_THEME_GIT_PROMPT_AHEAD="%{$fg[red]%}↑%{$reset_color%}" + ZSH_THEME_GIT_PROMPT_AHEAD="%{$fg[cyan]%}↑%{$reset_color%}" ZSH_THEME_GIT_PROMPT_BEHIND="%{$fg[red]%}↓%{$reset_color%}" - ZSH_THEME_GIT_PROMPT_DIVERGED="%{$fg[red]%}↕%{$reset_color%}" + ZSH_THEME_GIT_PROMPT_DIVERGED="%{$fg[magenta]%}↕%{$reset_color%}" ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[green]%}✚" ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[yellow]%}✎" @@ -35,7 +41,7 @@ if [[ "$TERM" != "dumb" ]] && [[ "$DISABLE_LS_COLORS" != "true" ]]; then ZSH_THEME_GIT_TIME_SINCE_COMMIT_SHORT="%{$fg[green]%}" ZSH_THEME_GIT_TIME_SHORT_COMMIT_MEDIUM="%{$fg[yellow]%}" ZSH_THEME_GIT_TIME_SINCE_COMMIT_LONG="%{$fg[red]%}" - ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL="%{$fg[cyan]%}" + ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL="%{$reset_color%}" # Determine the time since last commit. If branch is clean, # use a neutral color, otherwise colors will vary according to time. From 83ecaf4154fa54fc62c486d84a1ee1c03be804f7 Mon Sep 17 00:00:00 2001 From: Steven Lu Date: Thu, 14 Mar 2013 18:36:26 +0000 Subject: [PATCH 04/39] turning off history setting --- lib/history.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/history.zsh b/lib/history.zsh index 876936b87..d86204983 100644 --- a/lib/history.zsh +++ b/lib/history.zsh @@ -10,4 +10,4 @@ setopt hist_ignore_dups # ignore duplication command history list setopt hist_ignore_space setopt hist_verify setopt inc_append_history -setopt share_history # share command history data +#setopt share_history # share command history data From 2aeb7611434e37003fd323bcd0691db10ebf679c Mon Sep 17 00:00:00 2001 From: Steven Lu Date: Fri, 7 Jun 2013 01:14:47 -0400 Subject: [PATCH 05/39] Here are my local changes --- lib/history.zsh | 2 +- plugins/history-substring-search/history-substring-search.zsh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/history.zsh b/lib/history.zsh index 876936b87..a37270a07 100644 --- a/lib/history.zsh +++ b/lib/history.zsh @@ -10,4 +10,4 @@ setopt hist_ignore_dups # ignore duplication command history list setopt hist_ignore_space setopt hist_verify setopt inc_append_history -setopt share_history # share command history data +# setopt share_history # share command history data diff --git a/plugins/history-substring-search/history-substring-search.zsh b/plugins/history-substring-search/history-substring-search.zsh index 53f707c79..ef3a73539 100644 --- a/plugins/history-substring-search/history-substring-search.zsh +++ b/plugins/history-substring-search/history-substring-search.zsh @@ -132,8 +132,8 @@ # configuration variables #----------------------------------------------------------------------------- -HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND='bg=magenta,fg=white,bold' -HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND='bg=red,fg=white,bold' +HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND='bg=cyan,fg=black' +HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND='bg=magenta,fg=black' HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS='i' #----------------------------------------------------------------------------- From adee3659b99883a7f1f4659fa004551d6ed12c48 Mon Sep 17 00:00:00 2001 From: Steven Lu Date: Sat, 15 Jun 2013 14:38:51 -0400 Subject: [PATCH 06/39] adding more stuff into the prompt for the win --- themes/lust.zsh-theme | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/themes/lust.zsh-theme b/themes/lust.zsh-theme index 66215ba77..f26e31272 100644 --- a/themes/lust.zsh-theme +++ b/themes/lust.zsh-theme @@ -13,7 +13,7 @@ function myjobs() { } if [[ "$TERM" != "dumb" ]] && [[ "$DISABLE_LS_COLORS" != "true" ]]; then - PROMPT='%{$fg[red]%}%n%{$reset_color%}@%{$fg[green]%}%m%{$reset_color%}:%{$fg[blue]%}%~%{$reset_color%} %{$fg[yellow]%}%*%{$reset_color%} + PROMPT='%{$fg[red]%}%n%{$reset_color%}@%{$fg[green]%}%m%{$reset_color%}:%{$fg[blue]%}%~%{$reset_color%} %{$fg[yellow]%}%w %T%{$fg[magenta]%} %!%{$reset_color%} $(myjobs)%(!.%{$fg[red]%}#.%{$fg[cyan]%}❯)%{$reset_color%} ' ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}" @@ -126,4 +126,4 @@ else ZSH_THEME_GIT_PROMPT_RENAMED=" ➜" ZSH_THEME_GIT_PROMPT_UNMERGED=" ═" ZSH_THEME_GIT_PROMPT_UNTRACKED=" ✭" -fi \ No newline at end of file +fi From c1f8a11962d60c2016545666c3c4410b49ce482a Mon Sep 17 00:00:00 2001 From: Steven Lu Date: Tue, 2 Jul 2013 00:11:34 -0400 Subject: [PATCH 07/39] Improving the history size --- lib/history.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/history.zsh b/lib/history.zsh index 08ddf03c0..86cabdd9b 100644 --- a/lib/history.zsh +++ b/lib/history.zsh @@ -2,8 +2,8 @@ if [ -z $HISTFILE ]; then HISTFILE=$HOME/.zsh_history fi -HISTSIZE=10000 -SAVEHIST=10000 +HISTSIZE=100000 +SAVEHIST=100000 setopt append_history setopt extended_history From 40b792f513b5b3823c78a2afc85078c576440701 Mon Sep 17 00:00:00 2001 From: Steven Lu Date: Mon, 8 Jul 2013 23:30:16 -0400 Subject: [PATCH 08/39] These are the changes for being friendly with my path-saving zsh history --- .../history-substring-search.zsh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/plugins/history-substring-search/history-substring-search.zsh b/plugins/history-substring-search/history-substring-search.zsh index ef3a73539..53b1b429b 100644 --- a/plugins/history-substring-search/history-substring-search.zsh +++ b/plugins/history-substring-search/history-substring-search.zsh @@ -434,6 +434,8 @@ function _history-substring-search-down-buffer() { false } +HISTORY_PATH_SEPARATOR="///; " + function _history-substring-search-up-history() { # # Behave like up in ZSH, except clear the $BUFFER @@ -447,7 +449,8 @@ function _history-substring-search-up-history() { # going up from somewhere below the top of history else - zle up-history + ((HISTNO--)) + BUFFER=${history[$HISTNO]#*$HISTORY_PATH_SEPARATOR} fi return true @@ -470,7 +473,8 @@ function _history-substring-search-down-history() { # going down from somewhere above the bottom of history else - zle down-history + ((HISTNO++)) + BUFFER=${history[$HISTNO]#*$HISTORY_PATH_SEPARATOR} fi return true @@ -517,7 +521,7 @@ function _history-substring-search-up-search() { # to highlight the current buffer. # (( _history_substring_search_match_index-- )) - BUFFER=$history[$_history_substring_search_matches[$_history_substring_search_match_index]] + BUFFER=${history[$_history_substring_search_matches[$_history_substring_search_match_index]]#*$HISTORY_PATH_SEPARATOR} _history_substring_search_query_highlight=$HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND elif [[ $_history_substring_search_match_index -eq 1 ]]; then From 2bf772118b41009267bae6f1e9af8c455fbcf371 Mon Sep 17 00:00:00 2001 From: Steven Lu Date: Tue, 9 Jul 2013 21:21:28 +0000 Subject: [PATCH 09/39] Removing bad alias that screws over sending flags to "history" --- lib/aliases.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/aliases.zsh b/lib/aliases.zsh index 9b3709172..4a2f8fe83 100644 --- a/lib/aliases.zsh +++ b/lib/aliases.zsh @@ -13,7 +13,7 @@ alias please='sudo' #alias g='grep -in' # Show history -alias history='fc -l 1' +# alias history='fc -l 1' # List direcory contents alias lsa='ls -lah' From dfb8c9c1c38f8070376079b3d0a004403a8db2bf Mon Sep 17 00:00:00 2001 From: Steven Lu Date: Tue, 9 Jul 2013 21:32:17 +0000 Subject: [PATCH 10/39] Adjust prompt date --- themes/lust.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/lust.zsh-theme b/themes/lust.zsh-theme index f26e31272..e09144501 100644 --- a/themes/lust.zsh-theme +++ b/themes/lust.zsh-theme @@ -13,7 +13,7 @@ function myjobs() { } if [[ "$TERM" != "dumb" ]] && [[ "$DISABLE_LS_COLORS" != "true" ]]; then - PROMPT='%{$fg[red]%}%n%{$reset_color%}@%{$fg[green]%}%m%{$reset_color%}:%{$fg[blue]%}%~%{$reset_color%} %{$fg[yellow]%}%w %T%{$fg[magenta]%} %!%{$reset_color%} + PROMPT='%{$fg[red]%}%n%{$reset_color%}@%{$fg[green]%}%m%{$reset_color%}:%{$fg[blue]%}%~%{$reset_color%} %{$fg[yellow]%}%W %T%{$fg[magenta]%} %!%{$reset_color%} $(myjobs)%(!.%{$fg[red]%}#.%{$fg[cyan]%}❯)%{$reset_color%} ' ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}" From 765dc37f893b0df22acdea6d04e567e87458ee14 Mon Sep 17 00:00:00 2001 From: Steven Lu Date: Tue, 9 Jul 2013 23:00:49 -0400 Subject: [PATCH 11/39] Fully building the fork into a ready to deploy form --- tools/install.sh | 24 +++++++---- zshrc | 101 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 118 insertions(+), 7 deletions(-) create mode 100644 zshrc diff --git a/tools/install.sh b/tools/install.sh index a2bd5665a..e4ef8aeef 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -4,8 +4,13 @@ then exit fi +which zsh || { + echo "zsh not found!" + exit +} + echo "\033[0;34mCloning Oh My Zsh...\033[0m" -hash git >/dev/null && /usr/bin/env git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh || { +hash git >/dev/null && /usr/bin/env git clone https://github.com/unphased/oh-my-zsh.git ~/.oh-my-zsh || { echo "git not installed" exit } @@ -17,16 +22,21 @@ then mv ~/.zshrc ~/.zshrc.pre-oh-my-zsh; fi -echo "\033[0;34mUsing the Oh My Zsh template file and adding it to ~/.zshrc\033[0m" -cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc +echo "\033[0;34mUsing my zshrc, linking ~/.zshrc to it\033[0m" +if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]; then + rm ~/.zshrc +fi +ln -s "$HOME/.oh-my-zsh/zshrc" ~/.zshrc -echo "\033[0;34mCopying your current PATH and adding it to the end of ~/.zshrc for you.\033[0m" -echo "export PATH=\$PATH:$PATH" >> ~/.zshrc +# cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc -echo "\033[0;34mTime to change your default shell to zsh!\033[0m" +# echo "\033[0;34mCopying your current PATH and adding it to the end of ~/.zshrc for you.\033[0m" +# echo "export PATH=\$PATH:$PATH" >> ~/.zshrc + +echo "\033[0;34mChanging default shell to zsh\033[0m" chsh -s `which zsh` -echo "\033[0;32m"' __ __ '"\033[0m" +echo "\033[0;32m"" __ slu's fork __ ""\033[0m" echo "\033[0;32m"' ____ / /_ ____ ___ __ __ ____ _____/ /_ '"\033[0m" echo "\033[0;32m"' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ '"\033[0m" echo "\033[0;32m"'/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / '"\033[0m" diff --git a/zshrc b/zshrc new file mode 100644 index 000000000..5f11d5c40 --- /dev/null +++ b/zshrc @@ -0,0 +1,101 @@ +# Path to your oh-my-zsh configuration. +ZSH=$HOME/.oh-my-zsh + +# 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="lust" + +# Example aliases +# alias zshconfig="mate ~/.zshrc" +# alias ohmyzsh="mate ~/.oh-my-zsh" + +# Set to this to use case-sensitive completion +# CASE_SENSITIVE="true" + +# Comment this out to disable bi-weekly auto-update checks +# DISABLE_AUTO_UPDATE="true" + +# Uncomment to change how many often would you like to wait before auto-updates occur? (in days) +# export UPDATE_ZSH_DAYS=13 + +# Uncomment following line if you want to disable colors in ls +# DISABLE_LS_COLORS="true" + +# 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" # yes yes yes + +# 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 cp osx history zsh-syntax-highlighting) + +source $ZSH/oh-my-zsh.sh + + +# Thankfully the path that is already present is the one that the system has set according to +# normal practices. This inserts a few more things that I use from the shell. +export PATH=~/bin:~/util:$PATH:/usr/local/share/npm/bin +# export PAGER=vimpager + +# zmodload zsh/complist +# bindkey -M menuselect ' ' accept-and-infer-next-history +# bindkey -M menuselect '^?' undo + +# vim mode. I'm ready for it. +bindkey -v +bindkey "^H" backward-kill-word +bindkey "^?" backward-delete-char +bindkey "^U" backward-kill-line +# must bind all kind of shit for gettind the damn control keys right now... +bindkey "^[[1;5D" backward-word +bindkey "^[[1;5C" forward-word +bindkey "^[[1;3D" vi-backward-word # alt +bindkey "^[[1;3C" vi-forward-word-end # alt +bindkey "^[[1~" beginning-of-line +bindkey "^[[4~" end-of-line +# bindkey "^[[2~" Thsi should run tmux ctrl a ] to paste copy buffer +bindkey "^[[3~" delete-char +bindkey "^[[5~" up-line-or-search +bindkey "^[[6~" down-line-or-search +bindkey -M vicmd "F10" vi-cmd-mode +# bindkey -m vicmd "F10" this should run a widget that runs tmux to switch pane (Note the semantics are reversed; by default the shell should be in insert mode) +bindkey -M viins '^r' history-incremental-search-backward +bindkey -M vicmd '^r' history-incremental-search-backward + +stty -ixon +stty -ixoff +source $ZSH/plugins/history-substring-search/history-substring-search.plugin.zsh + +export HISTSIZE=20000 +export SAVEHIST=200000 + +function zshaddhistory() { + COMMAND_STR=${1%%$'\n'} + [[ ( -z $COMMAND_STR ) || ( $COMMAND_STR == history ) || \ + ( $COMMAND_STR =~ ^l(s\|l\|a)?$ ) || \ + ( $COMMAND_STR =~ ^(d\|gd\|git\ diff\|glp\|gg)$ ) \ + ]] && return 1 + print -sr "${PWD}///; ${COMMAND_STR}" + fc -p +} + +alias l="ls" +alias gs="git s" # short status +alias glp="git log -p --no-ext-diff" +alias gdt="git difftool" +alias gd="git diff --no-ext-diff" +alias gdc="gd --cached" +alias gg="git lg" +alias gcm="git commit -am" +alias mk="make" +alias v="vim" + +alias ds="dirs -v | head -10" +alias d="gd" + +echo "Finished loading my .zshrc" From 6febdea2df97d326c42183dd2458e00f56f10cf1 Mon Sep 17 00:00:00 2001 From: Steven Lu Date: Tue, 9 Jul 2013 23:11:12 -0400 Subject: [PATCH 12/39] More auto-ness for making Linux (Ubuntu is what I'm testing now) happy --- tools/install.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/install.sh b/tools/install.sh index e4ef8aeef..7c8ab0a56 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -34,6 +34,7 @@ ln -s "$HOME/.oh-my-zsh/zshrc" ~/.zshrc # echo "export PATH=\$PATH:$PATH" >> ~/.zshrc echo "\033[0;34mChanging default shell to zsh\033[0m" +sudo echo `which zsh` >> /etc/shells chsh -s `which zsh` echo "\033[0;32m"" __ slu's fork __ ""\033[0m" From 10e73268e3bcd341e870f7687dbf153cb43766b7 Mon Sep 17 00:00:00 2001 From: Steven Lu Date: Wed, 10 Jul 2013 08:59:11 -0400 Subject: [PATCH 13/39] prpagating --- zshrc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/zshrc b/zshrc index 62e4f3349..cff44690b 100644 --- a/zshrc +++ b/zshrc @@ -5,7 +5,9 @@ ZSH=$HOME/.oh-my-zsh # 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="steeef" +ZSH_THEME="lust" + +export LANG=en_US.UTF-8 # Example aliases # alias zshconfig="mate ~/.zshrc" From 51f28dfc43045c51617d61e3b8cc59d2b6df48cb Mon Sep 17 00:00:00 2001 From: Steven Lu Date: Thu, 11 Jul 2013 02:33:35 -0400 Subject: [PATCH 14/39] Changing to a zsh-theme that appears not to suffer from the offset madness from plain putty --- themes/lust.zsh-theme | 2 +- zshrc | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/themes/lust.zsh-theme b/themes/lust.zsh-theme index e09144501..9e4341b33 100644 --- a/themes/lust.zsh-theme +++ b/themes/lust.zsh-theme @@ -102,7 +102,7 @@ $(myjobs)%(!.%{$fg[red]%}#.%{$fg[cyan]%}❯)%{$reset_color%} ' } # display exitcode on the right when >0 - return_code="%(?..%{$fg[magenta]%}%? ↲ %{$reset_color%}) " + return_code="%(?..%F{magenta}%? ↲ %f) " RPROMPT='${return_code}$(git_prompt_info)$(git_prompt_short_sha)$(my_git_prompt_status_and_time)' diff --git a/zshrc b/zshrc index 5f11d5c40..62e4f3349 100644 --- a/zshrc +++ b/zshrc @@ -5,7 +5,7 @@ ZSH=$HOME/.oh-my-zsh # 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="lust" +ZSH_THEME="steeef" # Example aliases # alias zshconfig="mate ~/.zshrc" @@ -93,7 +93,6 @@ alias gdc="gd --cached" alias gg="git lg" alias gcm="git commit -am" alias mk="make" -alias v="vim" alias ds="dirs -v | head -10" alias d="gd" From 491e71ccdafabb83b4c7f79ae07dd4a2db1774d4 Mon Sep 17 00:00:00 2001 From: Steven Lu Date: Thu, 11 Jul 2013 14:47:22 -0400 Subject: [PATCH 15/39] turns out the fix is just to put unicode to LANG --- zshrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zshrc b/zshrc index 62e4f3349..756b8bd46 100644 --- a/zshrc +++ b/zshrc @@ -5,7 +5,7 @@ ZSH=$HOME/.oh-my-zsh # 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="steeef" +ZSH_THEME="lust" # Example aliases # alias zshconfig="mate ~/.zshrc" From 9029adb9c67d15da0da05a33ab8c77959c1b9f53 Mon Sep 17 00:00:00 2001 From: Steven Lu Date: Thu, 11 Jul 2013 17:07:07 -0400 Subject: [PATCH 16/39] More adjustments to zsh setup --- lib/aliases.zsh | 1 + lib/history.zsh | 4 ++-- plugins/history/history.plugin.zsh | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/aliases.zsh b/lib/aliases.zsh index 4a2f8fe83..391e9da5f 100644 --- a/lib/aliases.zsh +++ b/lib/aliases.zsh @@ -14,6 +14,7 @@ alias please='sudo' # Show history # alias history='fc -l 1' +alias his = 'fc -l 1' # List direcory contents alias lsa='ls -lah' diff --git a/lib/history.zsh b/lib/history.zsh index 86cabdd9b..2bfed11d9 100644 --- a/lib/history.zsh +++ b/lib/history.zsh @@ -2,8 +2,8 @@ if [ -z $HISTFILE ]; then HISTFILE=$HOME/.zsh_history fi -HISTSIZE=100000 -SAVEHIST=100000 +HISTSIZE=200000 +SAVEHIST=2000000 setopt append_history setopt extended_history diff --git a/plugins/history/history.plugin.zsh b/plugins/history/history.plugin.zsh index 0f4aa4b10..3bad8dc47 100644 --- a/plugins/history/history.plugin.zsh +++ b/plugins/history/history.plugin.zsh @@ -1,8 +1,8 @@ -alias h='history' +alias h='his' function hs { - history | grep $* + h | grep $* } alias hsi='hs -i' From 6ca29791166f98e2261a5ea7934752b41aa3b79c Mon Sep 17 00:00:00 2001 From: Steven Lu Date: Wed, 10 Jul 2013 11:42:49 -0400 Subject: [PATCH 17/39] This is fixing a stupid typo in declaring an alias --- lib/aliases.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/aliases.zsh b/lib/aliases.zsh index 391e9da5f..98af8648e 100644 --- a/lib/aliases.zsh +++ b/lib/aliases.zsh @@ -14,7 +14,7 @@ alias please='sudo' # Show history # alias history='fc -l 1' -alias his = 'fc -l 1' +alias his='fc -l 1' # List direcory contents alias lsa='ls -lah' From b30ff1104e27c1129b036556da494c65ca1daa5e Mon Sep 17 00:00:00 2001 From: Steven Lu Date: Wed, 10 Jul 2013 11:47:54 -0400 Subject: [PATCH 18/39] Adding /usr/local/bin to path for root in zsh --- zshrc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/zshrc b/zshrc index a7212d976..dd7229bf7 100644 --- a/zshrc +++ b/zshrc @@ -41,6 +41,8 @@ source $ZSH/oh-my-zsh.sh # Thankfully the path that is already present is the one that the system has set according to # normal practices. This inserts a few more things that I use from the shell. export PATH=~/bin:~/util:$PATH:/usr/local/share/npm/bin + +[[ $(id -u) == 0 ]] && export PATH=/usr/local/bin/:$PATH # export PAGER=vimpager # zmodload zsh/complist From e9dd08041e7e3dacd31f8be7a2a6b3124cf2d94b Mon Sep 17 00:00:00 2001 From: Steven Lu Date: Wed, 10 Jul 2013 11:49:13 -0400 Subject: [PATCH 19/39] fixing extra slash in path --- zshrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zshrc b/zshrc index dd7229bf7..a79bf9586 100644 --- a/zshrc +++ b/zshrc @@ -42,7 +42,7 @@ source $ZSH/oh-my-zsh.sh # normal practices. This inserts a few more things that I use from the shell. export PATH=~/bin:~/util:$PATH:/usr/local/share/npm/bin -[[ $(id -u) == 0 ]] && export PATH=/usr/local/bin/:$PATH +[[ $(id -u) == 0 ]] && export PATH=/usr/local/bin:$PATH # export PAGER=vimpager # zmodload zsh/complist From 4a9d949b6b1108f3fa76ac39406754d9f21fd665 Mon Sep 17 00:00:00 2001 From: Steven Lu Date: Fri, 12 Jul 2013 22:42:32 -0400 Subject: [PATCH 20/39] Disabling auto update because it messes with my own fork. I know there is a bunch of cruft in here but I have too many of my own tweaks to give them up. I will be periodically merging in from upstream --- zshrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zshrc b/zshrc index a79bf9586..73b889825 100644 --- a/zshrc +++ b/zshrc @@ -16,7 +16,7 @@ export LANG=en_US.UTF-8 # CASE_SENSITIVE="true" # Comment this out to disable bi-weekly auto-update checks -# DISABLE_AUTO_UPDATE="true" +DISABLE_AUTO_UPDATE="true" # Uncomment to change how many often would you like to wait before auto-updates occur? (in days) # export UPDATE_ZSH_DAYS=13 From be527c83d0b967501a44e3e4024161c57003e770 Mon Sep 17 00:00:00 2001 From: Steven Lu Date: Fri, 12 Jul 2013 23:06:25 -0400 Subject: [PATCH 21/39] This is all a bit of a mystery to me, tbh. It basically seems to work well enough so far. --- lib/history.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/history.zsh b/lib/history.zsh index 2bfed11d9..f41aeb553 100644 --- a/lib/history.zsh +++ b/lib/history.zsh @@ -4,6 +4,8 @@ if [ -z $HISTFILE ]; then fi HISTSIZE=200000 SAVEHIST=2000000 +INC_APPEND_HISTORY=1 +HIST_IGNORE_DUPS=1 setopt append_history setopt extended_history From 83f01cc9ab8852bc20268525d4595b207415f52e Mon Sep 17 00:00:00 2001 From: Steven Lu Date: Mon, 15 Jul 2013 14:53:40 +0000 Subject: [PATCH 22/39] This is not something that should be done unless as a last resort --- zshrc | 2 -- 1 file changed, 2 deletions(-) diff --git a/zshrc b/zshrc index 73b889825..a35855ef7 100644 --- a/zshrc +++ b/zshrc @@ -41,8 +41,6 @@ source $ZSH/oh-my-zsh.sh # Thankfully the path that is already present is the one that the system has set according to # normal practices. This inserts a few more things that I use from the shell. export PATH=~/bin:~/util:$PATH:/usr/local/share/npm/bin - -[[ $(id -u) == 0 ]] && export PATH=/usr/local/bin:$PATH # export PAGER=vimpager # zmodload zsh/complist From 606be8570d7f4b189658e315f1a0e118c76081d9 Mon Sep 17 00:00:00 2001 From: Steven Lu Date: Fri, 19 Jul 2013 00:26:23 -0400 Subject: [PATCH 23/39] This is a fix to move away from bad crap shoved into the zsh history --- zshrc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/zshrc b/zshrc index 73b889825..8dfd5c031 100644 --- a/zshrc +++ b/zshrc @@ -42,7 +42,7 @@ source $ZSH/oh-my-zsh.sh # normal practices. This inserts a few more things that I use from the shell. export PATH=~/bin:~/util:$PATH:/usr/local/share/npm/bin -[[ $(id -u) == 0 ]] && export PATH=/usr/local/bin:$PATH +# [[ $(id -u) == 0 ]] && export PATH=/usr/local/bin:$PATH # export PAGER=vimpager # zmodload zsh/complist @@ -77,13 +77,21 @@ source $ZSH/plugins/history-substring-search/history-substring-search.plugin.zsh export HISTSIZE=20000 export SAVEHIST=200000 +# This is an independent save of the history and terminal's cwd. +# This avoids problems that crop up when I try to squish the cwd into the history entry. function zshaddhistory() { COMMAND_STR=${1%%$'\n'} [[ ( -z $COMMAND_STR ) || ( $COMMAND_STR == history ) || \ ( $COMMAND_STR =~ ^l(s\|l\|a)?$ ) || \ ( $COMMAND_STR =~ ^(d\|gd\|git\ diff\|glp\|gg)$ ) \ ]] && return 1 - print -sr "${PWD}///; ${COMMAND_STR}" + # do not do anything on common commands + + # do the needful + echo "$PWD; $COMMAND_STR; $TTY@$(date +%s.%N)" >> ~/.zsh_enhanced_history + + # rest is "default" zshaddhistory() + print -sr "${COMMAND_STR}" fc -p } From c0b1058149b87983e4ff89e69b7082f18b2c18ee Mon Sep 17 00:00:00 2001 From: Steven Lu Date: Tue, 23 Jul 2013 19:51:59 -0400 Subject: [PATCH 24/39] more better fixing --- .../history-substring-search.zsh | 10 +++------ zshrc | 22 +------------------ 2 files changed, 4 insertions(+), 28 deletions(-) diff --git a/plugins/history-substring-search/history-substring-search.zsh b/plugins/history-substring-search/history-substring-search.zsh index 53b1b429b..ef3a73539 100644 --- a/plugins/history-substring-search/history-substring-search.zsh +++ b/plugins/history-substring-search/history-substring-search.zsh @@ -434,8 +434,6 @@ function _history-substring-search-down-buffer() { false } -HISTORY_PATH_SEPARATOR="///; " - function _history-substring-search-up-history() { # # Behave like up in ZSH, except clear the $BUFFER @@ -449,8 +447,7 @@ function _history-substring-search-up-history() { # going up from somewhere below the top of history else - ((HISTNO--)) - BUFFER=${history[$HISTNO]#*$HISTORY_PATH_SEPARATOR} + zle up-history fi return true @@ -473,8 +470,7 @@ function _history-substring-search-down-history() { # going down from somewhere above the bottom of history else - ((HISTNO++)) - BUFFER=${history[$HISTNO]#*$HISTORY_PATH_SEPARATOR} + zle down-history fi return true @@ -521,7 +517,7 @@ function _history-substring-search-up-search() { # to highlight the current buffer. # (( _history_substring_search_match_index-- )) - BUFFER=${history[$_history_substring_search_matches[$_history_substring_search_match_index]]#*$HISTORY_PATH_SEPARATOR} + BUFFER=$history[$_history_substring_search_matches[$_history_substring_search_match_index]] _history_substring_search_query_highlight=$HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND elif [[ $_history_substring_search_match_index -eq 1 ]]; then diff --git a/zshrc b/zshrc index 8dfd5c031..76cf322ce 100644 --- a/zshrc +++ b/zshrc @@ -49,26 +49,6 @@ export PATH=~/bin:~/util:$PATH:/usr/local/share/npm/bin # bindkey -M menuselect ' ' accept-and-infer-next-history # bindkey -M menuselect '^?' undo -# vim mode. I'm ready for it. -bindkey -v -bindkey "^H" backward-kill-word -bindkey "^?" backward-delete-char -bindkey "^U" backward-kill-line -# must bind all kind of shit for gettind the damn control keys right now... -bindkey "^[[1;5D" backward-word -bindkey "^[[1;5C" forward-word -bindkey "^[[1;3D" vi-backward-word # alt -bindkey "^[[1;3C" vi-forward-word-end # alt -bindkey "^[[1~" beginning-of-line -bindkey "^[[4~" end-of-line -# bindkey "^[[2~" Thsi should run tmux ctrl a ] to paste copy buffer -bindkey "^[[3~" delete-char -bindkey "^[[5~" up-line-or-search -bindkey "^[[6~" down-line-or-search -bindkey -M vicmd "F10" vi-cmd-mode -# bindkey -m vicmd "F10" this should run a widget that runs tmux to switch pane (Note the semantics are reversed; by default the shell should be in insert mode) -bindkey -M viins '^r' history-incremental-search-backward -bindkey -M vicmd '^r' history-incremental-search-backward stty -ixon stty -ixoff @@ -99,7 +79,7 @@ alias l="ls" alias gs="git s" # short status alias glp="git log -p --no-ext-diff" alias gdt="git difftool" -alias gd="git diff --no-ext-diff" +alias gd="git diff" alias gdc="gd --cached" alias gg="git lg" alias gcm="git commit -am" From 35313072270bebadbc4662ce13e426690cb72605 Mon Sep 17 00:00:00 2001 From: Steven Lu Date: Wed, 24 Jul 2013 22:28:33 -0400 Subject: [PATCH 25/39] Yes --- keychain-setup.sh | 5 +++++ zshrc | 2 ++ 2 files changed, 7 insertions(+) create mode 100644 keychain-setup.sh diff --git a/keychain-setup.sh b/keychain-setup.sh new file mode 100644 index 000000000..cfcd28c8a --- /dev/null +++ b/keychain-setup.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +# This script sets up the keychain and is sourced by .{ba,z}shrc. +keychain ~/.ssh/id_rsa +. ~/.keychain/${HOST}-sh diff --git a/zshrc b/zshrc index 76cf322ce..215a21e33 100644 --- a/zshrc +++ b/zshrc @@ -88,4 +88,6 @@ alias mk="make" alias ds="dirs -v | head -10" alias d="gd" +source ~/.oh-my-zsh/keychain-setup.sh + echo "Finished loading my .zshrc" From aa581421cbf48e84c1439599e19e3ccc9bb60e41 Mon Sep 17 00:00:00 2001 From: Steven Lu Date: Thu, 25 Jul 2013 00:25:59 -0400 Subject: [PATCH 26/39] A descriptive comment --- keychain-setup.sh | 5 ----- zshrc | 1 + 2 files changed, 1 insertion(+), 5 deletions(-) delete mode 100644 keychain-setup.sh diff --git a/keychain-setup.sh b/keychain-setup.sh deleted file mode 100644 index cfcd28c8a..000000000 --- a/keychain-setup.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# This script sets up the keychain and is sourced by .{ba,z}shrc. -keychain ~/.ssh/id_rsa -. ~/.keychain/${HOST}-sh diff --git a/zshrc b/zshrc index 215a21e33..ae0c0a95c 100644 --- a/zshrc +++ b/zshrc @@ -88,6 +88,7 @@ alias mk="make" alias ds="dirs -v | head -10" alias d="gd" +# maintain this manually per-system source ~/.oh-my-zsh/keychain-setup.sh echo "Finished loading my .zshrc" From 9263a2782218ed3f1a6e29c6feceae5421c6ede6 Mon Sep 17 00:00:00 2001 From: Steven Lu Date: Thu, 25 Jul 2013 00:40:04 -0400 Subject: [PATCH 27/39] This is the new place for this --- zshrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zshrc b/zshrc index ae0c0a95c..b1a27541c 100644 --- a/zshrc +++ b/zshrc @@ -89,6 +89,6 @@ alias ds="dirs -v | head -10" alias d="gd" # maintain this manually per-system -source ~/.oh-my-zsh/keychain-setup.sh +source ~/.keychain-setup.sh echo "Finished loading my .zshrc" From 91edf3e5dd0da74bce75e5eb9619e9815c5dc31a Mon Sep 17 00:00:00 2001 From: Steven Lu Date: Thu, 25 Jul 2013 20:25:01 -0400 Subject: [PATCH 28/39] shit the other message to util was for this :( It was "too early" --- zshrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zshrc b/zshrc index b1a27541c..46f8a2d61 100644 --- a/zshrc +++ b/zshrc @@ -79,7 +79,7 @@ alias l="ls" alias gs="git s" # short status alias glp="git log -p --no-ext-diff" alias gdt="git difftool" -alias gd="git diff" +alias gd="git diff --no-ext-diff" alias gdc="gd --cached" alias gg="git lg" alias gcm="git commit -am" From 4262b6238e715453746f7f533338e77446bdb460 Mon Sep 17 00:00:00 2001 From: Steven Lu Date: Fri, 26 Jul 2013 01:42:06 -0400 Subject: [PATCH 29/39] Bringing back original history plugin stuff (i liked the old history mass-dump) --- lib/aliases.zsh | 3 +-- plugins/history/history.plugin.zsh | 4 ++-- zshrc | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/aliases.zsh b/lib/aliases.zsh index 98af8648e..9b3709172 100644 --- a/lib/aliases.zsh +++ b/lib/aliases.zsh @@ -13,8 +13,7 @@ alias please='sudo' #alias g='grep -in' # Show history -# alias history='fc -l 1' -alias his='fc -l 1' +alias history='fc -l 1' # List direcory contents alias lsa='ls -lah' diff --git a/plugins/history/history.plugin.zsh b/plugins/history/history.plugin.zsh index 3bad8dc47..0f4aa4b10 100644 --- a/plugins/history/history.plugin.zsh +++ b/plugins/history/history.plugin.zsh @@ -1,8 +1,8 @@ -alias h='his' +alias h='history' function hs { - h | grep $* + history | grep $* } alias hsi='hs -i' diff --git a/zshrc b/zshrc index 46f8a2d61..3c45012d8 100644 --- a/zshrc +++ b/zshrc @@ -71,7 +71,7 @@ function zshaddhistory() { echo "$PWD; $COMMAND_STR; $TTY@$(date +%s.%N)" >> ~/.zsh_enhanced_history # rest is "default" zshaddhistory() - print -sr "${COMMAND_STR}" + print -Sr ${COMMAND_STR} fc -p } From bb102a0e18b423e00d57ca2effc4efca5b4e240f Mon Sep 17 00:00:00 2001 From: Steven Lu Date: Fri, 26 Jul 2013 01:43:38 -0400 Subject: [PATCH 30/39] to silence status --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 51a5ee6c3..4d0435870 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ custom/* *.swp !custom/example.zshcache cache/ +plugins/zsh-syntax-highlighting/ From e82a08dc37bce833ec043edccb27d8bdfa27d06e Mon Sep 17 00:00:00 2001 From: Steven Lu Date: Thu, 8 Aug 2013 22:23:06 -0400 Subject: [PATCH 31/39] This adds the host to the enhanced history in preparation for auto-chronological-merging of my command history --- zshrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zshrc b/zshrc index 3c45012d8..5e7213327 100644 --- a/zshrc +++ b/zshrc @@ -68,7 +68,7 @@ function zshaddhistory() { # do not do anything on common commands # do the needful - echo "$PWD; $COMMAND_STR; $TTY@$(date +%s.%N)" >> ~/.zsh_enhanced_history + echo "$PWD; $COMMAND_STR; $TTY@$HOST@$(date +%s.%N)" >> ~/.zsh_enhanced_history # rest is "default" zshaddhistory() print -Sr ${COMMAND_STR} From 124e114a973a950f446c2d97da32f60e7dfba406 Mon Sep 17 00:00:00 2001 From: Steven Lu Date: Fri, 9 Aug 2013 12:09:39 -0400 Subject: [PATCH 32/39] More to exclude --- zshrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zshrc b/zshrc index 5e7213327..d008b4c86 100644 --- a/zshrc +++ b/zshrc @@ -61,7 +61,7 @@ export SAVEHIST=200000 # This avoids problems that crop up when I try to squish the cwd into the history entry. function zshaddhistory() { COMMAND_STR=${1%%$'\n'} - [[ ( -z $COMMAND_STR ) || ( $COMMAND_STR == history ) || \ + [[ ( -z $COMMAND_STR ) || ( $COMMAND_STR =~ hist(ory)? ) || \ ( $COMMAND_STR =~ ^l(s\|l\|a)?$ ) || \ ( $COMMAND_STR =~ ^(d\|gd\|git\ diff\|glp\|gg)$ ) \ ]] && return 1 From 57142e46c68d8a847272ba0c6a79ceea093bcaf3 Mon Sep 17 00:00:00 2001 From: Steven Lu Date: Mon, 12 Aug 2013 11:09:57 -0400 Subject: [PATCH 33/39] This fixes the escapement issue with this sweet sweet thing --- zshrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zshrc b/zshrc index d008b4c86..c73847ca8 100644 --- a/zshrc +++ b/zshrc @@ -68,7 +68,7 @@ function zshaddhistory() { # do not do anything on common commands # do the needful - echo "$PWD; $COMMAND_STR; $TTY@$HOST@$(date +%s.%N)" >> ~/.zsh_enhanced_history + print -r "$PWD; $COMMAND_STR; $TTY@$HOST@$(date +%s.%N)" >> ~/.zsh_enhanced_history # rest is "default" zshaddhistory() print -Sr ${COMMAND_STR} From 1f450adbcba4ed6b62db493586c9137d644b1c5b Mon Sep 17 00:00:00 2001 From: Steven Lu Date: Wed, 14 Aug 2013 16:08:00 -0400 Subject: [PATCH 34/39] Anchoring this as well so culling is not overzealous --- zshrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zshrc b/zshrc index c73847ca8..c45c32318 100644 --- a/zshrc +++ b/zshrc @@ -61,7 +61,7 @@ export SAVEHIST=200000 # This avoids problems that crop up when I try to squish the cwd into the history entry. function zshaddhistory() { COMMAND_STR=${1%%$'\n'} - [[ ( -z $COMMAND_STR ) || ( $COMMAND_STR =~ hist(ory)? ) || \ + [[ ( -z $COMMAND_STR ) || ( $COMMAND_STR =~ $hist(ory)?$ ) || \ ( $COMMAND_STR =~ ^l(s\|l\|a)?$ ) || \ ( $COMMAND_STR =~ ^(d\|gd\|git\ diff\|glp\|gg)$ ) \ ]] && return 1 From 5a881d9164211673e138b0c091ced358dc065d71 Mon Sep 17 00:00:00 2001 From: Steven Lu Date: Fri, 16 Aug 2013 00:39:40 -0400 Subject: [PATCH 35/39] Wtf typo --- zshrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zshrc b/zshrc index c45c32318..46d35bb48 100644 --- a/zshrc +++ b/zshrc @@ -61,7 +61,7 @@ export SAVEHIST=200000 # This avoids problems that crop up when I try to squish the cwd into the history entry. function zshaddhistory() { COMMAND_STR=${1%%$'\n'} - [[ ( -z $COMMAND_STR ) || ( $COMMAND_STR =~ $hist(ory)?$ ) || \ + [[ ( -z $COMMAND_STR ) || ( $COMMAND_STR =~ ^hist(ory)?$ ) || \ ( $COMMAND_STR =~ ^l(s\|l\|a)?$ ) || \ ( $COMMAND_STR =~ ^(d\|gd\|git\ diff\|glp\|gg)$ ) \ ]] && return 1 From 80637fdc763953449893d919c6171563a97322ec Mon Sep 17 00:00:00 2001 From: Steven Lu Date: Wed, 21 Aug 2013 15:08:22 -0400 Subject: [PATCH 36/39] This consolidates so aliases are shared between bash and zsh --- zshrc | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/zshrc b/zshrc index 46d35bb48..3f7470915 100644 --- a/zshrc +++ b/zshrc @@ -42,7 +42,9 @@ source $ZSH/oh-my-zsh.sh # normal practices. This inserts a few more things that I use from the shell. export PATH=~/bin:~/util:$PATH:/usr/local/share/npm/bin -# [[ $(id -u) == 0 ]] && export PATH=/usr/local/bin:$PATH +# this should be allowed I think. But the system should really be configured to +# give that path to root user. +[[ $(id -u) == 0 ]] && export PATH=/usr/local/bin:$PATH # export PAGER=vimpager # zmodload zsh/complist @@ -75,18 +77,7 @@ function zshaddhistory() { fc -p } -alias l="ls" -alias gs="git s" # short status -alias glp="git log -p --no-ext-diff" -alias gdt="git difftool" -alias gd="git diff --no-ext-diff" -alias gdc="gd --cached" -alias gg="git lg" -alias gcm="git commit -am" -alias mk="make" - -alias ds="dirs -v | head -10" -alias d="gd" +. ~/aliases.sh # maintain this manually per-system source ~/.keychain-setup.sh From f5909117ae481072e6c428583ed583cf669343b6 Mon Sep 17 00:00:00 2001 From: Steven Lu Date: Wed, 21 Aug 2013 18:29:33 -0400 Subject: [PATCH 37/39] changing this file.. gah --- zshrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zshrc b/zshrc index 3f7470915..15a02071d 100644 --- a/zshrc +++ b/zshrc @@ -77,7 +77,7 @@ function zshaddhistory() { fc -p } -. ~/aliases.sh +. ~/.aliases.sh # maintain this manually per-system source ~/.keychain-setup.sh From ab15a72004482a3231a9fd623b5fef2ece31b9c9 Mon Sep 17 00:00:00 2001 From: Steven Lu Date: Sat, 24 Aug 2013 16:38:54 -0400 Subject: [PATCH 38/39] Apportable path --- zshrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zshrc b/zshrc index 46d35bb48..e98dbcff9 100644 --- a/zshrc +++ b/zshrc @@ -40,7 +40,7 @@ source $ZSH/oh-my-zsh.sh # Thankfully the path that is already present is the one that the system has set according to # normal practices. This inserts a few more things that I use from the shell. -export PATH=~/bin:~/util:$PATH:/usr/local/share/npm/bin +export PATH=~/bin:~/util:$PATH:/usr/local/share/npm/bin:~/.apportable/SDK/bin # [[ $(id -u) == 0 ]] && export PATH=/usr/local/bin:$PATH # export PAGER=vimpager From c6635ef9a0d1aa8cc121a6feedf37f9d62dc06f0 Mon Sep 17 00:00:00 2001 From: Steven Lu Date: Thu, 5 Sep 2013 16:04:50 -0400 Subject: [PATCH 39/39] Well... im not sure but i think this one got left out during one of my purges. It is very convenient to have.... --- zshrc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/zshrc b/zshrc index 15a02071d..35a52914d 100644 --- a/zshrc +++ b/zshrc @@ -54,6 +54,8 @@ export PATH=~/bin:~/util:$PATH:/usr/local/share/npm/bin stty -ixon stty -ixoff +bindkey "^[[1;3C" forward-word +bindkey "^[[1;3D" backward-word source $ZSH/plugins/history-substring-search/history-substring-search.plugin.zsh export HISTSIZE=20000