vim 自动命令组
示例
自动命令组对组织很有用,但对调试也很有用。可以将它们视为可以随意启用/禁用的小型命名空间。
示例
augroup MyGroup
" Clear the autocmds of the current group to prevent them from piling
" up each time you reload your vimrc.
autocmd!
" These autocmds are fired after the filetype of a buffer is defined to
" 'foo'. Don't forget to use 'setlocal' (for options) and '<buffer>'
" (for mappings) to prevent your settings to leak in other buffers with
" a different filetype.
autocmd FileType foo setlocal bar=baz
autocmd FileType foo nnoremap <buffer> <key> :command<CR>
" This autocmd calls 'MyFunction()' everytime Vim tries to create/edit
" a buffer tied to a file in /'path/to/project/**/'.
autocmd BufNew,BufEnter /path/to/project/**/* call MyFunction()
augroup END请参阅:helpautocommand。
热门推荐
1 泰迪狗狗如何训练
3 狗狗训练图
5 狗狗训练方法
6 训练狗狗不咬人
8 敏捷训练狗狗
10 训练狗狗吃饭
11 泰迪狗狗训练
12 狗狗从多大开始训练
13 狗狗训练学校费用
14 怎么去训练狗狗
15 狗狗训练狗狗
16 狗狗训练教程
17 训练狗狗装死
18 泰迪狗狗的训练方法