Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 424 lines (386 sloc) 12.437 kb
58b4aefb »
2012-01-07 I have no idea why the shebang used to be broken
1 #!/usr/bin/env zsh
aef0fc6e »
2011-06-21 A few files I've quickly checked for sanity
2 # richo '11
3 #
4 # TODO
5 # Document all of the *TITLE variables
6 # Clean up that infrastructure (honestly, I think I either need to learn zsh
7 # modules, or write a seperate program to do it
6738685d »
2011-10-21 Teach the shell stuff about my aliases
8 # in a perfect world, the titles should dereference aliases to see what I would
9 # have had to type
1b153820 »
2011-09-06 Rearrangement into more logical units
10 # {{{ Colors
f7e08100 »
2011-08-18 Refactor colors in zshrc
11 autoload colors
12 colors
1b00edff »
2011-08-19 Add more colors
13 for COLOR in RED BLUE GREEN MAGENTA YELLOW WHITE BLACK CYAN; do
f7e08100 »
2011-08-18 Refactor colors in zshrc
14 eval PR_$COLOR='%{$fg[${(L)COLOR}]%}'
15 eval PR_BRIGHT_$COLOR='%{$fg_bold[${(L)COLOR}]%}'
16 done
17 PR_RESET="%{${reset_color}%}";
1b153820 »
2011-09-06 Rearrangement into more logical units
18 # }}}
f7e08100 »
2011-08-18 Refactor colors in zshrc
19
1b153820 »
2011-09-06 Rearrangement into more logical units
20 # Source this after colors, in case profile wants to use it (Terrible idea, but
21 # nicer on the eyes)
aef0fc6e »
2011-06-21 A few files I've quickly checked for sanity
22 source ~/.profile
1b153820 »
2011-09-06 Rearrangement into more logical units
23
24 # {{{ completion
25 # rvm completion
926e801a »
2011-08-26 Enable rvm completion. Timing is very important!!
26 [[ -r $rvm_path/scripts/zsh/Completion ]] &&
27 fpath=($rvm_path/scripts/zsh/Completion $fpath)
aef0fc6e »
2011-06-21 A few files I've quickly checked for sanity
28 zstyle :compinstall filename '/home/richo/.zshrc'
1b153820 »
2011-09-06 Rearrangement into more logical units
29 autoload -U compinit
aef0fc6e »
2011-06-21 A few files I've quickly checked for sanity
30 autoload -Uz vcs_info
31 compinit
1b153820 »
2011-09-06 Rearrangement into more logical units
32 # }}}
33 # {{{ inbuilt prompt hax
34 autoload -U promptinit
aef0fc6e »
2011-06-21 A few files I've quickly checked for sanity
35 promptinit
36 setopt prompt_subst
37
82f2c383 »
2011-08-25 collissions avoidance
38 function __richo_host()
45b1ffd4 »
2011-08-18 prompt shows exit status + color
39 {
df75233b »
2011-08-19 Older versions of zsh: ${#?} is always = 0
40 local b=$?
41 local n=$((${#b} + 2))
45b1ffd4 »
2011-08-18 prompt shows exit status + color
42 echo "$sHost[0,-$n]"
43 }
44
f9b4ddb5 »
2011-12-22 Show what kind of repo we're in with the prompt char
45 function __richo_prompt()
46 {
47 if hg root >/dev/null 2>&1; then
48 echo "☿"
49 return
50 fi
51 if git branch >/dev/null 2>&1; then
52 echo "±"
53 return
54 fi
55 echo "%#"
56 }
57
9ea781a4 »
2011-08-25 Show something clever for system ruby
58 function __richo_rvm_version()
59 {
60 local v=$(rvm-prompt v g)
61 if [ -z "$v" ]; then
62 echo 'system'
63 else
64 echo $v
65 fi
66 }
67
f9b4ddb5 »
2011-12-22 Show what kind of repo we're in with the prompt char
68 PS1="${SHELL_COLOR}%(?.%m.\$(__richo_host) $PR_BRIGHT_RED%?)%b $PR_BRIGHT_BLUE\$(__richo_prompt) $PR_RESET"
ffd4c111 »
2011-08-24 Completely refactor prompt generation, zsh handles it all now
69 RPS1="$PR_BRIGHT_BLUE%~ "
70 which rvm-prompt > /dev/null &&
9ea781a4 »
2011-08-25 Show something clever for system ruby
71 RPS1+='$PR_BRIGHT_CYAN($(__richo_rvm_version)) '
ffd4c111 »
2011-08-24 Completely refactor prompt generation, zsh handles it all now
72 RPS1+='%b$PR_CYAN$vcs_info_msg_0_$PR_BRIGHT_BLUE${ZSH_TIME}$PR_RESET'
1b153820 »
2011-09-06 Rearrangement into more logical units
73 # }}}
f91b7155 »
2011-09-06 Yet more rearranging. Apologies to anyone who was trying to keep in sync
74 # {{{ Misc shell settings
1b153820 »
2011-09-06 Rearrangement into more logical units
75 HISTFILE=~/.histfile
76 HISTSIZE=1000
77 SAVEHIST=1000
78 setopt sharehistory
f91b7155 »
2011-09-06 Yet more rearranging. Apologies to anyone who was trying to keep in sync
79 setopt histignoredups
118e5a0f »
2011-11-04 Someting in my environment has changed, clobber isn't on by default
80 setopt clobber
f91b7155 »
2011-09-06 Yet more rearranging. Apologies to anyone who was trying to keep in sync
81 bindkey '^R' history-incremental-search-backward
82 bindkey -v
95525716 »
2011-10-07 Continue collecting similar config items
83 [ -n "$TTY" ] &&
84 REPORTTIME=5
f91b7155 »
2011-09-06 Yet more rearranging. Apologies to anyone who was trying to keep in sync
85 # }}}
1b153820 »
2011-09-06 Rearrangement into more logical units
86
87 function cdp
f91b7155 »
2011-09-06 Yet more rearranging. Apologies to anyone who was trying to keep in sync
88 { cd $pdir }
1b153820 »
2011-09-06 Rearrangement into more logical units
89
f91b7155 »
2011-09-06 Yet more rearranging. Apologies to anyone who was trying to keep in sync
90 # {{{ Helper functions
91 function __richo_time()
92 { date "+%s" }
aef0fc6e »
2011-06-21 A few files I've quickly checked for sanity
93
f91b7155 »
2011-09-06 Yet more rearranging. Apologies to anyone who was trying to keep in sync
94 function __richo_bg_tags()
4bc627a4 »
2011-09-16 Don't capture output
95 { (cd $1 && ctags -R -f .newtags . 2>/dev/null && mv .newtags tags) &| }
aef0fc6e »
2011-06-21 A few files I've quickly checked for sanity
96
f91b7155 »
2011-09-06 Yet more rearranging. Apologies to anyone who was trying to keep in sync
97 function __set_title()
aef0fc6e »
2011-06-21 A few files I've quickly checked for sanity
98 {
f91b7155 »
2011-09-06 Yet more rearranging. Apologies to anyone who was trying to keep in sync
99 if [ ! -z $INSCREEN ] ; then
100 echo -ne "\033k$t_prefix$@\033\\"
101 fi
aef0fc6e »
2011-06-21 A few files I've quickly checked for sanity
102 }
f91b7155 »
2011-09-06 Yet more rearranging. Apologies to anyone who was trying to keep in sync
103 function __set_urxvt_title()
191627d5 »
2011-07-19 When we create tags automatically, do that in the background
104 {
f91b7155 »
2011-09-06 Yet more rearranging. Apologies to anyone who was trying to keep in sync
105 echo -ne "\033]0;$1\007"
191627d5 »
2011-07-19 When we create tags automatically, do that in the background
106 }
3f9900db »
2011-10-11 Preserve window title hax
107 function __richo_tmux_hook()
108 {
109 case $rTITLE in
110 *"tmux"*)
111 ;;
112 *)
113 export rTITLE="$rTITLE [tmux]"
114 __set_urxvt_title $rTITLE
115 ;;
116 esac
117 }
f91b7155 »
2011-09-06 Yet more rearranging. Apologies to anyone who was trying to keep in sync
118 # }}}
119 function __richo_preexec() # {{{
aef0fc6e »
2011-06-21 A few files I've quickly checked for sanity
120 # DOCS
1f8dc5a3 »
2012-01-11 Fix comments to be more representative of current state of affairs
121 # This function has a few variables that it throws around. I'm thinking pretty
122 # seriously about building this show into it's own module and calling that, but
123 # load times could become an issue
aef0fc6e »
2011-06-21 A few files I've quickly checked for sanity
124 #
125 # reTITLE
126 # -------
127 # This is what the title will be set to after this command finishes
128 #
129 # sTITLE
130 # ------
1f8dc5a3 »
2012-01-11 Fix comments to be more representative of current state of affairs
131 # This is the current value of the title "at rest" (Including things like the
132 # prefix)
133 #
134 # TODO I could potentially optimise this a little and make it more readable by
135 # &&ing a ton of function calls together and then just returning false when one
136 # of them succeeds. Then just benchmark which ones get called most often and
137 # put them first
f91b7155 »
2011-09-06 Yet more rearranging. Apologies to anyone who was trying to keep in sync
138 {
aef0fc6e »
2011-06-21 A few files I've quickly checked for sanity
139 reTITLE=$sTITLE
140 case $1 in
141 # Rails kludges
142 "rails "*)
2405e5c3 »
2011-08-06 Use shell redirection instead of echo
143 work=`sed -e 's/^rails //' <<< $1`
aef0fc6e »
2011-06-21 A few files I've quickly checked for sanity
144 case $work in
145 "s"|"server")
146 arg="WEBRICK"
147 ;;
148 esac
149 ;;
6738685d »
2011-10-21 Teach the shell stuff about my aliases
150 "be"*|"bundle exec"*)
151 arg=`sed $sed_r -e 's/^(be|bundle exec)/BE:/' <<< $1`
6d667a8c »
2011-06-27 Show full command (sans bundle exec) for things I run in the bundle env
152 ;;
41edfb30 »
2011-10-25 Show a useful title wen I ./serve
153 "./serve"*) # Special case
bb03b031 »
2011-11-07 Let t_prefix take precedence over the pwd when serving
154 arg="serve"
155 if [ -z "$t_prefix" ] &&
156 arg="`basename $PWD`: $arg"
157 ;;
aa55d823 »
2011-08-18 Move the cd hook in preexec to it's own specific zsh hook
158 "cd"*|"ls"*|"cp"*|"mv"*|"echo"*|"wiki"*|"screen"*|"dig"*|"rm"*|"mkdir"*|"tinfo"*)
aef0fc6e »
2011-06-21 A few files I've quickly checked for sanity
159 reTITLE=""
160 return ;;
7ad248b7 »
2011-08-05 clear clears title ( Patch from @onlysamurai )
161 "clear"*)
162 arg="zsh";;
4a06c78a »
2011-10-25 Whitespace
163
aef0fc6e »
2011-06-21 A few files I've quickly checked for sanity
164 # If we're doing it to everything, the command is more interesting than
165 # the target
166 *"*")
2405e5c3 »
2011-08-06 Use shell redirection instead of echo
167 arg=$(awk '{print $1}' <<< $1);;
aef0fc6e »
2011-06-21 A few files I've quickly checked for sanity
168 # Catch kill early
169 "kill "*)
170 reTITLE=""
2405e5c3 »
2011-08-06 Use shell redirection instead of echo
171 arg=$(awk '{print $NF}' <<< $1);;
aef0fc6e »
2011-06-21 A few files I've quickly checked for sanity
172 "ctags"*|"killall"*|"screen"*)
173 return ;;
174 "tmux"*)
3f9900db »
2011-10-11 Preserve window title hax
175 __richo_tmux_hook
aef0fc6e »
2011-06-21 A few files I've quickly checked for sanity
176 ;;
177 "man"*)
178 arg=$1;;
179 "watchr"*)
180 arg="WATCHR";;
181 # For Source control I want the whole line, I think...
182 "svn"*|"git"*|"hg"*|"cvs"*)
183 arg=$1;;
184
185 "make"*)
186 arg=$(pwd | grep -o "[^/]*/[^/]*$");;
187
188 # TODO Include host
189 "cap"*)
190 # hax
191 #arg=$(echo $1 | grep -o "(deploy[^ ]*)");;
2405e5c3 »
2011-08-06 Use shell redirection instead of echo
192 arg=$(awk '{print $2}' <<< $1);;
e489bc98 »
2011-09-01 Follow the same path for vimpc as ncmpc
193 "ncmpc"*|"vimpc"*)
2405e5c3 »
2011-08-06 Use shell redirection instead of echo
194 arg=$(sed $sed_r -e 's/ ?-h */:/' <<< $1);;
4a06c78a »
2011-10-25 Whitespace
195
aef0fc6e »
2011-06-21 A few files I've quickly checked for sanity
196 # Webby stuffs
197 "lynx"*|"links"*)
2405e5c3 »
2011-08-06 Use shell redirection instead of echo
198 arg=$(sed $sed_r -e 's/^(lynx|links) (http[s]?:\/\/)?(www\.)?//' -e 's/\/.*$//' <<< $1);;
aef0fc6e »
2011-06-21 A few files I've quickly checked for sanity
199
200 "su"*)
201 arg="!root!"
202 export reTITLE=$sTITLE
203 ;;
204 "ssh"*)
2405e5c3 »
2011-08-06 Use shell redirection instead of echo
205 arg=$(awk '{print $NF}' <<< $1)
aef0fc6e »
2011-06-21 A few files I've quickly checked for sanity
206 # Don't care where in the local fs we are
207 export t_prefix=""
208 export reTITLE=$sTITLE
209 ;;
210 "vim"*)
211 # Vim likes to play funny buggers with my terminal. Show that
212 # bastage who's in charge.
213 export reTITLE=$sTITLE
214 # Don't bother setting a title- handles it.
215 ;;
5565ef32 »
2011-10-10 Now that twat -f is a usable feed parser thing
216 "twat"*)
217 arg='twat';;
ffedfa0b »
2011-10-07 Mutt now shows which account you're connected to
218 "mutt"*)
219 arg=`awk '{ print $1 ":" $2 }' <<< $1`;;
a64046ca »
2011-08-01 Put thor commands in window title more intelligently
220 "_thor"*|"thor"*)
eedd2264 »
2011-08-01 Added thor titling
221 export reTITLE=$sTITLE
2405e5c3 »
2011-08-06 Use shell redirection instead of echo
222 arg=`sed $sed_r -e 's/^_?thor //' -e 's/ /:/' <<< $1`
eedd2264 »
2011-08-01 Added thor titling
223 if [ -z "$INSCREEN" ]; then
106e3ba2 »
2011-08-18 Refactor title functions, again for collisions
224 __set_urxvt_title "$arg: "
eedd2264 »
2011-08-01 Added thor titling
225 fi
226 ;;
aef0fc6e »
2011-06-21 A few files I've quickly checked for sanity
227 *)
2405e5c3 »
2011-08-06 Use shell redirection instead of echo
228 arg=$(awk '{print $NF}' <<< $1);;
aef0fc6e »
2011-06-21 A few files I've quickly checked for sanity
229 esac
230
106e3ba2 »
2011-08-18 Refactor title functions, again for collisions
231 __set_title $arg
b4a072f3 »
2011-08-18 Rename this function to avoid potentiall collisions
232 }
233 add-zsh-hook preexec __richo_preexec
234 # }}}
f91b7155 »
2011-09-06 Yet more rearranging. Apologies to anyone who was trying to keep in sync
235 function __richo_chpwd() # {{{
aa55d823 »
2011-08-18 Move the cd hook in preexec to it's own specific zsh hook
236 {
9fd1a3b6 »
2011-12-25 Refactor the hacks to ignore the right files for add
237 [ -f .gitignore ] &&
238 __git_ignore_hook
aa55d823 »
2011-08-18 Move the cd hook in preexec to it's own specific zsh hook
239 # Clear title if we're going home
240 if [ "$PWD" = "$HOME" ]; then
241 export t_prefix=""
242 arg=$sTITLE
243 else
244 if [ -e .title ]; then
245 export pdir=$PWD
246 # XXX Should this happen for all titles?
247 dTITLE=$(cat .title | sed $sed_r 's/[\r\n]//g')
248 export t_prefix="$dTITLE: "
249 arg=""
250 fi
251 if [ -n "$AUTOTAGS" -a -f .autotags ]; then
252 # TODO
253 # Store some more info about the tags, command to run and
254 # git branch, and use the stat time of the file, rather
255 # than the contents to work out timing
7c0428ed »
2011-08-26 Carry on renaming functions
256 if [ $((`cat .autotags` + $TAGS_LIFETIME)) -lt `__richo_time` ]; then
257 __richo_time > .autotags
aa55d823 »
2011-08-18 Move the cd hook in preexec to it's own specific zsh hook
258 echo "Tags are mad old, regenerating."
282344c8 »
2011-09-03 Make the background/disown happen in the context of the function
259 __richo_bg_tags $PWD
aa55d823 »
2011-08-18 Move the cd hook in preexec to it's own specific zsh hook
260 fi
261 fi
262 fi
106e3ba2 »
2011-08-18 Refactor title functions, again for collisions
263 __set_title $arg
aa55d823 »
2011-08-18 Move the cd hook in preexec to it's own specific zsh hook
264 }
265 add-zsh-hook chpwd __richo_chpwd
f91b7155 »
2011-09-06 Yet more rearranging. Apologies to anyone who was trying to keep in sync
266 # }}}
267 function __richo_precmd() # {{{
aef0fc6e »
2011-06-21 A few files I've quickly checked for sanity
268 {
f91b7155 »
2011-09-06 Yet more rearranging. Apologies to anyone who was trying to keep in sync
269 vcs_info 'prompt'
270 if [ -n "$reTITLE" -a -n "$INSCREEN" ]; then
271 __set_title $reTITLE
272 export reTITLE=""
aef0fc6e »
2011-06-21 A few files I've quickly checked for sanity
273 fi
274 }
f91b7155 »
2011-09-06 Yet more rearranging. Apologies to anyone who was trying to keep in sync
275 add-zsh-hook precmd __richo_precmd
aef0fc6e »
2011-06-21 A few files I've quickly checked for sanity
276 # }}}
f91b7155 »
2011-09-06 Yet more rearranging. Apologies to anyone who was trying to keep in sync
277
45fbc737 »
2011-10-12 Add some todo notes for myself
278 # XXX I know you want to change this. It doesn't look right. But it breaks old
279 # zsh versions and you just have to live with it until the next debian stable
280 # release.
c1d36fe0 »
2011-10-10 [[ <condition> && <condition> && <condition> ]] Borks old zsh
281 if [[ -n "$SSH_CONNECTION" ]] && [[ "$TERM" =~ "screen" ]] && [[ -z "$TMUX" ]]; then
aef0fc6e »
2011-06-21 A few files I've quickly checked for sanity
282 export INSCREEN=yes
6fa2574b »
2011-08-19 Localise vars used
283 dTITLE=$sHost
aef0fc6e »
2011-06-21 A few files I've quickly checked for sanity
284 t_prefix="$dTITLE: "
c7797889 »
2011-08-24 IUpdate to current api
285 __set_title
aef0fc6e »
2011-06-21 A few files I've quickly checked for sanity
286 fi
287
288 # TODO This is just someone's template, fix.
289 # set formats
952eabd8 »
2011-12-27 Cleanup
290 # %b - branchname | %u - unstagedstr (see below)
291 # %c - stangedstr (see below) | %a - action (e.g. rebase-i)
292 # %R - repository path | %S - path in the repository
aef0fc6e »
2011-06-21 A few files I've quickly checked for sanity
293 REPO_COLOR=${PR_CYAN}
294 FMT_ACTION="(${PR_CYAN}%a${PR_RESET}%)" # e.g. (rebase-i)
4a06c78a »
2011-10-25 Whitespace
295
aef0fc6e »
2011-06-21 A few files I've quickly checked for sanity
296 # check-for-changes can be really slow.
4a06c78a »
2011-10-25 Whitespace
297 # you should disable it, if you work with large repositories
babc7d94 »
2012-01-23 Fix the git prompt inside an svn repo for 4.3.15
298 zstyle ':vcs_info:*' enable hg bzr git svn
aef0fc6e »
2011-06-21 A few files I've quickly checked for sanity
299 zstyle ':vcs_info:*:prompt:*' check-for-changes true
fe17aa53 »
2011-12-22 Finally fixed multibyte madness
300 zstyle ':vcs_info:*:prompt:*' unstagedstr '¹' # display ¹ if there are unstaged changes
301 zstyle ':vcs_info:*:prompt:*' stagedstr '²' # display ² if there are staged changes
aef0fc6e »
2011-06-21 A few files I've quickly checked for sanity
302 # Save this for later ³
303 # TODO - Show something if I have unpushed changes.
7c0428ed »
2011-08-26 Carry on renaming functions
304 function __richo_vcs_init(){
aef0fc6e »
2011-06-21 A few files I've quickly checked for sanity
305 FMT_BRANCH="${REPO_COLOR}%b${PR_BRIGHT_CYAN}%u%c${PR_RESET}${PR_RED}%m${PR_RESET}"
306 zstyle ':vcs_info:*:prompt:*' actionformats "${FMT_BRANCH}${FMT_ACTION}"
307 zstyle ':vcs_info:*:prompt:*' formats "${FMT_BRANCH}"
4a06c78a »
2011-10-25 Whitespace
308 zstyle ':vcs_info:*:prompt:*' nvcsformats "" "%~"
aef0fc6e »
2011-06-21 A few files I've quickly checked for sanity
309 }
7c0428ed »
2011-08-26 Carry on renaming functions
310 function __richo_svn_init(){
aef0fc6e »
2011-06-21 A few files I've quickly checked for sanity
311 SVN_BRANCH="${REPO_COLOR}%b${PR_BRIGHT_CYAN}%u%c${PR_RESET}${PR_RED}%m${PR_RESET}"
312 zstyle ':vcs_info:svn:prompt:*' actionformats "${SVN_BRANCH}${FMT_ACTION}"
313 zstyle ':vcs_info:svn:prompt:*' formats "${SVN_BRANCH}"
314 }
7c0428ed »
2011-08-26 Carry on renaming functions
315 __richo_vcs_init
aef0fc6e »
2011-06-21 A few files I've quickly checked for sanity
316
317 # Show remote ref name and number of commits ahead-of or behind
cd3dbb90 »
2011-06-24 Clean up the git hook a bit further
318 countl () { wc -l | sed $sed_r -e "s/^ +//" }
aef0fc6e »
2011-06-21 A few files I've quickly checked for sanity
319 function +vi-git-st() { #{{{
320 local ahead remote msg origin
321 local -a gitstatus
322
323 # Are we on a remote-tracking branch?
324 remote=${$(git rev-parse --verify ${hook_com[branch]}@{upstream} \
325 --symbolic-full-name 2>/dev/null)/refs\/remotes\/}
326
327 msg=""
328
87697aef »
2011-08-30 Always pull git info, even when we don't have a remote
329 # for git prior to 1.7
330 # ahead=$(git rev-list origin/${hook_com[branch]}..HEAD | wc -l)
331 origin=$(git rev-list origin/${hook_com[branch]}..HEAD 2>/dev/null | countl)
332 (( $origin )) && msg+="+$origin"
aef0fc6e »
2011-06-21 A few files I've quickly checked for sanity
333
87697aef »
2011-08-30 Always pull git info, even when we don't have a remote
334 ahead=$(git rev-list ${hook_com[branch]}@{upstream}..HEAD 2>/dev/null | countl)
335 (( $ahead )) && msg+="|$ahead|"
aef0fc6e »
2011-06-21 A few files I've quickly checked for sanity
336
87697aef »
2011-08-30 Always pull git info, even when we don't have a remote
337 behind=$(git rev-list HEAD..${hook_com[branch]}@{upstream} 2>/dev/null | countl)
338 (( $behind )) && msg+="-$behind"
aef0fc6e »
2011-06-21 A few files I've quickly checked for sanity
339
87697aef »
2011-08-30 Always pull git info, even when we don't have a remote
340 stashes=$(git stash list 2>/dev/null | countl)
341 if [ "$stashes" -gt 0 ]; then
342 msg+="?${stashes}s"
aef0fc6e »
2011-06-21 A few files I've quickly checked for sanity
343 fi
87697aef »
2011-08-30 Always pull git info, even when we don't have a remote
344
345 #(( $ahead )) && hook_com[misc]+=" (+$ahead)"
346 [ -n "$msg" ] && hook_com[misc]=" ($msg)"
aef0fc6e »
2011-06-21 A few files I've quickly checked for sanity
347 } #}}}
348 function +vi-svn-nochanges() { #{{{
349 REPO_COLOR="${PR_YELLOW}"
7c0428ed »
2011-08-26 Carry on renaming functions
350 __richo_svn_init
aef0fc6e »
2011-06-21 A few files I've quickly checked for sanity
351 zstyle ':vcs_info:svn*+set-message:*' hooks ""
352 } #}}}
353 function +vi-svn-untimeduncommitted() { #{{{
354 v=$(svnversion)
2405e5c3 »
2011-08-06 Use shell redirection instead of echo
355 if grep "M$" > /dev/null 2>&1 <<< $v; then
aef0fc6e »
2011-06-21 A few files I've quickly checked for sanity
356 hook_com[misc]="**"
357 fi
358 } #}}}
359 function +vi-svn-uncommitted() { #{{{
6fa2574b »
2011-08-19 Localise vars used
360 local v=$(timeout $SVNVERSION_TIMEOUT svnversion)
aef0fc6e »
2011-06-21 A few files I've quickly checked for sanity
361 case $? in
362 124)
363 +vi-svn-nochanges
364 ;;
365 0)
2405e5c3 »
2011-08-06 Use shell redirection instead of echo
366 if grep "M$" > /dev/null 2>&1 <<< $v; then
aef0fc6e »
2011-06-21 A few files I've quickly checked for sanity
367 hook_com[misc]="**"
368 fi
369 ;;
370 esac
371 } #}}}
372
373 zstyle ':vcs_info:git*+set-message:*' hooks git-st
374 if which timeout >/dev/null; then
375 zstyle ':vcs_info:svn*+set-message:*' hooks svn-uncommitted
376 else
377 zstyle ':vcs_info:svn*+set-message:*' hooks svn-untimeduncommitted
378 fi
379
380 alias nochanges="zstyle ':vcs_info:svn*+set-message:*' hooks svn-nochanges"
381 alias changes="zstyle ':vcs_info:svn*+set-message:*' hooks svn-untimeduncommitted"
382
383 # FIXME!!!
f8f3fa94 »
2011-06-24 Now uses .svnignore and .gitignore to work out what not to commit
384 # This is horrid, and I'm clearly knackered. There /is/ an easier way to
385 # replace the newlines with pipe symbols. There is.
9fd1a3b6 »
2011-12-25 Refactor the hacks to ignore the right files for add
386 function __git_ignore_hook() #{{{
387 {
bc2d22fb »
2012-01-22 Move gitignore to cvsignore for rsync
388 local global_ignore=`grep -v "^#" ~/.cvsignore | xargs echo | sed -e 's/ /|/g'`
9fd1a3b6 »
2011-12-25 Refactor the hacks to ignore the right files for add
389 [ -f .gitignore ] &&
390 global_ignore+="|`grep -v "^#" .gitignore | xargs echo | sed -e 's/ /|/g'`"
391 zstyle ':completion:*:*:git-add:*' ignored-patterns $global_ignore
392 }
bc2d22fb »
2012-01-22 Move gitignore to cvsignore for rsync
393 [ -f ~/.cvsignore ] &&
9fd1a3b6 »
2011-12-25 Refactor the hacks to ignore the right files for add
394 __git_ignore_hook #}}}
395
396 [ -f ~/.subversion/config ] &&
397 zstyle ':completion:*:*:svn-add:*' ignored-patterns \
398 `grep "^global-ignores" ~/.subversion/config | sed -e 's/^.*= //' -e 's/ /|/g'`
399
24c6267f »
2011-10-18 Don't complete to .o and .pyc files
400 zstyle ':completion:*:*:vim:*' ignored-patterns '*.o|*.pyc'
aef0fc6e »
2011-06-21 A few files I've quickly checked for sanity
401 zstyle ':completion:*:functions' ignored-patterns '_*'
402 zstyle ':completion:*:*:kill:*' menu yes select
403 zstyle ':completion:*:kill:*' force-list always
404 # If we're spawning a shell in a urxvt, but we're NOT in shell, put the tty in
405 # the titlebar.
ec0a6153 »
2011-07-29 Clean up a test
406 if [[ "$TERM" =~ "-256color" && -z "$INSCREEN" ]]; then
106e3ba2 »
2011-08-18 Refactor title functions, again for collisions
407 __set_urxvt_title $rTITLE
aef0fc6e »
2011-06-21 A few files I've quickly checked for sanity
408 fi
409
410
fe60a366 »
2011-06-28 Allow for .hostname instead of .local
411 [ -e $HOME/.zshrc.$sHost ] && source $HOME/.zshrc.$sHost
49da8fba »
2011-08-15 Experimenting with tmuxinator
412 [[ -s $HOME/.tmuxinator/scripts/tmuxinator ]] && source $HOME/.tmuxinator/scripts/tmuxinator
3f9900db »
2011-10-11 Preserve window title hax
413
414 if [ -n "$WIN_E" ]; then
415 unset WIN_E
c90610f2 »
2011-11-18 Start a background process to keep my WM title updated with currently
416
417 tty | grep "/0$" > /dev/null &&
418 [ -n =music_watch ] &&
419 music_watch -t &!
420
3f9900db »
2011-10-11 Preserve window title hax
421 __richo_tmux_hook
c90610f2 »
2011-11-18 Start a background process to keep my WM title updated with currently
422 tmux
3f9900db »
2011-10-11 Preserve window title hax
423 fi
Something went wrong with that request. Please try again.