vimcmdline icon indicating copy to clipboard operation
vimcmdline copied to clipboard

Mapping colon to semi-colon causing vimcmdline commands to not work

Open tinyheero opened this issue 7 years ago • 1 comments

I installed vimcmdline using Plug by placing the following line into my ~/.config/nvim/init.vim:

call plug#begin('~/.config/nvim/plugged')

Plug 'jalvesaq/vimcmdline'

call plug#end()

I was able to install the plugin. Loading up a test.sh file and then pressing <LocalLeader>s starts up my interpreter. But if add the following mapping:

call plug#begin('~/.config/nvim/plugged')

Plug 'jalvesaq/vimcmdline'

call plug#end()

" Swap ; and :
" Avoid needing to use <SHIFT> for Ex commands
" Only applies in 'normal' mode
" E.g. ;w! - Will save the file
nnoremap ; :
nnoremap : ;

The interpreter no longer starts. Clearly, the mapping of the colon to semicolon is having an adverse effect on starting the interpreter and other vimcmdline arguments. Is there a way to get around this? Interestingly, when I use Nvim-R I don't have this problem.

tinyheero avatar Jan 25 '18 22:01 tinyheero

I confirm the issue. The problem is that :call is hardcoded in many places in vimcmdline. But many other plugins that I have installed do the same. I believe you would get similar result there:

cd ~/.config/nvim/plugged
grep --color -R ': call'

Any idea on how to avoid the problem?

jalvesaq avatar Apr 12 '18 02:04 jalvesaq

Looking at the issue again, it seems to work if I map only ; to : (and don't map : to ;). Because ; doesn't seem to be used for anything in Normal mode, it's harmless to be unable to type it.

jalvesaq avatar Sep 24 '23 14:09 jalvesaq