Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
79 lines (62 sloc) 2.38 KB
set nocompatible
syntax enable
set encoding=utf-8
set number " line numbers
set ruler
set modeline " file info
set ls=2
nnoremap <F3> :set nonumber!<CR>" and toggle them with F3
set showcmd " display incomplete commands
filetype plugin indent on " load file type plugins + indentation
set t_Co=256
let g:solarized_termcolors=256
set background=light
colorscheme solarized
set guifont=Menlo:h16 " yes, I'm getting old
call togglebg#map("<F5>")
"" Whitespace
set nowrap " don't wrap lines
set tabstop=2 shiftwidth=2 " a tab is two spaces
set expandtab " use spaces, not tabs
set backspace=indent,eol,start " backspace through everything in insert mode
"" Searching
set hlsearch " highlight matches
set incsearch " incremental searching
set ignorecase " searches are case insensitive...
set smartcase " ... unless they contain at least one capital letter
"" No auto-commentation of lines
autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o
"" Bind paste mode toggle to key with feedback
nnoremap <F2> :set invpaste paste?<CR>
set pastetoggle=<F2>
set showmode
inoremap <expr> <C-Space> pumvisible() \|\| &omnifunc == '' ?
\ "\<lt>C-n>" :
\ "\<lt>C-x>\<lt>C-o><c-r>=pumvisible() ?" .
\ "\"\\<lt>c-n>\\<lt>c-p>\\<lt>c-n>\" :" .
\ "\" \\<lt>bs>\\<lt>C-n>\"\<CR>"
imap <C-@> <C-Space>
"" Highlight bad spaces: Trailing whitespaces, leading tabs
highlight ExtraWhitespace ctermbg=red guibg=red
highlight LeadingTabs ctermbg=red guibg=red
match ExtraWhitespace /\s\+$/
match LeadingTabs /^\t/
"" Python specific
autocmd BufRead *.py set tabstop=4 shiftwidth=4
autocmd BufRead *.py set smartindent cinwords=if,elif,else,for,while,try,except,finally,def,class
"" Go specific
au BufRead,BufNewFile *.go set filetype=go noexpandtab tabstop=2 shiftwidth=2
"" PHP specific
autocmd BufRead *.php set tabstop=4 shiftwidth=4
"" Puppet config files
au BufRead,BufNewFile *.pp set filetype=puppet noexpandtab tabstop=8 shiftwidth=8
"" Markdown
au BufRead,BufNewFile *.md set syntax=off
"" Tabs
set tabpagemax=100
map <C-n> :tabn<cr>
map <C-b> :tabp<cr>
"" Open all buffers in tabs
:au BufAdd,BufNewFile,BufRead * nested tab sball
set runtimepath^=~/.vim/bundle/ctrlp.vim