aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--vimput.pl13
1 files changed, 13 insertions, 0 deletions
diff --git a/vimput.pl b/vimput.pl
index 0c09d36..8563f44 100644
--- a/vimput.pl
+++ b/vimput.pl
@@ -31,10 +31,23 @@ sub write_input {
}
+# Open a Tmux split containing a Vim instance editing the tempfile.
+sub open_tmux_split {
+ if (!$ENV{TMUX}) {
+ print 'no tmux'; # TODO: Replace with Irssi print
+ return;
+ }
+
+ my $command = "vim ${\tempfile}";
+ system('tmux', 'split-window', $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_split();
}
};