fedepujol / move.nvim

Gain the power to move lines and blocks and auto-indent them!
GNU General Public License v3.0
345 stars 6 forks source link

Feature request: Add option to move word by word #16

Closed ambadyanands closed 1 year ago

ambadyanands commented 2 years ago

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.

fedepujol commented 2 years ago

Hey! Thanks for the suggestion.

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

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

hinell commented 1 year ago

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