Monday, June 20, 2011

.screenrc

Here is my .screenrc file:

escape ^Jj
startup_message off
defscrollback 10000
vbell off
autodetach on
hardstatus alwayslastline
#hardstatus string "%{=b}%{G} %{b}%w%=%{kG}%C%A"
hardstatus string '%{= kG}[%{G}%{y}%H%{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(
%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B}%m/%d %{W}%c%{g}]'
shell -$SHELL

.vimrc

Here is my .vimrc file:


" Whitespace
set expandtab           " tabs -> spaces
set tabstop=4           " tab = 4 spaces
set shiftwidth=4        " used with << and >> to shift text over

set showmode            " when in INPUT mode, show INPUT text at all times
set ruler               " show current position at all times
set showcmd             " show incomplete commands at bottom of screen

set title               " set title to name of open file
set showmatch           " show matching brace/parenthese/bracket
" make the matching parenthesis not stand out so much
hi MatchParen cterm=underline ctermbg=black

" after leaving VIM, remove that annoying 'Thanks for flying Vim' title
let &titleold="~"

set visualbell          " flash screen instead of beep when error happens

" Search
set incsearch           " start searching as you type the search
set hls                 " highlight search matches
set ignorecase          " ignore case while searching
set smartcase           " if search string has uppercase, don't ignore case
set infercase           " if using auto-completion, this makes the word found have an appropriate case
" use spacebar to clear search highlighting and any message already displayed
nnoremap :silent nohecho

syntax on               " turn on syntax coloring
"syntax match Test "p"
"highlight Test ctermbg=red guibg=red
"syntax match Tab "\s"
"highlight Tab ctermbg=red guibg=red

au BufReadPost,FileReadPost * syntax match OverLength "\%>79v.\+"
hi OverLength ctermbg=blue ctermfg=white guibg=blue

au BufReadPost,FileReadPost * syntax match TrailingSpaces "\s\+$"
hi TrailingSpaces ctermbg=red guibg=red

" highlight text past 79 characters
match OverLength /\%>79v.\+/

" highlight trailing spaces at end of line
"2match TrailingSpaces /\s\+$/

"highlight TrailingSpaces ctermbg=red guibg=red
highlight OverLength ctermbg=blue ctermfg=white guibg=blue

" Function to remove superfluous white space from the end of a line
function! RemoveWhiteSpace()
    :%s/\s*$//g
    :'^
    "`.
endfunction

Cygwin Tweak

to get a cygwin terminal that actually uses bash and allows you to paste stuff into the window, edit /cygdrive/c/cygwin/Cygwin.bat to have this:


@echo off

C:
chdir C:\cygwin\bin

start rxvt -sr -sl 10000 -fg grey -bg black -fn courier -tn cygwin -e /bin/bash --login -i