6

Vim 对比文件差异 | Linux 下同屏查看文件差异并修改

 2 years ago
source link: https://blog.frytea.com/archives/594/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Vim 对比文件差异 | Linux 下同屏查看文件差异并修改

November 8, 2021 • Read: 48 • 编程开发

本文首发于: https://blog.frytea.com/archives/594/

在 windows 下有如 Beyond Compare 这样的文本对比工具,而在 Linux 其实预装了很好用的文本对比工具 → vimdiff

使用方法很简单:

vimdiff [options] file1 file2 [file3 [file4]]

比如这样:

vimdiff Release Release.new

效果是这样的:

https://imagehost-cdn.frytea.com/images/2021/11/08/2021-11-08-12-28-16e0dfc839621b06b8.png

可以使用 Ctrl + w + 方向键 # 切换到前/下/上/后一个窗格 切换窗格,使用 i 进行编辑,操作同多窗口 Vim ,使用起来很方便,效果很惊艳,效率很高。

---------------------
Author: Frytea
Title: Vim 对比文件差异 | Linux 下同屏查看文件差异并修改
Link: https://blog.frytea.com/archives/594/
Copyright: This work by TL-Song is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK