An open API service indexing awesome lists of open source software.

https://github.com/dantleech/vim-phpnamespace

Insert namespace for current file
https://github.com/dantleech/vim-phpnamespace

Last synced: 4 months ago
JSON representation

Insert namespace for current file

Awesome Lists containing this project

README

          

Vim Namespace
=============

Plugin which guesses the namespace of the current file from `composer.json`.

Note that the algorithm for determining the namespace is not 100% accurate
(although it could be) but it should work in the majority of cases.

It should work with both `psr-0` and `psr-4` projects.

Installation
------------

With Vundle:

````vim
Plugin "dantleech/vim-phpnamespace"
````

Usage
-----

Map it:

````vim
nnoremap nn :call PhpNamespaceInsert()
````

Call it:

````vim
let s:foo = PhpNamespaceGet()
````

Integration with Ultisnips
--------------------------

Use it with ultisnips to generate class / interface templates:

````vim
snippet interface "Interface declaration template" !b