" This function is used to autocomplete the tags in user commands. function s:tagList(ArgLead, cmdLine, CursorPos) let l:files=glob(g:denote_directory .. '/*', 0, v:true) let l:tags=[] for f in l:files let l:tags=extend(l:tags, denote#meta#noteTagsFromFile(f)) endfor return uniq(sort(l:tags))->join("\n") endfunction " Public commands function denote#commands#load() if exists('g:denote_commands_loaded') && g:denote_commands_loaded return endif " Register user commands command -nargs=* Denote call denote#notes#list() | lcl | lw command -nargs=1 -complete=custom,s:tagList DenoteByTag call denote#notes#bytag() | lcl | lw command -nargs=+ DenoteGrep call denote#notes#grep() | lcl | lw command -nargs=1 DenoteNew call denote#notes#new() " Register auto commands autocmd BufReadPost quickfix call denote#ft#qf() let l:aupat = map(copy(g:denote_note_file_extensions), {_, v -> '*.' .. v})->join(',') exe 'autocmd BufReadPost,BufNewFile ' .. l:aupat .. ' call denote#ft#denote()' " Useful key mappings " nnoremap DenoteList :DenoteSearch:lclose:lopen:resize 20 " nnoremap DenoteBackReferences :DenoteBackReferences:lclose:lopen:resize 20 let g:denote_commands_loaded = v:true endfunction " " Public commands for the denote-list location list " function denote#commands#loadll() " command DenoteReload call denote# " " command -nargs=1 DenoteSetTitle call denote#notes#settitle() " endfunction