42 ms·
This was a really nice refresher and I learned a few new cool tricks (like gx). I'm a bit surprised that the 'u' flag for sort wasn't mentioned. That's the mos
by Agentlien 6y ago
This was a really nice refresher and I learned a few new cool tricks (like gx).
I'm a bit surprised that the 'u' flag for sort wasn't mentioned. That's the most useful one in my mind and I use it almost every time.
- residualmind 6y agoMy thoughts exactly about ':sort u'
- lucb1e 6y agoThe u option making it keep only unique lines, for anyone else left wondering. Personally, instead of re-learning how to do stuff with vim-sepecific commands, I just use the existing command line tool, especially since I don't do this on a daily/weekly basis (but I use sort in command line pipes at least weekly). The command is literally "sort" and for unique you just pass the -u flag, e.g. select something in Vim and type :!sort -u
- ravoori 6y agoVim's sort is handy on Windows where the option to shell out usually doesn't exist. Additionally you have the full power of Vim regex to sort on subsets of lines.
- thanato0s 6y ago... I forgot it :D I'll fix that. Thanks to point it out :)
- Agentlien 6y agoThank you for reading the comments and updating the article.