mileszs / ack.vim

Vim plugin for the Perl module / CLI script 'ack'
Other
3.08k stars 396 forks source link

langmap and nolangremap/ langnoremap can cause quickfix shortcuts to be incorrect #191

Open Anstow opened 8 years ago

Anstow commented 8 years ago

Using

set langmap=tj,TJ,jt,JT
set nolangremap

One would expect the t key to move around the quickfix window and the j key open a new tab. However with this set up the neither key moves around the window and t opens a new tab.

I believe this is due to the double remapping of t and T in the normal mode mapping

 "t": "<C-W><CR><C-W>T"

I can't not set nolangremap as this would break other plugins.

Anstow commented 7 years ago

This also occurs when using

nnoremap t j
nnoremap j t

A possible solution would be a way to disable the default mappings in g:ack_mappings.

NicolasWebDev commented 7 years ago

Yep, I have the same problem, I would like to remap

nnoremap t j
nnoremap j t

Setting g:ack_mappings seems to extend the existing mappings, instead of replacing them. I had to replace it directly in the file ack.vim/plugin/ack.vim, which is only a temporary solution.

Anstow commented 6 years ago

Another solution to replace the mappings is using an autocommand. For example

autocmd VimEnter * let g:ack_mappings = { "o": "<CR>" }

will replace the ack_mappings after vim has started (disabling the offending ack_mapping of t). This is sufficient for my purposes and I would be happy to call this issue closed assuming @NicolasWebDev doesn't have any other comments.

Integralist commented 3 years ago

Looks like the code currently will extend the s:ack_mappings if g:ack_mappings is set.