mirror of
https://github.com/Ascyii/telekasten.nvim.git
synced 2026-01-01 06:14:23 -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`
|
Default: `nil`
|
||||||
Example: `"call jobstart('firefox --new-window {{url}}')"`
|
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*
|
*telekasten.calendar_opts*
|
||||||
-----------------------------------
|
-----------------------------------
|
||||||
Valid keys for {opts.calendar_opts}
|
Valid keys for {opts.calendar_opts}
|
||||||
|
|||||||
@@ -150,6 +150,8 @@ local function defaultConfig(home)
|
|||||||
media_previewer = "telescope-media-files",
|
media_previewer = "telescope-media-files",
|
||||||
-- A customizable fallback handler for urls.
|
-- A customizable fallback handler for urls.
|
||||||
follow_url_fallback = nil,
|
follow_url_fallback = nil,
|
||||||
|
-- Enable creation new notes with Ctrl-n when finding notes
|
||||||
|
enable_create_new = true,
|
||||||
}
|
}
|
||||||
M.Cfg = cfg
|
M.Cfg = cfg
|
||||||
M.note_type_templates = {
|
M.note_type_templates = {
|
||||||
@@ -1737,8 +1739,10 @@ local function FindNotes(opts)
|
|||||||
map("n", "<c-i>", picker_actions.paste_link(opts))
|
map("n", "<c-i>", picker_actions.paste_link(opts))
|
||||||
map("i", "<c-cr>", picker_actions.paste_link(opts))
|
map("i", "<c-cr>", picker_actions.paste_link(opts))
|
||||||
map("n", "<c-cr>", picker_actions.paste_link(opts))
|
map("n", "<c-cr>", picker_actions.paste_link(opts))
|
||||||
|
if M.Cfg.enable_create_new then
|
||||||
map("i", "<c-n>", picker_actions.create_new(opts))
|
map("i", "<c-n>", picker_actions.create_new(opts))
|
||||||
map("n", "<c-n>", picker_actions.create_new(opts))
|
map("n", "<c-n>", picker_actions.create_new(opts))
|
||||||
|
end
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user