Quantcast
Channel: Active questions tagged user-commands - Vi and Vim Stack Exchange
Viewing all articles
Browse latest Browse all 60

Mapping using tpope/vim-surround only works with command

$
0
0

I have this mapping to surround a Word with jQuery id selector $("#...") and it works fine using a command:

command! JqId normal viwo^[i#^[ysiW"ysiW)i$^[Ennoremap <Leader>jqid :JqId<CR>

But I cannot make it works only with the mapping, it inserts the $ sign, but the vim-surround commands do nothing:

nnoremap <silent> <Leader>jqid viwo^[i#^[ysiW"ysiW)i$^[E

I also tried this (for testing purposes) and it doesn't work either:

nnoremap <silent> <Leader>jqid ysiW"

Any hint? Thanks!


Viewing all articles
Browse latest Browse all 60

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>