My vim configuration (~/.vimrc, ~/.vim).
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

505 lines
14 KiB

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>"
let g:polyglot_disabled = ['markdown']
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 '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 'Rican7/php-doc-modded'
Plugin 'mzlogin/vim-markdown-toc'
Plugin 'rosenfeld/conque-term'
" Plugin 'joonty/vdebug'
Plugin 'isRuslan/vim-es6'
Plugin 'suan/vim-instant-markdown'
Plugin 'dracula/vim'
Plugin 'sniphpets/sniphpets-doctrine'
Plugin 'sniphpets/sniphpets'
Plugin 'jaxbot/semantic-highlight.vim'
Plugin 'thaerkh/vim-indentguides'
Plugin 'PotatoesMaster/i3-vim-syntax'
Plugin 'fatih/vim-go'
Plugin 'mhinz/vim-signify'
Plugin 'andrewradev/splitjoin.vim'
Plugin 'wahidrahim/resize-font'
Plugin 'skywind3000/asyncrun.vim'
Plugin 'valloric/listtoggle'
Plugin 'c9s/phpunit.vim'
Plugin 'terryma/vim-multiple-cursors'
Plugin 'dkarter/bullets.vim'
Plugin 'connorholyday/vim-snazzy'
Plugin 'bluz71/vim-moonfly-colors'
Plugin 'glepnir/oceanic-material'
" Plugin 'patstockwell/vim-monokai-tasty'
Plugin 'AlessandroYorba/Sierra'
Plugin 'junegunn/fzf'
call vundle#end()
"""""""""""""""""""""""""""
" THEME
"""""""""""""""""""""""""""
syntax on
if has('gui_running')
" colorscheme tender
" colorscheme dracula
" colorscheme vim-monokai-tasty
" colorscheme moonfly
" set background=dark
" colorscheme oceanic_material
" colorscheme snazzy
" let g:sierra_Midnight = 1
" let g:sierra_Twilight = 1
" let g:sierra_Sunset = 1
let g:sierra_Pitch = 1
colorscheme sierra
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
"""""""""""""""""""""""""""
" SEMANTIC "
""""""""""""
if has('gui_running')
let g:semanticEnableFileTypes = { 'javascript': 'js', 'vim': 'vim', 'php': 'php'}
endif
" NERDTREE-GIT "
""""""""""""""""
let g:NERDTreeGitStatusIndicatorMapCustom = {
\ 'Modified' : 'M',
\ 'Staged' : 'S',
\ 'Untracked' : '?',
\ 'Renamed' : 'R',
\ 'Unmerged' : 'U',
\ 'Deleted' : '!',
\ 'Dirty' : 'D',
\ 'Clean' : 'C',
\ 'Unknown' : '?!'
\ }
" Markdown preview "
""""""""""""""""""""
let g:vim_markdown_auto_insert_bullets = 1
let g:vim_markdown_follow_anchor = 1
let g:vim_markdown_autowrite = 0
let g:vim_markdown_conceal = 0
let g:instant_markdown_autostart = 0
" 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 = 'Ξ'
let g:airline_theme = 'tender'
" airline symbols
if has('gui_running')
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 = ''
endif
" 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
" PHP-CS-FIXER "
""""""""""""""""
" let g:php_cs_fixer_level = ''
" let g:php_cs_fixer_php_path = "/usr/bin/php7.3"
" CTAGS "
"""""""""
command! CT AsyncRun ctags **/*.php
" 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>" :
\ neosnippet#expandable_or_jumpable() ? "\<Plug>(neosnippet_expand_or_jump)" :
\ "\<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/"
let g:pdv_cfg_autoEndFunction = 0
let g:pdv_cfg_autoEndClass = 0
let g:pdv_cfg_php4always = 0
let g:pdv_cfg_php4guess = 0
let g:pdv_cfg_annotation_Package = 0
let g:pdv_cfg_annotation_Version = 0
let g:pdv_cfg_annotation_Copyright = 0
let g:pdv_cfg_annotation_License = 0
" Vdebug "
""""""""""
let g:vdebug_options = {}
let g:vdebug_options['port'] = 9000
" PHPDOC "
""""""""""
noremap <F11> :call PhpDoc()<CR>
"""""""""""""""""""""""""""
" MAPPING
"""""""""""""""""""""""""""
" set keywordprg=pman
let mapleader = "_"
map <F1> :!indentation %<CR>
map <F2> :!php7.3 ~/php-cs-fixer.phar fix "%" --rules=@PSR2,@PhpCsFixer,@Symfony<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>
vmap <leader>cc :s/\%V_\([a-z]\)/\U\1/g<cr>
vmap <leader>sc :s/\%V\([A-Z]\)/_\L\1/g<cr>
vmap <leader>lc <leader>sc<cr>
nmap <leader>cc vaw<leader>cc
nmap <leader>sc vaw<leader>sc
nmap <leader>lc vaw<leader>sc
nmap <F7> ins<tab><esc>o
nmap <c-Down> :ResizeFontSmaller<CR>
nmap <c-Up> :ResizeFontBigger<CR>
inoremap <silent> <Bar> <Bar><Esc>:call <SID>align()<CR>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 rnu
set showmatch
set tabstop=4
set shiftwidth=4
set softtabstop=4
set incsearch
set wildmenu
set cursorline
set guipty
set fdc=2
set splitbelow
set splitright
set hlsearch
set nomodeline
" set modeline
" set guifont=Consolas\ 13
set guifont=Fantasque\ Sans\ Mono\ 14
autocmd FileType php setlocal expandtab
autocmd FileType javascript setlocal expandtab
autocmd FileType xml setlocal expandtab
autocmd FileType css setlocal expandtab
autocmd FileType scss setlocal expandtab
autocmd FileType go 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 python setlocal noexpandtab
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 BufRead,BufNewFile *.yaml,*.yml setfiletype yaml
au BufRead,BufNewFile *.vue setfiletype html
au BufRead,BufNewFile *.html.twig,*.twig setfiletype twig
au BufRead,BufNewFile *.js setfiletype js