Sunday, December 30, 2007

Auto-fold Perl subs

Add To enable it, just put the line:
let perl_fold=1
n your .vimrc, _vimrc or ftplugin/perl.vim.

Once you open a perl file, you'll see all functions are folded. You can then move to a function and (space) or "zo" to open it, "zc" to close it, "zR" to open all folds (normal file) and "zM" to re-fold all folds. It makes skimming over a file a breeze.<
See :help folding or :help perl.vim

If don't want to use perl_fold option and think you can handle it manually use some thing like below,
Add this to your .vimrc file and it'll automatically fold perl functions (and possibly other languages that define a subroutine with "sub ...")

http://www.vim.org/tips/tip.php?tip_id=419

Monday, December 3, 2007

Assigning Backspace key to console Terminal

On some consoles like AIX when we hit backspace you get control characters.
So the below can be used to assign the backspace key to erase backwards:

$ stty erase ^?

where ^? is equivalent to pressing the Backspace key.