[go: up one dir, main page]

Skip to content

Yet another PHP namespace resolver with fuzzy searching.

License

Notifications You must be signed in to change notification settings

xbot/Leaderf-phpnamespace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Leaderf-phpnamespace

This plugin uses the power of LeaderF to perform PHP namespace related tasks.

Features

  • Insert use statements for FQCNs.
  • Sort use statements alphabetically.
  • Expand class names to FQCNs.
  • Insert namespace for the current file.
  • All the above features support the fuzzy searching function and all the three modes (nameonly, fullpath and regex) provided by LeaderF.

Requirements

  • LeaderF
  • ctags is properly configured in Vim/Neovim.

Install

vim-plug

Plug 'xbot/Leaderf-phpnamespace'

Setup

" Import the current class under cursor
noremap <leader>iu :<C-U><C-R>=printf("Leaderf phpns --input %s", expand("<cword>"))<CR><CR>
" Expand the classname under cursor to its FQCN form.
noremap <leader>ec :<C-U><C-R>=printf("Leaderf phpns --input %s --expand", expand("<cword>"))<CR><CR>

Commands

Command Description
LeaderfPhpns Choose an FQCN to import.
PHPNamespaceInsert Insert namespace for the current file.

Press F1 to get more help

Options

Option Default Description
g:Lf_PHPNamespaceExpandToAbsolute 1 Expand the classname under cursor to absolute FQCN.
g:Lf_PHPNamespaceSortAfterImport 1 Sort the use statements block alphabetically after importing a class.

Credits

LICENSE

MIT

About

Yet another PHP namespace resolver with fuzzy searching.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published