aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorgi Kirilov <>2021-05-24 20:42:11 +0300
committerMatěj Cepl <mcepl@cepl.eu>2022-08-18 19:08:36 +0200
commit7fb0af9425010d406198c9e440990196722e7150 (patch)
treea5c1eed2034c283856296a0b889822e573d3944d
parent11d3d23d45e991c2a9414958a6c377d4506f5ea2 (diff)
downloadvis-toggler-7fb0af9425010d406198c9e440990196722e7150.tar.gz
use the full name from vis.h
-rw-r--r--init.lua15
1 files changed, 8 insertions, 7 deletions
diff --git a/init.lua b/init.lua
index 815b4f8..c69e248 100644
--- a/init.lua
+++ b/init.lua
@@ -23,7 +23,8 @@ local ordinal_words
local count
-local char_next = 17
+-- copied from vis.h
+local VIS_MOVE_CHAR_NEXT = 17
local dec_digit = R"09"
local hex_digit = R("09", "af", "AF")
@@ -150,12 +151,12 @@ end
vis.events.subscribe(vis.events.INIT, function()
local ord_next = vis:textobject_register(ordinal)
- operator_new("<C-a>", toggle(increment), ord_next, nil, "Toggle/increment word or number", true)
- operator_new("<C-x>", toggle(decrement), ord_next, nil, "Toggle/decrement word or number", true)
- operator_new("~", toggle(case, true), nil, char_next, "Toggle case of character or selection")
- operator_new("g~", toggle(case), nil, nil, "Toggle-case operator")
- operator_new("gu", toggle(string.lower), nil, nil, "Lower-case operator")
- operator_new("gU", toggle(string.upper), nil, nil, "Upper-case operator")
+ operator_new("<C-a>", toggle(increment), ord_next, nil, "Toggle/increment word or number", true)
+ operator_new("<C-x>", toggle(decrement), ord_next, nil, "Toggle/decrement word or number", true)
+ operator_new("~", toggle(case, true), nil, VIS_MOVE_CHAR_NEXT, "Toggle case of character or selection")
+ operator_new("g~", toggle(case), nil, nil, "Toggle-case operator")
+ operator_new("gu", toggle(string.lower), nil, nil, "Lower-case operator")
+ operator_new("gU", toggle(string.upper), nil, nil, "Upper-case operator")
lookup, ordinal_words = preprocess(M.config)
vis:map(vis.modes.NORMAL, "g~~", "g~il")
vis:map(vis.modes.NORMAL, "guu", "guil")