amartini51 /.vimrc

" config file for VIM in a terminal 
"
" loaded for VIM in it's own GUI too, but that also
" loads .gvimrc
"
" order: set/let statements & fundemental config; abbreviations; mappings

set nocompatible
set ai
set ffs=unix,mac,dos
set printoptions=paper:letter,number:y,syntax:n

" set an 80 char wide screen with 8 chars for the line numbers
" this really only applies to the command-line version -- the GUI
" version pretty much ignores this
set textwidth=72

" set up colors
" order matters here - flip them and things break
if !has("gui")
   set term=ansi
endif
colorscheme darkblue
syntax enable

" the Apple mouse uses <C-LeftMouse> for <RightMouse>
map <C-LeftMouse> <RightMouse>
map! <C-LeftMouse> <RightMouse>

set number              "line numbers
set backspace=2         "allow backspacing over everything in insert mode
set showmode

" TODO make this an flip-floppable thing
" Bielajev's style guide for Engin 100
set softtabstop=3          "make the TAB key indent
set shiftwidth=3           "3 space indents
set tabstop=3              "3 space tab display
set expandtab              "translate tabs to spaces

"show SQL highlighting in PHP files
let php_sql_query = 1

" these are useful when I'm doing a lot of C++ editing, but a pain in
" the butt otherwise.
"
"set cindent

"highlight Comment guifg=#f00000
"syn region Comment  start="\[ " end=" \]"

" Folding
set foldtext=""            " Don't show fold's first line
set foldmethod=indent
set foldenable
"otherwise I get black on black, which is hard to read...
"TODO might be better to tie this to the 'comment' color
hi Folded term=bold ctermfg=6 cterm=NONE


abbrev teh the

" note: Qv used to be gv, but this is already internally defined as
" 'reselect previous Visual block'  Watch for this on old version
" of the .vimrc file
map Qv gqap|               "format current paragraph
map Qj {jV}kJjj|           "join paragraph
map Qe :so ~/.vim/e100.vim<Return>|"set up for editing e100 assembly
map \ i <Esc>|             "insert a space and stay in command mode
map <Tab> :l<Return>|      "tab shows line unambiguously

" make Y and S effect to end of line instead of whole line
map Y y$
map S s$

" emacs like movement in insert mode
map! <C-A> <Home>
map! <C-E> <End>
map! <C-F> <Right>
map! <C-B> <Left>
map! <C-P> <Up>
map! <C-N> <Down>

" home row shortcuts
imap kj <Esc>
imap KJ <Esc>
imap df <C-X><C-P>
" additional OK key combos
" jj kk
" don't use lkj, since too many edits end with the letter l

" prevents the weird delete -> forward delete issue
imap k<Delete> k<Delete>
imap K<Delete> K<Delete>
imap d<Delete> d<Delete>

" handles strange BS vs DELETE problems on lapiz
map  <C-?> <Backspace>
map! <C-?> <Backspace>