# HG changeset patch # User Gustavo Picon # Date 1256792093 18000 # Node ID 62044620fb906c5223aad9c9f5d153b35f8cdb13 # Parent 0000000000000000000000000000000000000000 commiting the first dotfiles diff -r 0000000000000000000000000000000000000000 -r 62044620fb906c5223aad9c9f5d153b35f8cdb13 .bashrc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.bashrc Wed Oct 28 23:54:53 2009 -0500 @@ -0,0 +1,7 @@ +#!/bin/sh + +# everything happens in ~/.profile +if [ -f "$HOME/.profile" ] +then + . "$HOME/.profile" +fi diff -r 0000000000000000000000000000000000000000 -r 62044620fb906c5223aad9c9f5d153b35f8cdb13 .cshrc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.cshrc Wed Oct 28 23:54:53 2009 -0500 @@ -0,0 +1,108 @@ +# +# .cshrc +# +# Gustavo Picon - 1999-2009 +# +# This works with csh/tcsh in OS X, OpenBSD and SunOS +# +# Sets some basic aliases, a valid PATH env for every host (no non-existant +# dirs), some sane env vars, and a nice looking prompt. + +umask 22 + +alias df df -h +alias du du -h +alias f finger +alias h history +alias j jobs -l +alias ls ls -F + +setenv BLOCKSIZE K +setenv LC_ALL en_US.UTF-8 +setenv LANG en_US.UTF-8 + +# set the $PATH env, it will add only directories that actually exist in the +# system, so it's safe to add more and more dirs to the array +set path = () +foreach d (~/bin ~/.local/bin \ + /opt/local/{sbin,bin} \ + /usr/gnu/bin \ + /sbin /bin \ + /usr/{sbin,bin,local/sbin,local/bin,X11R6/bin,X11/bin,games} \ + /usr/{usb,opt/bin,pkg/sbin,pkg/bin} ) + if (-d $d) then + set path = (${path} ${d}) + endif +end + +# non-interactive shells stop here +if (! $?USER || ! $?prompt) then + exit 0 +endif + +# interactive shell + +# File completion with ESC and ctrl+D (csh/tcsh). TAB works in tcsh. +set filec + +# don't autocomplete these files +set fignore = (.o .pyc .swp) + +# Remember the last 1000 commands +set history = 1000 + +set savehist = 1000 +set mail = (/var/mail/$USER) +set host = `hostname | cut -f1 -d.` + +# use less if available, else, fall back to more +set rctmp = `which less >&! /dev/null` +if (! $status) then + setenv PAGER less +else + setenv PAGER more +endif + +# use vim if available, else, fall back to vi +set rctmp = `which vim >&! /dev/null` +if (! $status) then + setenv EDITOR vim +else + setenv EDITOR vi +endif + +unset rctmp + +if ($?tcsh) then + set promptchars = "%#" + set autolist = "ambiguous" + if (`id -u` == 0) then + set prompt="%{\033]0;%m:%~\007%}%m:%~%# " + else + set prompt="%{\033]0;%n@%m:%~\007%}%n@%m:%~%# " + endif + bindkey "^W" backward-delete-word + bindkey -k up history-search-backward + bindkey -k down history-search-forward +else + # plain old csh... + # abandon all hope for a hack-free cshrc ye who enter here + echo -n "]0;${user}@${host}" + if (`id -u` == 0) then + #if (`uname` == "OpenBSD" || `uname` == "SunOS") then + set prompt = "${host}# " + #else + # set prompt = "${host}:${cwd}# " + #endif + else + #if (`uname` == "OpenBSD" || `uname` == "SunOS") then + set prompt = "${user}@${host}% " + #else + # set prompt = "${user}@${host}:${cwd}% " + #endif + endif + cd . +endif + +# no annoyances +mesg n diff -r 0000000000000000000000000000000000000000 -r 62044620fb906c5223aad9c9f5d153b35f8cdb13 .profile --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.profile Wed Oct 28 23:54:53 2009 -0500 @@ -0,0 +1,217 @@ +#!/bin/sh +# +# .profile +# +# Gustavo Picon - 1999-2009 +# +# This works with bash, zsh, pdksh, ksh88, ksh93, ash, dash, sh +# in OS X, RHEL, FreeBSD, OpenBSD, SunOS, Solaris, HP-UX and Ubuntu +# +# Sets some basic aliases, a valid PATH env for every host (no non-existant +# dirs), some sane env vars, and a nice looking PS1/PROMPT, using the best +# available method for every shell. It will also set the xterm title when +# possible. +# +# Add your local scripts in ~/.local/bin +# You can add more settings in ~/.local/profile + + +umask 022 + +alias df='df -h' +alias du='du -h' +alias f='finger' +alias h='history' +alias j='jobs -l' +alias ls='ls -F' + +# set the $PATH env, it will add only directories that actually exist in the +# system, so it's safe to add more and more dirs to the array +PATH="" +set_path() { + for d in $@; do + if [ -d $d ]; then + if [ "$PATH" != "" ]; then + PATH=$PATH:$d + else + PATH=$d + fi + fi + done +} +set_path $HOME/bin $HOME/.local/bin \ + /opt/local/sbin /opt/local/bin /usr/gnu/bin \ + /ffp/sbin /ffp/bin \ + /sbin /bin \ + /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin /usr/X11R6/bin \ + /usr/X11/bin /usr/games \ + /usr/usb /usr/opt/bin /usr/pkg/sbin /usr/pkg/bin + +# alternates function STOLEN from Zak Johnson ;) +alternates() { + for i in $*; do + type $i >/dev/null 2>&1 && echo $i && return + done +} +EDITOR=$(alternates vim vi) +PAGER=$(alternates less more) +LESS=gi +HISTCONTROL=ignoreboth +BLOCKSIZE=K +LC_ALL=en_US.UTF-8 +LANG=en_US.UTF-8 + + + +export PATH EDITOR PAGER LESS HISTCONTROL LC_ALL LANG BLOCKSIZE + + +# end non-interactive section +[ -z "$PS1" ] && [ -z "$PROMPT" ] && return + +# +# interactive sessions +# + +# why sed instead of awk or cut? because sed will work in busybox ;) +shostname=$(hostname | sed 's/\..*//g') +shwhoami=$(whoami) +shuid=$(id -u) + +# just in case what follows FAILS (like some versions of busybox) +PS1=${shwhoami}'@'${shostname}':\W\$ ' +#PS1="]0;"${shwhoami}"@"${shostname}':\w'"${PS1}" +export PS1 + + +# identifying the shell type +# based on a snippet by Cyrille Lefevre +# https://mailman.research.att.com/pipermail/ast-users/2008q3/002204.html +# Added better korn shell detection and made it POSIX compliant +# Also added quick&dirty busybox detection +if ( [ -n "${BASH_VERSION:-}" ] ) +then + is='bash' +elif ( [ -n "${KSH_VERSION:-}" ] ) +then + is='pdksh' +elif ( [ -n "${ZSH_VERSION:-}" ] ) +then + is='zsh' +# +# Uncomment the next block to enable ksh detection +# I don't use ksh, and the "${.sh.version}" check isn't standard +# compliant, so it breaks some basic and/or old bourne shells. +# +### +#elif ( [ -n "${.sh.version}" ] ) 2>&- +#then +# if [[ ${SECONDS:-} = *'.'* ]] +# then +# is='ksh93' +# else +# is='ksh88' +# fi +### +else + # fallback + is='sh' +fi + + +if [ $is = 'bash' ] || [ $is = 'pdksh' ] +then + + if [ $(id -u) -eq 0 ] + then + PS1='\h:\W\$ ' + else + PS1='\u@\h:\W\$ ' + fi + + case "$TERM" in + xterm*|rxvt*|screen*) + PS1="\[]0;\u@\h:\w\]${PS1}" + ;; + *) + ;; + esac + + if [ $is = 'bash' ] + then + + # check the window size after each command and, if necessary, + # update the values of LINES and COLUMNS. + shopt -s checkwinsize + + # this is a cool feature in ubuntu + if [ -f /etc/bash_completion ] + then + . /etc/bash_completion + fi + fi + export PS1 + +elif [ $is = 'zsh' ] +then + PROMPT='%n@%m:%c%# ' + + case "$TERM" in + xterm*|rxvt*|screen*) + precmd () { + print -Pn "\e]0;%n@%m:%~\a" + } + ;; + *) + ;; + esac + + export PROMPT +elif ( [ "$is" = 'ksh88' ] || [ "$is" = 'ksh93' ] ) +then + # universal $PS1 + + + if ( [ "$shuid" = "0" ] ) + then + #PS1=${shostname}':${PWD/${HOME}/\~}# ' + PS1=${shostname}':${PWD##*/}# ' + else + PS1=${shwhoami}'@'${shostname}':${PWD##*/}\$ ' + fi + PS1="$PS1 $is" + + case "$TERM" in + xterm*|rxvt*|screen*) + PS1="]0;"${shwhoami}"@"${shostname}':${PWD/${HOME}/\~}'"${PS1}" + ;; + *) + ;; + esac + + export PS1 +else + # sh... possibly ash (bsd, busybox) or dash (ubuntu) + + if ( [ "$shuid" = "0" ] ) + then + PS1=${shostname}':${PWD}# ' + else + PS1=${shwhoami}'@'${shostname}':${PWD}\$ ' + fi + + case "$TERM" in + xterm*|rxvt*|screen*) + PS1="]0;"${shwhoami}"@"${shostname}':${PWD}'"${PS1}" + ;; + *) + ;; + esac + +fi + +unset shostname shwhoami shuid + +if [ -f "$HOME/.local/profile" ]; then + . "$HOME/.local/profile" +fi diff -r 0000000000000000000000000000000000000000 -r 62044620fb906c5223aad9c9f5d153b35f8cdb13 .vimrc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.vimrc Wed Oct 28 23:54:53 2009 -0500 @@ -0,0 +1,266 @@ +" File: .vimrc +" Author: Gustavo Picon <'%s@%s.%s' % ('tabo', 'gpicon', 'org')> +" Last Change: 2009 Apr 12 (Vim 7.1) +" Download: http://static.gpicon.org/code/vimrc.html +" Home: http://gpicon.org +" License: This file is placed in the publid domain +" Disclaimer: Published as-is, no support, no warranty + + +" VIM extensions, not very VI compatible; +" this setting must be set because when vim +" finds a .vimrc on startup, it will set +" itself as "compatible" with vi +set nocompatible + +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +" ignore this script if we're not using vim7 +" note: most (if not all) of this vimrc will work, since I've been +" using it since 2000; it's just that I don't have vim5/6 around +" anymore +" TL;DR: edit the next line to use on vim6 at your own risk +if version >= 700 + +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" +" User Interface +" +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +" Syntax highlighting, only if the feature is available and the +" terminal can display colors (or we're running gvim) +if has('syntax') && (&t_Co > 2 || has('win32') || has('gui_running')) + + " enable syntax highlighting + syntax on + + " I'm too lazy to fix termcap/terminfo in servers on N different + " platforms, so I'll just do this here... + " NEW: I don't like how the background isn't black after I quit vim, I'll + " enable this again when I know how to fix that + "if &term == "xterm-256color" + " set t_Co=256 + "endif + + if has('gui_running') + colorscheme twilight + "elseif &t_Co == 256 + " colorscheme oceanblack256 + else + " gah, fall back + colorscheme elflord + endif + +endif + +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" +" display +" +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +" welcome to the 21st century +set encoding=utf-8 + +" faster macros +set lazyredraw + +" we like security +set nomodeline + +" abbrev. of messages (avoids 'hit enter') +set shortmess+=a + +" display the current mode +set showmode + +" min num of lines to keep above/below the cursor +set scrolloff=2 + +" show line numbers +" I don't like this because it's annoying when copying and I'm used to ctrl-g +"set number + +if has('cmdline_info') + + " show the ruler + set ruler + + " a ruler on steroids + set rulerformat=%30(%=\:b%n%y%m%r%w\ %l,%c%V\ %P%) + + " show partial commands in status line and selected characters/lines in + " visual mode + set showcmd + +endif + +if has('statusline') + + " always show a status line + set laststatus=2 + + " a statusline, also on steroids + set statusline=%<%f\ %=\:\b%n\[%{strlen(&ft)?&ft:'none'}/%{&encoding}/%{&fileformat}]%m%r%w\ %l,%c%V\ %P + +endif + +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" +" editing +" +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +" backspace for dummies +set backspace=indent,eol,start + +" show matching brackets/parenthesis +set showmatch + +" command completion, list matches and complete the longest common +" part, then, cycle through the matches +set wildmode=list:longest,full + +" enable filetype detection +filetype on + +" wrap long lines +set wrap + +" indent at the same level of the previous line +set autoindent + +" use indents of 4 spaces +set shiftwidth=4 + +" the text width +set textwidth=79 + +" basic formatting of text and comments +"set formatoptions+=tcq + +" match, to be used with % +set matchpairs+=<:> + +" spaces instead of tabs, CTRL-V to insert a real space +set expandtab + +" pastetoggle (sane indentation on pastes) just press F12 when you are +" going to paste several lines of text so they won't be indented. +" When in paste mode, everything is inserted literally. +set pastetoggle= + +" ignore these file types when opening +set wildignore=*.pyc,*.o,*.obj,*.swp + + +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" +" search +" +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +" show search results as you type (enable this _only_ if you work with small +" files) +set incsearch + +" highlight all search matches +set hlsearch + + +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" +" file types +" +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +autocmd FileType c,cpp call cstuff() +function cstuff() + set cindent + set formatoptions+=croql + set formatoptions-=t +endfunction + +autocmd FileType python call pystuff() +function pystuff() + set foldmethod=indent + set foldlevel=999999 + set smartindent cinwords=if,elif,else,for,while,try,except,finally,def,class,with +endfunction + +" I have been working with cobol lately, the horror +au BufNewFile,BufRead *.CBL,*.cbl,*.cob setf cobol + +" clearsilver templates +au BufNewFile,BufRead *.cst setf cs + + +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" +" misc, there is _always_ a misc section +" +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +" real men _never_ _ever_ do backups +" (but real programmers use version control) +set nobackup + + +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" +" plugins +" +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +let g:netrw_list_hide="\.pyc$,\.swp$,\.bak$,^\.svn/$" +" tree style +"let g:netrw_liststyle=3 +" F11 to open the work directory +nmap :Explore + +" press F11 to toggle the project sidebar +"nmap ToggleProject +"let g:proj_flags="mst" + +map t :FuzzyFinderTextMate + +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" +" tabs +" +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +" this settings are basically for gvim in gtk and windows +map :tabnew +map :tabnext +map :tabprevious + + +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" +" gvim- (here instead of .gvimrc) +" +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +if has('gui_running') + set guioptions-=T " remove the toolbar + set guioptions+=a " + set lines=999 + if has("mac") + set guifont=Monaco:h14 + elseif has("unix") + set guifont=Monospace\ 12 + elseif has("win32") || has("win64") + set guifont=Consolas:h10:cANSI + endif + set cursorline +endif + +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +endif " if version >= 700 (at the beggining of the file) + +" to please the gods +iabbrev cthuf Ia! Ia! Cthulhu fhtagn! Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn! Cthulhu fhtagn! Cthulhu fhtagn!