From 635baf679915b8d4b29ed1823d60f8cd2b6a5c2b Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Fri, 15 Feb 2013 21:27:21 -0800 Subject: [PATCH 01/19] Add history and job count to RPS1 in loquacious --- zsh/func/prompt_loquacious_setup | 2 ++ 1 file changed, 2 insertions(+) diff --git a/zsh/func/prompt_loquacious_setup b/zsh/func/prompt_loquacious_setup index 3e35fcd..82a266f 100644 --- a/zsh/func/prompt_loquacious_setup +++ b/zsh/func/prompt_loquacious_setup @@ -90,6 +90,8 @@ function set_prompt_info PS1_REPO="" fi + RPS1="[%(j1.%F{magenta}%j%f,.)%F{red}%h%f]" + PS1_LINE='%# ' } From 43eb3c064dba5abf56f2bc2992613774991a753b Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Fri, 15 Feb 2013 21:27:46 -0800 Subject: [PATCH 02/19] Ignore .DS_Store files --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index a2a863f..85eae86 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ +.DS_Store + zsh/cache/ vim/view/ From 2e32f224c6dd143f725de73238933fb2d5fb8545 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Wed, 6 Mar 2013 09:15:40 -0800 Subject: [PATCH 03/19] Add git_gutter toggles --- gvimrc | 2 ++ vimrc | 12 ++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/gvimrc b/gvimrc index 577574b..6581eec 100644 --- a/gvimrc +++ b/gvimrc @@ -15,3 +15,5 @@ endif set guioptions-=T " turn off toolbar set guioptions-=m " turn off menubar + +call togglebg#map("") diff --git a/vimrc b/vimrc index 437af8b..31824fe 100644 --- a/vimrc +++ b/vimrc @@ -126,8 +126,6 @@ endif set bg=dark -call togglebg#map("") - " use solarized colorscheme if the terminal can support it (or we're in a GUI) let g:solarized_termtrans = 1 let g:solarized_visibility = 'low' @@ -163,6 +161,11 @@ nnoremap j nnoremap k nnoremap l +" Usual EMACS (oh the horror!) begin-line and end-line keys for first and last +" buffer. +"nnoremap :bfirst +"nnoremap :blast +" Move between buffers with and nnoremap :bn nnoremap :bp @@ -259,6 +262,11 @@ nmap gV `[v`] "let g:CommandTAcceptSelectionMap='' "let g:CommandTAcceptSelectionTabMap='' +" GitGutter shows changed lines in files. +let g:gitgutter_enabled = 0 +highlight clear SignColumn +nmap gg :ToggleGitGutter + if has('autocmd') filetype plugin indent on From b4bdc559bc42e524426eaeff53b277307c2ca708 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Wed, 6 Mar 2013 09:16:07 -0800 Subject: [PATCH 04/19] Ignore vim spelling files --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 85eae86..e5014bb 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ zsh/cache/ vim/view/ +vim/spelling* From 470b583f28708126b73c991be29c5e6ad8d8e30d Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Wed, 6 Mar 2013 09:16:25 -0800 Subject: [PATCH 05/19] Show history count in RPS1 --- zsh/func/prompt_loquacious_setup | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/zsh/func/prompt_loquacious_setup b/zsh/func/prompt_loquacious_setup index 82a266f..646c688 100644 --- a/zsh/func/prompt_loquacious_setup +++ b/zsh/func/prompt_loquacious_setup @@ -74,6 +74,7 @@ function print_newline function set_prompt_info { + PS1_HISTORY="`prompt_colorize -b -f 'green' '%h'`" PS1_NAME="`prompt_colorize -f 'magenta' '%n'` " PS1_CWD="in `prompt_colorize -f 'green' '%~'` " @@ -90,7 +91,8 @@ function set_prompt_info PS1_REPO="" fi - RPS1="[%(j1.%F{magenta}%j%f,.)%F{red}%h%f]" + # Show background job count if any exist. + RPS1="%(1j.[`prompt_colorize -f 'magenta' '%j'`].)" PS1_LINE='%# ' } From f07bb147c1a2051d1199acbe2e0201298d5f5065 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Fri, 8 Mar 2013 09:20:25 -0800 Subject: [PATCH 06/19] Use the Light varient of Source Code Pro for the Vim GUI --- gvimrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gvimrc b/gvimrc index 6581eec..c909bcb 100644 --- a/gvimrc +++ b/gvimrc @@ -5,7 +5,7 @@ if has('win32') || has('win64') || has('win32unix') set guifont=Inconsolata:h18 elseif has('mac') try - set guifont=Source\ Code\ Pro:h13 + set guifont=Source\ Code\ Pro\ Light:h13 catch set guifont=Menlo:h11 endtry From 8426c840ba68bc5884e396f84eaf2e692cbb8c54 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Tue, 12 Mar 2013 10:58:12 -0700 Subject: [PATCH 07/19] Ignore irssi's away.log Conflicts: .gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index e5014bb..1389dd4 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,5 @@ zsh/cache/ vim/view/ vim/spelling* + +irssi/away.log From 27789e5f3dc188355e79ef671cd20c332afb9fa8 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Tue, 12 Mar 2013 11:00:44 -0700 Subject: [PATCH 08/19] Remove duplicate difftool entry for Kaleidoscope --- gitconfig | 2 -- 1 file changed, 2 deletions(-) diff --git a/gitconfig b/gitconfig index ca8c981..c317f08 100644 --- a/gitconfig +++ b/gitconfig @@ -60,8 +60,6 @@ prompt = false [difftool] prompt = false -[difftool "Kaleidoscope"] - cmd = ksdiff --partial-changeset --relative-path \"$MERGED\" -- \"$LOCAL\" \"$REMOTE\" [mergetool "Kaleidoscope"] cmd = ksdiff --merge --output \"$MERGED\" --base \"$BASE\" -- \"$LOCAL\" --snapshot \"$REMOTE\" --snapshot trustExitCode = true From 402d298f52e6a533eeeee16178f89ed05fdc3eeb Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Tue, 12 Mar 2013 11:00:55 -0700 Subject: [PATCH 09/19] Irssi theme tweaks --- irssi/default.theme | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/irssi/default.theme b/irssi/default.theme index ac99356..7fbb404 100644 --- a/irssi/default.theme +++ b/irssi/default.theme @@ -118,7 +118,7 @@ abstracts = { ## # the basic styling of how to print message, $0 = nick mode, $1 = nick - msgnick = "%K<%n$0$1-%K>%n %|"; + msgnick = " %n$0$1-%k>%n %|"; # message from you is printed. "msgownnick" specifies the styling of the # nick ($0 part in msgnick) and "ownmsgnick" specifies the styling of the @@ -250,7 +250,7 @@ abstracts = { # default background for all statusbars. You can also give # the default foreground color for statusbar items. - sb_background = "%4%w"; + sb_background = "%n%0"; # default backround for "default" statusbar group #sb_default_bg = "%4"; @@ -266,14 +266,14 @@ abstracts = { sbstart = ""; # text at the end of statusbars. Use space so that it's never # used for anything. - sbend = " "; + sbend = ""; topicsbstart = "{sbstart $*}"; topicsbend = "{sbend $*}"; - prompt = "[$*] "; + prompt = "[%n$*] "; - sb = " %c[%n$*%c]%n"; + sb = "%c[%n$*%c]%n "; sbmode = "(%c+%n$*)"; sbaway = " (%GzZzZ%n)"; sbservertag = ":$0 (change with ^X)"; @@ -286,9 +286,9 @@ abstracts = { # normal text sb_act_text = "%c$*"; # public message - sb_act_msg = "%W$*"; + sb_act_msg = "%w$*"; # hilight - sb_act_hilight = "%M$*"; + sb_act_hilight = "%m$*"; # hilight with specified color, $0 = color, $1 = text sb_act_hilight_color = "$0$1-%n"; }; From 4129bc6022b27e0b7e8205d03b8574bb21e5a747 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Tue, 12 Mar 2013 11:01:09 -0700 Subject: [PATCH 10/19] Tmux theme tweaks Looks more like @vilhalmer's config: https://twitter.com/vilhalmer/status/311529816304267264 --- tmux.conf | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/tmux.conf b/tmux.conf index 51ba709..7198b08 100644 --- a/tmux.conf +++ b/tmux.conf @@ -22,20 +22,31 @@ set -g mode-keys vi set -g repeat-time 0 # No left status; right status bar is session name -set -g status-bg green set -g status-left "" +set -g status-left-bg black +set -g status-left-fg brightblue set -g status-left-attr none + set -g status-right "| #S " +set -g status-right-bg black +set -g status-right-fg brightblue set -g status-right-attr none # Start window and pane indexing from 1 instead of 0 set-option -g base-index 1 set-option -g pane-base-index 1 -# Tabs like this: " :() " -setw -g window-status-format " #I:#W(#P) " -setw -g window-status-current-bg yellow -setw -g window-status-current-format " #I:#W(#P) " +# Tabs like this: "(:)" +setw -g window-status-bg black +setw -g window-status-fg brightgreen +setw -g window-status-format "(#I:#W)" +setw -g window-status-current-bg black +setw -g window-status-current-fg yellow +setw -g window-status-current-format "(#I:#W)" + +setw -g window-status-bell-fg red +setw -g window-status-content-fg brightred +setw -g window-status-activity-fg brightred setw -g alternate-screen on From 5b3bc2653be8f1f23b101e3269d12facc427cae4 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Tue, 12 Mar 2013 11:03:11 -0700 Subject: [PATCH 11/19] Extra linebreaks in vimrc --- vimrc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vimrc b/vimrc index 31824fe..1581dbf 100644 --- a/vimrc +++ b/vimrc @@ -183,6 +183,7 @@ function! strip_trailing_whitespace() call cursor(l, c) endfunction + function! FindProjectFileOrDirectory(fod) let l:dir = getcwd() " Search up the path, starting at the current working directory, for the @@ -197,14 +198,17 @@ function! FindProjectFileOrDirectory(fod) return "" endfunction + function! GetProjectRuntimeDirectory() return FindProjectFileOrDirectory("vim") endfunction + function! GetProjectFile() return FindProjectFileOrDirectory("project.vim") endfunction + function! SourceProjectFile() let l:project_file = GetProjectFile() if l:project_file != "" @@ -212,6 +216,7 @@ function! SourceProjectFile() endif endfunction + function! AddProjectRuntimeDirectory() let l:project_rtp = GetProjectRuntimeDirectory() if isdirectory(l:project_rtp) From 5ba6c60a912d66ad0abb31f93c1f375f01159259 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Tue, 12 Mar 2013 13:57:58 -0700 Subject: [PATCH 12/19] Set PS1_JOBS --- zsh/func/prompt_loquacious_setup | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/zsh/func/prompt_loquacious_setup b/zsh/func/prompt_loquacious_setup index 646c688..242e08f 100644 --- a/zsh/func/prompt_loquacious_setup +++ b/zsh/func/prompt_loquacious_setup @@ -1,5 +1,8 @@ #!/usr/bin/zsh +# vim:sw=4:sts=4: +# # A wordy prompt theme. +# # Eryn Wells @@ -84,11 +87,18 @@ function set_prompt_info PS1_HOST='' fi + # Get git repo information, if it exists. See setup function for + # configuration details. vcs_info loquacious if [[ -n "$vcs_info_msg_0_" ]]; then - PS1_REPO="on $vcs_info_msg_0_ " + PS1_REPO="on $vcs_info_msg_0_ " else - PS1_REPO="" + PS1_REPO="" + fi + + # Show background jobs, if any. + if [[ `jobs | wc -l` -ge 1 ]]; then + PS1_JOBS='%j' fi # Show background job count if any exist. From f90198bf2b063c5338c5bda0a8f0d0ca4c3f49d1 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Tue, 12 Mar 2013 13:58:13 -0700 Subject: [PATCH 13/19] Add configure_vcs_info function to zshrc --- zshrc | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/zshrc b/zshrc index 275d5e0..baf8ccc 100644 --- a/zshrc +++ b/zshrc @@ -1,5 +1,5 @@ # .zshrc -# vim: ft=zsh fdm=marker +# vim:ft=zsh:fdm=marker:sw=4:sts=4: # # ZSH init for interactive shells # @@ -174,6 +174,26 @@ function configure_completion #{{{ } #}}} +function configure_vcs_info #{{{ +{ + autoload -U add-zsh-hook + autoload -Uz vcs_info + + zstyle ':vcs_info:*' disable bzr cdv darcs mtn svk tla cvs svn + zstyle ':vcs_info:*' enable git p4 + + zstyle ':vcs_info:git:general:*' formats '%b' + + # Export the current Git branch before every prompt. + function export_gitbranch { + vcs_info general + export gitbranch=${vcs_info_msg_0_} + } + + add-zsh-hook precmd export_gitbranch +} #}}} + + configure_general configure_omz configure_zle @@ -181,6 +201,7 @@ configure_modules_and_functions configure_zsh_aliases configure_history configure_completion +configure_vcs_info configure_prompt From 1f8f5e3a9f7711e083fbfa1380c56ede6c053383 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Tue, 12 Mar 2013 14:01:55 -0700 Subject: [PATCH 14/19] Check $TMUX variable to see if we're in a tmux session before printing list --- zprofile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zprofile b/zprofile index 7b24140..7b917b6 100644 --- a/zprofile +++ b/zprofile @@ -12,7 +12,7 @@ print_heading -l 1 'Initializing login shell' list_tmux_sessions() { tmux_out=`tmux list-sessions 2>/dev/null` - [[ -z "$tmux_out" ]] && return + [[ -z "$tmux_out" || -n "$TMUX" ]] && return echo "You have the following active tmux sessions:" for session in ${(f)tmux_out}; do From 4ca4e39e031ba2da39555c58947bc2da96d20e34 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Tue, 12 Mar 2013 15:34:47 -0700 Subject: [PATCH 15/19] Remove explicit setting of comments in c.vim --- vim/after/ftplugin/c.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vim/after/ftplugin/c.vim b/vim/after/ftplugin/c.vim index c8c679d..b2b3404 100644 --- a/vim/after/ftplugin/c.vim +++ b/vim/after/ftplugin/c.vim @@ -11,6 +11,6 @@ endif " Do comments that look like this: " /* stuff and things " more stuff with things */ -setlocal comments="sO:* -,mO: ,exO:*/,sl:/*,mb: ,ex:*/" +"setlocal comments="sO:* -,mO: ,exO:*/,sl:/*,mb: ,ex:*/" setlocal cinoptions+=(0,Ws From 53f368a30684711ded215afadfe560c8ef50ba17 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Tue, 12 Mar 2013 15:39:46 -0700 Subject: [PATCH 16/19] Set g() instead of alias g=git --- rc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/rc b/rc index c54a388..8ce7e63 100644 --- a/rc +++ b/rc @@ -10,7 +10,6 @@ print_info -l 2 'Creating aliases' alias h='history' alias df='df -h' alias du='du -h' -alias g='git' alias v='vim' binary_exists ledger && alias l='ledger' @@ -27,6 +26,15 @@ alias addkey="ssh-agent ~/.ssh/id_rsa" alias pprint="python -c 'import sys,pprint; pprint.pprint(eval(sys.stdin.read()))'" alias pprint-json="python -c 'import sys,json;print json.dumps(json.load(sys.stdin), indent=2)'" +function g +{ + if [[ $# -gt 0 ]]; then + git $@ + else + git status --short --branch + fi +} + print_info -l 2 "Sourcing ${SYS}-specific settings" case $SYS in From 9375e417d583ada0bab56b42ff4983d34fa95167 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Tue, 12 Mar 2013 15:39:56 -0700 Subject: [PATCH 17/19] Move vcs_info message to configure_vcs_info() --- zshrc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/zshrc b/zshrc index baf8ccc..1aa26e7 100644 --- a/zshrc +++ b/zshrc @@ -83,10 +83,6 @@ function configure_modules_and_functions #{{{ print_info_sub -l 2 "Adding $myfpath to fpath" fpath=($myfpath/makers $myfpath $fpath) - print_info -l 3 'Loading vcs_info' - autoload -Uz vcs_info - zstyle ':vcs_info:*' enable git - load_module 'makers' print_info -l 3 "Loading pw module" @@ -176,6 +172,8 @@ function configure_completion #{{{ function configure_vcs_info #{{{ { + print_info -l 3 'Loading vcs_info' + autoload -U add-zsh-hook autoload -Uz vcs_info From f04ecc43ac5f557aad9c933439cd4e09cad9d421 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Tue, 12 Mar 2013 15:48:56 -0700 Subject: [PATCH 18/19] Remove git from omz configuration --- rc | 1 + zshrc | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/rc b/rc index 8ce7e63..cb775f8 100644 --- a/rc +++ b/rc @@ -33,6 +33,7 @@ function g else git status --short --branch fi + return $? } diff --git a/zshrc b/zshrc index 1aa26e7..deeb629 100644 --- a/zshrc +++ b/zshrc @@ -45,7 +45,7 @@ function configure_omz #{{{ DISABLE_AUTO_UPDATE="true" COMPLETION_WAITING_DOTS="true" - plugins=(autojump brew encode64 fasd git gnu-utils history osx python) + plugins=(autojump brew encode64 fasd gnu-utils history osx python) source $ZSH/oh-my-zsh.sh From a591e33760997fc82b100cfa942dd8cf6c6f106c Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Tue, 12 Mar 2013 16:01:51 -0700 Subject: [PATCH 19/19] Add back status-bg setting in tmux.conf --- tmux.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/tmux.conf b/tmux.conf index 7198b08..cbc91d2 100644 --- a/tmux.conf +++ b/tmux.conf @@ -22,6 +22,7 @@ set -g mode-keys vi set -g repeat-time 0 # No left status; right status bar is session name +set -g status-bg black set -g status-left "" set -g status-left-bg black set -g status-left-fg brightblue