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