更改vi编辑器的配置|的vimrc

时间:2014-01-17 07:49:23

标签: vi

我正在使用无法安装vim的机器。 vi编辑器已经存在,我需要调整一下,以便它的行为像我以前一样。

为实现这一目标,我在适当的位置创建了一个vimrc文件,并从某处复制并安装了配置。

我的问题是 - vi 编辑器还查找vimrc文件的配置(我知道 vim 吗?)

如果我没有正确思考并且你能提供帮助,请告诉我。

由于

1 个答案:

答案 0 :(得分: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).                                                                                                           |
+---------+---------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+