chrisbra / matchit

The matchit plugin from Vim
61 stars 9 forks source link

can not unmap [% #32

Closed bika-c closed 2 years ago

bika-c commented 2 years ago

I am not so sure why map [% and ]% to<NOP> does not work nor unmap

edit, just realize <nop> did not display properly

chrisbra commented 2 years ago

so is [% actually being mapped? Check the output of :verbose nmap [%. I just tried and it seems to work for me. Do you get an error message?

bika-c commented 2 years ago

Here is the verbose map [%

image

This is verbose nmap [%

image

If I try to do unmap [%, it says no such mapping. This is probably because I can't unmap internal mappings?

NVIM v0.6.1
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by brew@HMBRW-A-001-M1-004.local

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/opt/homebrew/Cellar/neovim/0.6.1/share/nvim"

Run :checkhealth for more info
chrisbra commented 2 years ago

try first to nunmap [

bika-c commented 2 years ago
nunmap [
nunmap ]                                                                                                                          
unmap [%
unmap ]%
map [% <nop>
map ]% <nop>
"map [ <C-o>
"map ] <C-i>

Still there, [% still works. I have no clue what might be causing it. I just want to map [ to <C-O>

image
chrisbra commented 2 years ago

Try :nunmap [% please. Also try with a minimal vimrc file to rule out some conflicts with other settings.

bika-c commented 2 years ago

I am able to unmap it with the command :nunmap [%, but if I put it into the init.vim, it complains no such keybinding and I am not able to remove it (that is the only thing I have in the init.vim). Is it normal?

chrisbra commented 2 years ago

yes, most likely the plugin isn't loaded by the time you want to unmap it.

chrisbra commented 2 years ago

so put it into a VimEnter autocommand to have it triggered later