preservim / vimux

easily interact with tmux from vim
MIT License
2.21k stars 161 forks source link

remaping space break <Leader>vs shortcut example in the doc #150

Closed zippeurfou closed 3 years ago

zippeurfou commented 7 years ago

Hi, Strange behavior is happening when I remap space. i.e.

nnoremap <space> dd

here is the shortcut I am using (just changing localleader with leader):

 " If text is selected, save it in the v buffer and send that buffer it to tmux
 vmap <Leader>vs "vy :call VimuxSlime()<CR>

 " Select current paragraph and send it to tmux
 nmap <Leader>vs vip<Leader>vs<CR>

you will see that basically <space> get called which result in line deletion. I am still new to vim, so I am quite sure this can be avoided (help would be welcome) but I feel like remaping space is not uncommon and maybe the doc should be edited for this case.

alerque commented 3 years ago

Best advice: don't remap space! This will be a never ending rabbit hole of problems.

If you really wanted this to work, you'd need to specify all your other mappings in a way that don't inherit the mapping of space. As it is you are saying that space is delete, then sending spaces. VIM is just going to do what you said.

This isn't a Vimux issue so I'm going to close this, but feel free to ask on vi.stackexchange.com if you are still having trouble with the way mappings recurse and how to configure them to do what you want.