Where is vim located?

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
meyer0095

Where is vim located?

Post by meyer0095 »

I just switched over to Mint/Linux from Windows yesterday. Very confused about the file structure compared to Windows.

I am trying to find the vim directory to mess around with configurations and plugins, but have no idea where vim was installed. Could anyone also point me in the direction to a good guide on the file structure of Mint/Linux. Do all distros have the same file structure, or do they vary by distro? Are programs installed in a central location like C:\Program Files in windows?

Any help is greatly appreciated.

Thanks!
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
xenopeek
Level 25
Level 25
Posts: 29597
Joined: Wed Jul 06, 2011 3:58 am

Re: Where is vim located?

Post by xenopeek »

This could be the start of a beautiful story, called "how I borked my Linux Mint installation on the first day by pretending Linux = Windows." It doesn't have a happy ending :(

Not to worry, we're here to help write a better story :D First, generally the various Linux distros have a filesystem layout based on the Filesystem Hierarchy Standard, which you can access here: https://wiki.linuxfoundation.org/en/FHS. Generally a program's static files are installed in /usr, which you normally have no reason to modify, and it's system-wide configuration files are installed in /etc, which you would modify sometimes. Your personal preferences are saved by the program as you use it in hidden files or folders in your home folder (press Ctrl+H to show these), or you can create these as you need them.

vim has a system-wide configuration file in /etc/vim/vimrc, but you wouldn't normally edit this. You would edit, or first create, the .vimrc file in your home folder for your personal preferences. Read the documentation for help on this; here is the online copy of the relevant section: http://vimdoc.sourceforge.net/htmldoc/s ... -settings/.

vim plugins or scripts are generally also installed in your home folder, in the folder called .vim.

There are various other resources available for help with vim: http://www.vim.org/docs.php. Perhaps good to start there.
Image
meyer0095

Re: Where is vim located?

Post by meyer0095 »

My .vimrc file is not being read, nor are any my plugins in ~/.vim :/

If I do :scriptnames it is showing 17 files allow found in /usr/share/vim/vim73

How do I configure vim to also read the files found in ~/.vim?

Thanks!
User avatar
xenopeek
Level 25
Level 25
Posts: 29597
Joined: Wed Jul 06, 2011 3:58 am

Re: Where is vim located?

Post by xenopeek »

Your .vimrc should be read, if it is located in /home/yourusername/.vimrc. Sorry for failing to mention this, but by default *.vim script files you want to add should be in the /home/yourusername/.vim/plugin folder (or in a subfolder of that). This is also documented in the manual, here the online copy: http://vimdoc.sourceforge.net/htmldoc/usr_05.html#05.4.

This page on the Ubuntu wiki about vim may be helpful: https://help.ubuntu.com/community/VimHowto.

You can get scripts from the vim website, or from the vim scripts mirror on GitHub.

And yes, default scripts are installed somewhere in /usr but with the above you should be able to load your own scripts successfully.
Image
meyer0095

Re: Where is vim located?

Post by meyer0095 »

I accidently placed in .vimrc file in my .vim folder instead of right in the home folder. That fixed everything. Thanks for all the help and information!
Locked

Return to “Beginner Questions”