Paweł Grzybek 4/11/2026

Vim tip: more intuitive CTRL-A (adding) and CTRL-X (subtracting)

Read Original

This article provides a Vim/Neovim tip for developers who use CTRL-A (increment) and CTRL-X (decrement) commands. It explains a common pitfall where adding to a date like '2026-03-10' treats the month as a negative number, causing unexpected results. The solution is to set the 'nrformats' option to 'unsigned' or 'blank', making Vim treat all numbers as absolute values for more intuitive behavior. The tip is short, practical, and relevant to text editing in programming workflows.

Vim tip: more intuitive CTRL-A (adding) and CTRL-X (subtracting)

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser

Top of the Week

No top articles yet