diff --git a/autoload.vim b/autoload.vim index e179eb0..1750985 100644 --- a/autoload.vim +++ b/autoload.vim @@ -73,6 +73,10 @@ function! xolox#notes#select(filter) " {{{1 return '' endfunction +function! xolox#notes#complete(arglead, cmdline, cursorpos) " {{{1 + return filter(xolox#notes#get_titles(), 'v:val =~ a:arglead') +endfunction + function! xolox#notes#save() abort " {{{1 " When the current note's title is changed, automatically rename the file. if &filetype == 'notes' diff --git a/notes.vim b/notes.vim index 9f3219c..8c83acb 100644 --- a/notes.vim +++ b/notes.vim @@ -3,7 +3,7 @@ " Last Change: January 7, 2011 " URL: http://peterodding.com/code/vim/notes/ " License: MIT -" Version: 0.8.1 +" Version: 0.8.2 " Support for automatic update using the GLVS plug-in. " GetLatestVimScripts: 3375 1 :AutoInstall: session.zip @@ -37,7 +37,7 @@ if !exists('g:notes_indexscript') endif " User commands to create, delete and search notes. -command! -bar -bang -nargs=? Note call xolox#notes#edit(, ) +command! -bar -bang -nargs=? -complete=customlist,xolox#notes#complete Note call xolox#notes#edit(, ) command! -bar -bang DeleteNote call xolox#notes#delete() command! -bar -bang -nargs=1 SearchNotes call xolox#notes#search(, ) command! -bar -bang RelatedNotes call xolox#notes#related()