转载: http://blog.chinaunix.net/uid-26849125-id-3261592.html 如: 列出文件中所有以非#开头的行,在vim命令模式下输入: :g/^[^#]/p 列出所有包含substr的行,在vim命令模式下输入: :g/substr/p