Open andrewferrier opened 2 years ago
Hey 👋🏼,
I totally agree and it would be a killer feature, which is why it is added to the roadmap. Before creating this script I used vim-sort-motion
for many years but created this since I wanted better delimiter support.
With that said I will be honest and note that this very likely isn't something I will have time to work on, especially since I see little need for it in my day to day. I would be more than happy to look at a PR though!
Fair enough. Suggest if you are willing you keep this issue open, if I find some free time to do some NeoVim hacking I might have a go at it myself :)
Thanks for your hard work on this great plugin...
I notice that in the README you list out some normal-mode remaps that "cheat" by pre-selecting a visual area and then running
:Sort
on them.This is great, but I think what would be even more fantastic is if
sort.nvim
provided a Vim/NeoVim-native operator-pending mode so that the user could type (following the example above)go<any text object>
and have it commented out. Theoretically, they can typev<any text object><Esc><Cmd>Sort<CR>
today, but that's a bit clumsy. The keybindings as listed above are a bit restrictive, as they limit the user to only those text objects that a binding already exists for.Compare this with the vimscript-based https://github.com/christoomey/vim-sort-motion, which I've used for a long time, which provides this capability as its "default" approach (although it does also provide a keybinding in visual mode).
(More information on how this works/how to implement it here: https://www.vikasraj.dev/blog/vim-dot-repeat).