如何将Vim中的所有文本转换为小写?这有可能吗?
发布于 2013-12-02 20:06:34
使用此命令模式选项
ggguG
gg - Goto the first line
g - start to converting from current line
u - Convert into lower case for all characters
G - To end of the file.
发布于 2011-01-02 14:26:00
类似于mangledorf的解决方案,但更短,对外行更友好
:%s/.*/\L&/g
发布于 2009-10-18 15:31:27
剥猫皮的方法有很多。下面是我使用posted的方法:
:%s/[A-Z]/\L&/g
大写字母也是如此:
:%s/[a-z]/\U&/g
我更喜欢这种方式,因为我一直在使用这个结构(:%s/[pattern]/replace/g
),所以它更自然。
https://stackoverflow.com/questions/1102859
复制相似问题