mirror of
https://github.com/Ascyii/telekasten.nvim.git
synced 2026-01-01 06:14:23 -05:00
Merge branch 'main' into special_links
This commit is contained in:
1
.github/FUNDING.yml
vendored
1
.github/FUNDING.yml
vendored
@@ -1,3 +1,4 @@
|
|||||||
# These are supported funding model platforms
|
# These are supported funding model platforms
|
||||||
|
|
||||||
github: renerocksai
|
github: renerocksai
|
||||||
|
custom: https://buymeacoffee.com/renerocksai
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
- [ ] yt video
|
- [ ] yt video
|
||||||
|
|
||||||
## Dones
|
## Dones
|
||||||
|
- [x] dailies and weeklies: don't display whole paths: fix entries: display values
|
||||||
- [x] added option parameter `i` to `toggle_todo(opts)` and `insert_link(opts)` to enter insert mode.
|
- [x] added option parameter `i` to `toggle_todo(opts)` and `insert_link(opts)` to enter insert mode.
|
||||||
- [x] find_friends()
|
- [x] find_friends()
|
||||||
- [x] show_backlinks() : issue #3
|
- [x] show_backlinks() : issue #3
|
||||||
|
|||||||
@@ -114,6 +114,7 @@ Other plugins I find useful in my day-to-day zettelkasten work:
|
|||||||
- [vim-emoji-complete](https://github.com/kyuhi/vim-emoji-complete)
|
- [vim-emoji-complete](https://github.com/kyuhi/vim-emoji-complete)
|
||||||
- [markdown-preview.nvim](https://github.com/iamcco/markdown-preview.nvim)
|
- [markdown-preview.nvim](https://github.com/iamcco/markdown-preview.nvim)
|
||||||
- [vim-markdown-toc](https://github.com/mzlogin/vim-markdown-toc)
|
- [vim-markdown-toc](https://github.com/mzlogin/vim-markdown-toc)
|
||||||
|
- [telescope-media-files](https://github.com/nvim-telescope/telescope-media-files.nvim)
|
||||||
|
|
||||||
### 2. Configure telekasten.nvim
|
### 2. Configure telekasten.nvim
|
||||||
Somewhere in your vim config, put a snippet like this:
|
Somewhere in your vim config, put a snippet like this:
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ local pickers = require("telescope.pickers")
|
|||||||
local finders = require("telescope.finders")
|
local finders = require("telescope.finders")
|
||||||
local conf = require("telescope.config").values
|
local conf = require("telescope.config").values
|
||||||
local scan = require("plenary.scandir")
|
local scan = require("plenary.scandir")
|
||||||
|
local utils = require("telescope.utils")
|
||||||
|
|
||||||
-- declare locals for the nvim api stuff to avoid more lsp warnings
|
-- declare locals for the nvim api stuff to avoid more lsp warnings
|
||||||
local vim = vim
|
local vim = vim
|
||||||
@@ -68,7 +69,7 @@ end
|
|||||||
|
|
||||||
-- ----------------------------------------------------------------------------
|
-- ----------------------------------------------------------------------------
|
||||||
-- image stuff
|
-- image stuff
|
||||||
local imgFromClipboard = function()
|
local function imgFromClipboard()
|
||||||
if vim.fn.executable("xclip") == 0 then
|
if vim.fn.executable("xclip") == 0 then
|
||||||
vim.api.nvim_err_write("No xclip installed!\n")
|
vim.api.nvim_err_write("No xclip installed!\n")
|
||||||
return
|
return
|
||||||
@@ -160,7 +161,7 @@ local monthmap = {
|
|||||||
"December",
|
"December",
|
||||||
}
|
}
|
||||||
|
|
||||||
local calenderinfo_today = function()
|
local function calenderinfo_today()
|
||||||
local dinfo = os.date("*t")
|
local dinfo = os.date("*t")
|
||||||
local opts = {}
|
local opts = {}
|
||||||
opts.date = os.date("%Y-%m-%d")
|
opts.date = os.date("%Y-%m-%d")
|
||||||
@@ -202,7 +203,7 @@ local function linesubst(line, title, calendar_info)
|
|||||||
return line
|
return line
|
||||||
end
|
end
|
||||||
|
|
||||||
local create_note_from_template = function(title, filepath, templatefn, calendar_info)
|
local function create_note_from_template(title, filepath, templatefn, calendar_info)
|
||||||
-- first, read the template file
|
-- first, read the template file
|
||||||
local lines = {}
|
local lines = {}
|
||||||
for line in io.lines(templatefn) do
|
for line in io.lines(templatefn) do
|
||||||
@@ -218,7 +219,7 @@ local create_note_from_template = function(title, filepath, templatefn, calendar
|
|||||||
ofile:close()
|
ofile:close()
|
||||||
end
|
end
|
||||||
|
|
||||||
local path_to_linkname = function(p)
|
local function path_to_linkname(p)
|
||||||
local fn = vim.split(p, "/")
|
local fn = vim.split(p, "/")
|
||||||
fn = fn[#fn]
|
fn = fn[#fn]
|
||||||
fn = vim.split(fn, M.Cfg.extension)
|
fn = vim.split(fn, M.Cfg.extension)
|
||||||
@@ -226,18 +227,83 @@ local path_to_linkname = function(p)
|
|||||||
return fn
|
return fn
|
||||||
end
|
end
|
||||||
|
|
||||||
local order_numeric = function(a, b)
|
local function order_numeric(a, b)
|
||||||
return a > b
|
return a > b
|
||||||
end
|
end
|
||||||
|
|
||||||
local find_files_sorted = function(opts)
|
-- local function endswith(s, ending)
|
||||||
|
-- return ending == "" or s:sub(-#ending) == ending
|
||||||
|
-- end
|
||||||
|
|
||||||
|
local function file_extension(fname)
|
||||||
|
return fname:match("^.+(%..+)$")
|
||||||
|
end
|
||||||
|
|
||||||
|
local function filter_filetypes(flist, ftypes)
|
||||||
|
local new_fl = {}
|
||||||
|
ftypes = ftypes or { M.Cfg.extension }
|
||||||
|
|
||||||
|
local ftypeok = {}
|
||||||
|
for _, ft in pairs(ftypes) do
|
||||||
|
ftypeok[ft] = true
|
||||||
|
end
|
||||||
|
|
||||||
|
for _, fn in pairs(flist) do
|
||||||
|
if ftypeok[file_extension(fn)] then
|
||||||
|
table.insert(new_fl, fn)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return new_fl
|
||||||
|
end
|
||||||
|
|
||||||
|
-- find_files_sorted(opts)
|
||||||
|
-- like builtin.find_files, but:
|
||||||
|
-- - uses plenary.scan_dir synchronously instead of external jobs
|
||||||
|
-- - pre-sorts the file list in descending order (nice for dates, most recent first)
|
||||||
|
-- - filters for allowed file types by extension
|
||||||
|
-- - (also supports devicons)
|
||||||
|
-- - displays subdirs if necessary
|
||||||
|
-- - e.g. when searching for daily notes, no subdirs are displayed
|
||||||
|
-- - but when entering a date in find_notes, the daily/ and weekly/ subdirs are displayed
|
||||||
|
local function find_files_sorted(opts)
|
||||||
opts = opts or {}
|
opts = opts or {}
|
||||||
|
|
||||||
local file_list = scan.scan_dir(opts.cwd, {})
|
local file_list = scan.scan_dir(opts.cwd, {})
|
||||||
|
file_list = filter_filetypes(file_list, M.Cfg.filter_extensions)
|
||||||
table.sort(file_list, order_numeric)
|
table.sort(file_list, order_numeric)
|
||||||
|
|
||||||
|
-- display with devicons
|
||||||
|
local function iconic_display(display_entry)
|
||||||
|
local display_opts = {
|
||||||
|
path_display = function(_, e)
|
||||||
|
return e:gsub(opts.cwd .. "/", "")
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
|
||||||
|
local hl_group
|
||||||
|
local display = utils.transform_path(display_opts, display_entry.value)
|
||||||
|
|
||||||
|
display, hl_group = utils.transform_devicons(display_entry.value, display, false)
|
||||||
|
|
||||||
|
if hl_group then
|
||||||
|
return display, { { { 1, 3 }, hl_group } }
|
||||||
|
else
|
||||||
|
return display
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local function make_entry(entry)
|
||||||
|
local iconic_entry = {}
|
||||||
|
iconic_entry.value = entry
|
||||||
|
iconic_entry.ordinal = entry
|
||||||
|
iconic_entry.display = iconic_display
|
||||||
|
return iconic_entry
|
||||||
|
end
|
||||||
|
|
||||||
pickers.new(opts, {
|
pickers.new(opts, {
|
||||||
finder = finders.new_table({
|
finder = finders.new_table({
|
||||||
results = file_list,
|
results = file_list,
|
||||||
|
entry_maker = make_entry,
|
||||||
}),
|
}),
|
||||||
sorter = conf.generic_sorter(opts),
|
sorter = conf.generic_sorter(opts),
|
||||||
previewer = conf.file_previewer(opts),
|
previewer = conf.file_previewer(opts),
|
||||||
@@ -250,7 +316,7 @@ end
|
|||||||
--
|
--
|
||||||
-- Select from daily notes
|
-- Select from daily notes
|
||||||
--
|
--
|
||||||
local FindDailyNotes = function(opts)
|
local function FindDailyNotes(opts)
|
||||||
opts = opts or {}
|
opts = opts or {}
|
||||||
|
|
||||||
local today = os.date("%Y-%m-%d")
|
local today = os.date("%Y-%m-%d")
|
||||||
@@ -262,7 +328,6 @@ local FindDailyNotes = function(opts)
|
|||||||
create_note_from_template(today, fname, M.note_type_templates.daily)
|
create_note_from_template(today, fname, M.note_type_templates.daily)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- builtin.find_files({
|
|
||||||
find_files_sorted({
|
find_files_sorted({
|
||||||
prompt_title = "Find daily note",
|
prompt_title = "Find daily note",
|
||||||
cwd = M.Cfg.dailies,
|
cwd = M.Cfg.dailies,
|
||||||
@@ -276,7 +341,7 @@ end
|
|||||||
--
|
--
|
||||||
-- Select from daily notes
|
-- Select from daily notes
|
||||||
--
|
--
|
||||||
local FindWeeklyNotes = function(opts)
|
local function FindWeeklyNotes(opts)
|
||||||
opts = opts or {}
|
opts = opts or {}
|
||||||
|
|
||||||
local title = os.date("%Y-W%V")
|
local title = os.date("%Y-W%V")
|
||||||
@@ -289,7 +354,6 @@ local FindWeeklyNotes = function(opts)
|
|||||||
create_note_from_template(title, fname, M.note_type_templates.weekly)
|
create_note_from_template(title, fname, M.note_type_templates.weekly)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- builtin.find_files({
|
|
||||||
find_files_sorted({
|
find_files_sorted({
|
||||||
prompt_title = "Find weekly note",
|
prompt_title = "Find weekly note",
|
||||||
cwd = M.Cfg.weeklies,
|
cwd = M.Cfg.weeklies,
|
||||||
@@ -303,9 +367,9 @@ end
|
|||||||
--
|
--
|
||||||
-- Select from all notes and put a link in the current buffer
|
-- Select from all notes and put a link in the current buffer
|
||||||
--
|
--
|
||||||
local InsertLink = function(opts)
|
local function InsertLink(opts)
|
||||||
opts = opts or {}
|
opts = opts or {}
|
||||||
builtin.find_files({
|
find_files_sorted({
|
||||||
prompt_title = "Insert link to note",
|
prompt_title = "Insert link to note",
|
||||||
cwd = M.Cfg.home,
|
cwd = M.Cfg.home,
|
||||||
attach_mappings = function(prompt_bufnr, _)
|
attach_mappings = function(prompt_bufnr, _)
|
||||||
@@ -330,7 +394,7 @@ end
|
|||||||
--
|
--
|
||||||
-- find the file linked to by the word under the cursor
|
-- find the file linked to by the word under the cursor
|
||||||
--
|
--
|
||||||
local FollowLink = function(opts)
|
local function FollowLink(opts)
|
||||||
opts = opts or {}
|
opts = opts or {}
|
||||||
vim.cmd("normal yi]")
|
vim.cmd("normal yi]")
|
||||||
local title = vim.fn.getreg('"0')
|
local title = vim.fn.getreg('"0')
|
||||||
@@ -347,7 +411,7 @@ local FollowLink = function(opts)
|
|||||||
create_note_from_template(title, fname, M.note_type_templates.normal)
|
create_note_from_template(title, fname, M.note_type_templates.normal)
|
||||||
end
|
end
|
||||||
|
|
||||||
builtin.find_files({
|
find_files_sorted({
|
||||||
prompt_title = "Follow link to note...",
|
prompt_title = "Follow link to note...",
|
||||||
cwd = M.Cfg.home,
|
cwd = M.Cfg.home,
|
||||||
default_text = title,
|
default_text = title,
|
||||||
@@ -361,7 +425,7 @@ end
|
|||||||
--
|
--
|
||||||
-- Find notes also linking to the link under cursor
|
-- Find notes also linking to the link under cursor
|
||||||
--
|
--
|
||||||
local FindFriends = function()
|
local function FindFriends()
|
||||||
vim.cmd("normal yi]")
|
vim.cmd("normal yi]")
|
||||||
local title = vim.fn.getreg('"0')
|
local title = vim.fn.getreg('"0')
|
||||||
|
|
||||||
@@ -379,7 +443,7 @@ end
|
|||||||
--
|
--
|
||||||
-- Create and yank a [[link]] from the current note.
|
-- Create and yank a [[link]] from the current note.
|
||||||
--
|
--
|
||||||
local YankLink = function()
|
local function YankLink()
|
||||||
local title = "[[" .. path_to_linkname(vim.fn.expand("%")) .. "]]"
|
local title = "[[" .. path_to_linkname(vim.fn.expand("%")) .. "]]"
|
||||||
vim.fn.setreg('"', title)
|
vim.fn.setreg('"', title)
|
||||||
print("yanked " .. title)
|
print("yanked " .. title)
|
||||||
@@ -391,7 +455,7 @@ end
|
|||||||
--
|
--
|
||||||
-- find today's daily note and create it if necessary.
|
-- find today's daily note and create it if necessary.
|
||||||
--
|
--
|
||||||
local GotoToday = function(opts)
|
local function GotoToday(opts)
|
||||||
opts = opts or calenderinfo_today()
|
opts = opts or calenderinfo_today()
|
||||||
local word = opts.date or os.date("%Y-%m-%d")
|
local word = opts.date or os.date("%Y-%m-%d")
|
||||||
|
|
||||||
@@ -403,7 +467,6 @@ local GotoToday = function(opts)
|
|||||||
create_note_from_template(word, fname, M.note_type_templates.daily, opts)
|
create_note_from_template(word, fname, M.note_type_templates.daily, opts)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- builtin.find_files({
|
|
||||||
find_files_sorted({
|
find_files_sorted({
|
||||||
prompt_title = "Goto day",
|
prompt_title = "Goto day",
|
||||||
cwd = M.Cfg.home,
|
cwd = M.Cfg.home,
|
||||||
@@ -430,8 +493,8 @@ end
|
|||||||
--
|
--
|
||||||
-- Select from notes
|
-- Select from notes
|
||||||
--
|
--
|
||||||
local FindNotes = function(_)
|
local function FindNotes(_)
|
||||||
builtin.find_files({
|
find_files_sorted({
|
||||||
prompt_title = "Find notes by name",
|
prompt_title = "Find notes by name",
|
||||||
cwd = M.Cfg.home,
|
cwd = M.Cfg.home,
|
||||||
find_command = M.Cfg.find_command,
|
find_command = M.Cfg.find_command,
|
||||||
@@ -444,7 +507,7 @@ end
|
|||||||
--
|
--
|
||||||
-- find the file linked to by the word under the cursor
|
-- find the file linked to by the word under the cursor
|
||||||
--
|
--
|
||||||
local SearchNotes = function(_)
|
local function SearchNotes(_)
|
||||||
builtin.live_grep({
|
builtin.live_grep({
|
||||||
prompt_title = "Search in notes",
|
prompt_title = "Search in notes",
|
||||||
cwd = M.Cfg.home,
|
cwd = M.Cfg.home,
|
||||||
@@ -460,7 +523,7 @@ end
|
|||||||
--
|
--
|
||||||
-- Find all notes linking to this one
|
-- Find all notes linking to this one
|
||||||
--
|
--
|
||||||
local ShowBacklinks = function(_)
|
local function ShowBacklinks(_)
|
||||||
local title = path_to_linkname(vim.fn.expand("%"))
|
local title = path_to_linkname(vim.fn.expand("%"))
|
||||||
-- or vim.api.nvim_buf_get_name(0)
|
-- or vim.api.nvim_buf_get_name(0)
|
||||||
builtin.live_grep({
|
builtin.live_grep({
|
||||||
@@ -490,7 +553,7 @@ local function on_create(title)
|
|||||||
create_note_from_template(title, fname, M.note_type_templates.normal)
|
create_note_from_template(title, fname, M.note_type_templates.normal)
|
||||||
end
|
end
|
||||||
|
|
||||||
builtin.find_files({
|
find_files_sorted({
|
||||||
prompt_title = "Created note...",
|
prompt_title = "Created note...",
|
||||||
cwd = M.Cfg.home,
|
cwd = M.Cfg.home,
|
||||||
default_text = title,
|
default_text = title,
|
||||||
@@ -498,7 +561,7 @@ local function on_create(title)
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
local CreateNote = function(_)
|
local function CreateNote(_)
|
||||||
-- vim.ui.input causes ppl problems - see issue #4
|
-- vim.ui.input causes ppl problems - see issue #4
|
||||||
-- vim.ui.input({ prompt = "Title: " }, on_create)
|
-- vim.ui.input({ prompt = "Title: " }, on_create)
|
||||||
local title = vim.fn.input("Title: ")
|
local title = vim.fn.input("Title: ")
|
||||||
@@ -527,14 +590,15 @@ local function on_create_with_template(title)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
builtin.find_files({
|
find_files_sorted({
|
||||||
prompt_title = "Select template...",
|
prompt_title = "Select template...",
|
||||||
cwd = M.Cfg.templates,
|
cwd = M.Cfg.templates,
|
||||||
find_command = M.Cfg.find_command,
|
find_command = M.Cfg.find_command,
|
||||||
attach_mappings = function(prompt_bufnr, _)
|
attach_mappings = function(prompt_bufnr, _)
|
||||||
actions.select_default:replace(function()
|
actions.select_default:replace(function()
|
||||||
actions.close(prompt_bufnr)
|
actions.close(prompt_bufnr)
|
||||||
local template = M.Cfg.templates .. "/" .. action_state.get_selected_entry().value
|
-- local template = M.Cfg.templates .. "/" .. action_state.get_selected_entry().value
|
||||||
|
local template = action_state.get_selected_entry().value
|
||||||
create_note_from_template(title, fname, template)
|
create_note_from_template(title, fname, template)
|
||||||
-- open the new note
|
-- open the new note
|
||||||
vim.cmd("e " .. fname)
|
vim.cmd("e " .. fname)
|
||||||
@@ -544,7 +608,7 @@ local function on_create_with_template(title)
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
local CreateNoteSelectTemplate = function(_)
|
local function CreateNoteSelectTemplate(_)
|
||||||
-- vim.ui.input causes ppl problems - see issue #4
|
-- vim.ui.input causes ppl problems - see issue #4
|
||||||
-- vim.ui.input({ prompt = "Title: " }, on_create_with_template)
|
-- vim.ui.input({ prompt = "Title: " }, on_create_with_template)
|
||||||
local title = vim.fn.input("Title: ")
|
local title = vim.fn.input("Title: ")
|
||||||
@@ -559,7 +623,7 @@ end
|
|||||||
--
|
--
|
||||||
-- find this week's weekly note and create it if necessary.
|
-- find this week's weekly note and create it if necessary.
|
||||||
--
|
--
|
||||||
local GotoThisWeek = function(opts)
|
local function GotoThisWeek(opts)
|
||||||
opts = opts or {}
|
opts = opts or {}
|
||||||
|
|
||||||
local title = os.date("%Y-W%V")
|
local title = os.date("%Y-W%V")
|
||||||
@@ -572,7 +636,6 @@ local GotoThisWeek = function(opts)
|
|||||||
create_note_from_template(title, fname, M.note_type_templates.weekly)
|
create_note_from_template(title, fname, M.note_type_templates.weekly)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- builtin.find_files({
|
|
||||||
find_files_sorted({
|
find_files_sorted({
|
||||||
prompt_title = "Goto this week:",
|
prompt_title = "Goto this week:",
|
||||||
cwd = M.Cfg.weeklies,
|
cwd = M.Cfg.weeklies,
|
||||||
@@ -586,7 +649,7 @@ end
|
|||||||
-- --------------
|
-- --------------
|
||||||
|
|
||||||
-- return if a daily 'note exists' indicator (sign) should be displayed for a particular day
|
-- return if a daily 'note exists' indicator (sign) should be displayed for a particular day
|
||||||
local CalendarSignDay = function(day, month, year)
|
local function CalendarSignDay(day, month, year)
|
||||||
local fn = M.Cfg.dailies .. "/" .. string.format("%04d-%02d-%02d", year, month, day) .. M.Cfg.extension
|
local fn = M.Cfg.dailies .. "/" .. string.format("%04d-%02d-%02d", year, month, day) .. M.Cfg.extension
|
||||||
if file_exists(fn) then
|
if file_exists(fn) then
|
||||||
return 1
|
return 1
|
||||||
@@ -596,7 +659,7 @@ end
|
|||||||
|
|
||||||
-- action on enter on a specific day:
|
-- action on enter on a specific day:
|
||||||
-- preview in telescope, stay in calendar on cancel, open note in other window on accept
|
-- preview in telescope, stay in calendar on cancel, open note in other window on accept
|
||||||
local CalendarAction = function(day, month, year, weekday, _)
|
local function CalendarAction(day, month, year, weekday, _)
|
||||||
local today = string.format("%04d-%02d-%02d", year, month, day)
|
local today = string.format("%04d-%02d-%02d", year, month, day)
|
||||||
local opts = {}
|
local opts = {}
|
||||||
opts.date = today
|
opts.date = today
|
||||||
@@ -609,7 +672,7 @@ local CalendarAction = function(day, month, year, weekday, _)
|
|||||||
GotoToday(opts)
|
GotoToday(opts)
|
||||||
end
|
end
|
||||||
|
|
||||||
local ShowCalendar = function(opts)
|
local function ShowCalendar(opts)
|
||||||
local defaults = {}
|
local defaults = {}
|
||||||
defaults.cmd = "CalendarVR"
|
defaults.cmd = "CalendarVR"
|
||||||
defaults.vertical_resize = 1
|
defaults.vertical_resize = 1
|
||||||
@@ -622,7 +685,7 @@ local ShowCalendar = function(opts)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- set up calendar integration: forward to our lua functions
|
-- set up calendar integration: forward to our lua functions
|
||||||
local SetupCalendar = function(opts)
|
local function SetupCalendar(opts)
|
||||||
local defaults = M.Cfg.calendar_opts
|
local defaults = M.Cfg.calendar_opts
|
||||||
opts = opts or defaults
|
opts = opts or defaults
|
||||||
|
|
||||||
@@ -661,7 +724,7 @@ local SetupCalendar = function(opts)
|
|||||||
vim.cmd(cmd)
|
vim.cmd(cmd)
|
||||||
end
|
end
|
||||||
|
|
||||||
local ToggleTodo = function(opts)
|
local function ToggleTodo(opts)
|
||||||
-- replace
|
-- replace
|
||||||
-- by -
|
-- by -
|
||||||
-- - by - [ ]
|
-- - by - [ ]
|
||||||
@@ -696,7 +759,7 @@ end
|
|||||||
--
|
--
|
||||||
-- Overrides config with elements from cfg. See top of file for defaults.
|
-- Overrides config with elements from cfg. See top of file for defaults.
|
||||||
--
|
--
|
||||||
local Setup = function(cfg)
|
local function Setup(cfg)
|
||||||
cfg = cfg or {}
|
cfg = cfg or {}
|
||||||
local debug = cfg.debug
|
local debug = cfg.debug
|
||||||
for k, v in pairs(cfg) do
|
for k, v in pairs(cfg) do
|
||||||
@@ -737,7 +800,10 @@ local Setup = function(cfg)
|
|||||||
or "left-fit"
|
or "left-fit"
|
||||||
SetupCalendar(M.Cfg.calendar_opts)
|
SetupCalendar(M.Cfg.calendar_opts)
|
||||||
end
|
end
|
||||||
-- print(vim.inspect(cfg))
|
|
||||||
|
-- setup extensions to filter for
|
||||||
|
M.Cfg.filter_extensions = cfg.filter_extensions or { M.Cfg.extension }
|
||||||
|
|
||||||
if debug then
|
if debug then
|
||||||
print("Resulting config:")
|
print("Resulting config:")
|
||||||
print("-----------------")
|
print("-----------------")
|
||||||
@@ -756,7 +822,8 @@ M.new_note = CreateNote
|
|||||||
M.goto_thisweek = GotoThisWeek
|
M.goto_thisweek = GotoThisWeek
|
||||||
M.find_weekly_notes = FindWeeklyNotes
|
M.find_weekly_notes = FindWeeklyNotes
|
||||||
M.yank_notelink = YankLink
|
M.yank_notelink = YankLink
|
||||||
M.create_note_sel_template = CreateNoteSelectTemplate
|
M.create_note_sel_template = CreateNoteSelectTemplate -- documented wrongly, let's keep it for the moment
|
||||||
|
M.new_templated_note = CreateNoteSelectTemplate
|
||||||
M.show_calendar = ShowCalendar
|
M.show_calendar = ShowCalendar
|
||||||
M.CalendarSignDay = CalendarSignDay
|
M.CalendarSignDay = CalendarSignDay
|
||||||
M.CalendarAction = CalendarAction
|
M.CalendarAction = CalendarAction
|
||||||
|
|||||||
Reference in New Issue
Block a user