Vim 7.3 on Ubuntu 12.10 doesn't have 'ftplugin' directory anywhere

霸气de小男生 提交于 2020-01-03 06:03:27

问题


Vim 7.3 on Ubuntu 12.10

I recently installed vim from the Ubuntu software center. So far, I've installed the following vim plugins: NERDTree, rails and ack.

I'm taking a course on python and another one on Ruby on Rails. I was surprised that vim didn't recognize the languages as far as indenting goes. Checking various questions and answers on this forum, as well as checking vim help, I see that there should be a directory named 'ftplugin' in the $VIMRUNTIME directory. My $VIMRUNTIME is just the same as $HOME which is ~/, but there is no 'ftplugin' in my home directory. There's also nothing like that in ~/.vim. Does that mean I don't have any filetype plugins?

If I don't, where can I get the usual set?


回答1:


edit

Just to be clear: upon install, Vim doesn't do anything to your home directory. The ~/.vim directory and any subdirectory are to be created by the user: it is where you put your config so you are in charge.

endedit

You must create those directories yourself, no matter what OS you are using. On UNIX-like systems (Linux, Mac OS X…) all your stuff is supposed to go into ~/.vim:

$ cd
$ mkdir .vim
$ cd .vim

Some plugins may need to be placed into specific subdirectories:

~/.vim/autoload
~/.vim/plugin
etc.

You can:

  • create those directories just like you created ~/.vim and place all the files manually
  • $ unzip the plugins right there in ~/.vim, the necessary directories are created for you
  • use some plugin manager like Pathogen or VAM or Vundle and/or a VCS…

I'd advise you to start slow. Just install everything manually: it will help you getting more comfortable with the whole thing.

Anyway, since you have already installed a bunch of (useless IMO, except rails) plugins you probably already know all that.

Vim already has the necessary ftplugins, you only need to tell Vim to "activate" them by default. Add these two lines to your ~/.vimrc (create that file if you didn't already):

filetype plugin indent on
syntax on


来源:https://stackoverflow.com/questions/12962233/vim-7-3-on-ubuntu-12-10-doesnt-have-ftplugin-directory-anywhere

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!