mirror of
https://github.com/Ascyii/telekasten.nvim.git
synced 2026-01-01 06:14:23 -05:00
telekasten, take over my home!
This commit is contained in:
@@ -185,6 +185,10 @@ lua << END
|
|||||||
local home = vim.fn.expand("~/zettelkasten")
|
local home = vim.fn.expand("~/zettelkasten")
|
||||||
require('telekasten').setup({
|
require('telekasten').setup({
|
||||||
home = home,
|
home = home,
|
||||||
|
|
||||||
|
-- if true, telekasten will be enabled when opening a note within the configured home
|
||||||
|
take_over_my_home = true,
|
||||||
|
|
||||||
dailies = home .. '/' .. 'daily',
|
dailies = home .. '/' .. 'daily',
|
||||||
weeklies = home .. '/' .. 'weekly',
|
weeklies = home .. '/' .. 'weekly',
|
||||||
templates = home .. '/' .. 'templates',
|
templates = home .. '/' .. 'templates',
|
||||||
@@ -249,6 +253,7 @@ END
|
|||||||
| setting | description | example |
|
| setting | description | example |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| `home` | path to your zettelkasten folder (folder with markdown files) | ~/zettelkasten |
|
| `home` | path to your zettelkasten folder (folder with markdown files) | ~/zettelkasten |
|
||||||
|
| **`take_over_my_home`** | if set to `true` (default), telekasten will take over your home. Any notes from the configured `home` directory will receive a `set filetype=telekasten`, no matter if opened by telekasten or another way. | true |
|
||||||
| `dailies` | path where your daily notes go | ~/zettelkasten/daily |
|
| `dailies` | path where your daily notes go | ~/zettelkasten/daily |
|
||||||
| `weeklies` | path where your weekly notes go | ~/zettelkasten/weekly |
|
| `weeklies` | path where your weekly notes go | ~/zettelkasten/weekly |
|
||||||
| `templates` | path where your note templates go | ~/zettelkasten/templates |
|
| `templates` | path where your note templates go | ~/zettelkasten/templates |
|
||||||
|
|||||||
@@ -127,6 +127,15 @@ telekasten.setup({opts})
|
|||||||
|
|
||||||
Default: '~/zettelkasten'
|
Default: '~/zettelkasten'
|
||||||
|
|
||||||
|
*telekasten.settings.take_over_my_home*
|
||||||
|
take_over_my_home: ~
|
||||||
|
If set to `true`, telekasten.nvim will take over your home. Any notes
|
||||||
|
from the configured `home` directory will receive a `set`
|
||||||
|
`filetype=telekasten`, no matter if opened by telekasten or another
|
||||||
|
way.
|
||||||
|
|
||||||
|
Default: `true`
|
||||||
|
|
||||||
*telekasten.settings.daily*
|
*telekasten.settings.daily*
|
||||||
daily: ~
|
daily: ~
|
||||||
Path to your daily notes, to separate them from 'normal' notes.
|
Path to your daily notes, to separate them from 'normal' notes.
|
||||||
|
|||||||
@@ -25,6 +25,10 @@ local M = {}
|
|||||||
|
|
||||||
M.Cfg = {
|
M.Cfg = {
|
||||||
home = home,
|
home = home,
|
||||||
|
|
||||||
|
-- if true, telekasten will be enabled when opening a note within the configured home
|
||||||
|
take_over_my_home = true,
|
||||||
|
|
||||||
dailies = home .. "/" .. "daily",
|
dailies = home .. "/" .. "daily",
|
||||||
weeklies = home .. "/" .. "weekly",
|
weeklies = home .. "/" .. "weekly",
|
||||||
templates = home .. "/" .. "templates",
|
templates = home .. "/" .. "templates",
|
||||||
@@ -1591,6 +1595,10 @@ local function Setup(cfg)
|
|||||||
-- setting the syntax moved into plugin/telekasten.vim
|
-- setting the syntax moved into plugin/telekasten.vim
|
||||||
-- and does not work
|
-- and does not work
|
||||||
|
|
||||||
|
if M.Cfg.take_over_my_home == true then
|
||||||
|
vim.cmd('au BufEnter ' .. M.Cfg.home .. '/*' .. M.Cfg.extension .. ' set ft=telekasten')
|
||||||
|
end
|
||||||
|
|
||||||
if debug then
|
if debug then
|
||||||
print("Resulting config:")
|
print("Resulting config:")
|
||||||
print("-----------------")
|
print("-----------------")
|
||||||
|
|||||||
Reference in New Issue
Block a user