I found myself working on Objective-C, JavaScript, and C# all at the same time today. One issue I ran into was our C# model classes used camel case property names, but the JSON from the Node server used underscores.
Once you get comfortable with :%s for searching and replacing across an entire file, you can start to unlock more power by exploiting Vim's rich regular expression handling. Coming from a GUI background, you might be tempted to look for a plugin to solve a…
:%s
DuplicateWrite by Ingo Karkat is a script that writes a duplicate copy of a file whenever it’s saved. That means you could do things like use netrw to write a copy to a remote server.
netrw
I was working with a particularly unfriendly SQL dump file which was raising errors indicating that my data had the wrong amount of columns. To figure out what was going on, I used Vim to count the number of columns and then corrected the data using a substitution…
Send in your Vim scripts for review through our contact form.
vim-scroll-position (GitHub: junegunn / vim-scroll-position) by Junegunn Choi is…
Last week I discussed how to use the substitute and global commands for search and replace in Vim. Once these commands have been mastered, they can be combined with argument list commands to apply them to multiple files.
In this article I assume the reader has a basic knowledge of regular expressions. To read about how Vim uses regular expressions, take a look at the pattern section of the Vim manual in :help pattern.
:help pattern