diff --git a/.gitignore b/.gitignore index 0a56e3f..ab2e9f6 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /doc/tags +__pycache__ diff --git a/autoload/mbnotes.vim b/autoload/mbnotes.vim index 45a4904..ab4bf44 100644 --- a/autoload/mbnotes.vim +++ b/autoload/mbnotes.vim @@ -64,7 +64,7 @@ export def BeforeNoteSave() var daily_path = g:mbnotes_dir .. "/daily" # Don't touch daily notes - if daily_path != full_path[0 : len(daily_path) - 1] + if g:mbnotes_rename_on_save && daily_path != full_path[0 : len(daily_path) - 1] var base = expand('%:t') var date = base[0 : 9] diff --git a/doc/mbnotes.txt b/doc/mbnotes.txt index e96baae..137edf6 100644 --- a/doc/mbnotes.txt +++ b/doc/mbnotes.txt @@ -130,6 +130,14 @@ If none of the above are defined, and this variable is not set explicitly, then the render commands (e.g. |:MBNotesRenderPDF|) will not open the output file after rendering. +g:mbnotes_rename_on_save *g:mbnotes_rename_on_save* + +This plugin will attempt to intelligently rename a note based on its title, +which is the first H1 that it finds in the document. Disable this behaviour by +setting this variable to false >vim + + let g:mbnotes_rename_on_save = 0 + ============================================================================== 4. Commands *mbnotes-commands* diff --git a/plugin/mbnotes.vim b/plugin/mbnotes.vim index 27662fe..ea1658d 100644 --- a/plugin/mbnotes.vim +++ b/plugin/mbnotes.vim @@ -41,6 +41,10 @@ if !exists("g:mbnotes_date_format_long") g:mbnotes_date_format_long = "%A, %-e %B %Y" endif +if !exists("g:mbnotes_rename_on_save") + g:mbnotes_rename_on_save = 1 +endif + import autoload 'mbnotes.vim' augroup MBNotes diff --git a/python3/__pycache__/mbnotes.cpython-313.pyc b/python3/__pycache__/mbnotes.cpython-313.pyc deleted file mode 100644 index c20436d..0000000 Binary files a/python3/__pycache__/mbnotes.cpython-313.pyc and /dev/null differ diff --git a/python3/mbnotes.py b/python3/mbnotes.py index 709ce10..4ae196d 100644 --- a/python3/mbnotes.py +++ b/python3/mbnotes.py @@ -27,6 +27,4 @@ def generate_daily_note(date_offset = 0): date_format = vim.eval("g:mbnotes_date_format_long") date = date.strftime(date_format) - author = vim.eval("g:mbnotes_author") - - return daily_template.substitute(date=date, author=author) + return daily_template.substitute(date=date)