Skip to content

vim

Remove last newline with vim

I was writing some tests for Asfaload and I needed to validate that a JSON file is generated correctly. I needed the file to be a one-line file, with no End Of Line character (I probably could have done it an other way, working with a file having an EOL, but let’s not consider this for the sake of this blog post). On a unix platform, when you save a file with vim, it will add a EOL character if there is none.

Build your specialised editor with vim

Intro In this post we’ll see how easy it is to configure vim to get a specialised editor. You only have to remember that any command-mode instruction you have available inside vim (those commands you type preceded by : to enter the command mode), can also be passed on the command line by prefixing the command with a + rather than a : (or use the flag -c). Those are iso-called Ex commands.