aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2017-12-17 01:31:45 +0100
committerTeddy Wing2017-12-17 01:31:45 +0100
commit06eab3f18d685aeb1729ec029f922603a61eb976 (patch)
treeaae469b2dd6251796c2e691cc4d2823cbeef9696
parentc1144625d59dd269838974b63cec400ca1ac8eb8 (diff)
downloadirssi-vimput-06eab3f18d685aeb1729ec029f922603a61eb976.tar.bz2
Add help
Irssi help accessible from `/help vimput`. Describes the command and lets users know that they should bind a shortcut in order to use the plugin.
-rw-r--r--vimput.pl27
1 files changed, 27 insertions, 0 deletions
diff --git a/vimput.pl b/vimput.pl
index b3f6b80..3903610 100644
--- a/vimput.pl
+++ b/vimput.pl
@@ -189,6 +189,33 @@ sub is_ok_message {
}
+Irssi::command_bind('help', sub {
+ if ($_[0] !~ /^vimput\s*$/) {
+ return;
+ }
+
+ my $help = <<HELP;
+%9Syntax:%9
+
+VIMPUT
+
+%9Details:%9
+
+ Opens the current input line in a new Tmux split in Vim. When the Vim
+ buffer is written, Irssi's prompt will be updated from the contents of the
+ buffer.
+
+ %9Note:%9 In order to use this script, you'll have to make a key binding to
+ Vimput. For example:
+
+ /BIND ^X command vimput
+HELP
+
+ Irssi::print($help, MSGLEVEL_CLIENTCRAP);
+ Irssi::signal_stop();
+});
+
+
Irssi::command_bind('vimput' => sub {
write_input(Irssi::parse_special('$L', undef, 0));
open_tmux_and_update_input_line_when_finished();