aboutsummaryrefslogtreecommitdiffstats

Improved versions of , , ~, g~, gu, and gU.

They are all implemented as operators, which allows for composing with motions/textobjecs, dot-repeating, and better undo.

Also, and are configurable and can "increment" and "decrement" not only numbers but words as well.

Installation

If you don't want word toggling:

require('vis-toggler')

If you do:

toggler_config = require('vis-toggler.example')
toggler = require('vis-toggler')
toggler.config = toggler_config

The table to assign to config need not come from a separate configuration file, it can be defined in and manipulated from within visrc.lua as well.

Decimal and hexadecimal numbers are supported. If a number has leading zeros, its width is preserved.

The letter case of a hex number is either that of any existing letters, of letters in the last inc-/decremented hex number (if any), or of the base prefix (0x or 0X).

Ideas for improvement

Improve / to support filetype-specific radix notation and sets of words. Add option to force hexadecimal base even without explicit prefix.


Friendly fork of https://repo.or.cz/vis-toggler.git (I hope, the upstream will merge it back).

All issues, questions, complaints, or (even better!) patches should be send via email to ~mcepl/devel@lists.sr.ht email list (for patches use git send-email).