2014-01-17 37 views
0

我正在使用一臺機器,我無法安裝vim。 vi編輯器已經存在,我需要稍微調整一下,以便它像我習慣的那樣工作。更改vi editor |的配置vimrc

爲了達到這個目的,我在適當的位置創建了一個vimrc文件,並從某處複製並安裝了配置。

我的問題是 - 不編輯器還查找了vimrc文件作爲配置(我知道VIM呢)?

請讓我知道,如果我不正確思考,如果你能幫助。

感謝

回答

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

**「(VIM只):一個叫做.vimrc的文件,位於用戶的主目錄中,包含配置選項如果此文件Vim不會查找任何後續配置文件或檢查其他環境變量。「** 因此,這意味着* vi *甚至不會查看.vimrc文件,是否正確? – vatsals

+0

是的,你是對的@vatsals。 –