Changeset b30c256


Ignore:
Timestamp:
Mar 7, 2010, 6:56:51 PM (10 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.6, release-1.7, release-1.8, release-1.9
Children:
43e8bb2
Parents:
d64f963
git-author:
David Benjamin <davidben@mit.edu> (10/24/09 14:51:10)
git-committer:
David Benjamin <davidben@mit.edu> (03/07/10 18:56:51)
Message:
Add edit:help command for zsh-style in-edit help

zsh has this convenient feature where pressing M-h while typing a
command will look up the man page for the current command and fully
restore your editting session afterwards.

This command brings a similar feature to BarnOwl. Instead of launching
man, we open the usual popwin, which is much easier to restore from.

Signed-off-by: David Benjamin <davidben@mit.edu>
Location:
perl/lib
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • perl/lib/BarnOwl.pm

    r365950b rb30c256  
    3737use BarnOwl::Editwin;
    3838use BarnOwl::Completion;
     39use BarnOwl::Help;
    3940
    4041use List::Util qw(max);
  • perl/lib/BarnOwl/Hooks.pm

    r7574eed rb30c256  
    108108                           "This is the function responsible for tab-completion."
    109109                       });
     110    BarnOwl::new_command('edit:help' => \&BarnOwl::Help::show_help,
     111                       {
     112                           summary     => "Display help for the current command",
     113                           usage       => "help",
     114                           description =>
     115                           "Opens the help information on the current command.\n" .
     116                           "Returns to the previous editing context afterwards.\n\n" .
     117                           "SEE ALSO: help"
     118                         });
    110119    BarnOwl::bindkey(editline => TAB => command => 'edit:complete');
     120    BarnOwl::bindkey(editline => 'M-h' => command => 'edit:help');
    111121}
    112122
Note: See TracChangeset for help on using the changeset viewer.