Giter Club home page Giter Club logo

phpdocblocks.vim's Introduction

PHPDocBlocks.vim

This Vim plug-in lets you generate PHP doc blocks quickly. It will fill in literal and hinted types as well as names automatically. You can also edit templates for each doc block type to fit your needs.

Installation

Add it using your favorite Vim plug-in manager.

Vundle: Add the following code between call vundle#begin() and call vundle#end() in your .vimrc. Then run :PluginInstall and restart Vim.

Plugin 'brett-griffin/phpdocblocks.vim'

Usage

Run the :PHPDocBlocks command while your cursor is on the line that you want documented.
You can map the command in your .vimrc as shown below:

nnoremap <leader>pd :PHPDocBlocks<cr>

Templates

This plug-in uses a simple template system.

  • Templates are stored in the PHPDocBlocks.vim/templates directory.
  • Blank lines and lines starting with a # symbol will be ignored.
Template Variables
  • Variables are inserted using the syntax: {{variable}}
  • You may only use one {{variable}} per line.
  • {{newline}} will insert a blank line.

Global Variables

Set these variables in your .vimrc

let g:phpdocblocks_return_void = 0 or 1 (Default: 1)
Will add @return void to the doc block if the function has no return statement defined.

let g:phpdocblocks_abbreviate_types = 0 or 1 (Default: 1)
This will toggle between using int/integer and bool/boolean in your doc blocks.

let g:phpdocblocks_move_cursor = 0 or 1 (Default: 0)
Will automatically move the cursor to the end of the closest line that begins with @ and change to insert mode.

let g:phpdocblocks_templates_directory = PATH (Default: Automatically set)
This is automatically set in PHPDocBlocks.vim/plugin/phpdocblocks.vim but if it is not working for you or if you want to set a custom directory, set it manually using this command.

phpdocblocks.vim's People

Contributors

brett-griffin avatar username11 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.