2014-01-17 2 views
0

Я использую машину, где я не могу установить vim. Редактор vi уже существует, и мне нужно немного его настроить, чтобы он вел себя так, как я привык.Изменение конфигурации для редактора vi | vimrc

Для этого я создал файл vimrc в соответствующем месте и скопировал и установил конфигурацию где-то.

Мой вопрос - это VI редактор также искать файл vimrc для его конфигурации (я знаю, что ВИМ делает)?

Пожалуйста, дайте мне знать, если я не буду думать правильно, и если вы можете помочь.

Благодаря

ответ

0

я цитирую this developerWorks article:

+---------+---------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ 
| Order | Location              | Description                                                                                                                                              | 
+=========+===============================================================+===================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================+ 
| 1  | Specific file invoked by \`-u\`option       | (Vim only): If invoked with the \`-u\` option followed by the name of a configuration file, Vim ignores the rest of its configuration sequence and loads only settings from the specified file. To skip all configuration files, you can specify \`NONE\` as the argument to the \`-u\` option. You can prevent standard vi from loading any configuration files by setting the \`EXINIT\` environment variable to the \`":set noexrc"\` string and then executing vi. The following example does this from the command line if you are using the Bash shell: EXINIT=":set noexrc" vi file1.txt | 
+---------+---------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ 
| 2  | Specific configuration file identified when Vim is compiled | (Vim only): A specific configuration file identified when Vim is compiled (usually /etc/vim/vimrc or /usr/share/vim/vimrc) that contains system-wide configuration settings for Vim. This file typically sets some configuration options and loads other Vim configuration files that are specific to the operating system and operating system distribution that you are running.                                                    | 
+---------+---------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ 
| 3  | \`VIMINIT\`environment variable        | (Vim only): An environment variable that consists of a sequence of one or more configuration commands. If this environment variable is set, Vim does not look for any subsequent configuration files or examine other environment variables.                                                                                      | 
+---------+---------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ 
| 4  | $HOME/.vimrc             | (Vim only): A file named .vimrc, located in the user's home directory, that contains configuration options. If this file is found, Vim does not look for any subsequent configuration files or examine other environment variables. See [Downloads](http://www.ibm.com/developerworks/aix/library/au-customize\_vi/index.html?utm\_source=twitterfeed&utm\_medium=statusnet#download) for the sample.vimrc file.                                             | 
+---------+---------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ 
| 5  | \`EXINIT\`environment variable        | An environment variable that consists of a sequence of one or more configuration commands.                                                                                                                          | 
+---------+---------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ 
| 6  | $HOME/.exrc             | A file named .exrc, located in the user's home directory, that contains configuration options. If this file is found, vi and Vim do not look for any subsequent configuration files unless the \`exrc\` option is set in this configuration file. See [Downloads](http://www.ibm.com/developerworks/aix/library/au-customize\_vi/index.html?utm\_source=twitterfeed&utm\_medium=statusnet#download) for the sample.exrc file.                                          | 
+---------+---------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ 
| 7  | .exrc               | A file named .exrc, located in the current working directory, that contains configuration options. (If you are using Vim on a Microsoft Windows® system, the name of this file is \_exrc.) An .exrc file in the current directory is read only if a previous configuration instruction or file set the \`exrc\` option (or if you are starting vi or Vim from your home directory and you have an .exrc file there, which therefore matches the following step in the search sequence).                           | 
+---------+---------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ 
+0

** "(Вим только):. Файл с именем .vimrc, находится в домашнем каталоге пользователя, который содержит параметры конфигурации Если этот файл , Vim не ищет никаких последующих файлов конфигурации или не проверяет другие переменные среды. ** Значит, это означает, что * vi * даже не смотрит файл .vimrc, правильно? – vatsals

+0

Да, вы правы @vatsals. –

Смежные вопросы