Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Completion for :Note command

  • Loading branch information...
commit 21c8699880876d3f584f9a8d8ad0312e1861e3a5 1 parent 9d0a9dd
Peter Odding authored
Showing with 6 additions and 2 deletions.
  1. +4 −0 autoload.vim
  2. +2 −2 notes.vim
4 autoload.vim
View
@@ -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'
4 notes.vim
View
@@ -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>)
Please sign in to comment.
Something went wrong with that request. Please try again.