From d1a2a24cb258d3f6e5eee99b4d4a38c8d33f74e0 Mon Sep 17 00:00:00 2001 From: Julio Biason Date: Sun, 22 Jun 2014 08:15:43 -0300 Subject: [PATCH] major update: removed the check for autocmd (cause fuck not having it), removed vim-mode and used python syntax and vim-jedi instead; removed a bunch of commented code --- configs/vimrc | 190 ++++++++++++++++++++------------------------------ 1 file changed, 74 insertions(+), 116 deletions(-) diff --git a/configs/vimrc b/configs/vimrc index f94e317..fcd1efc 100644 --- a/configs/vimrc +++ b/configs/vimrc @@ -61,85 +61,66 @@ syntax sync minlines=1500 " increases the number of lines to find the proper syn let mapleader="," " use comma to start user-defined (in plugins) functions -" Only do this part when compiled with support for autocommands. -if has("autocmd") - " Enable file type detection. - " Use the default filetype settings, so that mail gets 'tw' set to 72, - " 'cindent' is on in C files, etc. - " Also load indent files, to automatically do language-dependent indenting. - filetype plugin indent on - - " Put these in an autocmd group, so that we can delete them easily. - augroup vimrcEx - au! - - " For all text files set 'textwidth' to 78 characters. - autocmd FileType text setlocal textwidth=78 - - " When editing a file, always jump to the last known cursor position. - " Don't do it when the position is invalid or when inside an event handler - " (happens when dropping a file on gvim). - autocmd BufReadPost * - \ if line("'\"") > 0 && line("'\"") <= line("$") | - \ exe "normal g`\"" | - \ endif - - augroup END - - " Python files should not have empty lines - autocmd FileType python autocmd BufWritePre :%s/\s\+$//e - - - " omni completion - au FileType python setlocal ofu=pythoncomplete#Complete - au FileType javascript setlocal ofu=javascriptcomplete#CompleteJS - au FileType html setlocal ofu=htmlcomplete#CompleteTags - au FileType css setlocal ofu=csscomplete#CompleteCSS - au FileType xml setlocal ofu=xmlcomplete#CompleteTags - au FileType php setlocal ofu=phpcomplete#CompletePHP - - set completeopt-=preview - - " ---------------------------------------------------------------------- - " Auto-commands - " ---------------------------------------------------------------------- - - " default python style - " (use spaces instead of tabs (expandtab), uses 4 spaces for tabs (tabstop), - " when auto-indenting, also use 4 spaces (shiftwidth), when deleting text, 4 - " spaces are a tab (softtabstop) and break the line at column 78 (textwidth)) - au FileType python setlocal expandtab tabstop=4 shiftwidth=4 softtabstop=4 textwidth=78 colorcolumn=79 - - " reStructured files follow python closely, but use 3 tab stops instead of 4 - au FileType rst setlocal expandtab tabstop=3 sw=3 sts=3 textwidth=78 - - " templates (Jinja2 in this case) will use tabs instead (to reduce file size) - au FileType htmldjango setlocal noet tabstop=4 shiftwidth=4 softtabstop=4 textwidth=0 - au FileType jinja setlocal noet tabstop=4 shiftwidth=4 softtabstop=4 textwidth=0 - - " the smarty filetypes doesn't have any sort of indentation, so we set it to - " auto - au FileType smarty setlocal ai - - " PHP break lines at column 79, like Python - au FileType php setlocal textwidth=79 - - " svn (when editing svn commit messages, break lines at - " column 70) - au FileType svn setlocal tw=70 - - " email (mostly mutt stuff) - au FileType mail setlocal spell spelllang=en - - " JavaScript (who though those were "good" defaults?) - au FileType javascript setlocal expandtab tabstop=2 sw=2 sts=2 textwidth=0 - - " Pinpoint (presentation format) - au BufNewFile,BufRead *.pin set filetype=pinpoint - au FileType pinpoint setlocal colorcolumn=79 textwidth=78 -else - set autoindent " always set autoindenting on -endif " has("autocmd") +" Enable file type detection. +" Use the default filetype settings, so that mail gets 'tw' set to 72, +" 'cindent' is on in C files, etc. +" Also load indent files, to automatically do language-dependent indenting. +filetype plugin indent on + +" Put these in an autocmd group, so that we can delete them easily. +augroup vimrcEx +au! + +" For all text files set 'textwidth' to 78 characters. +autocmd FileType text setlocal textwidth=78 + +" When editing a file, always jump to the last known cursor position. +" Don't do it when the position is invalid or when inside an event handler +" (happens when dropping a file on gvim). +autocmd BufReadPost * +\ if line("'\"") > 0 && line("'\"") <= line("$") | +\ exe "normal g`\"" | +\ endif + +augroup END + +" ---------------------------------------------------------------------- +" Auto-commands +" ---------------------------------------------------------------------- + +" default python style +" (use spaces instead of tabs (expandtab), uses 4 spaces for tabs (tabstop), +" when auto-indenting, also use 4 spaces (shiftwidth), when deleting text, 4 +" spaces are a tab (softtabstop) and break the line at column 78 (textwidth)) +au FileType python setlocal expandtab tabstop=4 shiftwidth=4 softtabstop=4 textwidth=78 colorcolumn=79 + +" Python files should not have empty lines +au FileType python autocmd BufWritePre :%s/\s\+$//e + +" reStructured files follow python closely, but use 3 tab stops instead of 4 +au FileType rst setlocal expandtab tabstop=3 sw=3 sts=3 textwidth=78 + +" templates (Jinja2 in this case) will use tabs instead (to reduce file size) +au FileType htmldjango setlocal noet tabstop=4 shiftwidth=4 softtabstop=4 textwidth=0 +au FileType jinja setlocal noet tabstop=4 shiftwidth=4 softtabstop=4 textwidth=0 + +" the smarty filetypes doesn't have any sort of indentation, so we set it to +" auto +au FileType smarty setlocal ai + +" PHP break lines at column 79, like Python +au FileType php setlocal textwidth=79 +let php_smart_members=1 " colorize instance members + +" svn (when editing svn commit messages, break lines at +" column 70) +au FileType svn setlocal tw=70 + +" email (mostly mutt stuff) +au FileType mail setlocal spell spelllang=en + +" JavaScript (who though those were "good" defaults?) +au FileType javascript setlocal expandtab tabstop=2 sw=2 sts=2 textwidth=0 " ---------------------------------------------------------------------- " mapings @@ -192,9 +173,6 @@ else imap :tabn 10a endif -" custom PHP syntax file configuration -let php_smart_members=1 - " Vundle stuff starts here set rtp+=~/.vim/bundle/vundle/ call vundle#rc() @@ -206,7 +184,6 @@ call vundle#rc() Bundle 'gmarik/vundle' " status line -" Bundle "Lokaltog/powerline" Bundle "bling/vim-airline" " git support @@ -220,22 +197,18 @@ Bundle 'godlygeek/tabular' " close pairs Bundle 'jiangmiao/auto-pairs' -" Bundle 'Townk/vim-autoclose' " python -" Bundle 'nvie/vim-flake8' -Bundle 'klen/python-mode' +" Bundle 'klen/python-mode' Bundle 'scrooloose/syntastic' +Bundle 'hdima/python-syntax' +Bundle 'davidhalter/jedi-vim' " snippets Bundle 'msanders/snipmate.vim' -" Bundle "MarcWeber/vim-addon-mw-utils" -" Bundle "tomtom/tlib_vim" -" Bundle "garbas/vim-snipmate" " fuzzy file open Bundle 'kien/ctrlp.vim' -" Bundle "unite.vim" " fuzzy function search (based on ctrlp) Bundle 'tacahiroy/ctrlp-funky' @@ -245,38 +218,23 @@ Bundle 'terryma/vim-multiple-cursors' " colorscheme Bundle 'croaker/mustang-vim' -" Bundle "Ambient-Color-Scheme" +Bundle "Ambient-Color-Scheme" Bundle 'EditPlus' -" Bundle 'altercation/vim-colors-solarized' +Bundle 'altercation/vim-colors-solarized' color mustang " looks awesome on gvim, looks alright in vim if you have 256 color support -" Autocomplete -" Bundle 'ervandew/supertab' - " Improved syntax files Bundle 'Glench/Vim-Jinja2-Syntax' Bundle 'fmoralesc/vim-pinpoint' - -" Identation guidelines -" Bundle 'nathanaelkane/vim-indent-guides' +Bundle 'elzr/vim-json' " Airline to prompt Bundle 'edkolev/promptline.vim' -" JSON -Bundle 'elzr/vim-json' - -" auto-pair settings -let g:AutoPairsMapCR = 1 - " ---------------------------------------------------------------------- -" Powerline settings +" Autopair settings " ---------------------------------------------------------------------- - -" python from powerline.vim import setup as powerline_setup -" python powerline_setup() -" python del powerline_setup -" let g:Powerline_symbols = 'unicode' +let g:AutoPairsMapCR = 1 " ---------------------------------------------------------------------- " Airline configuration @@ -291,12 +249,6 @@ let g:airline#extensions#tabline#show_buffers = 0 let g:airline#extensions#tabline#show_tab_type = 0 let g:airline#extensions#tabline#tab_nr_type = 1 -" ---------------------------------------------------------------------- -" Unite configuration (disabled) -" ---------------------------------------------------------------------- -" let g:unite_split_rule = "bottomleft" -let g:unite_winheight = 10 - " ---------------------------------------------------------------------- " CtrlP and extensions configuration " ---------------------------------------------------------------------- @@ -316,3 +268,9 @@ let g:indent_guides_guide_size=1 let g:vim_json_syntax_conceal = 0 autocmd BufNewFile,BufRead *.json set filetype=json autocmd Filetype json set noet ts=4 + +" ---------------------------------------------------------------------- +" Pinpoint syntax +" ---------------------------------------------------------------------- +au BufNewFile,BufRead *.pin set filetype=pinpoint +au FileType pinpoint setlocal colorcolumn=79 textwidth=78