I have a long list of different university names. I am trying to create a synonym table by matching strings with specific unique keywords; that is, in the file, I will determine that Harvard is the keyword here:
Harvard Business School|
Harvard College|
Harvard School of Divinity|
and paste them into another file as
Harvard Business School|Harvard College|Harvard School of Divinity|
I do this by looking for a word under the cursor, pulling the lines with that word into the register, inserting the register into another file, and using the join command āJā to join the lines together:
[ clear register 'a' ]
0"ay0
[ move cursor to 'Harvard" and yank lines with keyword into register a ]
:g/\<<CTRL-R><CTRL-W>\>/y A
[ move to other screen and paste ]
"ap
[ join lines ]
JJJJJ
, , . , , , JJJJ . , , "a", "a", "a".
?
EDIT:
:
- , . % S/\ //
- "foo" , .:% S/Foo//
- "foo" , .:% S/A//
:
- "foo" "bar" "a" "b"
- "foo" "bar" 'a' 'a'