The Computer Oracle

installing plugins in vim

--------------------------------------------------
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------

Music by Eric Matyas
https://www.soundimage.org
Track title: Puddle Jumping Looping

--

Chapters
00:00 Installing Plugins In Vim
00:45 Answer 1 Score 5
01:03 Accepted Answer Score 61
02:40 Answer 3 Score 1
03:11 Thank you

--

Full question
https://superuser.com/questions/404686/i...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#vim #vimplugins

#avk47



ACCEPTED ANSWER

Score 61


You don't need to do anything for Vim to find your plugins and settings. Except actually putting them in the right place.

  1. On UNIX derivatives, $VIM refers to the directory where Vim's support files were installed. On Mac OS X, a UNIX derivative, Vim's default location is /usr/bin and its support files are installed in /usr/share.

  2. Don't put your plugins/colorschemes/scripts in /usr/share/vim/vim73. Only default files should be there as they will likely be changed the next time you or Apple updates your install.

  3. On Mac OS X (or any UNIX derivative) you must put your plugins/colorschemes/scripts in a ~/.vim directory and your custom settings in a ~/.vimrc file. None of these are there by default: you'll have to create them yourself as well as any needed sub-directories.

  4. Some plugins consist of only one file, pluginname.vim that you should put in ~/.vim/plugin as in:

    ~/.vim/plugin/pluginname.vim
    

    If the plugin and your version of Vim are compatible it should work. Check the plugin's page if it needs some activation command or setting. You'll need to relaunch Vim anyway.

    Many plugins, though, are composed of many files in many directories like autoload, after, doc… You'll have to put the files in their corresponding directories under your ~/.vim, creating them as needed. Taking CtrlP as an example:

    ~/.vim/autoload/ctrlp/<many files>
    ~/.vim/autoload/ctrlp/ctrlp.vim
    ~/.vim/doc/ctrlp.txt
    ~/.vim/plugin/ctrlp.vim
    
  5. Once you are OK with the basics of plugin management in Vim you should try Pathogen or Vundle or some other solution.




ANSWER 2

Score 5


Better use ~/.vim/plugin/ directory to put vim plugins files (as mentioned by Vim help command).

See http://www.youtube.com/watch?v=Dmv6-dguS3g&feature=player_embedded#!

In vim, see the help: :h plugin




ANSWER 3

Score 1


Since this question not specifically about configuring paths in order to have plugins work, an alternative to mucking around with all the path stuff is to just source the specific plugins you want in vim from your .vimrc (assuming it's working) by adding the line :source PATH/TO/FILE.vim. Vim generally checks for .vimrc right in the home directory ~/. If it does not exist, try creating it there, and from within it either sourcing the plugin(s) you want as described, or first doing something else you'll notice when starting vim such as :echo your vimrc says hello.