root/dotfiles/bash/mrkn-bashrc @ 33271

Revision 28977, 3.1 kB (checked in by mrkn, 4 years ago)

remove \] and \[ around of second (\w) in WORKING_DIRECTORY.

  • Property svn:keywords set to Id
Line 
1# -*- mode: sh; coding: utf-8; -*-
2# ~/.bashrc: executed by bash(1) for non-login shells.
3# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
4# for examples
5#
6# $Id$
7
8export RUBYFORGE_USER=mrkn
9
10# Default language and encoding are ja_JP and UTF-8 respectively
11export LANG=ja_JP.UTF-8
12export LANGUAGE=ja_JP:en_US
13
14# If not running interactively, don't do anything
15[ -z "$PS1" ] && return
16
17# don't put duplicate lines in the history. See bash(1) for more options
18export HISTCONTROL=ignoredups
19
20# check the window size after each command and, if necessary,
21# update the values of LINES and COLUMNS.
22shopt -s checkwinsize
23
24# make less more friendly for non-text input files, see lesspipe(1)
25[ -x /usr/bin/lesspipe ] && eval "$(lesspipe)"
26
27# set variable identifying the chroot you work in (used in the prompt below)
28if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
29  debian_chroot=$(cat /etc/debian_chroot)
30fi
31
32# set a fancy prompt (non-color, unless we know we "want" color)
33case "$TERM" in
34xterm*|rxvt*|putty*|screen*)
35  #PS1='${debian_chroot:+($debian_chroot)}\[\e[0;33m\][$(date +%H:%M:%S)#\#]\[\e[1;32m\]\u@\h\[\e[00m\]:\[\e[1;34m\]\w\[\e[0m\]\$ '
36  WORKING_DIRECTORY='\[\e[$[COLUMNS-$(echo -n " (\w)" | wc -c)]C\e[1;35m(\w)\e[0m\e[$[COLUMNS]D\]'
37  PS1=${WORKING_DIRECTORY}'${debian_chroot:+($debian_chroot)}\[\e[0;33m\][$(date +%H:%M:%S)#\#]\[\e[1;32m\]\u@\h\[\e[00m\]\$ '
38  ;;
39*)
40  PS1='${debian_chroot:+($debian_chroot)}[$(date +%H:%M:%S)(\#)]\u@\h:\w\$ '
41  ;;
42esac
43
44# Comment in the above and uncomment this below for a color prompt
45#PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u#\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
46
47# # If this is an xterm set the title to user@host:dir
48# case "$TERM" in
49# xterm*|rxvt*|putty*)
50#   PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007"'
51#   ;;
52# *)
53#   ;;
54# esac
55
56# Alias definitions.
57# You may want to put all your additions into a separate file like
58# ~/.bash_aliases, instead of adding them here directly.
59# See /usr/share/doc/bash-doc/examples in the bash-doc package.
60
61#if [ -f ~/.bash_aliases ]; then
62#  . ~/.bash_aliases
63#fi
64
65# enable color support of ls and also add handy aliases
66if [ "$TERM" != "dumb" ]; then
67  if [ `uname -s` = "Darwin" ]; then
68    alias ls='ls -G'
69  else
70    eval "`dircolors -b`"
71    alias ls='ls --color=auto'
72  fi
73  #alias dir='ls --color=auto --format=vertical'
74  #alias vdir='ls --color=auto --format=long'
75fi
76
77if [ `uname -s` = "Darwin" ]; then
78  alias ldd='otool -L'
79fi
80
81# some more ls aliases
82#alias ll='ls -l'
83#alias la='ls -A'
84#alias l='ls -CF'
85
86alias tube_start='ssh -f start.tube.complex.eng.hokudai.ac.jp sh .ssh_monitor'
87alias tube_finish='ssh tube.complex.eng.hokudai.ac.jp sh .ssh_finish'
88
89alias stone_start='sudo stone localhost:22 443 &'
90
91case `uname -s` in
92Darwin*)
93  alias gnuplot='env DYLD_LIBRARY_PATH= /opt/local/bin/gnuplot'
94  alias emacs='env DYLD_LIBRARY_PATH= /Applications/Emacs.app/Contents/MacOS/Emacs'
95  ;;
96esac
97
98# enable programmable completion features (you don't need to enable
99# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
100# sources /etc/bash.bashrc).
101if [ -f /etc/bash_completion ]; then
102  . /etc/bash_completion
103fi
Note: See TracBrowser for help on using the browser.