There are many plugins and ftplugins that do this work. In most cases, new users' plugins are no better, as they often reinvent the wheel without taking into account the odd cases.
In the "old" material, I:
- My code bracketing system , which simplifies the definition of mappings aimed at inserting balanced pairs of characters in the form of brackets.
- and related functions , which are aimed at simplifying the task of determining evolving (*) code fragments (as a rule, control instructions). I have examples of using C ++ .
(*) Extension of mappings / abbreviations is prevented in the context of comments / lines, several surrounding forms of C-instructions are provided, and several stylistic options are supported (in the case of C-operator-operators, they are easily transferred to other languages)
source share