DEV Community

Discussion on: Vim: Math on vim substitution

Collapse
 
filbranden profile image
Filipe Brandenburger

Great tips overall! Very nice article. It has most of my favorite math tricks in Vim.

One important caveat to watch for is that Vim will interpret numbers like 047 as octal (so that's actually 39 rather than 47.) In your particular examples, that wouldn't matter, because you only have two digit seconds there, and 01 through 07 will behave the same whether octal or decimal, and Vim will interpret 08 and 09 as decimal. So it all looks good... But when you start having three-digit numbers with leading zeroes, that's something to watch for...

I love the g Ctrl-A trick in block visual mode! (Or, more accurately, I just love block visual mode! So cool!)

Thanks for the article again. Looking forward to reading more Vim articles from you.

Collapse
 
voyeg3r profile image
Sérgio Araújo • Edited

Hi, Filipe!

I have found a great article I backed up some time ago about "how amazing vim regexes are" and I think you will like reading it:
bitbucket.org/snippets/sergio/7nzqxx

I suggest increasing the font size for better reading.