File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change 1
1
" Vim auto-load script
2
2
" Author: Peter Odding <peter@peterodding.com>
3
- " Last Change: December 25 , 2010
3
+ " Last Change: December 28 , 2010
4
4
" URL: http://peterodding.com/code/vim/notes/
5
5
6
6
" Note: This file is encoded in UTF-8 including a byte order mark so
7
7
" that Vim loads the script using the right encoding transparently.
8
8
9
9
let s: script = expand (' <sfile>:p:~' )
10
10
11
- function ! xolox#notes#new (bang ) " {{{1
11
+ function ! xolox#notes#new (bang , name ) " {{{1
12
12
" Create a new note using the :NewNote command.
13
13
if ! s: is_empty_buffer ()
14
14
execute ' enew' . a: bang
15
15
endif
16
16
setlocal filetype = notes
17
17
execute ' silent read' fnameescape (xolox#path#merge (g: notes_shadowdir , ' New note' ))
18
18
1 delete
19
- setlocal nomodified
19
+ if a: name = ~ ' \S'
20
+ call setline (1 , xolox#trim (a: name ))
21
+ else
22
+ setlocal nomodified
23
+ endif
20
24
doautocmd BufReadPost
21
25
endfunction
22
26
@@ -59,7 +63,7 @@ function! xolox#notes#shortcut() " {{{1
59
63
let filename = ' '
60
64
let arguments = xolox#trim (matchstr (expand (' <afile>' ), ' note:\zs.*' ))
61
65
if arguments == ' '
62
- call xolox#notes#new (bang )
66
+ call xolox#notes#new (bang , ' ' )
63
67
return
64
68
endif
65
69
for [fname, title ] in items (xolox#notes#get_fnames_and_titles ())
Original file line number Diff line number Diff line change 3
3
" Last Change: December 28, 2010
4
4
" URL: http://peterodding.com/code/vim/notes/
5
5
" License: MIT
6
- " Version: 0.7.20
6
+ " Version: 0.7.21
7
7
8
8
" Support for automatic update using the GLVS plug-in.
9
9
" GetLatestVimScripts: 3375 1 :AutoInstall: session.zip
@@ -37,7 +37,7 @@ if !exists('g:notes_indexscript')
37
37
endif
38
38
39
39
" User commands to create, delete and search notes.
40
- command ! - bar - bang NewNote call xolox#notes#new (<q-bang> )
40
+ command ! - bar - bang - nargs =? NewNote call xolox#notes#new (<q-bang> , <q-args > )
41
41
command ! - bar - bang DeleteNote call xolox#notes#delete (<q-bang> )
42
42
command ! - bar - bang -nargs =1 SearchNotes call xolox#notes#search (<q-bang> , <q-args> )
43
43
command ! - bar - bang RelatedNotes call xolox#notes#related (<q-bang> )
You can’t perform that action at this time.
0 commit comments