The default way to install plugins is to put their individual pieces in some subdirectories of your ~/.vim/
directory. Taking this plugin as example:
~/.vim/plugin/jshint.vim
~/.vim/doc/jshint.txt
The :Helptags
command is used to generate the index (tags
) used by Vim to navigate through the documentation of third party plugins. You are supposed to use it like that:
:Helptags ~/.vim/doc
The idea behind Pathogen and other plugin managers is that each plugin should be in its own directory rather than be scattered through your ~/.vim/
directory. In Pathogen's case (and others followed, but there's no standard), that's the bundle directory: ~/.vim/bundle/
.
Therefore, the correct location for your plugin should be:
~/.vim/bundle/jshint/plugin/jshint.vim
~/.vim/bundle/jshint/doc/jshint.txt
~/.vim/bundle/jshint/README.md
~/.vim/bundle/jshint/LICENSE
In order for pathogen to work its magic, you are supposed to add these two lines to your ~/.vimrc
:
silent! call pathogen#infect()
silent! call pathogen#helptags()
The first line takes care of "registering" and loading each plugin found in ~/.vim/bundle/
. The second line indexes their documentation, the equivalent of :Helptags …
that you don't need to run, then.
So…
Make sure Pathogen is installed and configured correctly.
Install the JSHint plugin where it should be.
?
Enjoy writing JavaScript in Vim!
To run :JSHint
on the current buffer every time you write it, add this line to your ~/.vimrc
:
autocmd! BufWritePost *.js JSHint