0

I have a list of cities

London
Madrid
Paris
Brasil

I want to write a macro, that will add a ul tag and wrap each city in to an li.

I think, i need to create a variable like:

let i = 4

Than to write macro a(also have macros b, that will wrap each line into li)

qa(call var i)Vc<ul>j</ul>kp(call var i)@b
2
  • 1
    It seems like what you really want is the ability to use a variable as a count for commands like V and @b?
    – D. Ben Knoble
    Jan 6 at 15:45
  • Yes, you are write, but how to do that?
    – serii
    Jan 7 at 8:41

1 Answer 1

0

Doesn't answer the title question, but with https://github.com/tpope/vim-surround, I would do (type literally; angle brackets here are not key notation)

ysip<ul>Vitoj:normal yss<li>

and press Enter.

1
  • I will check a bit later.
    – serii
    Jan 7 at 8:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.