0

I just installed Ubuntu 16.04 and installed Vim, I tried to edit some files and when trying to write changes Vim said:

E173 4 more files to edit

I don't know why it's happening but it's making my cry like a baby.

Always when I execute vim someFile in a terminal, it opens a file called example no matter what name I pass as an argument, even without arguments! it opens the example file and I can't do anything about!

My .vimrc is empty, I ran apt-get purge vim twice already and installed from repos, I deleted the legacy Vi, I built Vim from sources and it's happening the same, I rebooted my machine a lot of times but it keeps happening!

How could I make it work properly?

2
  • I have no idea what caused this behavior, I had to reinstall ubuntu and now it's working fine, luckily for me I lost just one day of work. If someone figure out what caused this issue please let the answer below. Thanks in advance!
    – Migdress
    Aug 9 '17 at 3:11
  • You could be facing the same issue I am. Possibly: vi.stackexchange.com/q/25209/1596 May 9 '20 at 13:22
1

Disclaimer: I do not have enough "reputations" for writing a comment so I post this message as an answer.

Please check with whereis vim and then try to find the ELF file using the file <pathname> command. When you find it, use it directly and see if you still have the problem.

Example (for my machine and note that the lines starting with $ are the commands I typed):

$ whereis vim
vim: /usr/bin/vim.basic /usr/bin/vim.gnome /usr/bin/vim /usr/bin/vim.tiny /etc/vim /usr/share/vim /usr/share/man/man1/vim.1.gz
$ file /usr/bin/vim
/usr/bin/vim: symbolic link to /etc/alternatives/vim
$ file /etc/alternatives/vim
/etc/alternatives/vim: symbolic link to /usr/bin/vim.gnome
$ file /usr/bin/vim.gnome
/usr/bin/vim.gnome: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=4780361a80931ec2b91b7c62c32364d4b0bd49aa, stripped
$ /usr/bin/vim.gnome

If everything act normally with the ELF file, this means somewhere you have an alias or a script file changing the behaviour.

Search in your .bashrc (or anything corresponding to your shell) for aliases like

alias vim='/usr/bin/vim example you got pranked'

Maybe when searching for the ELF file, file indicated that one file is a script file (example /usr/bin/vim: Bourne-Again shell script, ASCII text executable). If this is the case, check the file, maybe you will have something like this:

#!/bin/bash
/usr/bin/vim.gnome example you got pranked

I hope it helped.

PS: In our school, a classmate and I thought it was sad that most of the students use gedit when doing exams on the school computers. He had the great idea to move, on some school computers, /usr/bin/gedit to /usr/bin/gedit.bak and to create a script file /usr/bin/gedit that would open the freshly moved gedit alongside with ten terminals with Vim opened in them.

3
  • 1
    Your answer was not the right one, but because of you I checked my .bash_history, found that the very first thing I did after install vim was to modify my vimrc, I copied a text from the internet (where I store my vimrc lines) and pasted it into ~/.vimrc. FOR SOME REASON, the buffer of the clipboard didn't work properly and some of the first characters of the whole vimrc setup were not pasted, and FOR SOME REASON those lines were doing the trick of not letting me open any file with vim, I opened my .vimrc with gedit, deleted all the lines and now is working well.
    – Migdress
    Aug 9 '17 at 23:50
  • Interesting, I would not have thought it was a problem with the .vimrc. Thanks for the feedback!
    – Nales
    Aug 10 '17 at 9:53
  • Actually, my first line was the same as the vimrc example " An example for a vimrc file. But when copying the whole vimrc, the first was wrongly copied thus n example for a vimrc file. It looks like 'n' open the file "example" and also the files "for" "a" "vimrc" and "file". So that was the deal.
    – Migdress
    Aug 10 '17 at 23:12

Not the answer you're looking for? Browse other questions tagged or ask your own question.