0

I need to multiply symbol "a" with a number from clipboard. For example 3a = aaa

In clipboard register is @+. May be to do that throw command line mode, but don't understand how.

3
  • Where does the symbol a reside? In a register? Or is it really literal a? Or a selection of edited text? Anyway have you tried :help repeat()?
    – Hoblovski
    Jul 5 at 7:29
  • 1
    Thanks a lot. It's working. Copy number in @+ ``` <c-r> in insert mode :repeat('a', @+) ```
    – serii
    Jul 5 at 7:54
  • 2
    @Serii feel free to post your answer such that other can vote for it. You could also accept your own answer after a delay of two days. It allow the question to rest :-) Jul 5 at 8:05

1 Answer 1

0

If the number is in the + register, you can insert the result of a repeat() expression by doing (from insert mode):

<c-r>=repeat('a', @+)<enter>

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.