global command

Sett 14 ganger
Hopp til første uleste melding

Ni Va

ulest,
9. apr. 2022, 04:27:1809.04.2022
til vim_use
Hi,

How to not moving cursor when executing global command ?

g/^EOF/call add(g:ends, line('.'))

Thank you

Stan Brown

ulest,
9. apr. 2022, 05:25:2909.04.2022
til vim...@googlegroups.com
On 2022-04-09 01:27, Ni Va wrote:
> How to not moving cursor when executing global command ?
>
> g/^EOF/call add(g:ends, line('.'))

I don't know of any way within the g command. However, what I do after a
global command is move the cursor back to where it was before the
command: either '' or ``

See <:help ''> and <:help restore-position>.

--
Stan Brown
Tehachapi, CA, USA
https://BrownMath.com

Ni Va

ulest,
9. apr. 2022, 07:04:4109.04.2022
til vim...@googlegroups.com
Hum. Thank you Stan ! 😃 

--
--
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 a topic in the Google Groups "vim_use" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vim_use/-iZXDs5DWCw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vim_use+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/8a08f47d-686d-0476-bc08-2bec25f80a76%40fastmail.fm.
Svar alle
Svar til forfatter
Videresend
0 nye meldinger