VIM Insert PHPdoc automatically

前端 未结 3 1165
有刺的猬
有刺的猬 2021-01-31 10:53

Is there a way to insert PHPDoc in VIM using a command or key combination?

For example, I have a class:

class MyClass
{

  public function __construct()          


        
3条回答
  •  遥遥无期
    2021-01-31 11:46

    Assume you place your template at ~/templates/phpdoc.php. With the below abbreviation, if you type ,p, you will read the contents of your phpdoc.php into the current file, ( at or below the current line - one of those ).

    map ,p :r ~/templates/phpdoc.php
    

    Then just add the line to your .vimrc file, replacing the file-path and ,p to your liking.

提交回复
热议问题