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

posted @ 2019-05-21 15:56  无边身尊者  阅读(4629)  评论(0编辑  收藏  举报