|
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 |
| -let g:xolox#notes#version = '0.30' |
| 9 | +let g:xolox#notes#version = '0.31' |
10 | 10 | let g:xolox#notes#url_pattern = '\<\(mailto:\|javascript:\|\w\{3,}://\)\(\S*\w\)\+/\?'
|
11 | 11 | let s:scriptdir = expand('<sfile>:p:h')
|
12 | 12 |
|
@@ -61,6 +61,15 @@ function! xolox#notes#init() " {{{1
|
61 | 61 | if !exists('g:notes_recentindex')
|
62 | 62 | let g:notes_recentindex = xolox#misc#path#merge(localdir, 'recent.txt')
|
63 | 63 | endif
|
| 64 | + " Define the default location of the template for new notes. |
| 65 | + if !exists('g:notes_new_note_template') |
| 66 | + if !empty($VIM_NOTES_TEMPLATE) |
| 67 | + " Command line override. |
| 68 | + let g:notes_new_note_template = xolox#misc#path#absolute($VIM_NOTES_TEMPLATE) |
| 69 | + else |
| 70 | + let g:notes_new_note_template = xolox#misc#path#merge(g:notes_shadowdir, 'New note') |
| 71 | + endif |
| 72 | + endif |
64 | 73 | " Define the default location of the template for HTML conversion.
|
65 | 74 | if !exists('g:notes_html_template')
|
66 | 75 | let g:notes_html_template = xolox#misc#path#merge(localdir, 'template.html')
|
@@ -158,8 +167,7 @@ function! xolox#notes#edit(bang, title) abort " {{{1
|
158 | 167 | let fname = xolox#notes#title_to_fname(title)
|
159 | 168 | noautocmd execute 'edit' . a:bang fnameescape(fname)
|
160 | 169 | if line('$') == 1 && getline(1) == ''
|
161 |
| - let fname = xolox#misc#path#merge(g:notes_shadowdir, 'New note') |
162 |
| - execute 'silent read' fnameescape(fname) |
| 170 | + execute 'silent read' fnameescape(g:notes_new_note_template) |
163 | 171 | 1delete
|
164 | 172 | if !xolox#notes#unicode_enabled()
|
165 | 173 | call s:transcode_utf8_latin1()
|
|
0 commit comments