362 lines
10 KiB
VimL
362 lines
10 KiB
VimL
set nocompatible
|
||
filetype off
|
||
|
||
runtime! debian.vim
|
||
|
||
if filereadable("/etc/vim/vimrc.local")
|
||
source /etc/vim/vimrc.local
|
||
endif
|
||
|
||
"""""""""""""""""""""""""""
|
||
" PLUGINS
|
||
"""""""""""""""""""""""""""
|
||
|
||
let g:SuperTabDefaultCompletionType = "<c-x><c-o>"
|
||
|
||
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'
|
||
|
||
call vundle#end()
|
||
|
||
"""""""""""""""""""""""""""
|
||
" THEME
|
||
"""""""""""""""""""""""""""
|
||
|
||
syntax on
|
||
|
||
colorscheme Tomorrow-Night-Bright
|
||
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'
|
||
|
||
" COLORIZER "
|
||
"""""""""""""
|
||
|
||
let g:colorizer_auto_color = 1
|
||
|
||
|
||
" SNIPS "
|
||
"""""""""
|
||
|
||
let g:snips_author = "Simon Vieille <simon@deblan.fr>"
|
||
let g:snips_email = "simon@deblan.fr"
|
||
let g:snips_github = "https://gitnet.fr/deblan"
|
||
|
||
let g:UltiSnipsExpandTrigger="<tab>"
|
||
let g:UltiSnipsJumpForwardTrigger="<c-b>"
|
||
let g:UltiSnipsJumpBackwardTrigger="<c-z>"
|
||
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 = 'Ξ'
|
||
|
||
" 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
|
||
|
||
" 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 = '<c-e>'
|
||
let g:use_emmet_complete_tag = 1
|
||
|
||
let g:user_emmet_settings = {
|
||
\ 'indentation' : ' ',
|
||
\ 'php' : {
|
||
\ 'extends': 'html',
|
||
\ 'aliases' : {
|
||
\ },
|
||
\ 'snippets' : {
|
||
\ 'php': "<?php\n\t|\n?>",
|
||
\ '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 '<pre>', var_dump(|), '</pre>';\n",
|
||
\ 'vardd': "echo '<pre>', var_dump(|), '</pre>';\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': "<table name=\"\" phpName=\"\">\n\t\n</table>",
|
||
\ 'column': "<column name=\"\" type=\"integer\" size=\"\" required=\"true\" />\n",
|
||
\ 'fkey': "<foreign-key onUpdate=\"none\" foreignTable=\"\" onDelete=\"cascade\">\n\t\n</foreign-key>\n",
|
||
\ 'reference': "<reference local=\"\" foreign=\"\"/>\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': "<pre>{{ dump(|) }}</pre>\n",
|
||
\ 'vardd': "<pre>{{ dump(|) }}</pre>\n",
|
||
\ 'debug': "<pre>{{ dump(|) }}</pre>\n",
|
||
\ 'dump': "<pre>{{ dump(|) }}</pre>\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() . "\<CR>"
|
||
"return (pumvisible() ? "\<C-y>" : "" ) . "\<CR>"
|
||
"inoremap <expr> <C-n> pumvisible() ? '<C-n>' :
|
||
"" \ '<C-n><C-r>=pumvisible() ? "\<lt>Down>" : ""<CR>'
|
||
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 <expr><C-g> neocomplete#undo_completion()
|
||
inoremap <expr><C-l> neocomplete#complete_common_string()
|
||
inoremap <silent> <CR> <C-r>=<SID>my_cr_function()<CR>
|
||
|
||
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>"
|
||
|
||
" 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/"
|
||
|
||
"""""""""""""""""""""""""""
|
||
" 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 <c-B> :!php -l %<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 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
|