When I run pacdiff I get an error about vim

pacdiff -s brings the following output for me:

LC_ALL=C pacdiff -s                                                                  ✔
==> ERROR: Cannot find the vim -d binary required for viewing differences.

should I install vim at first?

I would prefer to do this with nano. How does that work?

I’m not sure how nano would handle that. I prefer meld. and it’s usually recommended:

DIFFPROG=meld pacdiff -s

You will probably need to install meld first: sudo pacman -Syu meld :wink:

3 Likes

thx @BG405

1 Like

If you add

DIFFPROG=/usr/bin/meld

in /etc/environment, then the command

pacdiff -s

will be enough in the future.

3 Likes

Cheers; suppose one could also use an alias but that might be considered the “lazy” way!

1 Like

You have to define the DIFFPROG variable, either on the command line (as shown higher up) or in an environment configuration file such as /etc/environment.

2 Likes

Have you rebooted after adding it to /etc/environment?

Does not work for me, but I still get the message afterwards:

pacdiff -s                                                                           ✔
==> ERROR: Cannot find the vim -d binary required for viewing differences.

meld is installed, but vim is not.

Oh sorry, no … :smiling_face:

What does this tell you?

Install vim:

sudo pacman -S vim

This should solve your error about vim.

Cheers.

1 Like

Just wondering is it possible to make it nano instead of vim?

That’s up to you, I suppose.

Installing vim should lose that warning, regardless.

As I recall there are several configurations possible, dependent on whichever tools you opt to use; and their respective configurations. Search the forum (that’s what it’s for) and see what you can find on the general topic.

1 Like

Sorry, I edited my post before I see your reply.
To be honest my post was asking why not use nano to edit a file instead of vim which I just reworded to be more precise.

I have no experience about Vim, but you can compare this 2 files much better with Meld as with a normal editor like Nano.

You see the file difference right there with marked colors and you can overwrite or move the code lines much better in Meld because you have this little arrows that lead you much faster to the destination when you want to merge pacnew files.

3 Likes

pacdiff compares the original version of a file with its .pacnew version. This comparison, and subsequent merging, is easier when using an application that directly supports comparing files. The vim editor contains a vimdiff component that can perform such a comparison and merging. The meld application mentioned above also does this.

If you desire, you can use the diff command to compare two files, and then make manual changes with the editor of your choice. But unless your editor has a diff ability built in, it cannot be used together with pacdiff.

1 Like

Of course I realize that I should install vim because of this message, but I wanted to avoid that. Firstly, because I get along better with nano and secondly: meld is already installed anyway, so why install more stuff?

But DIFFPROG=meld pacdiff -s is quite sufficient.

:heavy_check_mark:

1 Like

Here is a visual amplification, posted by @oneno, of what @Kobold and @Takakage posted, showing how a comparison utility would work. This particular utility is diffuse; I had tried meld and then decided to use diffuse because the interface made more sense to me personally.

Edit: you may have to follow the link to @oneno’s post to actually see the graphic. Sorry about that.

1 Like

No.

nano has no comparison feature.

You must use a comparison tool with DIFFPROG. Like meld or kompare or kdiff … or vim -d.

3 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.