|
1 |
| -*starting.txt* For Vim version 9.1. Last change: 2024 Mar 13 |
| 1 | +*starting.txt* For Vim version 9.1. Last change: 2024 May 02 |
2 | 2 |
|
3 | 3 |
|
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar
|
@@ -93,20 +93,20 @@ filename One or more file names. The first one will be the current
|
93 | 93 |
|
94 | 94 | The startup mode can be changed by using another name instead of "vim", which
|
95 | 95 | is equal to giving options:
|
96 |
| -ex vim -e Start in Ex mode (see |Ex-mode|). *ex* |
97 |
| -exim vim -E Start in improved Ex mode (see |Ex-mode|). *exim* |
98 |
| - (normally not installed) |
99 |
| -view vim -R Start in read-only mode (see |-R|). *view* |
100 |
| -gvim vim -g Start the GUI (see |gui|). *gvim* |
101 |
| -gex vim -eg Start the GUI in Ex mode. *gex* |
102 |
| -gview vim -Rg Start the GUI in read-only mode. *gview* |
103 |
| -rvim vim -Z Like "vim", but in restricted mode (see |-Z|) *rvim* |
104 |
| -rview vim -RZ Like "view", but in restricted mode. *rview* |
105 |
| -rgvim vim -gZ Like "gvim", but in restricted mode. *rgvim* |
106 |
| -rgview vim -RgZ Like "gview", but in restricted mode. *rgview* |
107 |
| -evim vim -y Easy Vim: set 'insertmode' (see |-y|) *evim* |
108 |
| -eview vim -yR Like "evim" in read-only mode *eview* |
109 |
| -vimdiff vim -d Start in diff mode |diff-mode| |
| 96 | +ex vim -e Start in Ex mode (see |Ex-mode|). *ex* |
| 97 | +exim vim -E Start in improved Ex mode (see |Ex-mode|). *exim* |
| 98 | + (normally not installed) |
| 99 | +view vim -R Start in read-only mode (see |-R|). *view* |
| 100 | +gvim vim -g Start the GUI (see |gui|). *gvim* |
| 101 | +gex vim -eg Start the GUI in Ex mode. *gex* |
| 102 | +gview vim -Rg Start the GUI in read-only mode. *gview* |
| 103 | +rvim vim -Z Like "vim", but in restricted mode (see |-Z|) *rvim* |
| 104 | +rview vim -RZ Like "view", but in restricted mode. *rview* |
| 105 | +rgvim vim -gZ Like "gvim", but in restricted mode. *rgvim* |
| 106 | +rgview vim -RgZ Like "gview", but in restricted mode. *rgview* |
| 107 | +evim vim -y Easy Vim: set 'insertmode' (see |-y|) *evim* |
| 108 | +eview vim -yR Like "evim" in read-only mode *eview* |
| 109 | +vimdiff vim -d Start in diff mode |diff-mode| |
110 | 110 | gvimdiff vim -gd Start in diff mode |diff-mode|
|
111 | 111 |
|
112 | 112 | Additional characters may follow, they are ignored. For example, you can have
|
@@ -811,7 +811,8 @@ accordingly. Vim proceeds in this order:
|
811 | 811 | name. Also see |vimrc-intro|.
|
812 | 812 |
|
813 | 813 | Places for your personal initializations:
|
814 |
| - Unix $HOME/.vimrc or $HOME/.vim/vimrc |
| 814 | + Unix $HOME/.vimrc, $HOME/.vim/vimrc |
| 815 | + or $XDG_CONFIG_HOME/vim/vimrc |
815 | 816 | MS-Windows $HOME/_vimrc, $HOME/vimfiles/vimrc
|
816 | 817 | or $VIM/_vimrc
|
817 | 818 | Amiga s:.vimrc, home:.vimrc, home:vimfiles:vimrc
|
@@ -853,15 +854,16 @@ accordingly. Vim proceeds in this order:
|
853 | 854 | I The environment variable VIMINIT (see also |compatible-default|) (*)
|
854 | 855 | The value of $VIMINIT is used as an Ex command line.
|
855 | 856 | II The user vimrc file(s):
|
856 |
| - "$HOME/.vimrc" (for Unix) (*) |
857 |
| - "$HOME/.vim/vimrc" (for Unix) (*) |
858 |
| - "s:.vimrc" (for Amiga) (*) |
859 |
| - "home:.vimrc" (for Amiga) (*) |
860 |
| - "home:vimfiles:vimrc" (for Amiga) (*) |
861 |
| - "$VIM/.vimrc" (for Amiga) (*) |
862 |
| - "$HOME/_vimrc" (for Win32) (*) |
863 |
| - "$HOME/vimfiles/vimrc" (for Win32) (*) |
864 |
| - "$VIM/_vimrc" (for Win32) (*) |
| 857 | + "$HOME/.vimrc" (for Unix) (*) |
| 858 | + "$HOME/.vim/vimrc" (for Unix) (*) |
| 859 | + "$HOME/.config/vim/vimrc" (for Unix) (*) |
| 860 | + "s:.vimrc" (for Amiga) (*) |
| 861 | + "home:.vimrc" (for Amiga) (*) |
| 862 | + "home:vimfiles:vimrc" (for Amiga) (*) |
| 863 | + "$VIM/.vimrc" (for Amiga) (*) |
| 864 | + "$HOME/_vimrc" (for Win32) (*) |
| 865 | + "$HOME/vimfiles/vimrc" (for Win32) (*) |
| 866 | + "$VIM/_vimrc" (for Win32) (*) |
865 | 867 | "$HOME/config/settings/vim/vimrc" (for Haiku) (*)
|
866 | 868 |
|
867 | 869 | Note: For Unix and Amiga, when ".vimrc" does not exist,
|
@@ -1085,6 +1087,44 @@ defaults.vim from your .vimrc, first unlet skip_defaults_vim, as in the
|
1085 | 1087 | example above.
|
1086 | 1088 |
|
1087 | 1089 |
|
| 1090 | + *xdg-base-dir* *$XDG_CONFIG_HOME* |
| 1091 | +XDG Base Directory Specification ~ |
| 1092 | + |
| 1093 | +The XDG Base Directory Specification aims to define a standard location for |
| 1094 | +configuration files used by applications. This is mainly done to prevent |
| 1095 | +the legacy behavior of dumping everything into the user's home directory. |
| 1096 | +The specification can be found online at |
| 1097 | +https://specifications.freedesktop.org/basedir-spec/latest/ |
| 1098 | + |
| 1099 | +The location of this standard configuration directory is configurable by the |
| 1100 | +user, using an environment variable but should also give fallback in case those |
| 1101 | +variables weren't set. |
| 1102 | + |
| 1103 | +This is not an exhaustive list of those directories: |
| 1104 | + Environment var Default location Description ~ |
| 1105 | + `$XDG_CACHE_HOME` $HOME/.cache Ephemeral data files |
| 1106 | + `$XDG_CONFIG_HOME` $HOME/.config Configuration files |
| 1107 | + `$XDG_DATA_HOME` $HOME/.local/share Persistent data files |
| 1108 | + `$XDG_STATE_HOME` $HOME/.local/state State data files |
| 1109 | + |
| 1110 | +Vim will only use the `$XDG_CONFIG_HOME` directory, the others are not |
| 1111 | +(yet) used for its various configuration and state files. |
| 1112 | + |
| 1113 | + *xdg-vimrc* |
| 1114 | +Vim, on Unix systems, will look at `$XDG_CONFIG_HOME/vim/vimrc` for its |
| 1115 | +configuration (see |vimrc|) but it will source it only if no other |
| 1116 | +initialization file is found in `$HOME` or `$HOME/.vim` (thus making this |
| 1117 | +feature backward compatible). However, if you want to migrate to use |
| 1118 | +`$XDG_CONFIG_HOME/vim/` directory, you will have to move away your `~/.vimrc` |
| 1119 | +and `~/.vim/vimrc` file. |
| 1120 | + |
| 1121 | + *xdg-runtime* |
| 1122 | +When the |xdg-vimrc| is used the 'runtimepath' and 'packpath' options will be |
| 1123 | +modified accordingly to respect the |xdg-base-dir|: > |
| 1124 | +
|
| 1125 | + "$XDG_CONFIG_HOME/vim,$VIMRUNTIME,/after,$XDG_CONFIG_HOME/vim/after" |
| 1126 | +< |
| 1127 | + |
1088 | 1128 | Avoiding trojan horses ~
|
1089 | 1129 | *trojan-horse*
|
1090 | 1130 | While reading the "vimrc" or the "exrc" file in the current directory, some
|
|
0 commit comments