fix config bug

This commit is contained in:
Rene Schallner
2021-11-21 21:21:45 +01:00
parent f8a7469fd7
commit 3ee8ba7716
2 changed files with 29 additions and 25 deletions

View File

@@ -29,8 +29,9 @@ Somewhere in your vim config, put a snippet like this:
```vimscript ```vimscript
lua << END lua << END
local home = vim.fn.expand("~/zettelkasten")
require('telekasten').setup({ require('telekasten').setup({
home = vim.fn.expand("~/zettelkasten"), home = home
dailies = vim.fn.expand("~/zettelkasten/daily"), dailies = vim.fn.expand("~/zettelkasten/daily"),
weeklies = vim.fn.expand("~/zettelkasten/weekly"), weeklies = vim.fn.expand("~/zettelkasten/weekly"),
extension = ".md", extension = ".md",
@@ -50,13 +51,13 @@ require('telekasten').setup({
weeklies_create_nonexisting = true, weeklies_create_nonexisting = true,
-- template for new notes (new_note, follow_link) -- template for new notes (new_note, follow_link)
template_new_note = ZkCfg.home .. '/' .. 'templates/new_note.md', template_new_note = home .. '/' .. 'templates/new_note.md',
-- template for newly created daily notes (goto_today) -- template for newly created daily notes (goto_today)
template_new_daily = ZkCfg.home .. '/' .. 'templates/daily.md', template_new_daily = home .. '/' .. 'templates/daily.md',
-- template for newly created weekly notes (goto_thisweek) -- template for newly created weekly notes (goto_thisweek)
template_new_weekly= ZkCfg.home .. '/' .. 'templates/weekly.md', template_new_weekly= home .. '/' .. 'templates/weekly.md',
}) })
END END
``` ```

View File

@@ -10,35 +10,38 @@ local vim = vim
-- ---------------------------------------------------------------------------- -- ----------------------------------------------------------------------------
-- DEFAULT CONFIG -- DEFAULT CONFIG
-- ---------------------------------------------------------------------------- -- ----------------------------------------------------------------------------
local home = vim.fn.expand("~/zettelkasten")
ZkCfg = { ZkCfg = {
home = vim.fn.expand("~/zettelkasten"), home = home,
dailies = vim.fn.expand("~/zettelkasten/daily"), dailies = vim.fn.expand("~/zettelkasten/daily"),
weeklies = vim.fn.expand("~/zettelkasten/weekly"), weeklies = vim.fn.expand("~/zettelkasten/weekly"),
extension = ".md", extension = ".md",
daily_finder = "daily_finder.sh", daily_finder = "daily_finder.sh",
-- where to install the daily_finder, -- where to install the daily_finder,
-- (must be a dir in your PATH) -- (must be a dir in your PATH)
my_bin = vim.fn.expand('~/bin'), my_bin = vim.fn.expand('~/bin'),
-- download tool for daily_finder installation: curl or wget -- download tool for daily_finder installation: curl or wget
downloader = 'curl', downloader = 'curl',
-- downloader = 'wget', -- wget is supported, too -- downloader = 'wget', -- wget is supported, too
-- following a link to a non-existing note will create it -- following a link to a non-existing note will create it
follow_creates_nonexisting = true, follow_creates_nonexisting = true,
dailies_create_nonexisting = true, dailies_create_nonexisting = true,
weeklies_create_nonexisting = true, weeklies_create_nonexisting = true,
-- templates for new notes -- templates for new notes
template_new_note = ZkCfg.home .. '/' .. 'templates/new_note.md', template_new_note = home .. '/' .. 'templates/new_note.md',
-- currently unused, hardcoded in daily_finder.sh: template_new_daily = home .. '/' .. 'templates/daily_tk.md',
template_new_daily = ZkCfg.home .. '/' .. 'templates/daily_tk.md', template_new_weekly = home .. '/' .. 'templates/weekly_tk.md',
-- currently unused
template_new_weekly= ZkCfg.home .. '/' .. 'templates/weekly_tk.md',
} }
-- ---------------------------------------------------------------------------- -- ----------------------------------------------------------------------------
local downloader2cmd = { local downloader2cmd = {
curl = 'curl -o', curl = 'curl -o',
wget = 'wget -O', wget = 'wget -O',