当前位置:网站首页>write a number of lines to a new file in vim

write a number of lines to a new file in vim

2022-06-24 21:41:00 ztenv

1. simplest

:100,200 w filename

2. set a start mark named A first, set a end mark named B second, and then

      `: 'A,'B w filename`

3. set vim in visual model, such as ctrl+v, and then select all lines that you want to write to a new file, and then press shit+:

:'<,'> w filename # ‘<,’> will be filled by vim auotmatically

4. other

:+0,+99 w filename

原网站

版权声明
本文为[ztenv]所创,转载请带上原文链接,感谢
https://lianshaohua.blog.csdn.net/article/details/125433725