comparison rc/bashrc @ 501:072662ced8b8

Per-version tmux config.
author edogawaconan <me@myconan.net>
date Sun, 09 Mar 2014 14:11:47 +0900
parents 3979f3a55d0a
children 84ad2517ac90
comparison
equal deleted inserted replaced
500:faf6bc91feb5 501:072662ced8b8
12 fi 12 fi
13 13
14 [ -f "${HOME}/.ecos_bash.before" ] && . "${HOME}/.ecos_bash.before" 14 [ -f "${HOME}/.ecos_bash.before" ] && . "${HOME}/.ecos_bash.before"
15 15
16 _org_path="${PATH}" 16 _org_path="${PATH}"
17
18 _os="$(uname -s)"
17 19
18 # Basic PATH 20 # Basic PATH
19 export PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/games" 21 export PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/games"
20 22
21 # pkgsrc 23 # pkgsrc
83 _has_gnu_grep= 85 _has_gnu_grep=
84 _ls="ls" 86 _ls="ls"
85 _grep="grep" 87 _grep="grep"
86 _has_posix_grep=y 88 _has_posix_grep=y
87 89
88 case "$(uname -s)" in 90 case "${_os}" in
89 Linux) 91 Linux)
90 _has_gnu_ls=y 92 _has_gnu_ls=y
91 _has_gnu_grep=y 93 _has_gnu_grep=y
92 ;; 94 ;;
93 SunOS) 95 SunOS)
231 PS1='\[\e[0;33m\]\u\[\e[0m\]@\[\e[0;32m\]\h\[\e[0m\]:\[\e[0;36m\]\w\[\e[0m\]\$ ' 233 PS1='\[\e[0;33m\]\u\[\e[0m\]@\[\e[0;32m\]\h\[\e[0m\]:\[\e[0;36m\]\w\[\e[0m\]\$ '
232 fi 234 fi
233 ;; 235 ;;
234 esac 236 esac
235 237
238 # Priority PATHs. Always enable.
239 PATH="${HOME}/bin:${HOME}/.ecos_bin:/opt/local/bin:/opt/local/sbin:${PATH}"
240
236 if command -v vim > /dev/null 2>&1; then 241 if command -v vim > /dev/null 2>&1; then
237 alias vi=vim 242 alias vi=vim
238 export EDITOR=vim 243 export EDITOR=vim
239 fi 244 fi
240 245
261 if command -v curl > /dev/null 2>&1; then 266 if command -v curl > /dev/null 2>&1; then
262 alias 0p="gzip | curl 'http://0paste.com/pastes.txt' -F 'paste[paste_gzip]=<-'" 267 alias 0p="gzip | curl 'http://0paste.com/pastes.txt' -F 'paste[paste_gzip]=<-'"
263 alias 0pp="gzip | curl 'http://0paste.com/pastes.txt' -F 'paste[is_private]=1' -F 'paste[paste_gzip]=<-'" 268 alias 0pp="gzip | curl 'http://0paste.com/pastes.txt' -F 'paste[is_private]=1' -F 'paste[paste_gzip]=<-'"
264 fi 269 fi
265 270
266 # Priority PATHs. Always enable. 271 if command -v tmux > /dev/null 2>&1; then
267 PATH="${HOME}/bin:${HOME}/.ecos_bin:/opt/local/bin:/opt/local/sbin:${PATH}" 272 case "${_os}" in
273 OpenBSD)
274 # FIXME: OpenBSD version check
275 _tmux_conf_ver=1.9
276 ;;
277 *)
278 case "$(tmux -V)" in
279 "tmux 1."[1-9][0-9]*|"tmux 1.9"*) _tmux_conf_ver=1.9;;
280 "tmux 1."[4-8]*) _tmux_conf_ver=1.4;;
281 *) _tmux_conf_ver=1.3;;
282 esac
283 ;;
284 esac
285 alias tmux="tmux -f '""${HOME}""/.tmux-""${_tmux_conf_ver}"".conf'"
286 unset _tmux_conf_ver
287 fi
288
289 unset _os
268 290
269 [ -f "${HOME}/.ecos_bash.after" ] && . "${HOME}/.ecos_bash.after" 291 [ -f "${HOME}/.ecos_bash.after" ] && . "${HOME}/.ecos_bash.after"