YazzY's .vimrc

From ezUnix
Jump to: navigation, search
                                    pdf_icon.png Download this article as a single PDF document 
" Set general variables
set nocompatible
" set viminfo='10,:40,%,n~/.viminfo
set wildmode=list:full wildmode=longest,list pastetoggle=<c-u>
set report=0 laststatus=2 shortmess=filmnrwxs scs expandtab wildmenu
set visualbell nowrap nojoinspaces ruler magic hidden number is aw showcmd
set showmatch nohlsearch incsearch noignorecase autoindent smartindent
set nojoinspaces ruler magic hidden number is aw showcmd
set backspace=2 shiftwidth=2 textwidth=80 tabstop=4 background=dark

" Color
"colorscheme deo

" Set start/end () / []
highlight MatchParen ctermfg=white guifg=white ctermbg=black guifg=black

" Font
set guifont=Lucida\ Console\ 11

" No beeps
set visualbell

" No auto line break
set nowrap

" Cursor can move to no text areas
"set ve=all

" Doh... you know what this does... ;-)
syntax on

" Some useful abbreviations to common mistyped commands
cab W w | cab Q q | cab Wq wq | cab wQ wq | cab WQ wq

" Enable loading of plugins and indent rules based on filetype
"filetype plugin indent on
filetype plugin on

" Map additional extensions to some file formats
au BufNewFile,BufRead *.as setf actionscript
au BufNewFile,BufRead *.cpy,*.vpy setf python
au BufNewFile,BufRead *.pt,*.cpt,*.zcml setf xhtml

" Jump to the file last known position, after open it, if there's a '" mark
au BufReadPost * if line("'\"") && line("'\"") <= line("$") | exe "normal g'\"" | endif

" Binary edit using xxd
augroup Binary
" Remove ALL autocommands for the current group.
au!
au BufReadPre  *.bin,*.hex let &binary=1
au BufReadPost *.hex if &binary | exe '%!xxd' | set ft=xxd | endif
au BufReadPost *.bin if &binary | exe '%!xxd -b' | set ft=xxd | endif
au BufWritePre *.hex if &binary | exe '%!xxd -r' | endif
au BufWritePost *.bin,*.hex if &binary | exe '%!xxd' | set nomod | endif
augroup END

" Comment/Uncomment for different languages
au FileType haskell,vhdl,ada let comment = '-- '
au FileType sh,make,python   let comment = '# '
au FileType c,cpp,java       let comment = '// '
au FileType tex              let comment = '% '
au FileType vim              let comment = '" '

" Comment Blocks
noremap <silent> ,C :s,^,<C-R>=comment<CR>,<CR>:noh<CR>
noremap <silent> ,U :s,^\V<C-R>=comment<CR>,,e<CR>:noh<CR>

" Show extra endline tabs/spaces in red
highlight WhitespaceEOL ctermbg=red guibg=red
match WhitespaceEOL /\s\+$/

" Map ,a to clean extra endline tabs/spaces
nnoremap <silent> ,a :%s,\s\+$,,<CR>

" Map F8 to Tlist
nnoremap <silent> <F8> :Tlist<CR>

" Auto close {([
imap { {}<left>
imap ( ()<left>
imap [ []<left>

" Move to left/right of {([
imap <c-l> <esc><right>a
imap <c-h> <esc><left>a

" Auto open/close Tlist
"let Tlist_Auto_Open = 1
let Tlist_Exit_OnlyWindow = 1

" python
let python_highlight_all = 1

" PO vars
let g:po_translator = 'Dorneles Treméa <dorneles@x3ng.com.br>'
let g:po_lang_team = 'Plone i18n <plone-i18n@lists.sourceforge.net>'

" Disable autospell plugin
let loaded_vimspell = 1

" Disable EnhancedCommentify.vim plugin
let DidEnhancedCommentify = 1

" Disable NERD_comments.vim plugin
let loaded_nerd_comments = 1