Sublime Forum

Hitting enter in docblocks

#1

Hi there,

this is a minor feature, but I’ve always found it very useful when using Textmate, and it’s a nice time saver overall.
When in a docblock (PHP or Java), hitting the enter key automatically creates a new line, properly indented and pre-populated with:

* 

Can this be done? Thanks!

0 Likes

#2

I have a small hack of a plugin I’ve been using to implement this for js, you can probably get it to work in java fairly easily:
github.com/ajpalkovic/SublimePl … nserter.py
You also have to add a keybinding:
{ “keys”: “enter”], “command”: “star_inserter”}

0 Likes

#3

I had the exact same complaint, and so I put together a plugin which does exactly that (and a heap more, now)

github.com/spadgos/sublime-jsdocs

It’s called “JSDocs”, because it was initially designed for Javascript, but it has proper support for PHP, and (should it be requested) adding Java wouldn’t be a difficult task. The readme on the github site linked above contains installation instructions (it’s in Package Control), plus a list of the features.

0 Likes

#4

You guys rock! Thanks so much!

0 Likes