set nocompatible filetype off runtime! debian.vim if filereadable("/etc/vim/vimrc.local") source /etc/vim/vimrc.local endif """"""""""""""""""""""""""" " PLUGINS """"""""""""""""""""""""""" let g:SuperTabDefaultCompletionType = "" 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 'taglist.vim' Plugin 'bling/vim-airline.git' Plugin 'kchmck/vim-coffee-script.git' Plugin 'sheerun/vim-polyglot' Plugin 'honza/vim-snippets.git' Plugin 'tobyS/vmustache.git' 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-upgrade' Plugin 'php.vim' Plugin 'closetag.vim' Plugin 'vim-scripts/Emmet.vim' Plugin 'beyondwords/vim-twig' Plugin 'ctrlpvim/ctrlp.vim' Plugin 'Xuyuanp/nerdtree-git-plugin' Plugin 'jistr/vim-nerdtree-tabs' Plugin 'raimondi/delimitmate' Plugin 'dietsche/vim-lastplace.git' Plugin 'tomtom/tcomment_vim' Plugin 'ahri/vim-sesspit' Plugin 'voronkovich/ctrlp-symfony2.vim' Plugin 'Colorizer--Brabandt' Plugin 'gregsexton/gitv' Plugin 'markgandolfo/nerdtree-fetch.vim' Plugin 'evandotpro/nerdtree-chmod' Plugin 'shawncplus/phpcomplete.vim' Plugin 'bronson/vim-trailing-whitespace' Plugin 'jacoborus/tender' Plugin 'vexxor/phpdoc.vim' Plugin 'mzlogin/vim-markdown-toc' Plugin 'rosenfeld/conque-term' call vundle#end() """"""""""""""""""""""""""" " THEME """"""""""""""""""""""""""" syntax on if has('gui_running') colorscheme tender else colorscheme Tomorrow-Night-Bright endif set background=dark if has("autocmd") filetype plugin on au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") endif set statusline=%<%f%=%([%{Tlist_Get_Tagname_By_Line()}]%) set completeopt-=preview """"""""""""""""""""""""""" " PLUGINS CONFIGURATION """"""""""""""""""""""""""" " PHP-CS-FIXER " """""""""""""""" let g:php_cs_fixer_level = 'symfony' " NERDTREE-GIT " """""""""""""""" let g:NERDTreeIndicatorMapCustom = { \ 'Modified' : 'M', \ 'Staged' : 'S', \ 'Untracked' : '?', \ 'Renamed' : 'R', \ 'Unmerged' : 'U', \ 'Deleted' : '!', \ 'Dirty' : 'D', \ 'Clean' : 'C', \ 'Unknown' : '?!' \ } " COLORIZER " """"""""""""" let g:colorizer_auto_color = 1 " SNIPS " """"""""" let g:snips_author = "Simon Vieille " let g:snips_email = "simon@deblan.fr" let g:snips_github = "https://gitnet.fr/deblan" let g:UltiSnipsExpandTrigger="" let g:UltiSnipsJumpForwardTrigger="" let g:UltiSnipsJumpBackwardTrigger="" let g:UltiSnipsEditSplit="vertical" " AIRLINE " """"""""""" let g:airline_powerline_fonts = 1 if !exists('g:airline_symbols') let g:airline_symbols = {} endif " unicode symbols let g:airline_left_sep = '»' let g:airline_left_sep = '▶' let g:airline_right_sep = '«' let g:airline_right_sep = '◀' let g:airline_symbols.linenr = '␊' let g:airline_symbols.linenr = '␤' let g:airline_symbols.linenr = '¶' let g:airline_symbols.branch = '⎇' let g:airline_symbols.paste = 'ρ' let g:airline_symbols.paste = 'Þ' let g:airline_symbols.paste = '∥' let g:airline_symbols.whitespace = 'Ξ' let g:airline_theme = 'tender' " airline symbols let g:airline_left_sep = '' let g:airline_left_alt_sep = '' let g:airline_right_sep = '' let g:airline_right_alt_sep = '' let g:airline_symbols.branch = '' let g:airline_symbols.readonly = '' let g:airline_symbols.linenr = '' " CLOSETAG " """""""""""" au Filetype html,xml,xsl,php,jsp,jspf,twig source ~/.vim/bundle/closetag.vim/plugin/closetag.vim " 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 NERDTreeCascadeSingleChildDir = 0 let NERDTreeCascadeOpenSingleChildDir = 1 " CTRLP Symfony " """"""""""""""""" command! Sfassets CtrlPSymfony2Assets command! Sfconfigs CtrlPSymfony2Configs command! Sfcontrollers CtrlPSymfony2Controllers command! Sfmodels CtrlPSymfony2Entities command! Sfentities CtrlPSymfony2Entities command! Sfviews CtrlPSymfony2Views command! Sfservices CtrlPSymfonyServices command! Sfservicesdefinition CtrlPSymfonyServiceDefinition command! Sfforms CtrlPSymfonyForms " EMMET " """"""""" let g:user_emmet_expandabbr_key = '' let g:use_emmet_complete_tag = 1 let g:user_emmet_settings = { \ 'indentation' : ' ', \ 'php' : { \ 'extends': 'html', \ 'aliases' : { \ }, \ 'snippets' : { \ 'php': "", \ 'sf:exe' : "public function |Action()\n{\n\n}", \ 'pf' : "public function |()\n{\n\n}", \ 'ppf' : "protected function |()\n{\n\n}", \ 'pppf' : "private function |()\n{\n\n}", \ 'sf:pdo': "\\$con = Propel::getConnection();\n\\$stmt = \\$con->prepare('|');\n\\$stmt->bindValue();\n\\$stmt->execute();\n\\$results = \\$stmt->fetchAll();", \ 'b:add': "\\$builder->add(\n '|',\n 'text',\n [\n 'label' => '',\n 'required' => true,\n 'attr' => [\n ],\n 'constraints' => [\n ],\n ]\n);", \ 'b:addfile': "\\$builder->add(\n \\$builder->create(\n '|',\n 'file',\n [\n 'label' => '',\n 'attr' => [\n ],\n 'constraints' => [\n ],\n ]\n )->addModelTransformer(new \\Trinity\\Component\\Form\\DataTransformer\\StringToFileTransformer(\\$builder->getData(), 'file'))\n);\n\n\\$builder->addEventSubscriber(\n new \\Trinity\\Component\\Form\\EventListener\\FileDeleteFormListener(\n \\$builder->getFormFactory(),\n [\n '|',\n ]\n )\n);", \ 'foreach': "foreach (\\$| as \\$k => \\$v) {\n\t\n}", \ 'vard': "echo '
', var_dump(|), '
';\n", \ 'vardd': "echo '
', var_dump(|), '
';\ndie;\n", \ 'class': "class | {\n\tpublic function __construct() {\n\t\n\t}\n}\n", \ 'cc': "/**\n * @var type\n */\n", \ 'if': "if (|) {\n\n}", \ 'for': "for ($u = 0; $u < |; $u++) {\n\t\n}", \ 'while': "while (|) {\n\n}", \ } \ }, \ 'javascript' : { \ 'aliases' : { \ }, \ 'snippets' : { \ 'ready': "$(document).ready(function() {\n\t|\n});", \ 'closure': "(function($) {\n\t|\n})(jQuery);", \ 'load': "$(|).load('', function(datas) {});", \ 'if': "if (|) {\n\n}", \ 'for': "for (var u=0; u<|; u++) {\n\t\n}", \ 'while': "while (|) {\n\n}", \ } \ }, \ 'xml' : { \ 'aliases' : { \ }, \ 'snippets' : { \ 'table': "\n\t\n
", \ 'column': "\n", \ 'fkey': "\n\t\n\n", \ 'reference': "\n" \ } \ }, \ 'twig' : { \ 'extends': 'html', \ 'aliases' : { \ }, \ 'snippets' : { \ 'if': "{% if | %}\n\n{% endif %}\n", \ 'else': "{% else %}\n", \ 'elseif': "{% elseif %}\n", \ 'twig': "{% | %}\n", \ 'include': "{% include \"|\" %}\n", \ 'render': "{% render \"|\" %}\n", \ 'vard': "
{{ dump(|) }}
\n", \ 'vardd': "
{{ dump(|) }}
\n", \ 'debug': "
{{ dump(|) }}
\n", \ 'dump': "
{{ dump(|) }}
\n", \ 'for': "{% for key, value in | %}\n\n{% endfor %}\n" \ } \ } \} " GITGUTTER " """"""""""""" let g:gitgutter_max_signs = 1000 " CTAGS " """"""""" let Tlist_Process_File_Always = 1 let Tlist_Ctags_Cmd='/usr/bin/ctags' " NEOCOMPLETE " """"""""""""""" function! s:my_cr_function() return neocomplete#close_popup() . "\" "return (pumvisible() ? "\" : "" ) . "\" "inoremap pumvisible() ? '' : "" \ '=pumvisible() ? "\Down>" : ""' endfunction if !exists('g:neocomplete#keyword_patterns') let g:neocomplete#keyword_patterns = {} endif if !exists('g:neocomplete#force_omni_input_patterns') let g:neocomplete#force_omni_input_patterns = {} endif 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#force_omni_input_patterns.php = '\h\w*\|[^. \t]->\%(\h\w*\)\?\|\h\w*::\%(\h\w*\)\?' "let g:neocomplete#force_omni_input_patterns.php = '\h\w*\|[^- \t]->\w*' let g:neocomplete#lock_buffer_name_pattern = '\*ku\*' let g:neocomplete#sources#dictionary#dictionaries = { \ 'default' : '', \ 'vimshell' : $HOME.'/.vimshell_hist', \ 'scheme' : $HOME.'/.gosh_completions' \ } let g:neocomplete#disable_auto_complete = 1 let g:neocomplete#keyword_patterns['default'] = '\h\w*' inoremap neocomplete#undo_completion() inoremap neocomplete#complete_common_string() inoremap =my_cr_function() inoremap \ pumvisible() ? "\" : \ neosnippet#expandable_or_jumpable() ? "\(neosnippet_expand_or_jump)" : \ "\" inoremap neocomplete#smart_close_popup()."\" inoremap neocomplete#smart_close_popup()."\" " PDV (DOC) " """"""""""""" function! PhpSyntaxOverride() hi! def link phpDocTags phpDefine hi! def link phpDocParam phpType endfunction augroup phpSyntaxOverride autocmd! autocmd FileType php call PhpSyntaxOverride() augroup END let g:pdv_template_dir = $HOME."/.vim/bundle/pdv/templates_snip/" " PHPDOC " """""""""" noremap :call PhpDoc() """"""""""""""""""""""""""" " MAPPING """"""""""""""""""""""""""" " set keywordprg=pman let mapleader = "_" map :!indentation % map :call PhpCsFixerFixFile() map :r!namespace % map :!phpmd % text /usr/share/phpmd/psr2.xml \| cut -d: -f2- map :!php -l % map :w map :call PhpInsertUse() nnoremap :GundoToggle inoremap :call align()a function! s:align() let p = '^\s*|\s.*\s|\s*$' if exists(':Tabularize') && getline('.') =~# '^\s*|' && (getline(line('.')-1) =~# p || getline(line('.')+1) =~# p) let column = strlen(substitute(getline('.')[0:col('.')],'[^|]','','g')) let position = strlen(matchstr(getline('.')[0:col('.')],'.*|\s*\zs.*')) Tabularize/|/l1 normal! 0 call search(repeat('[^|]*|',column).'\s\{-\}'.repeat('.',position),'ce',line('.')) endif endfunction """"""""""""""""""""""""""" " 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 php setlocal omnifunc=phpcomplete#CompletePHP autocmd FileType python setlocal omnifunc=pythoncomplete#Complete autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags au BufNewFile,BufRead *.yaml,*.yml setfiletype yaml au BufRead,BufNewFile *.twig setfiletype twig