Friday, March 31, 2023

Re: how to CTRL-A in a script

Try :execute "normal \<c-a>"

Otherwise, you'd have to embed an actual ctrl-A in your script by typing ctrl-v ctrl-a, which would put a 'weird' character in your script. 

I do have a version of the normal command (that I called, creatively, Normal) that lets me just do :Normal <c-a>. If you're interested, I can find its definition (I'm typing this from my phone).

Salman

On Fri, Mar 31, 2023, 22:34 tooth pik <toothpik6@gmail.com> wrote:
i know this is a stupid question and i'll slap my forehead and say i KNEW that when i find out, but...

a very useful feature of vim is the ability to hit CTRL-A in normal mode to increment whatever number is nearby by one -- but if i want to do the same thing in a script, normal CTRL-A is not the way

what is?

thx in advance,

toothpik

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CALfSX1yKZsaTauDf6XfQ%3DG0beE8vAWGBV1MpQ5xP0tJrNEN%3Dmg%40mail.gmail.com.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CANuxnEeBWZKQ3FOQBmr3MBCNmb_AxMwVfEUCEFvkbrFqxU_FtA%40mail.gmail.com.

No comments: