Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
I used the following command to find google in 1.txt and paste it once, but it didn't work. I guess it's because p in vim is not a command using after :. But how can I fix this problem?
google
1.txt
p
:
vim "+g/google/y a" -c "p" -c "wq" 1.txt
vim
sed
grep
Ex-command for pasting is :put:
:put
-c put
(no need to quote, there is nothing to protect from shell.)
You can also use :normal:
:normal
-c "normal p"
(quotes are used to protect the space.)
Add a comment
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.
vimfor this, and not i.e.sedorgrep?