Browse Source

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

master
Julio Biason 11 years ago
parent
commit
d1a2a24cb2
  1. 190
      configs/vimrc

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

Loading…
Cancel
Save