gpt4 book ai didi

vim - 强制 vim 重新加载已经加载的自动加载 vim 文件

转载 作者:行者123 更新时间:2023-12-02 03:47:30 27 4
gpt4 key购买 nike

我试图尝试 vim 在启动时加载的自动加载文件。我将 example.vim 文件保存在:

~/.vim/autoload/

目录并编写了一个非常简单的函数:

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

但是我想以编程方式强制重新加载 Vim 已经加载的自动加载 example.vim 文件,而不打扰用户。原因是我希望程序员在运行时可以更改函数的行为并加载最新修改的函数。

我怎样才能做到这一点?

谢谢。

最佳答案

auto-load files which vim load at the time of start.

没有。自动加载功能恰恰相反:自动加载的脚本是在运行时获取的,当调用它包含的函数时

But I want to programatically force a reload of an autoload example.vim file which Vim has already loaded, without bothering the user.

:source 再来一遍?

关于vim - 强制 vim 重新加载已经加载的自动加载 vim 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46335796/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com