简体   繁体   中英

VIM: How to yank text in quotes on current line in ex mode?

Lets say cursor is standing on line #10:

foo bar "fizz" buzz

first character.

How can I yank fizz using ex mode (to do the same as f"yi" would do)?

Bonus points for ability to specify register.

You can execute any normal mode command via :normal (add ! to ignore any mappings; a good practice when writing plugins).

:normal! f"yi"

For special keys, enclose the command in :execute , as in:

:execute "normal! aText\<Esc>"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM