Skip to content
mitchell edited this page Dec 12, 2020 · 2 revisions

This module provides additional enclose commands

Functions

  • 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).

Link

Github

Preset keybindings

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
Clone this wiki locally