You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for the great plugin! I would like to ask for something extra. It would be great if move.nvim can detect some popular wrapper and anchor characters and use it to swap horizontally everything between.
In TypeScript, sometimes I want to swap the imports:
// beforeimport{|Something,typeOther,Else}from'somewhere';// move.nvim can detect my cursor is inside the wrapper `{ ... }` with `,` anchor,// so if I use MoveWord(1), it will become:import{typeOther,|Something,Else}from'somewhere';
This is also useful in some cases like:
// beforeforwardRef<SomeProps,typeofOther>(...)// move.nvim can detect my cursor is inside `< ... >` wrapper with `,` anchor// so if I use MoveWord(), it will become:forwardRef<typeofOther,SomeProps>(...)
The text was updated successfully, but these errors were encountered:
sangdth
changed the title
Allow using some characters as "anchor"
Allow using some characters as "wrapper" and "anchor"
Jun 6, 2023
But it doesn't work nice on the edges or in complex cases like the one you specified:
// beforeimport{|Something,typeOther,Else}from'somewhere';// after MoveWordimport{type|Something,Other,Else}from'somewhere';
// beforeimport{Something,typeOther,Else|}from'somewhere';// after MoveWordimport{Something,typeElse|Other,}from'somewhere';
I like the example config you proposed and we could extend it:
require('move').setup({
word= {
-- Creates the MoveWord commandenable=true,
-- We could change how MoveWord operates.-- delimited -> inside predefined wrappers with anchorsdelimited= {
enable=true, -- by default this will be false-- Required only when `enable = true`. And it could be extendable.-- not sure about the naming `formulas`.formulas= { "<,>", "{,}" }
},
},
})
Thanks for the great plugin! I would like to ask for something extra. It would be great if
move.nvim
can detect some popular wrapper and anchor characters and use it to swap horizontally everything between.Please see examples below,
|
is the cursor:Example of config:
Example in usages:
In TypeScript, sometimes I want to swap the imports:
This is also useful in some cases like:
The text was updated successfully, but these errors were encountered: