mirror of
https://github.com/Ascyii/telekasten.nvim.git
synced 2025-12-31 22:04:24 -05:00
Fix: Allow disabling <C-n> mapping for note creation in picker (#302)
* Enable config for creation of new note with Ctrl-n * Add `enable_create_new` documentation
This commit is contained in:
@@ -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 <C-n> in enabled when
|
||||
using the `find_notes` picker.
|
||||
|
||||
Default: true
|
||||
|
||||
*telekasten.calendar_opts*
|
||||
-----------------------------------
|
||||
Valid keys for {opts.calendar_opts}
|
||||
|
||||
@@ -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", "<c-i>", picker_actions.paste_link(opts))
|
||||
map("i", "<c-cr>", picker_actions.paste_link(opts))
|
||||
map("n", "<c-cr>", picker_actions.paste_link(opts))
|
||||
map("i", "<c-n>", picker_actions.create_new(opts))
|
||||
map("n", "<c-n>", picker_actions.create_new(opts))
|
||||
if M.Cfg.enable_create_new then
|
||||
map("i", "<c-n>", picker_actions.create_new(opts))
|
||||
map("n", "<c-n>", picker_actions.create_new(opts))
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user