Ubuntu 12.10 上的 Vim 7.3 在任何地方都没有“ftplugin"目录 [英] Vim 7.3 on Ubuntu 12.10 doesn't have 'ftplugin' directory anywhere

查看:28
本文介绍了Ubuntu 12.10 上的 Vim 7.3 在任何地方都没有“ftplugin"目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Ubuntu 12.10 上的 Vim 7.3

Vim 7.3 on Ubuntu 12.10

我最近从 Ubuntu 软件中心安装了 vim.到目前为止,我已经安装了以下 vim 插件:NERDTree、rails 和 ack.

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

我正在学习一门关于 Python 的课程和另一门关于 Ruby on Rails 的课程.我很惊讶 vim 不能识别缩进的语言.在这个论坛上查看各种问答,以及查看vim帮助,我看到$VIMRUNTIME目录下应该有一个名为'ftplugin'的目录.我的 $VIMRUNTIME 与 $HOME 相同,即 ~/,但我的主目录中没有 'ftplugin'.~/.vim 中也没有类似的东西.这是否意味着我没有任何文件类型插件?

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?

推荐答案

编辑

需要说明的是:安装时,Vim 不会对您的主目录执行任何操作.~/.vim 目录和任何子目录将由用户创建:它是放置你的的地方> 配置以便负责.

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.

结束编辑

无论您使用什么操作系统,您都必须自己创建这些目录.在类 UNIX 系统(Linux、Mac OS X...)上,你所有的东西都应该进入 ~/.vim:

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.

您可以:

  • 像创建~/.vim一样创建这些目录并手动放置所有文件
  • $ unzip 插件就在 ~/.vim 中,为你创建了必要的目录
  • 使用一些插件管理器,如 Pathogen 或 VAM 或 Vundle 和/或 VCS...
  • 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.

无论如何,既然您已经安装了一堆(IMO 无用,除了 rails)插件,您可能已经知道所有这些.

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

Vim 已经有必要的 ftplugins,你只需要告诉 Vim 默认激活"它们.将这两行添加到您的 ~/.vimrc(如果您还没有创建该文件):

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

这篇关于Ubuntu 12.10 上的 Vim 7.3 在任何地方都没有“ftplugin"目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆