aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--vim_prompt/vim_prompt.pl36
1 files changed, 36 insertions, 0 deletions
diff --git a/vim_prompt/vim_prompt.pl b/vim_prompt/vim_prompt.pl
new file mode 100644
index 0000000..6bc560c
--- /dev/null
+++ b/vim_prompt/vim_prompt.pl
@@ -0,0 +1,36 @@
+use Irssi;
+use strict;
+
+Irssi::expando_create('vim_prompt', sub {
+ my $prompt;
+ my $cmd_mode = Irssi::parse_special('$vim_cmd_mode', 0, 0);
+ my $chatnet = Irssi::parse_special('$chatnet', 0, 0);
+ my $T = Irssi::parse_special('$T', 0, 0);
+ if (index($cmd_mode, "INS") != -1) {
+ $prompt="%z005f00%k%9 INS ".$chatnet."/".$T."%N%k%Z005f00%9%N"
+ }
+ if (index($cmd_mode, "CMD") != -1) {
+ $prompt="%z0087d7%k%9 CMD ".$chatnet."/".$T."%N%k%Z0087d7%9%N"
+ }
+ if (index($cmd_mode, "EX") != -1) {
+ $prompt="%zff5f5f%k%9 EX ".$chatnet."/".$T."%N%k%Zff5f5f%9%k%Zff5f5f"
+ }
+ return $prompt
+}, {});
+
+Irssi::expando_create('vim_prompt_empty', sub {
+ my $prompt;
+ my $cmd_mode = Irssi::parse_special('$vim_cmd_mode', 0, 0);
+ my $chatnet = Irssi::parse_special('$chatnet', 0, 0);
+ my $T = Irssi::parse_special('$T', 0, 0);
+ if (index($cmd_mode, "INS") != -1) {
+ $prompt="%z005f00%k%9 INS "."%N%k%Z005f00%9%N"
+ }
+ if (index($cmd_mode, "CMD") != -1) {
+ $prompt="%z0087d7%k%9 CMD "."%N%k%Z0087d7%9%N"
+ }
+ if (index($cmd_mode, "EX") != -1) {
+ $prompt="%zff5f5f%k%9 EX "."%N%k%Zff5f5f%9%k%Zff5f5f"
+ }
+ return $prompt
+}, {});