2

I just installed Ubuntu a few days ago and I am trying to download and use VIM.

So I went to terminal and ran sudo apt-get install vim, and everything went fine with running the command, the only problem is that I can not for the life of me figure out how to actually run or even access the files that were downloaded.

So, how do I access the files installed with sudo apt-get install vim? Or an even shorter question: given my circumstances, how do I run vim?

2
  • 4
    Open up the terminal and type vim then press enter...
    – Parto
    Nov 19, 2014 at 20:46
  • 1
    type vim foo.txt :)
    – Ampt
    Nov 19, 2014 at 20:46

4 Answers 4

1

As the comments have indicated, you should just be able to type vim or vim filename.txt and it should start for you.

As for the file(s), you should be able to see where Vim is located on your file system using the which command. From there you can ls the locations to find the files. On my system, I can track-down Vim like this:

$ which vim
/usr/bin/vim
$ ls -al /usr/bin/vim
lrwxrwxrwx 1 root root 21 Nov 19 18:10 /usr/bin/vim -> /etc/alternatives/vim
$ ls -al /etc/alternatives/vim
lrwxrwxrwx 1 root root 18 Nov 19 18:10 /etc/alternatives/vim -> /usr/bin/vim.basic
$ ls -al /usr/bin/vim.basic
-rwxr-xr-x 1 root root 2015392 May  3  2012 /usr/bin/vim.basic
1

You can use

$ which vim

to identify where vim has been installed into.

And use

$ vim

to open vim editor. If you want to know the parameters that you can pass type

$ vim -h

And also to edit a specific file or create a file in a particular file name, use

$ vim file_name
1

I love vim, but it is not the simplest thing to learn how to use. The default install is not very good either due to space considerations. Your sudo apt-get install vim is a good start to having a more usable install of vim.

vim

then :help will get you started. which vim shows as @BryceAtNetwork23 mentioned. To really learn try:

vimtutor

To see a list of all the files installed by any package use dpkg -L vim-tiny. To view a package and their dependencies use apt-cache show vim-tiny. I also recommend you install sudo apt-get install vim-doc, a suggested package but not a dependency so it's not installed by default.

0

This command will show you all the files that were installed by a package.

$ dpkg-query -L vim
/.
/usr
/usr/bin
/usr/bin/vim.basic
/usr/share
/usr/share/bug
/usr/share/bug/vim
/usr/share/bug/vim/presubj
/usr/share/bug/vim/script
/usr/share/lintian
/usr/share/lintian/overrides
/usr/share/lintian/overrides/vim
/usr/share/doc
/usr/share/doc/vim

In this case, the executable is

/usr/bin/vim.basic

Or just vim, which calls vim.basic.

$ update-alternatives --list vim
/usr/bin/vim.basic
1
  • @bs7280 Were you satisfied with my answer? Then give me a upvote (∧). If I could solve your problem, then it would be nice if you'd mark my answer (✓). ;)
    – A.B.
    Apr 18, 2015 at 15:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .