changeset 0:cd87be0968d9

Initial import.
author Edho Prima Arief <me@myconan.net>
date Sat, 10 Jul 2010 11:57:25 +0000
parents
children ddd721f10cb8
files hg install tcsh tmux uninstall
diffstat 5 files changed, 167 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hg	Sat Jul 10 11:57:25 2010 +0000
@@ -0,0 +1,2 @@
+[ui]
+username = Edho Prima Arief <me@myconan.net>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/install	Sat Jul 10 11:57:25 2010 +0000
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+scripts="tcsh vim tmux"
+
+case "$1" in
+  tcsh)
+    SCRIPT_SOURCE="tcsh"
+    SCRIPT_DEST=".tcsh_init"
+    grep -v '#ECCORE_TCSH' "${HOME}/.cshrc" > .cleancshrc
+    echo '[ -r "${HOME}/.tcsh_init" ] && source "${HOME}/.tcsh_init" #ECCORE_TCSH' >> .cleancshrc
+    mv .cleancshrc "${HOME}/.cshrc"
+  ;;
+  tmux)
+    SCRIPT_SOURCE="tmux"
+    SCRIPT_DEST=".tmux.conf"
+  ;;
+  hg)
+    SCRIPT_SOURCE="hg"
+    SCRIPT_DEST=".hgrc"
+esac
+
+ln -s "${PWD}/${SCRIPT_SOURCE}" "${HOME}/${SCRIPT_DEST}"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tcsh	Sat Jul 10 11:57:25 2010 +0000
@@ -0,0 +1,97 @@
+#!/usr/bin/env tcsh
+umask 22
+limit coredumpsize 0
+
+set prompt="[%B%n@%m %~%b]%# "
+set path=({,/usr}/{bin,sbin} "${HOME}/bin")
+set history=1000
+set savehist=1000
+set nobeep
+set filec
+
+setenv EDITOR vi
+setenv PAGER less
+setenv BLOCKSIZE K
+setenv LC_COLLATE C
+setenv LANG en_US.UTF-8
+
+unset autologout
+unset autoexpand
+unset autolist
+unset ignoreeof
+
+unalias \*
+alias h history 25
+alias j jobs -l
+alias la ls -A
+alias ll ls -lA
+alias ls ls -F
+alias upload-tcsh-init 'echo "put ${HOME}/.tcsh_init www/static/tcsh_init.txt" | sftp myconnet@myconan.net'
+alias download-tcsh-init 'printf "%s" "Current version will be overwritten! Press enter to continue or ctrl-c to cancel."; read _ ; curl -o ${HOME}/.tcsh_init.new http://static.myconan.net/tcsh_init.txt && cp "${HOME}/.tcsh_init" "${HOME}/.tcsh_init.old" && ln -f "${HOME}/.tcsh_init.new" "${HOME}/.tcsh_init" && rm "${HOME}/.tcsh_init.old" "${HOME}/.tcsh_init.new"' 
+
+if ($?prompt) then
+  set gnuls_opts="--color=auto --group-directories-first -F"
+  set iscolor=0
+  switch (${TERM})
+    case xterm*:
+    case dtterm:
+    case screen*:
+      setenv CLICOLOR 
+      set myhost=`hostname | cut -d '.' -f 1`
+      set prompt="[%{\033[0;33m%}%n%{\033[0m%}@%{\033[0;32m%}%m%{\033[0m%} %{\033[1;34m%}%c%{\033[0m%}]%# "
+      alias mypwd 'printf "%s\n" "${PWD}" | sed -e "s#^${HOME}#~#"'
+      alias precmd 'printf "\033]0;${USER}@${myhost}: %s\007" "`mypwd`"'
+      set iscolor=1
+    breaksw
+  endsw
+
+  if ("$TERM" == "screen") then
+    bindkey '\e[1~' beginning-of-line
+    bindkey '\e[3~' delete-char
+    bindkey '\e[4~' end-of-line
+    bindkey '\e[5~' history-search-backward
+    bindkey '\e[6~' history-search-forward
+    bindkey '\eOD' backward-word
+    bindkey '\eOC' forward-word
+    bindkey '\e\e[D' backward-word
+    bindkey '\e\e[C' forward-word
+  endif
+  bindkey "^W" backward-delete-word
+  bindkey -k up history-search-backward
+  bindkey -k down history-search-forward
+endif
+
+switch (`uname -s`)
+  case FreeBSD:
+    set path=(${path} /usr/local/{bin,sbin})
+    setenv LSCOLORS ExGxFxdxCxegedabagExEx
+    alias ls ls -FG
+    ( which gnuls ) > /dev/null && alias ls gnuls ${gnuls_opts}
+    alias man man -o
+  breaksw
+  case NetBSD:
+    set path=(${path} /usr/pkg/{bin,sbin})
+    breaksw
+    case OpenBSD:
+    set path=(${path} /usr/local/{bin,sbin})
+    [ "${iscolor}" -eq 1 ] && setenv TERM xterm-256color
+  breaksw
+  case DragonFly:
+    set path=(${path} /usr/pkg/{bin,sbin})
+    setenv LSCOLORS ExGxFxdxCxegedabagExEx
+    alias ls ls -FG
+  breaksw
+  case SunOS:
+    set path=(${path} /usr/{gnu,csw,xpg4}/{bin,sbin})
+    [ -x /usr/gnu/bin/ls ] && alias ls /usr/gnu/bin/ls ${gnuls_opts}
+  breaksw
+  case Linux:
+    alias ls ls ${gnuls_opts}
+    alias grep grep --color=auto
+  breaksw
+endsw
+unset gnuls_opts
+
+( which vim ) > /dev/null && alias vi vim
+
+[ -e "${HOME}/.tcsh_exec" ] && source "${HOME}/.tcsh_exec"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tmux	Sat Jul 10 11:57:25 2010 +0000
@@ -0,0 +1,24 @@
+set -g status-bg black
+set -g status-fg white
+
+set -g status-left '#S'
+set -g status-left-attr bold
+set -g status-left-fg blue
+
+set -g status-right '#[fg=blue,bold]#H #[fg=default]| #[fg=yellow,bold]%H:%M %b-%d'
+
+set -g status-utf8 on
+setw -g utf8 on
+
+set -g pane-border-bg black
+set -g pane-border-fg black
+set -g pane-active-border-bg green
+set -g pane-active-border-fg green
+
+set -g set-titles on
+set -g set-titles-string '#I:#W #T'
+
+setw -g window-status-current-bg red
+setw -g window-status-current-fg white
+setw -g window-status-current-format '#I:#W'
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uninstall	Sat Jul 10 11:57:25 2010 +0000
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+echo "Removing: ${1}"
+echo "Press any key to continue"
+read _
+
+case "$1" in
+  tcsh)
+    for i in init exec.before exec.after; do
+      [ -e "${HOME}/.tcsh_${i}" ] && rm "${HOME}/.tcsh_${i}"
+    done
+    grep -v "#ECCORE_TCSH" "${HOME}/.cshrc" > .newcshrc
+    mv .newcshrc "${HOME}/.cshrc"
+  ;;
+  tmux)
+    SCRIPT_NAME=".tmux.conf"
+  ;;
+  hg)
+    SCRIPT_NAME=".hgrc"
+  ;;
+esac
+[ -n "${SCRIPT_NAME}" ] && rm -f "${HOME}/${SCRIPT_NAME}"