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
- Host: GitHub
- URL: https://github.com/dantleech/vim-phpnamespace
- Owner: dantleech
- Created: 2015-05-14T06:35:48.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2021-02-17T20:17:59.000Z (over 5 years ago)
- Last Synced: 2025-04-14T01:12:58.485Z (about 1 year ago)
- Language: PHP
- Size: 5.86 KB
- Stars: 7
- Watchers: 2
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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