Permalink
Browse files

Add comment stripped version for sending to Bram

  • Loading branch information...
1 parent 53241c5 commit bb850cf07fe25693c535cb39b276319818ab0208 @2072 committed Feb 7, 2016
@@ -0,0 +1,101 @@
+PHP *ft-php-indent* *php-indent* *php-indenting*
+
+NOTE: PHP files will be indented correctly only if PHP |syntax| is active.
+
+If you are editing a file in Unix 'fileformat' and '\r' characters are present
+before new lines, indentation won't proceed correctly ; you have to remove
+those useless characters first with a command like: >
+
+ :%s /\r$//g
+
+Or, you can simply |:let| the variable PHP_removeCRwhenUnix to 1 and the
+script will silently remove them when Vim loads a PHP file (at each |BufRead|).
+
+OPTIONS: ~
+
+PHP indenting can be altered in several ways by modifying the values of some
+global variables:
+
+ *php-comment* *PHP_autoformatcomment*
+To not enable auto-formating of comments by default (if you want to use your
+own 'formatoptions'): >
+ :let g:PHP_autoformatcomment = 0
+
+Else, 't' will be removed from the 'formatoptions' string and "qrowcb" will be
+added, see |fo-table| for more information.
+-------------
+
+ *PHP_outdentSLComments*
+To add extra indentation to single-line comments: >
+ :let g:PHP_outdentSLComments = N
+
+With N being the number of 'shiftwidth' to add.
+
+Only single-line comments will be affected such as: >
+ # Comment
+ // Comment
+ /* Comment */
+-------------
+
+ *PHP_default_indenting*
+To add extra indentation to every PHP lines with N being the number of
+'shiftwidth' to add: >
+ :let g:PHP_default_indenting = N
+
+For example, with N = 1, this will give:
+>
+ <?php
+ if (!isset($History_lst_sel))
+ if (!isset($History_lst_sel))
+ if (!isset($History_lst_sel)) {
+ $History_lst_sel=0;
+ } else
+ $foo="bar";
+
+ $command_hist = TRUE;
+ ?>
+(Notice the extra indentation between the PHP container markers and the code)
+-------------
+
+ *PHP_outdentphpescape*
+To indent PHP escape tags as the surrounding non-PHP code (only affects the
+PHP escape tags): >
+:let g:PHP_outdentphpescape = 0
+-------------
+
+ *PHP_removeCRwhenUnix*
+To automatically remove '\r' characters when the 'fileformat' is set to Unix: >
+ :let g:PHP_removeCRwhenUnix = 1
+-------------
+
+ *PHP_BracesAtCodeLevel*
+To indent braces at the same level than the code they contain: >
+ :let g:PHP_BracesAtCodeLevel = 1
+
+This will give the following result: >
+ if ($foo)
+ {
+ foo();
+ }
+Instead of: >
+ if ($foo)
+ {
+ foo();
+ }
+
+NOTE: Indenting will be a bit slower if this option is used because some
+ optimizations won't be available.
+-------------
+
+ *PHP_vintage_case_default_indent*
+To indent 'case:' and 'default:' statements in switch() blocks: >
+ :let g:PHP_vintage_case_default_indent = 1
+
+In PHP braces are not required inside 'case/default' blocks therefore 'case:'
+and 'default:' are indented at the same level than the 'switch()' to avoid
+meaningless indentation. You can use the above option to return to the
+traditional way.
+
+
+
+vim:tw=78:ts=8:ft=help:norl:
Oops, something went wrong.

0 comments on commit bb850cf

Please sign in to comment.