vim
vim kicks some serious buttocks. I don't think there's any editor that gives
you such speed and productivity coupled with more control and configuration
than any one person needs in their entire liftime. Yeah, you can counter with
emacs. I've tried that for awhile, and it just seems too bloated; I just want
to edit some C code effectively, not check the weather in Afghanistan at the
same time. (Also, the whole notion of having a meta key while hitting
<ctrl> and the like is totally inefficient. That's what makes vim so
great, you don't have to hit control keys for any actions; your fingers can
remain on the home row. Ahh, I'm getting goosebumps just thinking about it.)
Here's my
.vimrc
which sets up my vim environment. I turn on syntax
highlighting and cindenting which is all of a development environment I need.
IDE? I don't need no steenking IDE!
" vim kicks some serious arse, kids
version 5.3
"Let's get color and syntax highlighting to work, shall we?
:if has("terminfo")
: set t_Co=8
: set t_Sf=[3%p1%dm
: set t_Sb=[4%p1%dm
:else
: set t_Co=8
: set t_Sf=[3%dm
: set t_Sb=[4%dm
:endif
set background=dark "white text on black background
syntax on "syntax highlighting for coding
set shm=oa "abbrev mesgs and auto hit RETURN on msgs
set noai "auto indent can be evil
set showmode "tell me what mode we in
set shell=/usr/local/bin/bash "bash shell is keen
set wrapmargin=1 "wrap after 79 chars
set sw=4 "set shift width to 4
set ts=4 "set tab stop to 4
set et "use spaces for tab key
set undolevels=1000 "I like to be able to undo everything
"set mouse=a "me no like visual mouse mode for cut and paste
ab vioff set nocindent noai nosm noet
ab vion set cindent sm ai et
ab TM Tom M
"this is for cut-and-paste between windows when using visual mouse mode
vmap ,y :w! ~/.vi_tmp
nmap ,p :r ~/.vi_tmp
"reformat text when you have wrap margin on and then insert additional text
map ,H 1G:set tw=999999gqG:set tw=0
map ,r {:set tw=999999gq}:set tw=0
map ,a {/.\{60,}gq}k
"map ,a {gq}k
map ,A ^gq}k
map ' ` "map the hard-to-hit ` to '
map < space> "greatest mapping of all time! space pages down
map - ^B "the - pages up
map ,s :!ispell % < CR > :e % < CR > "spell check this file
"these are useful when using the Kernigan & Richie programming style (I usually
" do). These maps will let you traverse up and down all of the function
" declarations quickly (it searches for a '{' at the beginning of a line).
map ,f /^\s*{
map ,b ?^\s*{
map ,F /^\s*}
map ,B ?^\s*}
"useful for when doing / searches, and you want to temporarily disable case
map ,I :set noignorecase
map ,i :set ignorecase
"you can map stuff to the function keys (F2 and F3 here)
map #2 :set noai nocindent nosm
map #3 :set ai cindent sm
map #5 :syntax off
map #6 :syntax off
"set this stuff up for coding - otherwise it's off
"for program files, turn on cindent and showmatch
au BufEnter *.h,*.c,*.C,*.cpp,*.java set cindent showmatch
"some abbreviations useful whenever coding
au BufEnter *.h,*.c,*.C,*.cpp,*.java ab FOR for ( i =0; i < ; i++ ) {
au BufNewFile *.h,*.c,*.C,*.cpp,*.java :r ~/.rcstemplate
au BufEnter *.java ab Sop System.out.println(
au BufEnter *.java ab Sep System.err.println(
"Makefile needs actual tabs
au BufEnter Makefile,makefile set noet
"turn abbreviations off when leaving the buffer
"au BufLeave *.h,*.c,*.C,*.cpp,*.java unabbr FOR
"au BufLeave *.java unabbr FOR
"some colors for syntax highlighting
hi Comment ctermfg=cyan
hi Constant ctermfg=Magenta
hi Special ctermfg=LightRed
hi Identifier cterm=bold ctermfg=LightGreen
hi Statement ctermfg=Yellow
hi PreProc ctermfg=LightBlue
hi Type ctermfg=green
hi ErrorMsg ctermfg=red
"my vim haiku (by unpopular demand!)
"
"Silent, powerful,
"Editing files like crazy,
"How I love thee, vim.