[Vim] Diff and merge using Vim

After performing a system update on my Linux machine, the package manager placed a copy of an updated configuration file on the system – it couldn’t overwrite them as I had previously modified it. Since I was also using SSH to remote in the Linux machine, I didn’t want to merge the changes using a GUI like Meld. Fortunately, Vim supports diffing and runs within the terminal!

To view the diff between files, you can use vimdiff.

vimdiff {first file} {second file}

Read more of this post

Creating a File Set Processing Script with Vim

In Vim, the r! ex command will insert the contents of standard output of a command. Combining this with Vim’s powerful subsitute command, it is possible to write a batch script over a set of files. In this example, Vim is used to quickly change the extension of a number of files in a directory.

Read more of this post

Formatting Source Code in HTML

If have you seen a number of my tutorials, you would have seen some nicely formatted sample code embedded within the page. Pastebins can host your code there are Javascripts that can also format your code. However, the WordPress service does not allow either of those options to be used. The only way I have been able to do so far has been to convert the code into an HTML code.

Read more of this post