From 16321b7ce133b8b45bb1537e4aea691a92cfc461 Mon Sep 17 00:00:00 2001 From: Marcel Schneider Date: Wed, 10 Apr 2019 10:10:13 +0200 Subject: [PATCH] vim: swap phpcd with phpactor --- init.vim | 4 +++- vim/ftplugin/php.vim | 23 +++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/init.vim b/init.vim index 2f3986c..4d38d27 100644 --- a/init.vim +++ b/init.vim @@ -84,7 +84,9 @@ Plug 'rhysd/vim-clang-format', { 'for' : ['c', 'cpp', 'java'] } " PHP{{{ "Plug 'shawncplus/phpcomplete.vim', { 'for': 'php', 'do': 'curl -Ss http://vim-php.com/phpctags/install/phpctags.phar > ~/bin/phpctags && chmod +x ~/bin/phpctags' } -Plug 'lvht/phpcd.vim', { 'for': 'php', 'do': 'composer install' } +"Plug 'lvht/phpcd.vim', { 'for': 'php', 'do': 'composer install' } +Plug 'phpactor/phpactor', {'for': 'php', 'do': 'composer install'} +Plug 'kristijanhusak/deoplete-phpactor', { 'for': 'php' } Plug 'captbaritone/better-indent-support-for-php-with-html', { 'for': 'php' } Plug 'lumiliet/vim-twig', { 'for': [ 'php', 'html' ] } " Twig templates Plug 'Rican7/php-doc-modded', { 'for': 'php' } " Automatic phpdoc comments diff --git a/vim/ftplugin/php.vim b/vim/ftplugin/php.vim index 879c9f0..4e6b468 100644 --- a/vim/ftplugin/php.vim +++ b/vim/ftplugin/php.vim @@ -1,4 +1,27 @@ let g:deoplete#ignore_sources = get(g:, 'deoplete#ignore_sources', {}) let g:deoplete#ignore_sources.php = ['omni'] +" {{{ phpactor +" Include use statement +nmap u :call phpactor#UseAdd() +" Invoke the context menu +nmap mm :call phpactor#ContextMenu() +" Invoke the navigation menu +nmap nn :call phpactor#Navigate() +" Goto definition of class or class member under the cursor +nmap o :call phpactor#GotoDefinition() +" Show brief information about the symbol under the cursor +nmap K :call phpactor#Hover() +" Transform the classes in the current file +nmap tt :call phpactor#Transform() +" Generate a new class (replacing the current file) +nmap cc :call phpactor#ClassNew() +" Extract expression (normal mode) +nmap ee :call phpactor#ExtractExpression(v:false) +" Extract expression from selection +vmap ee :call phpactor#ExtractExpression(v:true) +" Extract method from selection +vmap em :call phpactor#ExtractMethod() +"}}} + nnoremap h :call PhpDocSingle()