gpt4 book ai didi

vim - 为 Vim 的默认缓冲区添加一个钩子(Hook)

转载 作者:行者123 更新时间:2023-12-04 14:11:37 25 4
gpt4 key购买 nike

我想配置 Vim,当 [No Name] 缓冲区打开时,语法设置为 markdown。这可能吗?我在 Vim 的帮助中看不到这种钩子(Hook)。

我正在使用 Vim 7.3,使用 --with-features=huge 编译。

最佳答案

这里提到on the vim tips wiki :

" default filetype
let g:do_filetype = 0
au GUIEnter,BufAdd * if expand('<afile>') == "" | let g:do_filetype = 1 | endif
au BufEnter * if g:do_filetype | setf markdown | let g:do_filetype = 0 | endif

Why the need to use a global variable, and not set the filetype immediately, is to my understanding, because the buffer hasn't been fully created when the autocmd is triggered.

关于vim - 为 Vim 的默认缓冲区添加一个钩子(Hook),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14390623/

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