使用 Vim 同时编辑多个文件 [英] Editing multiple files simultaneously with Vim

查看:28
本文介绍了使用 Vim 同时编辑多个文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在同一位置向多个文件添加多行.我想知道我是否可以用 Vim 打开所有文件,并且只在一个文件中进行更改,同时在所有文件中进行更改.我真的想避免打开 X 个文件,复制这个,粘贴,然后对 X 个文件的每个文件重复......必须有更好的方法来做到这一点,希望使用 vim......

I need to add several lines all at the same location to multiple files. I was wondering if I could possibly open all files with Vim, and only make the changes in one file for which the changes will be made in all files simultaneously. I really want to avoid opening X number of files, copying this, pasting, then repeating for each file of X files...There's gotta be a better way to do this, hopefully with vim...

谢谢!阿米特

推荐答案

您可以录制宏并在其他文件上执行它.请参阅 http://www.thegeekstuff.com/2009/01/vi-and-vim-macro-tutorial-how-to-record-and-play/ 获取详细教程.

You could record macro and execute it on other files. See http://www.thegeekstuff.com/2009/01/vi-and-vim-macro-tutorial-how-to-record-and-play/ for detailed tutorial.

这篇关于使用 Vim 同时编辑多个文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆