# HG changeset patch # User Steve Losh # Date 1315509063 14400 # Node ID f09eaa45d84e50883f0d9aec50a16fe29c464941 # Parent 2e25b11e75fcae5bdba0785c644b9a289bb41966 Formatting. diff -r 2e25b11e75fc -r f09eaa45d84e vim/.vimrc --- a/vim/.vimrc Thu Sep 08 09:20:01 2011 -0400 +++ b/vim/.vimrc Thu Sep 08 15:11:03 2011 -0400 @@ -83,34 +83,6 @@ set colorcolumn=+1 " }}} -" Status line {{{ - -set statusline=%f " Path. -set statusline+=%m " Modified flag. -set statusline+=%r " Readonly flag. -set statusline+=%w " Preview window flag. - -set statusline+=\ " Space. - -set statusline+=%#warningmsg# " Highlight the following as a warning. -set statusline+=%{SyntasticStatuslineFlag()} " Syntastic errors. -set statusline+=%* " Reset highlighting. - -set statusline+=%= " Right align. - -" File format, encoding and type. Ex: "(unix/utf-8/python)" -set statusline+=( -set statusline+=%{&ff} " Format (unix/DOS). -set statusline+=/ -set statusline+=%{strlen(&fenc)?&fenc:&enc} " Encoding (utf-8). -set statusline+=/ -set statusline+=%{&ft} " Type (python). -set statusline+=) - -" Line and column position and counts. -set statusline+=\ (line\ %l\/%L,\ col\ %03c) - -" }}} " Backups {{{ set undodir=~/.vim/tmp/undo// " undo files @@ -137,14 +109,52 @@ " }}} " }}} -" Useful abbreviations -------------------------------------------------------- {{{ +" Status line ----------------------------------------------------------------- {{{ + +set statusline=%f " Path. +set statusline+=%m " Modified flag. +set statusline+=%r " Readonly flag. +set statusline+=%w " Preview window flag. + +set statusline+=\ " Space. + +set statusline+=%#redbar# " Highlight the following as a warning. +set statusline+=%{SyntasticStatuslineFlag()} " Syntastic errors. +set statusline+=%* " Reset highlighting. + +set statusline+=%= " Right align. + +" File format, encoding and type. Ex: "(unix/utf-8/python)" +set statusline+=( +set statusline+=%{&ff} " Format (unix/DOS). +set statusline+=/ +set statusline+=%{strlen(&fenc)?&fenc:&enc} " Encoding (utf-8). +set statusline+=/ +set statusline+=%{&ft} " Type (python). +set statusline+=) + +" Line and column position and counts. +set statusline+=\ (line\ %l\/%L,\ col\ %03c) + +" }}} +" Abbreviations --------------------------------------------------------------- {{{ + +function! EatChar(pat) + let c = nr2char(getchar(0)) + return (c =~ a:pat) ? '' : c +endfunction + +function! MakeSpacelessIabbrev(from, to) + execute "iabbrev ".a:from." ".a:to."=EatChar('\\s')" +endfunction + +call MakeSpacelessIabbrev('sl/', 'http://stevelosh.com/') +call MakeSpacelessIabbrev('bb/', 'http://bitbucket.org/') +call MakeSpacelessIabbrev('bbs/', 'http://bitbucket.org/sjl/') +call MakeSpacelessIabbrev('gh/', 'http://github.com/') +call MakeSpacelessIabbrev('ghs/', 'http://github.com/sjl/') iabbrev ldis ಠ_ಠ -iabbrev sl/ http://stevelosh.com/ -iabbrev bb/ http://bitbucket.org/ -iabbrev bbs/ http://bitbucket.org/sjl/ -iabbrev gh/ http://github.com/ -iabbrev ghs/ http://github.com/sjl/ iabbrev sl@ steve@stevelosh.com " }}}