I'm using the nnn file manager v3.2 on Mint 19.3 64-bit. If I have a file named ‘a.txt’ and I want to make a copy of it named ‘b.txt’ in the same directory, I do the following: I select ‘a.txt’ so that it has a + prefixed to it’s name, press ‘w’ and then press ‘c’ to copy (as). However, after pressing ‘c’, instead of being asked to input a new name (‘b.txt’) my text editor gvim is launched and I get a cp error message in nnn’s terminal stating that "‘a.txt’ can’t be copied to ‘a.txt’". Have I misinterpreted the procedure, or is this a bug?
1 Answer
The workflow for cp/mv is to open the paths in selection in your $VISUAL (else $EDITOR) and let you edit them (because if you have selected 20 files it doesn't make sense to ask and rename one by one).
Your $VISUAL/$EDITOR is set to gvim so the list is opener in gvim. Rename the entries as you want and save the file for the changes to apply.
In your case you haven't renamed the entry a.txt before saving the file so the error message is shown. You can't have 2 files with the same same in a directory.
Note: If you want to use a cli editor like vim, set $VISUAL ($EDITOR if you do not want to set $VISUAL) to vim an duse the program option -e
.
-
The cp error message appears before the editor opens. cp: '/home/standard_user/a.txt' and '/home/standard_user/a.txt' are the same file ‘, Enter' to continue. The editor then opens a ‘.nnn…...’ file in /tmp. The first line is: #/home/standard_user/a.txt and the scond line is: a.txt. If a.txt on the second line is changed to b.txt and the file is saved, b.txt is not saved to the home dir.– w2kproJun 15, 2020 at 17:17
-
I think the gvim is opened detached so the program does not wait for it. Please fix that. If it still doesn't work, please raise a defect in the project page so the devs can take a look at it. Jun 15, 2020 at 22:10