" Go to file command |gf| adjustments " This resolves denote links. The function has access to the variable v:fname, " which corresponds to the filename under the cursor. function s:gotofile() return v:fname !~ '^denote:' \ ? v:fname \ : denote#meta#fileFromNoteId(v:fname[7:]) ?? v:fname endfunction " Denote note specifics function denote#ft#denote() if expand('%:p:h') != g:denote_directory return endif " Link completion setlocal omnifunc=denote#completion#get " Denote links are of the form 'denote:'; we require the column. setlocal isfname+=: " Set the function to resolve the filename under the cursor (see |gf|). setlocal includeexpr=s:gotofile() " Back references command let l:noteid = denote#meta#noteIdFromFile(expand('%:t')) exe 'command! DenoteBackReferences DenoteGrep /\/gj' endfunction " Location-list specifics " " This will be called for every location and quickfix, when data is loaded into " the list. This does nothing for such lists that are note 'denote' lists. function denote#ft#qf() let l:context = getloclist(0, {'context': 1})['context'] if type(l:context) != v:t_dict || !has_key(l:context, 'denote') " Clear settings set spell< nmapclear return endif setlocal nospell nnoremap q :lclose if has_key(l:context, 'gfun') nnoremap r :call denote#loclist#reload() endif " Denote-list specific configuration " if l:context == 'denote-list' " call denote#commands#loadll() " endif endfunction