summary refs log tree commit diff
path: root/.vim/lua/globals.lua
diff options
context:
space:
mode:
authorRobert Günzler <r@gnzler.io>2022-05-27 12:53:21 +0200
committerRobert Günzler <r@gnzler.io>2022-05-27 13:16:14 +0200
commitc35b450705899b011957f16c2a583e1e3818af8c (patch)
treec736ecd9c9dd1571a1c7f3b587e4d539a4f3db5e /.vim/lua/globals.lua
parent18b0a7c1943f28342dd2272135bf562f100d2839 (diff)
vim: register keybinds with which-key
Diffstat (limited to '.vim/lua/globals.lua')
-rw-r--r--.vim/lua/globals.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/.vim/lua/globals.lua b/.vim/lua/globals.lua
index 6b2f004..5492b73 100644
--- a/.vim/lua/globals.lua
+++ b/.vim/lua/globals.lua
@@ -12,3 +12,11 @@ _G.augroup = function(tbl)
     end
   end
 end
+
+_G.wk_register = function(mappings, opts)
+  local wk = package.loaded['which-key']
+  -- local _, wk = pcall(require, 'which-key')
+  if wk then return wk.register(mappings, opts) end
+  vim.notify_once('which-key missing')
+end
+