Vim给每一行添加序号+合并所有行
2021-01-23 本文已影响0人
千羽之城88
Computer Modern Font Family
Standard Font Definitions
Magnifications
Dimensions
Accents
Special Letters
Paging and Insertions
Category Codes
Ligatures
Math Characters
Parameters
Computer Modern Font Family
得到文件:
1. Computer Modern Font Family;2. Standard Font Definitions;3. Magnifications;4. Dimensions;5. Accents;6. Special Letters;7. Paging and Insertions;8. Category Codes;9. Ligatures;10. Math Characters;11. Parameters;12. Computer Modern Font Family;
代码:
nmap ll :let i=1 \| g/./s/$/;/ \| s/^/\=i.". "/ \| let i+=1 ^M :%j�
命令 | 描述 |
---|---|
let i=1 | g/./... | let i+=1 |
设置一个临时变量且每一行增加 1 |
nmap ll :commmand_1 | ... | command_n |
norm 模式下的将ll设置为快捷键,ll后面的内容是命令的合集,注意冒号[:] |
\| |
管道,在需要添加转移符号\
|