0

I would like to create a macro to replace having to type:

vi(
vi[
vi"

etc.

I have been trying things along the line of:

:nnoremap <leader><tab> vy:exe vi"0<cr>

but not succeeding.

I'm on Windows using VsVim.

Thanks.

2 Answers2

0

I just tried adding this to my _vsvimrc:

nnoremap gP vi"

and it worked just fine, as far as I could see. Does this give you what you need?

Thomas Svensen
  • 760
  • 1
  • 7
  • 14
  • no that only works to select inside " ". The macro I'm trying to create works for any enclosing characters. Something like this, although it seems that a registry character does not work with the vi command in vsvim. :nnoremapt vy:execute "normal! vi " – Varelse Jan 30 '17 at 12:46
  • Why not use `v%` then? Solves most of those cases, perhaps not quotes, though. – Thomas Svensen Jan 30 '17 at 16:23
0

In Vim, you can do this:

:nnoremap <leader><tab> yl:execute 'normal! vi' . @"<CR>

This yanks the character under the cursor, and then uses :normal! to run the vi... normal mode command, and :execute to interpolate the register contents into it.

I don't know about VsVim's capabilities, but I doubt it offers these capabilities; you can probably only do simple vi-style mappings there.

Ingo Karkat
  • 167,457
  • 16
  • 250
  • 324