Skip to content

Commit

Permalink
Completion for :Note command
Browse files Browse the repository at this point in the history
  • Loading branch information
xolox committed Jan 7, 2011
1 parent 9d0a9dd commit 21c8699
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions autoload.vim
Expand Up @@ -73,6 +73,10 @@ function! xolox#notes#select(filter) " {{{1
return '' return ''
endfunction 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 function! xolox#notes#save() abort " {{{1
" When the current note's title is changed, automatically rename the file. " When the current note's title is changed, automatically rename the file.
if &filetype == 'notes' if &filetype == 'notes'
Expand Down
4 changes: 2 additions & 2 deletions notes.vim
Expand Up @@ -3,7 +3,7 @@
" Last Change: January 7, 2011 " Last Change: January 7, 2011
" URL: http://peterodding.com/code/vim/notes/ " URL: http://peterodding.com/code/vim/notes/
" License: MIT " License: MIT
" Version: 0.8.1 " Version: 0.8.2


" Support for automatic update using the GLVS plug-in. " Support for automatic update using the GLVS plug-in.
" GetLatestVimScripts: 3375 1 :AutoInstall: session.zip " GetLatestVimScripts: 3375 1 :AutoInstall: session.zip
Expand Down Expand Up @@ -37,7 +37,7 @@ if !exists('g:notes_indexscript')
endif endif


" User commands to create, delete and search notes. " 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 DeleteNote call xolox#notes#delete(<q-bang>)
command! -bar -bang -nargs=1 SearchNotes call xolox#notes#search(<q-bang>, <q-args>) command! -bar -bang -nargs=1 SearchNotes call xolox#notes#search(<q-bang>, <q-args>)
command! -bar -bang RelatedNotes call xolox#notes#related(<q-bang>) command! -bar -bang RelatedNotes call xolox#notes#related(<q-bang>)
Expand Down

0 comments on commit 21c8699

Please sign in to comment.