Skip to main content

Command Palette

Search for a command to run...

How to use vim non-interactively

Published
1 min read
M

Hands-on technology leader with 10+ years building scalable, mission-critical systems at Goldman Sachs, Brevan Howard and fast-growing fintechs. Expert in cloud-native architectures, distributed data pipelines and high-throughput systems; experienced in migrating legacy platforms and designing AI-enabled services. Proven track record delivering reliable platforms that process millions of transactions daily.

If you want to use some feature of vim non-interactively, you can use -c command argument. This will accept a vim command and will execute it on the input file.
You can use multiple -c arguments. For example:
vim -c '%s/data/DATA/g' -c 'wq' myfile
This will replace all occurrences of data with DATA in myfile automatically.
Tip: You can combine this with find command and have an automated find-and-replace script which acts on a set of files.

 

 

More from this blog

A

A Blog about Software Development

96 posts