Reputation: 5353
Suppose I have
- 'autoindent' is set by default
- 'autoread' is set by default
- 'backspace' defaults to "indent,eol,start"
- 'backupdir' defaults to .,~/.local/share/nvim/backup (|xdg|)
- 'complete' doesn't include "i"
- 'directory' defaults to ~/.local/share/nvim/swap// (|xdg|), auto-created
How can I yank words autoindent autoread backspace...
and so on to system register with visual block (suppose)
P.S. have tried vim-multiple-cursors, but that plugin buggy (and not vim way) and dont allow copy-paste if one exit multiple-cursors mode in between.
Great answers too in russian version
Upvotes: 3
Views: 951
Reputation: 172758
My ExtractMatches plugin has (among others) a :YankMatches
command for that. It works similar to the built-in :substitute
:
:YankMatches!/'\zs[^']\+\ze'/+
By default, the command separates the elements by a newline; if you want them space-separated, use this variation:
:YankMatches!/'\zs[^']\+\ze'/& /+
Upvotes: 1
Reputation: 196876
:%norm f'"Zya'
would put 'autoindent' 'autoread' 'backspace' 'backupdir' 'complete' 'directory'
in register z
.
To make it available outside of Vim you can do:
:let @+ = @z
/'\w\{-}' <CR>
"Zca'
<C-r><C-o>"<Esc>
n.n.n.n.n.
The quickest way to clear a named register (register z, here) is:
qzq
Upvotes: 6
Reputation: 134
A solution without visual block:
:let @+=''
- clear the system register
qa
- record to register 'a'
^3l"kyej
- go fourth column, yank the word to register 'k' and go to the next line
:let @+=@+ . ' ' . @k
- concatenate the system register, ' ' and register 'k' and store the result again in the system register
q
- stop recording
5@a
- repeat the recorded command 5 times - voila
reg +
- shows "+ autoindent autoread backspace backupdir complete
Upvotes: 1
Reputation: 113
In order to make it work:
a
: typingqaq
in normal mode
execute in command line :
:%s/^- '\(\w\+\)'/\=setreg('A',submatch(1),'V')/n
the desired output is copied in register a
and you can get it by typing in command line :
:put A
Upvotes: 1