dotfiles / vimrc

Full commit
set formatoptions=crqn
set tabstop=4
set softtabstop=4
set shiftwidth=4
set expandtab
set smartcase
syntax enable 		" Turn on syntax hilighting
filetype on           " Enable filetype detection
set autoindent
filetype indent on    " Enable filetype-specific indenting
filetype plugin on    " Enable filetype-specific plugins
set nocompatible 	" Keep vim from trying to be 100% vi compatible
set backspace=indent,eol,start " Better backspacing
set ruler		" Vim will always tell me where she is
set lz          " Don't re-draw while running macros
set hid         " Can hide buffers without closing them
set shortmess=atI " shortens messages to avoid 'press a key' prompt 
set matchtime=1

set wildmenu    " Pretty command-line option matching
set wildignore=*.bak,*.o,*.e,*~,*.pyc
" Suffixes that get lower priority when doing tab completion for filenames.
" These are files we are not likely to want to edit or read.
set suffixes=.bak,~,.swp,.o,.info,.aux,.log,.dvi,.bbl,.blg,.brf,.cb,.ind,.idx,.ilg,.inx,.out,.toc,.class,.pyc
set tags=tags;/
set statusline=%f%m%r%h%w\ [%Y]\ [HEX=\%02.2B]%=Y=%04l,\ X=%04v\ %p%%\ of\ %L\ (buf\ %n)
set laststatus=2 " Always show status line

set foldmethod=marker

if has("autocmd")
	" Change to the directory the file in your current buffer is in
	autocmd BufEnter * :lcd %:p:h
	autocmd BufEnter * map <C-A> :!%:p
	autocmd BufEnter *.c map <C-X> :make
	autocmd BufEnter *.c map <C-A> :make run
	autocmd BufEnter *.c map <C-B> :!make debug
    autocmd BufEnter *.py map <C-A> :!py %
    autocmd BufEnter *.py set foldmethod=indent
    autocmd BufEnter *.html,*.htm,*.xml,*.js setlocal indentexpr= " Stop auto-indenting on HTMl
    autocmd BufEnter *.js setlocal nocin
    autocmd BufEnter *.js setlocal si
    autocmd BufEnter *.js setlocal ai
    autocmd Filetype html,xml source ~/.vim/plugin/closetag.vim 
endif " has("autocmd")

let py_source = '\(Py3k-svn\|Python-trunk\)'
let path = expand('%:p:h')
if path =~ py_source
    let path = substitute(path, '\(.*/' . py_source . '\).*', '\1', '')
    execute('source ' . path . '/Misc/Vim/vimrc')

" Make p in Visual mode replace the selected text with the "" register.
vnoremap p <Esc>:let current_reg = @"<CR>gvdi<C-R>=current_reg<CR><Esc>

noremap 0 ^
noremap ^ 0

set showcmd             " Show (partial) command in status line.
set showmatch           " Show matching brackets.
set incsearch           " Incremental search
set hlsearch		    " Hilight searches

nmap j gj
nmap k gk

" map c-o to new line below, then go back to normal, c-s-o to new line above and normal
map <C-O> ok
map � Oj

" NetRW stuff
let g:netrw_sort_sequence='[\/]$,*,\.bak$,\.o$,\.h$,\.info$,\.swp$,\.obj$,\.pyc$'
let g:netrw_keepdir=0
let g:netrw_browse_split=0

" map \ to nohlsearch
map \ :noh

" Some windowing convinience methods
map <c-h> <c-w>h
map <c-j> <c-w>j
map <c-k> <c-w>k
map <c-l> <c-w>l
map <c-@> <c-w>_
map <c-space> <c-w>_
map + <c-w>+
map - <c-w>-

map <right> :bn<return>
map <left> :bp<return>

map <F7> :setlocal spell spelllang=en_ca
map <F8> :setlocal spell spelllang=NONE

map  :!gnome-terminal &<Enter><Enter>

map <F9> Oimport rpdb2; rpdb2.start_embedded_debugger("asdf") #BREAK
map <F8> Oimport pdb; pdb.set_trace() #BREAK
map <F7> Oimport traceback, sys; traceback.print_exception(*sys.exc_info()) #TRACEBACK