Open sangdth opened 1 year ago
Hey! Sorry for taking a long time to answer. MoveWord
almost achieved that behaviour:
// before
import { |Something, Other, Else } from 'somewhere';
// doing MoveWord
import { Other, Something, Else } from 'somewhere';
But it doesn't work nice on the edges or in complex cases like the one you specified:
// before
import { |Something, type Other, Else } from 'somewhere';
// after MoveWord
import { type |Something, Other, Else } from 'somewhere';
// before
import { Something, type Other, Else| } from 'somewhere';
// after MoveWord
import { Something, type Else| Other, } from 'somewhere';
I like the example config you proposed and we could extend it:
require('move').setup({
word = {
-- Creates the MoveWord command
enable = true,
-- We could change how MoveWord operates.
-- delimited -> inside predefined wrappers with anchors
delimited = {
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 = { "<,>", "{,}" }
},
},
})
Hi @fedepujol, thanks for your response, I understand that everybody has busy stuffs to handle, so no problem at all.
I agree with your suggestion. I'm also not sure about the naming but it still look good to me. Naming is hard, nobody can blame you :D
Really appreciate your time and effort 🙏🏻
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: