diff --git a/doc/telekasten.txt b/doc/telekasten.txt index 175ba88..9723842 100644 --- a/doc/telekasten.txt +++ b/doc/telekasten.txt @@ -449,6 +449,14 @@ telekasten.setup({opts}) Default: `nil` Example: `"call jobstart('firefox --new-window {{url}}')"` + + *telekasten.settings.enable_create_new* + enable_create_new: ~ + Flag that determines if creating new notes with in enabled when + using the `find_notes` picker. + + Default: true + *telekasten.calendar_opts* ----------------------------------- Valid keys for {opts.calendar_opts} diff --git a/lua/telekasten.lua b/lua/telekasten.lua index 30d3dd9..2ff76e2 100644 --- a/lua/telekasten.lua +++ b/lua/telekasten.lua @@ -150,6 +150,8 @@ local function defaultConfig(home) media_previewer = "telescope-media-files", -- A customizable fallback handler for urls. follow_url_fallback = nil, + -- Enable creation new notes with Ctrl-n when finding notes + enable_create_new = true, } M.Cfg = cfg M.note_type_templates = { @@ -1737,8 +1739,10 @@ local function FindNotes(opts) map("n", "", picker_actions.paste_link(opts)) map("i", "", picker_actions.paste_link(opts)) map("n", "", picker_actions.paste_link(opts)) - map("i", "", picker_actions.create_new(opts)) - map("n", "", picker_actions.create_new(opts)) + if M.Cfg.enable_create_new then + map("i", "", picker_actions.create_new(opts)) + map("n", "", picker_actions.create_new(opts)) + end return true end