我试图尝试 vim 在启动时加载的自动加载文件。我将 example.vim 文件保存在:
〜/.vim/自动加载/
目录并编写了一个非常简单的函数:
echom "Autoloading..."
function! cpp#running#CompileAndRunFile(commands)
silent !clear
execute "!" . a:commands . " " . bufname("%")
endfunction
function! cpp#running#DebuggersOptions()
" Get the bytecode.
let bytecode = system(a:command . " -E -o " . bufname("%"))
" Open a new split and set it up.
vsplit __Bytecode__
normal! ggdG
setlocal filetype=potionbytecode
setlocal buftype=nofile
" Insert the bytecode.
call append(0, split(bytecode, '\v\n'))
endfunction
Run Code Online (Sandbox Code Playgroud)
但我想以编程方式强制重新加载 Vim 已加载的自动加载 example.vim 文件,而不打扰用户。原因是我希望程序员在运行时可以更改函数的行为并加载最新修改的函数。
我怎样才能做到这一点 ?
谢谢。
自动加载 vim 在启动时加载的文件。
不。自动加载功能恰恰相反:自动加载的脚本是在运行时调用它包含的函数时获取的。
但我想以编程方式强制重新加载 Vim 已加载的自动加载 example.vim 文件,而不打扰用户。
:source又来了?