X-Git-Url: http://git.bytex64.net/?a=blobdiff_plain;f=plugins%2FVimish.cs;fp=plugins%2FVimish.cs;h=0b699d8c66efa098870f4bd4c66dc8ca2a816630;hb=59c54a6d56a8e161b527c980e2cb468bcf54f371;hp=8de862a05422868ac652ec4d557c8668ac767b2b;hpb=0b2e5f8fffd9ed781a1ddab279dbd6fec5c7695a;p=WebThing.git diff --git a/plugins/Vimish.cs b/plugins/Vimish.cs index 8de862a..0b699d8 100644 --- a/plugins/Vimish.cs +++ b/plugins/Vimish.cs @@ -10,6 +10,7 @@ public class Vimish : WebThingPlugin { public override void Init(WebThing wt) { this.wt = wt; + wt.Tabs.ShowTabs = false; wt.Window.KeyPressEvent += Window_KeyPress; @@ -30,9 +31,15 @@ public class Vimish : WebThingPlugin { case Gdk.Key.o: CommandStart("open "); break; + case Gdk.Key.O: + CommandStart("open " + wt.WebView.MainFrame.Uri); + break; case Gdk.Key.t: CommandStart("tabopen "); break; + case Gdk.Key.T: + CommandStart("tabopen " + wt.WebView.MainFrame.Uri); + break; case Gdk.Key.colon: CommandlineShow(); break; @@ -115,10 +122,34 @@ public class Vimish : WebThingPlugin { case "q": wt.Quit(); break; + case "set": + if (args.Length == 2) + SetVar(args[1], ""); + else + SetVar(args[1], args[2]); + break; } CommandlineHide(); } + public void SetVar(string key, string val) { + switch(key) { + case "showtabs": + wt.Tabs.ShowTabs = true; + break; + case "hidetabs": + wt.Tabs.ShowTabs = false; + break; + default: + Error("No variable {0}", key); + break; + } + } + + private void Error(string format, params object[] values) { + Console.WriteLine(format, values); + } + private void command_KeyPress(object o, KeyPressEventArgs e) { if (e.Event.Key == Gdk.Key.Escape) CommandlineHide();