vim基础命令
:version
:显示版本及默认vimrc配置文件加载路径
system vimrc file: "$VIM\vimrc"
user vimrc file: "$HOME\_vimrc"
2nd user vimrc file: "$HOME\vimfiles\vimrc"
3rd user vimrc file: "$VIM\_vimrc"
user exrc file: "$HOME\_exrc"
2nd user exrc file: "$VIM\_exrc"
system gvimrc file: "$VIM\gvimrc"
user gvimrc file: "$HOME\_gvimrc"
2nd user gvimrc file: "$HOME\vimfiles\gvimrc"
3rd user gvimrc file: "$VIM\_gvimrc"
system menu file: "$VIMRUNTIME\menu.vim"
:scriptnames
:按加载顺序显示vim启动后所有script
通过这条命令可以发现本次VIM启动加载的哪一个vimrc配置文件,以及相关的引用Scripts
1: D:\app\Vim\vimrc
2: D:\app\Vim\vim74\filetype.vim
3: D:\app\Vim\vim74\menu.vim
4: D:\app\Vim\vim74\lang\menu_zh_cn.cp936.vim
5: D:\app\Vim\vim74\lang\menu_chinese_gb.936.vim
6: D:\app\Vim\vim74\autoload\paste.vim
7: D:\app\Vim\vim74\ftplugin.vim
8: D:\app\Vim\vim74\indent.vim
9: D:\app\Vim\vim74\syntax\syntax.vim
10: D:\app\Vim\vim74\syntax\synload.vim
11: D:\app\Vim\vim74\syntax\syncolor.vim
12: D:\app\Vim\vim74\autoload\plug.vim
13: D:\app\Vim\vim74\ftoff.vim
14: D:\app\Vim\vim74\syntax\nosyntax.vim
15: D:\app\Vim\vim74\delmenu.vim
16: D:\app\Vim\vim74\colors\kolor.vim
17: D:\app\Vim\_vimrc
18: D:\app\Vim\vim74\vimrc_example.vim
19: D:\app\Vim\vim74\mswin.vim
20: D:\app\Vim\ray\plugin\vim-airline\plugin\airline.vim
21: D:\app\Vim\ray\plugin\vim-airline\autoload\airline.vim
22: D:\app\Vim\ray\plugin\vim-airline\autoload\airline\init.vim
23: D:\app\Vim\ray\plugin\vim-airline\autoload\airline\parts.vim
:function
:查看加载的所有function
function <SNR>12_glob_dir(path)
function <SNR>12_upgrade()
function <SNR>10_Helpfind()
function <SNR>12_infer_properties(name, repo)
function g:AutoCloseJumpAfterPair()
function <SNR>10_BMHash(name)
function <SNR>2_FTlpc()
function <SNR>12_install(force, names)
function airline#extensions#load_theme()
function <SNR>12_esc(path)
function <SNR>12_split_rtp()
function <SNR>19_ToggleAutoCloseMappings()
function <SNR>10_BMShow(...)
function <SNR>2_Check_inp()
function <SNR>19_QuoteDelim(char)
function <SNR>12_format_message(bullet, name, message)
function <SNR>12_git_version_requirement(...)
function <SNR>2_Redif()
function <SNR>2_SQL()
function <SNR>19_CloseStackPop(char, pair)
function <SNR>35_exec_separator(dict, from, to, inverse, suffix)
VIM系统变量
:echo $HOME
:VIM HOME目录,对应于OS上的~目录
Linux上为/home/username/
Windows上为C:\Users\username\
:echo $VIM
:VIM被安装的目录
VIM的目录路径为:
\vim
\vim\vim74\
\vim\vimfiles\
_vimrc
:echo $VIMRUNTIME
:vim.exe程序的目录
\vim\vim74\
:echo $MYVIMRC
:用户VIMRC文件路径
Windows下为\vim\ _vimrc
Linux下为~/.vimrc
对应:scriptnames
命令可以看到生效的VIMRC文件
VIM环境变量
:set all
查看所有环境变量的设置
:set
查看所有与系统默认不同的环境变量
:set variable?
显示指定环境变量的当前值
:set runtimepath?
显示script搜索路径
彩蛋
:smile
网友评论