move.nvim icon indicating copy to clipboard operation
move.nvim copied to clipboard

Feature request: Add option to move word by word

Open ambadyanands opened this issue 3 years ago • 1 comments

I think it's more useful to move words around (like M-t in emacs for transposing words) than simply moving characters. dawwP and dawbP can do the same except for last word in the line. So it'll be good if this plugin can handle that.

If it's not too much to ask, I'd like to suggest more variants such as for WORDS, function arguments, sentences, paragraphs, etc. (i.e. to directly swap/move without having to enter visual mode and navigate character by character or line by line).

Thanks.

ambadyanands avatar Sep 12 '22 17:09 ambadyanands

Hey! Thanks for the suggestion.

The feature for moving words char by char could be easy to do. But anything related to a language:

  • Function arguments
  • Sentences (I don't know what you mean by that)

Will need a nvim-treesitter dependency to do it and a few days of playing around to see what could be done.

fedepujol avatar Sep 13 '22 18:09 fedepujol

If anyone interested, there is more powerful swapping tool based on tree-sitter module:

hinell avatar Sep 15 '23 16:09 hinell