From 3c3558b3d09a44031e1e1ddd38d0fa8fda816ff5 Mon Sep 17 00:00:00 2001 From: Sanchayan Maity Date: Fri, 30 Apr 2021 14:10:19 +0530 Subject: [PATCH] Revert "nvim: lua: plugins/colors: Switch to which-key.nvim" This reverts commit 86de71d5daa27385feac2fa907a8dcf72769c9e5. This plugin seems to create problems for things that should work. For example, trying to paste with 'p' triggers which-key when it should not. Disabling everything in setup except for Leader prefixed keys does not work either. --- nvim/.config/nvim/colors/yolokai.vim | 5 ++--- nvim/.config/nvim/lua/modules/which_key.lua | 8 +++++--- nvim/.config/nvim/lua/plugins.lua | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/nvim/.config/nvim/colors/yolokai.vim b/nvim/.config/nvim/colors/yolokai.vim index 6d961f7..d3917ee 100644 --- a/nvim/.config/nvim/colors/yolokai.vim +++ b/nvim/.config/nvim/colors/yolokai.vim @@ -648,11 +648,10 @@ local highlight_groups = { --[[ 4.4.11 Which key ]] WhichKey = 'Function' , - WhichKeySeperator = {bg=black, fg=green, style=NONE }, + WhichKeySeperator = 'DiffAdded', WhichKeyGroup = 'Keyword' , WhichKeyDesc = {bg=black, fg=orange, style=NONE }, - WhichKeyFloat = 'Pmenu' , - WhichKeyValue = 'Comment' , + WhichKeyFloating = 'Pmenu' , --[[ 4.4.12 conflict-marker ]] ConflictMarkerBegin = {bg=black, fg=purple, style=NONE }, diff --git a/nvim/.config/nvim/lua/modules/which_key.lua b/nvim/.config/nvim/lua/modules/which_key.lua index 97ef68b..f0c2528 100644 --- a/nvim/.config/nvim/lua/modules/which_key.lua +++ b/nvim/.config/nvim/lua/modules/which_key.lua @@ -1,4 +1,6 @@ -local wk = require("which-key") +local remap = vim.api.nvim_set_keymap -wk.register({}, { prefix = "" }) -wk.register({}, { prefix = "" }) +vim.g.which_key_use_floating_win = 1 + +remap('n', '', ':WhichKey \'\'', { noremap = true, silent = true }) +remap('n', '', ':WhichKey \',\'', { noremap = true, silent = true }) diff --git a/nvim/.config/nvim/lua/plugins.lua b/nvim/.config/nvim/lua/plugins.lua index a2cd38b..8d4dd29 100644 --- a/nvim/.config/nvim/lua/plugins.lua +++ b/nvim/.config/nvim/lua/plugins.lua @@ -90,7 +90,7 @@ local init = function () use 'justinmk/vim-dirvish' -- Show leader key bindings use { - 'folke/which-key.nvim', + 'liuchengxu/vim-which-key', config = "require('modules.which_key')" } -- Clipboard