dotvim/vimrc

200 lines
5.5 KiB
VimL

runtime! debian.vim
set nocompatible " be iMproved, required
filetype off " required
if filereadable("/etc/vim/vimrc.local")
source /etc/vim/vimrc.local
endif
"""""""""""""""""""""""""""
" PLUGINS
"""""""""""""""""""""""""""
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'mileszs/ack.vim.git'
Plugin 'Shougo/neocomplete.vim'
Plugin 'tobyS/pdv.git'
Plugin 'scrooloose/syntastic.git'
Plugin 'majutsushi/tagbar'
Plugin 'leafgarland/typescript-vim.git'
Plugin 'SirVer/ultisnips.git'
Plugin 'mattn/vdbi-vim'
Plugin 'bling/vim-airline.git'
Plugin 'kchmck/vim-coffee-script.git'
Plugin 'terryma/vim-multiple-cursors.git'
Plugin 'sheerun/vim-polyglot'
Plugin 'honza/vim-snippets.git'
Plugin 'tobyS/vmustache.git'
Plugin 'mattn/webapi-vim'
Plugin 'sjl/gundo.vim.git'
Plugin 'godlygeek/tabular.git'
Plugin 'tpope/vim-fugitive.git'
Plugin 'airblade/vim-gitgutter.git'
Plugin 'groenewege/vim-less.git'
Plugin 'arnaud-lb/vim-php-namespace.git'
Plugin 'tpope/vim-surround.git'
Plugin 'scrooloose/nerdtree'
Plugin 'nerdtree-ack'
Plugin 'php-cs-fixer'
Plugin 'php-doc'
Plugin 'php-doc-upgrade'
Plugin 'php.vim'
Plugin 'ZenCoding.vim'
Plugin 'closetag.vim'
Plugin 'beyondwords/vim-twig'
Plugin 'Shougo/vimproc'
Plugin 'Shougo/unite.vim'
Plugin 'm2mdas/phpcomplete-extended'
Plugin 'ctrlpvim/ctrlp.vim'
Plugin 'phpfolding.vim'
Plugin 'Xuyuanp/nerdtree-git-plugin'
Plugin 'jistr/vim-nerdtree-tabs'
Plugin 'raimondi/delimitmate'
Plugin 'dietsche/vim-lastplace.git'
call vundle#end()
"""""""""""""""""""""""""""
" THEME
"""""""""""""""""""""""""""
syntax on
" colorscheme Tomorrow-Night-Bright
colorscheme gruvbox
set background=dark
"""""""""""""""""""""""""""
" PLUGINS CONFIGURATION
"""""""""""""""""""""""""""
if has("autocmd")
filetype plugin on
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")
endif
set statusline=%<%f%=%([%{Tlist_Get_Tagname_By_Line()}]%)
au Filetype html,xml,xsl,php,jsp,jspf,twig source ~/.vim/bundle/closetag.vim/plugin/closetag.vim
" au VimEnter * NERDTree
let g:nerdtree_tabs_open_on_gui_startup = 2
let g:nerdtree_tabs_open_on_console_startup = 2
let g:nerdtree_tabs_autoclose = 0
let g:UltiSnipsExpandTrigger="<tab>"
let g:UltiSnipsJumpForwardTrigger="<c-b>"
let g:UltiSnipsJumpBackwardTrigger="<c-z>"
let g:UltiSnipsEditSplit="vertical"
let g:user_zen_expandabbr_key = '<c-e>'
let g:use_zen_complete_tag = 1
let g:gitgutter_max_signs = 1000
let Tlist_Process_File_Always = 1
let Tlist_Ctags_cmd='/usr/bin/ctags'
let g:acp_enableAtStartup = 0
let g:neocomplete#enable_at_startup = 1
let g:neocomplete#enable_smart_case = 1
let g:neocomplete#sources#syntax#min_keyword_length = 3
let g:neocomplete#lock_buffer_name_pattern = '\*ku\*'
let g:neocomplete#sources#dictionary#dictionaries = {
\ 'default' : '',
\ 'vimshell' : $HOME.'/.vimshell_hist',
\ 'scheme' : $HOME.'/.gosh_completions'
\ }
if !exists('g:neocomplete#keyword_patterns')
let g:neocomplete#keyword_patterns = {}
endif
let g:neocomplete#keyword_patterns['default'] = '\h\w*'
let g:phpcomplete_index_composer_command = 'composer'
inoremap <expr><C-g> neocomplete#undo_completion()
inoremap <expr><C-l> neocomplete#complete_common_string()
inoremap <silent> <CR> <C-r>=<SID>my_cr_function()<CR>
function! s:my_cr_function()
return neocomplete#close_popup() . "\<CR>"
endfunction
inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
inoremap <expr><C-h> neocomplete#smart_close_popup()."\<C-h>"
inoremap <expr><BS> neocomplete#smart_close_popup()."\<C-h>"
inoremap <expr><C-y> neocomplete#close_popup()
let g:pdv_template_dir = $HOME ."/.vim/bundle/pdv/templates_snip"
nnoremap <buffer> <C-p> :call pdv#DocumentWithSnip()<CR>
au BufRead,BufNewFile *.php inoremap <buffer> <C-P> :call pdv#DocumentWithSnip()<CR>
function! PhpSyntaxOverride()
hi! def link phpDocTags phpDefine
hi! def link phpDocParam phpType
endfunction
augroup phpSyntaxOverride
autocmd!
autocmd FileType php call PhpSyntaxOverride()
augroup END
"""""""""""""""""""""""""""
" MAPPING
"""""""""""""""""""""""""""
set keywordprg=pman
let mapleader = "_"
map <F1> :!indentation %<CR>
map <F2> :call PhpCsFixerFixFile()<CR>
map <F7> :r!namespace %<CR>
map <F8> :!phpmd % text /usr/share/phpmd/psr2.xml \| cut -d: -f2-<CR>
map <F10> :%!/home/simon/bin/indentation<CR>
map <c-B> :!php -l %<CR>
map <c-O> :CommandT<CR>
map <c-s> :w<CR>
map <F6> :call PhpInsertUse()<CR>
nnoremap <F5> :GundoToggle<CR>
"""""""""""""""""""""""""""
" UI AND EDITION
"""""""""""""""""""""""""""
set mouse=a
set autoindent
set nu
set showmatch
set tabstop=4
set shiftwidth=4
set softtabstop=4
set incsearch
set wildmenu
set cursorline
set guipty
set fdc=2
" set guifont=Consolas\ 13
set guifont=Fantasque\ Sans\ Mono\ 14
set splitbelow
set splitright
autocmd FileType php setlocal expandtab
autocmd FileType javascript setlocal expandtab
autocmd FileType xml setlocal expandtab
autocmd FileType css setlocal expandtab
autocmd FileType coffee setlocal expandtab
autocmd FileType ts setlocal expandtab
autocmd FileType html setlocal expandtab
autocmd FileType twig setlocal expandtab
autocmd FileType json setlocal expandtab
autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
au BufNewFile,BufRead *.yaml,*.yml so ~/.vim/yaml.vim
au BufRead,BufNewFile *.twig setfiletype twig