How to install vim in Linux laptop that is pre-installed with vi ?

naseeam
naseeam used Ask the Experts™
on
I have Darter Pro Linux Laptop running Ubuntu 18.04 LTS (64-bit).  vi editor is installed but I want to install vim editor.
Attached file show that vi is installed but vim isn't installed.

What is the best way to manage this installation?  Should I remove vi and then install vim?  vi came installed with this new laptop.  Is it even possible to remove it?
Screenshot-from-2019-11-24-21-49-17.png
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Dr. KlahnPrincipal Software Engineer

Commented:
Bring up a command prompt and issue "apt-get install vim" -- if there are any conflicts, apt will resolve them for you or ask what you want to do.

You can certainly remove vi, but unless there is some pressing reason to do so I would not.  A year later some install script will come along and it will have instructions for using vi and nothing else.
Distinguished Expert 2017
Commented:
vim and vi in newer versions are one and the same, run vi --version;
nociSoftware Engineer
Distinguished Expert 2018

Commented:
Mostly the vi package is a vim light variant. (vim without the extras and in some compatible to ancient vi configuration).
Success in ‘20 With a Profitable Pricing Strategy

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

David FavorFractional CTO
Distinguished Expert 2018

Commented:
As stated above, you'd have to be running a very old version of Linux... wow... probably 10+ years old, to actually have vi installed.

Likely vi is simply symlinked to vim.

This will tell you what's occurring...

# vi --version | head -n 1
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Jun 06 2019 17:31:41)

Open in new window


Likely you'll see vim is already installed.

Author

Commented:
amernaseem@system76-pc:~$ vi --version
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Jun 06 2019 17:31:41)



amernaseem@system76-pc:~$ vim somefile
Command 'vim' not found, but can be installed with:
sudo apt install vim      
sudo apt install vim-gtk3  
sudo apt install vim-tiny  
sudo apt install neovim    
sudo apt install vim-athena
sudo apt install vim-gtk  
sudo apt install vim-nox


I don't have to do anything?  Just invoke vim as vi <somefile ?
Distinguished Expert 2017
Commented:
Yes.
or you can du sudo ln /usr/bin/vi /usr/bin/vi
alternatively, you can within the shell config .bashrc .profile
add
alias vim='/usr/bin/vi'

either one should work.
nociSoftware Engineer
Distinguished Expert 2018

Commented:
dont use < on the commandline for vim..
vim somefile
should be used.

Author

Commented:
Thank you for the solution and supporting information.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial