Netbeans PHP - add/remove curly braces plugin/shortcut

五迷三道 提交于 2019-12-31 04:25:07

问题


I love short if statements without braces (PHP) like

if ($x === $y)
  echo $z;

If I want to add a few lines (maybe just temporary for debugging) I have to manually add the braces. Is there a plugin for netbeans that does that via shortcut, something like "toggle (add/remove) previous statement braces"?


回答1:


The best solution I got for now are two macros

Add Curly-Braces:

caret-end-line caret-begin-line "{" insert-break

Remove Curly-Braces:

caret-up caret-end-line remove-word-next selection-match-brace cut-to-clipboard remove-line remove-word-previous insert-break paste-from-clipboard caret-up caret-end-line

Cursor position has to be in the line of code I want to add/remove braces.



来源:https://stackoverflow.com/questions/3718670/netbeans-php-add-remove-curly-braces-plugin-shortcut

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!