Permalink
Browse files

Completion for :Note command

  • Loading branch information...
1 parent 9d0a9dd commit 21c8699880876d3f584f9a8d8ad0312e1861e3a5 @xolox committed Jan 7, 2011
Showing with 6 additions and 2 deletions.
  1. +4 −0 autoload.vim
  2. +2 −2 notes.vim
View
4 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'
View
4 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(<q-bang>, <q-args>)
+command! -bar -bang -nargs=? -complete=customlist,xolox#notes#complete Note call xolox#notes#edit(<q-bang>, <q-args>)
command! -bar -bang DeleteNote call xolox#notes#delete(<q-bang>)
command! -bar -bang -nargs=1 SearchNotes call xolox#notes#search(<q-bang>, <q-args>)
command! -bar -bang RelatedNotes call xolox#notes#related(<q-bang>)

0 comments on commit 21c8699

Please sign in to comment.