Skip to content
Browse files

os specific updates

  • Loading branch information...
1 parent d6ced6e commit 286a6a1596fb90f7e938b702c809021532ce71c8 @gabesoft committed May 30, 2011
Showing with 60 additions and 10 deletions.
  1. +53 −8 .bashrc
  2. +7 −2 .vimrc
View
61 .bashrc
@@ -5,21 +5,42 @@
# cd = navigate home
# cd - = navigate to previous folder
+# platform
+platform='unkown'
+unamestr=`uname`
+
+if [[ "$unamestr" == "Linux" ]]; then
+ platform='linux'
+elif [[ "$unamestr" == "Darwin" ]]; then
+ platform='mac'
+fi
+
#navigation
alias ..='cd ..'
alias ...='cd .. ; cd ..'
+alias cdd='cd -' # go to previous directory
+
+# sudo
+alias s='sudo'
# delete
alias rm='rm -i'
alias rf='rm -f'
alias rr='rm -f -r'
+alias srm='sudo rm -i'
+alias srf='sudo rm -f'
+alias srr='sudo rm -f -r'
# copy move
alias cp='cp -i'
+alias cr='cp -iR'
alias mv='mv -i'
+alias scp='sudo cp -i'
+alias scr='sudo cp -iR'
+alias smv='sudo mv -i'
# list directory
-alias ls='ls --color=auto'
+# alias ls='ls --color=auto'
alias ll='ls -hl'
alias la='ls -a'
alias lla='ls -lah'
@@ -44,7 +65,12 @@ alias profileme="history | awk '{print \$2}' | awk 'BEGIN{FS=\"|\"}{print \$1}'
alias df='df -h'
# tar
-alias untar='tar xvzf'
+alias untar='tar -xvzf'
+alias suntar='sudo tar -xvzf'
+
+# sudo unzip
+alias sunzip='sudo unzip'
+alias sbunzip2='sudo bunzip2'
# execute permissions
alias exusr='chmod u+x' # current user
@@ -81,12 +107,16 @@ source ~/.dirs # Initialization for the above 'save' facility: source the .sdir
shopt -s cdable_vars # set the bash option so that no '$' is required when using the above facility
# editor
-export EDITOR='vim -f'
+if [[ $platform == 'linux' ]]; then
+ export EDITOR='gvim -f'
+elif [[ $platform == 'mac' ]]; then
+ export EDITOR='/usr/local/bin/vim'
+fi
-# history
+# history
export HISTCONTROL=ignoredups
-# bash
+# bash
bind "set completion-ignore-case on"
bind "set bell-style none"
bind "set show-all-if-ambiguous on"
@@ -106,7 +136,13 @@ export TERM=xterm-color
export GREP_OPTIONS='--color=auto'
export GREP_COLOR='1;31'
export CLICOLOR=1
-export LS_COLORS='di=0;36:fi=0;37:ln=0;35:pi=5:so=5:bd=5:cd=5:or=31:mi=1:ex=0;31:*.rb=90'
+
+# shell colors
+if [[ $platform == 'linux' ]]; then
+ export LS_COLORS='di=0;36:fi=0;37:ln=0;35:pi=5:so=5:bd=5:cd=5:or=31:mi=1:ex=0;31:*.rb=90'
+elif [[ $platform == 'mac' ]]; then
+ export LSCOLORS=Gxfxcxdxbxegedabagacad
+fi
export COLOR_NC='\033[0m' # No Color
export COLOR_WHITE='\033[1;37m'
@@ -126,8 +162,17 @@ export COLOR_YELLOW='\033[1;33m'
export COLOR_GRAY='\033[1;30m'
export COLOR_LIGHT_GRAY='\033[0;37m'
+export COLOR_BG_NC='\033[49m'
+export COLOR_BG_LIGHT_GRAY='\033[47m'
+export COLOR_BG_PURPLE='\033[45m'
+export COLOR_BG_RED='\033[41m'
+export COLOR_BG_GREEN='\033[42m'
+export COLOR_BG_YELLOW='\033[43m'
+export COLOR_BG_BLUE='\033[44m'
+export COLOR_BG_CYAN='\033[46m'
+
echo -e "${COLOR_WHITE}kernel info: " `uname -smr`
echo -e "${COLOR_BROWN}`bash --version`"
-echo -ne "${COLOR_GRAY}uptime: "; uptime
-echo -ne "${COLOR_GRAY}server time is: "; date
+echo -ne "${COLOR_BG_CYAN}${COLOR_GRAY}uptime: "; uptime
+echo -ne "${COLOR_BG_CYAN}${COLOR_GRAY}server time is: "; date
echo -ne "${COLOR_NC}"
View
9 .vimrc
@@ -10,11 +10,15 @@ if has("win32")
set gfn=Monaco:h10:cANSI
elseif has("macunix")
set gfn=Monaco:h12
- set macmeta " enable the alt key on mac
else
set gfn=Monaco\ 12
endif
+" enable the alt key on mac
+if has("gui") && has("macunix")
+ set macmeta
+endif
+
" directories
if has("win32")
set nobackup
@@ -147,8 +151,9 @@ filetype plugin indent on
au FileType crontab set nobackup nowritebackup
au FileType crontab colorscheme vividchalk
-" color scheme for shell scripts
+" color scheme for various filetypes
au FileType sh colorscheme vividchalk
+au FileType gitcommit colorscheme vividchalk
" remove search highlighting
map <leader>g :silent :nohlsearch<CR>

0 comments on commit 286a6a1

Please sign in to comment.
Something went wrong with that request. Please try again.