From 4412b44b471a856381d06eead30903511baa706c Mon Sep 17 00:00:00 2001 From: Zachary Yedidia Date: Wed, 9 Jan 2019 15:17:51 -0500 Subject: [PATCH] Add showkey --- cmd/micro/action/command.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cmd/micro/action/command.go b/cmd/micro/action/command.go index 664a9cee..aee63e71 100644 --- a/cmd/micro/action/command.go +++ b/cmd/micro/action/command.go @@ -244,6 +244,16 @@ func Show(args []string) { // ShowKey displays the action that a key is bound to func ShowKey(args []string) { + if len(args) < 1 { + InfoBar.Error("Please provide a key to show") + return + } + + if action, ok := Bindings[args[0]]; ok { + InfoBar.Message(action) + } else { + InfoBar.Message(args[0], " has no binding") + } } // Bind creates a new keybinding