Ubuntu: Vim says its installed but not opening files


I have been using vim for a while now on my ubuntu (16.04 LTS) desktop, but for past few days, something seems to be wrong as when i try to open file using vim it says

The program 'vim' can be found in the following packages:

  • vim
  • vim-gnome
  • vim-tiny
  • vim-athena
  • vim-athena-py2
  • vim-gnome-py2
  • vim-gtk
  • vim-gtk-py2
  • vim-gtk3
  • vim-gtk3-py2
  • vim-nox
  • vim-nox-py2 Try: sudo apt install selected package.

I am pretty sure my vim is installed but nevertheless when I try to install using the standard, sudo apt-get install vim, it says

vim is already the newest version (2:7.4.1689-3ubuntu1.2)

I don't understand the problem. Thought about trying out emacs for a change, but I would like to know if there is any resolution for this. I can't figure out what is wrong here.

Update: I tried dpkg -L vim, which showed me:

/usr  /usr/share  /usr/share/doc  /usr/share/lintian  /usr/share/lintian/overrides  /usr/share/lintian/overrides/vim  /usr/share/bug  /usr/share/bug/vim  /usr/share/bug/vim/script  /usr/share/bug/vim/presubj  /usr/bin  /usr/bin/vim.basic  /usr/share/doc/vim  

So I used, vim.basic myfilename, which seems to be working for opening files, but still can't use vim.

**output of dpkg -l 'vim*' **

ii vim 2:7.4.1689-3ubuntu1 amd64 Vi IMproved - enhanced vi editor
un vim-athena (no description available)
un vim-athena-py2 (no description available)
ii vim-common 2:7.4.1689-3ubuntu1 amd64 Vi IMproved - Common files
un vim-doc (no description available)
ii vim-gnome 2:7.4.1689-3ubuntu1 amd64 Vi IMproved - enhanced vi editor - with GNOME2 GUI
un vim-gnome-py2 (no description available)
un vim-gtk (no description available)
un vim-gtk-py2 (no description available)
un vim-gtk3 (no description available)
un vim-gtk3-py2 (no description available)
ii vim-gui-common 2:7.4.1689-3ubuntu1 all Vi IMproved - Common GUI files
un vim-lua (no description available)
un vim-nox (no description available)
un vim-nox-py2 (no description available)
un vim-perl (no description available)
un vim-python (no description available)
un vim-ruby (no description available)
ii vim-runtime 2:7.4.1689-3ubuntu1 all Vi IMproved - Runtime files
un vim-scripts (no description available)
un vim-tcl (no description available)
rc vim-tiny 2:7.4.1689-3ubuntu1 amd64 Vi IMproved - enhanced vi editor - compact version

output of update-alternatives --display vim is:

vim - auto mode
link best version is /etc/vim
link currently points to /etc/vim
link vim is /usr/bin/vim
/etc/vim - priority 100
/usr/bin/vim.basic - priority 30
/usr/bin/vim.gnome - priority 60

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »