Here is my current vimrc.
Some highlights of what all these settings do:
Turn on some nifty colors, for syntax highlighting and on the status bar
Don't use real tabs, instead, use 4 spaces whenever you hit the tab key
Handles indentation of curlies
Uses upper ascii characters to represent real tabs, as well as showing you when there are spaces at the end of your lines
If you're typing out comments, and the text gets to the end of the line, make it wrap, and make sure it adds a comment for you at the beginning of the next line
Turn off all the noisy beeping, so the terminal won't beep every time you press the cursor in the wrong direction, or make some other simple mistake
And my all-time favorite:
Tab completion of variable names! If you hit tab with no characters before your curser, you get a normal 4 space tab. If there are characters before you cursor, it performs completion on them, allowing you to scroll forward through the options with tab, or backwards through the options with shift-tab.
" Eric Andreychek's .vimrc
" turn these ON:
set digraph esckeys hidden ruler showcmd wildmenu smartindent expandta
set visualbell showmatch title
" turn these OFF:
set noerrorbells nostartofline nohlsearch
set backspace=2 formatoptions=cqrt laststatus=2 shortmess=at textwidth
set whichwrap=<,>,h,l shiftwidth=4 softtabstop=4
set list listchars=tab:ùð,trail:Ü
map Q gq
map K <NUL>
map <C-Z> :shell<CR>
map ,v :e ~/.vimrc<CR>
map ,F :view $VIMRUNTIME/filetype.vim
map ,SO :source $VIMRUNTIME/syntax/
map ,V :view $VIMRUNTIME/syntax/
map <C-A> <Home>
map <C-E> <End>
" syntax coloring!! :-)
" some colors: "white on black"
hi comment ctermfg=darkgreen ctermbg=black guifg=darkgreen guibg=bla
" Make the status bar blue
" The bottom line is bold-white
" Mmmmm... tab completetion
let col = col('.') - 1
if !col || getline('.')[col - 1] !~ '\k'
elseif "backward" == a:direction
inoremap <S-tab> <c-r>=InsertTabWrapper ("backward")<cr>
inoremap <tab> <c-r>=InsertTabWrapper ("forward")<cr>
There are some control/escape characters in this vimrc file. If you really want to use the whole thing, don't try to copy and paste this, just snag it from my website: Eric's vimrc.
Update: Oh yeah, and vim rules :-)
Lucy: "What happens if you practice the piano for 20 years and then end up not being rich and famous?"
Schroeder: "The joy is in the playing."
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||