-
Notifications
You must be signed in to change notification settings - Fork 39
enclose
mitchell edited this page Dec 12, 2020
·
2 revisions
This module provides additional enclose commands
-
enclose_sel
: enclose selection, available without modifier key. -
paste_or_grow_enclose
: enclose selection, keeping the selection to make further enclosing possible, if nothing is selected, paste the char (if auto-pairing is not wanted).
keys["'"] = function() enclose_selection("'", "'") end
keys['"'] = function() enclose_selection('"', '"') end
keys['('] = function() enclose_selection('(', ')') end
keys['['] = function() enclose_selection('[', ']') end
keys['{'] = function() enclose_selection('{', '}') end
keys["ctrl+'"] = function() paste_or_grow_enclose("'", "'") end
keys['ctrl+"'] = function() paste_or_grow_enclose('"', '"') end
keys['ctrl+('] = function() paste_or_grow_enclose('(', ')') end
keys['ctrl+['] = function() paste_or_grow_enclose('[', ']') end
keys['ctrl+{'] = function() paste_or_grow_enclose('{', '}') end