diff options
| author | Teddy Wing | 2017-12-17 01:00:48 +0100 |
|---|---|---|
| committer | Teddy Wing | 2017-12-17 01:00:48 +0100 |
| commit | c1144625d59dd269838974b63cec400ca1ac8eb8 (patch) | |
| tree | 5309849fabd9ad03bb2562f50f7c0fcb31303e4d /vimput.pl | |
| parent | 6eb894c411ccaf473dd2b4bae961cfeb86aee5a6 (diff) | |
| download | irssi-vimput-c1144625d59dd269838974b63cec400ca1ac8eb8.tar.bz2 | |
Turn the 'on key press' signal into a command
Turns out it's possible to make this a command instead of listening for
a shortcut on key press.
Now when you want to run Vimput, you can make your own binding instead
of me forcing C-x:
/bind ^X /vimput
Diffstat (limited to 'vimput.pl')
| -rw-r--r-- | vimput.pl | 13 |
1 files changed, 4 insertions, 9 deletions
@@ -189,12 +189,7 @@ sub is_ok_message { } -# TODO: Find out if it's possible to do this is a command -Irssi::signal_add_last 'gui key pressed' => sub { - my ($key) = @_; - - if ($key eq CTRL_X) { - write_input(Irssi::parse_special('$L', undef, 0)); - open_tmux_and_update_input_line_when_finished(); - } -}; +Irssi::command_bind('vimput' => sub { + write_input(Irssi::parse_special('$L', undef, 0)); + open_tmux_and_update_input_line_when_finished(); +}); |
