azabiong / vim-highlighter

Highlight words and expressions
MIT License
226 stars 9 forks source link

HiMapKeys doesnt seem to work #25

Closed krzkrzkrz closed 12 months ago

krzkrzkrz commented 12 months ago

I am using Neovim v9.0.1

I am trying to unset all default keys.

In ~/.config/nvim/lua/core/plugins_config/vim-highlighter.lua, I have the following:

vim.cmd([[
  let HiMapKeys=0
]])

Hitting f and <CR> still triggers the default for HiSet. Am I missing something?

azabiong commented 12 months ago

Hi, I think that's the correct setting. Could you try the following code to see if that part of the code is actually called?

vim.cmd([[
  let HiMapKeys=0
  echomsg "==Here=="
]])

And then we can check it using :mes[sage] command, after restarting or opening another nvim.

azabiong commented 12 months ago

And the desired sequence is to set this variable 'HiMapKeys' somewhere at startup, so that it can be referenced later when the plugin is actually loaded.

krzkrzkrz commented 12 months ago

Typing :mes, returns:

All parsers are up-to-date!
==Here==

And the desired sequence is to set this variable 'HiMapKeys' somewhere at startup, so that it can be referenced later when the plugin is actually loaded.

Does this mean it should be in the nvim after directory?

azabiong commented 12 months ago

Looks good! It means that now we only need to adjust the loading order. It needs to be set before loading the plugin. So can we try setting it somewhere else before loading the plugin? And if you prefer Lua, you can also use the following line:

vim.g.HiMapKeys = 0
krzkrzkrz commented 12 months ago

Perfect! That works! Amazing work on the plugin. Will be closing the issue for now

azabiong commented 12 months ago

Great!  I hope you find this tool useful. 😄 Thanks!