My folding is setup to work based on a function to fold and unfold. I have the function mapped to my "spacebar", so pressing it while
in escape mode will either fold or unfold the code....


Place this in your .vimrc and then you can use "{{{" and "}}}" as your start and end tags....

--------------------------------------------------------------------
if has("folding")
 highlight Folded term=standout ctermfg=Yellow ctermbg=Blue
 set commentstring=#%s
 set fillchars="vert:|,fold: "
 set foldmethod=marker
 set foldmarker={{{,}}}

 fun! ToggleFold()
 if foldlevel('.') == 0
 normal! l
 else
 if foldclosed('.') < 0
 . foldclose
 else
 . foldopen
 endif
 endif
 " Clear status line
 echo
 endfun

 " Map this function to Space key.
 noremap <space> :call ToggleFold()<CR>

endif
--------------------------------------------------------------------

The reasons given about vim (or vi) being on platforms are exactly the same that I have stuck with vim (vi) over the years.
In some shops they do not allow emacs on their boxes, some don't install additional editors, but vi has always been a constant.
this is just my experience, so please note that I am not berating anyone for their choice of editor...


regards

Ahbaid.

Wouter van Vliet wrote:

Yeah .. vim is my god too. You can do so many things with so little
keystrokes. And it basically has the best syntax highlighting I've ever
seen. With some easy tricks you can even let it highlight your own
functions. I haven't doen so, but I know it's possible :P... Also, it exists
on most servers so you can work directly on the server. Without having to
mess with (Samba) filesharing. Another advantage is that it runs both on
Linux as well as on Windows.

W.

(ps. Ahbaid or anyone else .. how can I get code to re-fold. I've setup my
vim to fold every PHP function and class, which works when I load te file.
But when I'm done editing a certain block, what do I do to make it fold back
in again?)


-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to