import { autocmd_delete } from "https://deno.land/x/denops_std@v6.3.0/function/vim/mod.ts";
Deletes a List of autocmds and autocmd groups.
The {acmds} argument is a List where each item is a Dict with
the following optional items:
bufnr buffer number to delete a buffer-local autocmd.
If this item is specified, then the "pattern"
item is ignored.
cmd Ex command for this autocmd event
event autocmd event name. Refer to autocmd-events
.
If '*' then all the autocmd events in this
group are deleted.
group autocmd group name. Refer to autocmd-groups
.
If not specified or empty, then the default
group is used.
nested set to v:true for a nested autocmd.
Refer to autocmd-nested
.
once set to v:true for an autocmd which executes
only once. Refer to autocmd-once
.
pattern autocmd pattern string. Refer to
autocmd-patterns
. If "bufnr" item is
present, then this item is ignored.
If only {group} is specified in a {acmds} entry and {event}, {pattern} and {cmd} are not specified, then that autocmd group is deleted.
Returns v:true
on success and v:false
on failure.
Examples:
" :autocmd! BufLeave *.vim
let acmd = #{event: 'BufLeave', pattern: '*.vim'}
call autocmd_delete([acmd]})
" :autocmd! MyGroup1 BufLeave
let acmd = #{group: 'MyGroup1', event: 'BufLeave'}
call autocmd_delete([acmd])
" :autocmd! MyGroup2 BufEnter *.c
let acmd = #{group: 'MyGroup2', event: 'BufEnter',
\ pattern: '*.c'}
" :autocmd! MyGroup2 * *.c
let acmd = #{group: 'MyGroup2', event: '*',
\ pattern: '*.c'}
call autocmd_delete([acmd])
" :autocmd! MyGroup3
let acmd = #{group: 'MyGroup3'}
call autocmd_delete([acmd])
Can also be used as a method
:
GetAutocmdList()->autocmd_delete()