3 ms·
I just wish Vim had proper S-expression structural editing support. Many editors have vim support but very few have smartparens/paredit with good integration. I
by ampdepolymerase 5y ago
I just wish Vim had proper S-expression structural editing support. Many editors have vim support but very few have smartparens/paredit with good integration. If Vim can extend its language to include some basic structural editing, then writing any type of tag based code e.g. JSX would become much more pleasant. For example in VS Code's Flutter plugin there is support for "delete surrounding widget" and "wrap child widget in new widget". They just need better keybinding integration.
- SpaceNugget 5y agoVim uses text objects for that kind of thing, t being the tag text object. `dat` deletes the JSX tag enclosing the cursor, `cit` deletes the contents of the tag and leaves you in insert mode, etc. Matchit (included in neovim) can also be configured to have % match tags as well as the default brackets/parens. LSP text objects are also available for more language specific structural editing.
- emidln 5y agovim-sexp is very very good and IMO better than smartparens/paredit. I'm not a fan of the paredit-style keybindings by default, but the way it integrates into vim's model is IMO perfect.
- ampdepolymerase 5y agoBut it is not supported in other editors (VS Code, Intellij etc.), it is not like vim-surround or easymotion where almost every major third-party vim implementation supports it.