vim对行进行排序


vim自带排序函数sort, 在命令行模式下执行:help sort 可查看其具体用法,摘录如下:

Vim has a sorting function and a sorting command. The sorting function can be
found here: sort(), uniq().

:sor :sort
:[range]sor[t][!] [b][f][i][n][o][r][u][x] [/{pattern}/]
Sort lines in [range]. When no range is given all
lines are sorted.

With [!] the order is reversed.

With [i] case is ignored.

Options [n][f][x][o][b] are mutually exclusive.
View Code

example: 忽略大小写,对文件所有行进行排序

:sort i


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM