" Bryan Ross' .vimrc file
" Testing
" set verbose=10
" Use VIM as opposed to VI settings
set nocompatible
" Turn on syntax highlighting
syntax on
" Handle wrapping
set linebreak
set showbreak=>>\ \
" For changing tabs to spaces and back
:command! -range=% -nargs=0 Tab2Space execute "<line1>,<line2>s/^\\t\\+/\\=substitute(submatch(0), '\\t', repeat(' ', ".&ts."), 'g')"
:command! -range=% -nargs=0 Space2Tab execute "<line1>,<line2>s/^\\( \\{".&ts."\\}\\)\\+/\\=substitute(submatch(0), ' \\{".&ts."\\}', '\\t', 'g')"
" Show Line Numbers
set number
set cursorline
" Set encoding, indent and scrolloff
"set encoding=utf-8
"set scrolloff=999
set nolist
set nosmartindent
set noautoindent
set autochdir
" Set status line
set laststatus=2
set statusline=
set statusline+=%-3.3n
set statusline+=\[%{strlen(&ft)?&ft:'none'}]
set statusline+=\ %F
set statusline+=%=
set statusline+=0x%-8B
set statusline+=%-14(%l,%c%V%)
set statusline+=%<%P
" Show Command and Ruler
set showcmd
set ruler
set ignorecase
set smartcase
set wildmenu
set showmode
set visualbell
set incsearch
set hlsearch
" Handle buffer switching
set switchbuf=useopen
" Add new windows to right and bottom (yay!)
set splitright
set splitbelow
" Enter key clears search
:nnoremap <CR> :nohlsearch<CR>
" Enable filetype
filetype on
filetype indent on
filetype plugin on
" Set cmd height
set cmdheight=2
if has("win32") || has("win64")
set directory=$TMP
else
set directory=/tmp
end
" All ML stuff
let g:allml_global_maps = 1
" Fix Backspace
set backspace=indent,eol,start
" Set Tabbing
set shiftwidth=2
set tabstop=2
set softtabstop=2
set noexpandtab
set smarttab
" Vim info
set viminfo+=!
" Map to set CWD to file being edited
map ,cd :cd %:p:h<CR>
" Highlight ALL Python
let python_highlight_all = 1
" Nice trick for sudo
cmap w!! %!sudo tee > /dev/null %
colorscheme wombat
set formatoptions+=r