Tag Archives: vim

Ready-to-paste HTML-escaped Code in Vim

I’ve seen countless of websites that paste code and do not escape the <, > and & characters, resulting in broken HTML and missing code. I have been using online HTML entity encoders when pasting code, but today I decided to code a little Vimscript for my Vim.

Escape HTML Entities in VIM

Continue reading

VIM Scripting with Python: Lookup IP Country

I’ve been playing around with VIM scripting today, experimenting with a very small and limited portion of VIM’s full capacity. VIM scripting is powerful, however one is able to leverage the power of built-in and external Python libraries instead. Imagine coding an XML library in VIM script, it’s time consuming and error-prone. To make the article a little more fun, I’ll code up a simple VIM script that looks up a country for an IP.

VIM IP Lookup in Python

This mini-tutorial assumes you know the basics of VIM – movement, modes, buffers, windows, etc. I’m also going to assume that you’re using a terminal version of VIM.

Continue reading