My favorite vim setting
// vim:set expandtab tabstop=4 shiftwidth=4 softtabstop=4 foldmethod=marker syntax=php:
has the unfortunate side-effect of causing others to complain about the fact that my source code is “folded.” The problem is that some people who are only vim-users-only-when-working-on-a-remote-machine have a small learning curve when they see a page that looks like
<?php
// vim:set expandtab tabstop=4 shiftwidth=4 softtabstop=4 foldmethod=marker syntax=php:
+-- 12 lines: docs -------------------------------------------------------------
+-- 6 lines: imports ----------------------------------------------------------
+--154 lines: WidgetProviders --------------------------------------------------
?>
But with about a minute, training yourself how to navigate vim folding will pay itself off handsomely for those of us who don’t use IDEs or do fancy stuff like exuberant ctags.
[quick fold tutorial after the jump]
Continue reading →