renerocksai / telekasten.nvim Goto Github PK
View Code? Open in Web Editor NEWA Neovim (lua) plugin for working with a markdown zettelkasten / wiki and mixing it with a journal, based on telescope.nvim
License: MIT License
A Neovim (lua) plugin for working with a markdown zettelkasten / wiki and mixing it with a journal, based on telescope.nvim
License: MIT License
I just finished a complete rework of the documentation. You can see it on the wiki of my fork.
This rework splits the README.md in smaller, more digestible chuncks of information. Cross links have been added for simpler navigation and a custom sidebar was made as well. Tables were the subject of a major overhaul to improve their readability and images were resized or placed in tables whenever possible to better incorporate them in the documentation.
Most of the information previously present in the README is still there, the style has been improved a bit and some repetitions were removed.
Most additions concern snippets in lua (for mappings), alternative package managers, details on prerequisites, list of options for lua functions, etc.
To merge here, you need to
Hi, thank you for this great plugin!
I have a rather large zettelkasten with one level of subirectories (I know, it is not the standard approach to ZK). I have an issue when I paste a link, as only the filename is pasted. Therefore I can not follow-through the link.
Would it be possible to have some modifiers when pasting a link that allow to paste a relative path instead?
Before stumbling on your really feature-rich extension, I made my own very simplistic telescope plugin. I made it so the link could be formatted in different ways upon paste to circumvent this issue (maybe there could even be an option to always paste links a certain way).
Please confirm
Describe the bug
When I have a checklist which include a link, the link doesn't follow.
To Reproduce
For example.
- [ ] Do a thing on ticket [123](https://github.com)
Then put the cursor on 123
and use the follow_link
command.
Expected behavior
The link is followed when the issue is on a todo item.
Operating system (please complete the following information):
Please confirm
Describe the bug
When using a header link, depending on the cursor position, the output of follow_link
is not the same.
#
This is true for headers or bloc-ids links.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Picker output should be the same no matter the position of the cursor.
Operating system (please complete the following information):
Please confirm
Is your feature request related to a problem? Please describe.
No. More an extension of the nice functionality in telekasten for linking.
Describe the solution you'd like
I would like Taskpaper plain-text todo formats (I am working on enhancing the plugin for this in nvim) to be able to use telekasten links of the [[something]]
variety in task and project descriptions.
The idea being here that you would then be able to check backlinks on [[something]]
and see all Taskpaper tasks or projects related to a particular person or thing (in theory).
Example
Coding:
Lua:
- Remember to speak to [[renerocksai]] about supporting taskpaper in telekasten.
*What is required to make this work with both tasks and notes*
GoLang:
- Update [[harsh]] to Go 1.18 and release via goreleaser @due(2022-04-08)
Describe alternatives you've considered
I've thought of changing the taskpaper format in some fundamental way to support this kind of linked "roam" functionality, but it would be soooooo much nicer if it were easily baked into telekasten. I just need to figure out how to work in conjunction to make this work. Also, makes tk a much more robust plain-text for your life solution if you have notes and todos in plain-text all usable and linked.
Additional context
https://support.omnigroup.com/omnifocus-taskpaper-reference/
https://github.com/jessegrosjean/birch-outline
Yesterday was last year, and today is a new year, but we are in the same week : a classic problem to handle 🤔
Since the beginning of the week, goto thisweek
opens the 2021-W52
file, but today (first January 2022), it goes to 2022-W52
which stands for week including 12/26/2022 to 01/01/2023 (52nd week of year 2022).
Note that only the «week year number» part is affected : the daily recap of the week have good dates.
The workaround is simple : just wait tomorrow to copy/paste the content, next year, the overlapping is just one day and for 2024 there is no overlap, so the urgency is very low, but, hey, don't we aim perfection ? 🥇
Thanx for this great tool, coming from a markdown vimwiki + custom daily note system, the transition is painless and my power-user level goes +100 👍
Would be nice to have a function that searched for all notes that have a link to the presently opened note and presented it in Telescope.
I would prefer if Telekasten didn’t automatically set files it creates to have filetype telekasten
. This messes with my custom markdown treesitter implementation. Can it be made optional please?
Please confirm
Describe the bug
Fresh installion of the plugin, nothing customized at all.
Running on macOs, but besides that everthing is as recommended.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The list of files that links to the current file should appear
Screenshots
Operating system (please complete the following information):
Please confirm
Describe the bug
When I attempt to open a note while in a directory that isn't ~/zettelkasten
using one of the commands from the panel, it will create a new file in my current working directory named "c".
To Reproduce
Steps to reproduce the behavior:
<leader>zf
or <leader>zg
are what I first used to replicate the problem)Expected behavior
I expected the file that I selected in my zettelkasten to open.
Screenshots
I am on my phone at work at the moment, but when I get home I will add screenshots of what it is doing
Operating system (please complete the following information):
Additional context
This problem occurs even if I use an init.vim with only the plugins required for this one (the minimum init file you can create and still have this plugin work). Again, at work so I'll post it here when I get the chance tonight.
Please confirm
Is your feature request related to a problem? Please describe.
Every Sunday I write a weekly note. It sometimes happens that I forget to write the note on Sunday, so I write it on Monday instead. Or on Tuesday.. This often creates an entry for the wrong week or tries to append to an existing weekly entry.
Describe the solution you'd like
Add the day of the week to the weekly note string. 2021-W46-Monday.md
or 2021-11-21-W46.md
or 2021-11-21-Weekly-W46-Monday.md
.
This gives me the context that I wrote multiple notes that week. This would also allow me to merge the daily, weekly (and monthly and yearly) journal into the same folder. See my old system:
2021-12-31-Friday.md 2022-02-15-Tuesday.md
2022-01-01-Jahresrückblick-2022.md 2022-02-16-Wednesday.md
2022-01-01-Monatsrückblick-January-2022.md 2022-02-17-Thursday.md
2022-01-01-Saturday.md 2022-02-18-Friday.md
2022-01-01-Wochenrundschau-W52-2022.md 2022-02-19-Saturday.md
Describe alternatives you've considered
Please confirm
Tell us about what's bothering you...
Probably a simple question but a little stumped after a bit of thrashing on this a while.
I am attempting to modify the telekasten filetype markdown syntax to be different than the default (have already modified links and highlights as per the notes), however, I am a bit stumped as to how the syntax styles are referred to by name in TK in order to modify the markdown (I do see that run! syntax/markdown.vim
s where they should live... ).
So, mostly this is changing the h1 and h2 headings at the moment, though sure I'll need a few others.
I'm addiitonally wanting to modify the syntax slightly so links in headings get coloured as to the TK Hi for the links rather than the default for the markdown headers.
(also, apologize if this question is obvious to people with more nvim experience, but googling did not help me and some valiant attempts at markdown.vim from looking at other colorschemes and plugins did not either... :-/ If there is a RTFM link somewhere, also happy to take a look at that if there is an obvious one.).
I tried setting command_palette_theme = "dropdown"
, but it does not have the same layout as yours (see below)
I guess the problem comes from my telescope config, which has a prompt_position=bottom
as default (which I like more for "normal" telescope popup)
layout_config = {
width = 0.75,
preview_cutoff = 120,
prompt_position = "bottom",
horizontal = {
mirror = false,
preview_width = 0.5,
},
vertical = {
mirror = false,
},
},
Maybe you need to set explicitly the layout_config
for the command panel to ensure it looks as expected.
BTW, in readme you mention multiple times "popup" theme, but in the config example you say "dropdown". In the end it does not matter as this theme is the fallback one in the config, but it could be nice to have a single name for it.
Adding stuff to the wiki according to this method (see #75 (reply in thread)).
As the method says,
To merge, you need to
cd
into itgit pull [email protected]:lambtho12/telekasten.nvim.wiki.git
This issue only serves to notify you that new changes have been added to (my fork of) the wiki and need to be pulled.
Please confirm
Is your feature request related to a problem? Please describe.
When calling goto_today()
, I always want to go to the markdown file of my note. Currently, I have to press enter in the telescope prompt. I would like to skip the telescope prompt altogether.
Describe the solution you'd like
Jump straight to the file instead of opening the telescope prompt.
Describe alternatives you've considered
I tried coming up with a mapping like
"<cmd>lua require('telekasten').goto_today()<CR><cmd>lua require('telescope.actions.set').select()<CR>"
but without success.
Additional context
It could be a boolean option like jump_if_exists
, where if true you get the telescope prompt if today's note does not exist yet, and it jumps to the file if it exists already.
As proven in #65 , people (me) tend to forget some trivial stuff from time to time, such as adding documentation for their feature.
I think it would be good to have a template (at least for PR) with a checklist to ensure changes of good quality. Such checks would ensure that README
and doc/telekasten.txt
were updated if necessary, that the code was styled with sylua following the config provided, etc.
A very complete template that I like is the one from home-assistant, maybe we could draw inspiration from that...
Please confirm
Describe the bug
It looks to me like the img/
directory gets created from where vim was launched, not the notes path.
To Reproduce
Steps to reproduce the behavior:
img
directory.Expected behavior
The directory should get created at the base of the notes structure, not the cwd of where vim was launched.
Operating system (please complete the following information):
As there are two possibilities to create notes (new_note()
and new_templated_note()
), it should be possible to create new notes without having a template set up.
Currently, if new_note()
is called without an actual template in place, telekasten throws an error as it can not find a template. This is because it defaults to create a templated note when the file does not exist.
https://github.com/renerocksai/telekasten.nvim/blob/a6262253990dcaa08a5b4d8b60e7c244ed86a43f/lua/telekasten.lua#L766-L769
In my opinion, new_note()
should create a blank note, while new_tempalted_note()
should create one from the template.
Please confirm
Describe the bug
telekasten is looking for daily folder in Home/Home/daily instead of Home/daily
To Reproduce
Steps to reproduce the behavior:
Start nvim
Require Telekasten setup using example in README only changing home directory:
local home = '/Users/[user]/zettelkasten'
Run Telekasten new_note or search_notes
Telekasten says daily directory does not exist and offers to make it in wrong location (see screenshot).
Expected behavior
Telekasten detects existing daily directory or offers to create it in correct location
Operating system (please complete the following information):
Please confirm
Is your feature request related to a problem? Please describe.
It would be great to have the ability to switch between notebooks, for example, Personal and Work-related.
Describe the solution you'd like
It would be several tables for setup as an option and some selection in the Telescope.
Please confirm
Describe the bug
I just installed today using vim-plug
.
I have added the color configs into my init but I do not see them when I open my daily note and add a tag, link or highlight.
However, running :so $VIMRUNTIME/syntax/hitest.vim
shows the colors as expected (right side is a daily note I made with the plugin):
echo &filetype
when in my daily note file returns telekasten
as well.
Seems like everything should be in place but my tags and links don't show anything. Any help or even ideas on what I might look at to figure it out would be much appreciated.
I also tried adding the hi
commands into a file and :source
-ing it as noted here: #54 (comment)
I also tried adding it to the end of the vim-colorschemes color file for the theme I'm using, then ran that theme to no effect. I tried without any colorscheme called to no effect as well.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Tags, highlights, links, etc appear based on the hi
setting for their color group.
Screenshots
Posted above.
Operating system (please complete the following information):
Additional context
This looks awesome if I can get this worked out I'm really excited to try it out for a while.
I was trying out telekasten and found out that when pasting image from clipboard it doesn't save it into subfolder (in my case "img").
I tried to find what could cause this and found out that telekasten doesn't update the pngpath
variable if there is image_subdir
set in the config.
It seems that configuring the function imgFromClipboard()
fixes this issue:
if M.Cfg.image_subdir then
relpath = M.Cfg.image_subdir .. "/" .. pngname
pngpath = M.Cfg.home .. "/" .. M.Cfg.image_subdir
end
If the journal is not a subdirectory of the home zettelkasten, it is not possible to use follow_link() to open a link to a daily/weekly note, as follow_link() looks for files in the ZK home directory.
A new picker should therefore be created to open journal entries. Note that, as the filename format of the journal entries is hardcoded, a single picker could be implemented. The picker would parse the link and determine whether it has to look inside the dailies or weeklies directory.
As discussed somewhere else (#44 (comment)), I have my journal notes in an encrypted directory that I need to mount before accessing it. Obviously, I forget to mount it 50% of the time. In that case, Telekasten just throws a handful of errors when I want to create a daily note.
We should add a test before to look if the directory exists or not. If not, then ask the user if it should be created or if the operation should be cancelled altogether.
I have not tested other cases, but I suppose similar errors may be possible if the template folders are not where they are expected.
Please confirm
Describe the bug
When I rename file I get an error and have 2 files: old and new with new name
To Reproduce
Steps to reproduce the behavior:
E5108: Error executing lua ...cal/share/nvimvimplug/telekasten.nvim/lua/telekasten.lua:
1652: Vim(bdelete):E94: No matching buffer for Fromm.md
stack traceback:
[C]: in function 'cmd'
...cal/share/nvimvimplug/telekasten.nvim/lua/telekasten.lua:1652: in function '
rename_note'
[string ":lua"]:1: in main chunk
Expected behavior
A clear and concise description of what you expected to happen.
Operating system (please complete the following information):
Additional context
Add any other context about the problem here.
In my document, let's say I have [[superinteresting_stuff]] and use the find_file()
command while this file does not exist in my computer.
As the file does not exist, find_file() will create it first and suggest it in telescope. Now if in telescope I see an other file which already exist and is a better fit for my need, I will likely open this one and never use the newly created superinteresting_stuff.md
, that will remain blank. This situation also happens if I have a typo in the link I try to open. E.g. [[my fil]] instead of [[my file]]; that would create a useless file as I would pick the proper one in telescope as well. This also happens if I forget that the file I try to reach is in a subdir: [[thisfile]]
instead of [[subdir/thisfile]]
would create thisfile
in the current directory even though I will select the proper file in the telekasten prompt.
In that case, I think telekasten should detect that the file was not opened and remove it when an other file is selected (or when the telescope prompt is closed).
Hi,
First off, awesome project! Pretty stocked to get this working right now. I have almost lua experience other than my nvim config so struggling to debug this. Hopefully this will help you reproduce it?
I'm using neovim 0.5.1 on archlinux. I have wiped out my existing neovim config and have only the following in my init.lua right now.
return require('packer').startup(function()
-- Packer can manage itself
use 'wbthomason/packer.nvim'
use {
'nvim-telescope/telescope.nvim',
requires = { {'nvim-lua/plenary.nvim'} }
}
use 'renerocksai/telekasten.nvim'
use 'renerocksai/calendar-vim'
end)
I ran :PackerUp
to install the plugins then restarted neovim. I think all other commands I tested work great.
Calling :lua require("telekasten").new_note()
gives the following error though.
E5108: Error executing lua ...ite/pack/packer/start/telekasten.nvim/lua/telekasten.lua:463: attempt to index field 'ui' (a nil value)
Output from debug = true
Setup() setting `dailies_create_nonexisting` -> `true`
Setup() setting `dailies` -> `/home/gregf/zettelkasten/daily`
Setup() setting `template_new_daily` -> `/home/gregf/zettelkasten/templates/daily.md`
Setup() setting `template_new_note` -> `/home/gregf/zettelkasten/templates/new_note.md`
Setup() setting `follow_creates_nonexisting` -> `true`
Setup() setting `templates` -> `/home/gregf/zettelkasten/templates`
Setup() setting `weeklies_create_nonexisting` -> `true`
Setup() setting `extension` -> `.md`
Setup() setting `image_subdir` -> `img`
Setup() setting `template_new_weekly` -> `/home/gregf/zettelkasten/templates/weekly.md`
Setup() setting `home` -> `/home/gregf/zettelkasten`
Setup() setting `debug` -> `true`
Setup() setting `image_link_style` -> `markdown`
Setup() setting `plug_into_calendar` -> `true`
Setup() setting `weeklies` -> `/home/gregf/zettelkasten/weekly`
Resulting config:
-----------------
{
calendar_opts = {
calendar_mark = "left-fit",
calendar_monday = 1,
weeknm = 4
},
dailies = "/home/gregf/zettelkasten/daily",
dailies_create_nonexisting = true,
debug = true,
extension = ".md",
find_command = { "rg", "--files", "--sortr", "created" },
follow_creates_nonexisting = true,
home = "/home/gregf/zettelkasten",
image_link_style = "markdown",
image_subdir = "img",
plug_into_calendar = true,
template_new_daily = "/home/gregf/zettelkasten/templates/daily.md",
template_new_note = "/home/gregf/zettelkasten/templates/new_note.md",
template_new_weekly = "/home/gregf/zettelkasten/templates/weekly.md",
templates = "/home/gregf/zettelkasten/templates",
weeklies = "/home/gregf/zettelkasten/weekly",
weeklies_create_nonexisting = true
}
Thanks!
EDIT I was able to reproduce this on a clean vm running void linux as well. Same version of neovim.
Please confirm
Describe the bug
A clear and concise description of what the bug is.
E5108: Error executing lua .../site/pack/packer/start/plenary.nvim/lua/plenary/job.lua:493: 'rg --vimgrep -o (^|\s)tags:\s*\[([a-zA-Z]+[a-zA-Z0-9/\-_]*(,\s)*)*] -- /home/zach
/notes' was unable to complete in 5000 ms
stack traceback:
[C]: in function 'error'
.../site/pack/packer/start/plenary.nvim/lua/plenary/job.lua:493: in function 'wait'
.../site/pack/packer/start/plenary.nvim/lua/plenary/job.lua:447: in function 'sync'
...k/packer/start/telekasten.nvim/lua/taglinks/tagutils.lua:123: in function 'do_find_all_tags'
...ite/pack/packer/start/telekasten.nvim/lua/telekasten.lua:2391: in function 'selection'
...ite/pack/packer/start/telekasten.nvim/lua/telekasten.lua:2646: in function 'run_replace_or_original'
...packer/start/telescope.nvim/lua/telescope/actions/mt.lua:30: in function 'key_func'
...k/packer/start/telescope.nvim/lua/telescope/mappings.lua:236: in function 'execute_keymap'
[string ":lua"]:1: in main chunk
Second error.
Error executing luv callback:
...k/packer/start/telekasten.nvim/lua/taglinks/tagutils.lua:68: bad argument #1 to 'sub' (number expected, got nil)
stack traceback:
[C]: in function 'sub'
...k/packer/start/telekasten.nvim/lua/taglinks/tagutils.lua:68: in function 'yaml_to_tags'
...k/packer/start/telekasten.nvim/lua/taglinks/tagutils.lua:97: in function 'parse_entry'
...k/packer/start/telekasten.nvim/lua/taglinks/tagutils.lua:116: in function '_user_on_exit'
.../site/pack/packer/start/plenary.nvim/lua/plenary/job.lua:238: in function '_shutdown'
.../site/pack/packer/start/plenary.nvim/lua/plenary/job.lua:45: in function <.../site/pack/packer/start/plenary.nvim/lua/plenary/job.lua:36>
[C]: in function 'wait'
.../site/pack/packer/start/plenary.nvim/lua/plenary/job.lua:480: in function 'wait'
.../site/pack/packer/start/plenary.nvim/lua/plenary/job.lua:447: in function 'sync'
...k/packer/start/telekasten.nvim/lua/taglinks/tagutils.lua:123: in function 'do_find_all_tags'
...ite/pack/packer/start/telekasten.nvim/lua/telekasten.lua:2391: in function 'selection'
...ite/pack/packer/start/telekasten.nvim/lua/telekasten.lua:2646: in function 'run_replace_or_original'
...packer/start/telescope.nvim/lua/telescope/actions/mt.lua:30: in function 'key_func'
...k/packer/start/telescope.nvim/lua/telescope/mappings.lua:236: in function 'execute_keymap'
[string ":lua"]:1: in main chunk
To Reproduce
Steps to reproduce the behavior:
:Telekasten show_tags
Expected behavior
This hasn't worked for me, but I would expect to see something other than an error.
Operating system (please complete the following information):
Additional context
If I copy the rg
command mentioned in the error (quoting the regex), the command finishes.
Just setup telekasten following the readme but when I run :lua require("telekasten").new_note()
, it returns the following error:
E5108: Error executing lua ...ite/pack/packer/start/telekasten.nvim/lua/telekasten.lua:460: attempt to call field 'input' (a nil value)
What might I be missing?
Please confirm
Is your feature request related to a problem? Please describe.
I want to add a sort option to find_notes.
Describe the solution you'd like
require('telekasten').find_notes( {sort = { 'modified' }} )
sort options: title, created, modified
Additional context
In zk, sorting is implemented
https://github.com/mickael-menu/zk-nvim
After the latest commit (1bd06e5), the find_file
function is no longer working and returns the following error
E5108: Error executing lua ...ite/pack/packer/start/telekasten.nvim/lua/telekasten.lua:490: attempt to get length of local 'filename' (a nil value)
stack traceback:
...ite/pack/packer/start/telekasten.nvim/lua/telekasten.lua:490: in function 'follow_link'
[string ":lua"]:1: in main chunk
This is the case no matter what type of link I have (direct filename or some/dir/filename).
The error goes away when I put a #
after the filename, but then telescope does not return anything.
Moreover, tt seems that it only looks for the heading part and not the filename. So if I have multiple files that share the same heading (## Introduction
), following link [[file1#introduction]]
will output all files with a heading called # Introduction
and not the correct file at the correct place.
Please confirm
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
m
letterm
letter. For example try to rename file erich_fromm
to Erich Fromm
end get uncorrect name: Erich Fro
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
It doesn't use m
letter for name:
Operating system (please complete the following information):
Please confirm
Describe the bug
When writing tags with non ascii characters, the highlight don't work.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Tags are highlighted.
Screenshots
Operating system (please complete the following information):
Additional context
Using #tag
style, the highlight ends just before the char : #H
éritage
Please confirm
Describe the bug
Backlinks do not work well with blockID notation. Because the search for "Backlinks" contains \[\[search\]\]
. This does not allow for notation like `[[file#^withblock]] notation to become a result.
To Reproduce
Steps to reproduce the behavior:
Hello world!
^a-block-id
I would like to link [[hello#^a-block-id]]
backlink.md
use <cmd> lua require('telekasten').follow_link()<CR>
. This should send you to hello.md
at ^a-block-id
.<cmd> lua require('telekasten').show_backlinks()<CR>
, your results should be zero.\]\]
to see the backlink.Expected behavior
Step 4 should of resulted with at least backlink.md
Operating system (please complete the following information):
Additional context
Config as of writing this report is located here https://github.com/rwaltr/dotfiles/blob/2b058a3076c9897ded7238c1d7797ea388682782/home/dot_config/nvim/lua/rwaltr/telekasten.lua
Hello.
I am a big fan of telekasten.
Thank you for your great work.
I tried to use telekasten on windows 10 with nvim 0.6.1.
Link address is long when executing insert link command.
An error occurs when executing follow link command.
The configuration file I used is as follows.
syntax on
filetype on
let mapleader=" "
set nocompatible
call plug#begin('~/.vim/plugged')
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope.nvim'
Plug 'renerocksai/calendar-vim'
Plug 'renerocksai/telekasten.nvim'
call plug#end()
" ----- telekasten -----
lua << EOF
local home = vim.fn.expand("c:/schedule")
require('telekasten').setup({
home = home,
-- if true, telekasten will be enabled when opening a note within the configured home
take_over_my_home = true,
-- auto-set telekasten filetype: if false, the telekasten filetype will not be used
-- and thus the telekasten syntax will not be loaded either
auto_set_filetype = true,
dailies = home .. '/' .. 'daily',
weeklies = home .. '/' .. 'weekly',
templates = home .. '/' .. 'templates',
-- image subdir for pasting
-- subdir name
-- or nil if pasted images shouldn't go into a special subdir
image_subdir = "img",
-- markdown file extension
extension = ".md",
-- following a link to a non-existing note will create it
follow_creates_nonexisting = true,
dailies_create_nonexisting = true,
weeklies_create_nonexisting = true,
-- template for new notes (new_note, follow_link)
-- set to `nil` or do not specify if you do not want a template
template_new_note = home .. '/' .. 'templates/new_note.md',
-- template for newly created daily notes (goto_today)
-- set to `nil` or do not specify if you do not want a template
template_new_daily = home .. '/' .. 'templates/daily.md',
-- template for newly created weekly notes (goto_thisweek)
-- set to `nil` or do not specify if you do not want a template
template_new_weekly= home .. '/' .. 'templates/weekly.md',
-- image link style
-- wiki: ![[image name]]
-- markdown: ![](image_subdir/xxxxx.png)
image_link_style = "markdown",
-- integrate with calendar-vim
plug_into_calendar = true,
calendar_opts = {
-- calendar week display mode: 1 .. 'WK01', 2 .. 'WK 1', 3 .. 'KW01', 4 .. 'KW 1', 5 .. '1'
weeknm = 4,
-- use monday as first day of week: 1 .. true, 0 .. false
calendar_monday = 1,
calendar_diary = home .. '/diary',
-- calendar mark: where to put mark for marked days: 'left', 'right', 'left-fit'
calendar_mark = 'left-fit',
},
-- telescope actions behavior
close_after_yanking = false,
insert_after_inserting = true,
-- tag notation: '#tag', ':tag:', 'yaml-bare'
tag_notation = "#tag",
-- command palette theme: dropdown (window) or ivy (bottom panel)
command_palette_theme = "ivy",
-- tag list theme:
-- get_cursor: small tag list at cursor; ivy and dropdown like above
show_tags_theme = "ivy",
-- when linking to a note in subdir/, create a [[subdir/title]] link
-- instead of a [[title only]] link
subdirs_in_links = true,
-- template_handling
-- What to do when creating a new note via `new_note()` or `follow_link()`
-- to a non-existing note
-- - prefer_new_note: use `new_note` template
-- - smart: if day or week is detected in title, use daily / weekly templates (default)
-- - always_ask: always ask before creating a note
template_handling = "smart",
-- path handling:
-- this applies to:
-- - new_note()
-- - new_templated_note()
-- - follow_link() to non-existing note
--
-- it does NOT apply to:
-- - goto_today()
-- - goto_thisweek()
--
-- Valid options:
-- - smart: put daily-looking notes in daily, weekly-looking ones in weekly,
-- all other ones in home, except for notes/with/subdirs/in/title.
-- (default)
--
-- - prefer_home: put all notes in home except for goto_today(), goto_thisweek()
-- except for notes with subdirs/in/title.
--
-- - same_as_current: put all new notes in the dir of the current note if
-- present or else in home
-- except for notes/with/subdirs/in/title.
new_note_location = "smart",
})
EOF
Please confirm
Describe the bug
When I try try show tags I get code inside code blocks as a tag, such as #fff
inside .css
code block
To Reproduce
Steps to reproduce the behavior:
show tags
#...
patterns as a tag even if it is inside code blockOperating system (please complete the following information):
I think it's worth disabling this behavior by default or giving the opportunity to somehow regulate it
I have the same exact issue and outcome error as above but with tag_notation ="#tag". And if I remove the # from the regular expression in tagutils.lua line 4, the code runs. Seems to be choking on #. If I switch to ":tag:" and then write a tag... it works.
To Reproduce
Steps to reproduce the behavior:
Error executing luv callback:
...k/packer/start/telekasten.nvim/lua/taglinks/tagutils.lua:47: attempt to perform arithmetic on local 'endpos' (a nil value)
stack traceback:
...k/packer/start/telekasten.nvim/lua/taglinks/tagutils.lua:47: in function 'split'
...k/packer/start/telekasten.nvim/lua/taglinks/tagutils.lua:93: in function 'parse_entry'
...k/packer/start/telekasten.nvim/lua/taglinks/tagutils.lua:120: in function '_user_on_exit'
.../site/pack/packer/start/plenary.nvim/lua/plenary/job.lua:238: in function '_shutdown'
.../site/pack/packer/start/plenary.nvim/lua/plenary/job.lua:45: in function <.../site/pack/packer/start/plenary.nvim/lua/plenary/job.lua:36>
[C]: in function 'wait'
.../site/pack/packer/start/plenary.nvim/lua/plenary/job.lua:480: in function 'wait'
.../site/pack/packer/start/plenary.nvim/lua/plenary/job.lua:447: in function 'sync'
...k/packer/start/telekasten.nvim/lua/taglinks/tagutils.lua:131: in function 'do_find_all_tags'
...ite/pack/packer/start/telekasten.nvim/lua/telekasten.lua:2541: in function 'selection'
...ite/pack/packer/start/telekasten.nvim/lua/telekasten.lua:2816: in function 'panel'
[string ":lua"]:1: in main chunk
Operating system (please complete the following information):
Additional context
Add any other context about the problem here.
This Issue is slightly related: to #38 (comment) The general infos there also apply to this issue.
When inserting a new note with insert_link()
, I currently get a full path. For example(On MacOS):
[[/Users/USER/HOME/path/to/file/]]
That works, but in general absolute paths are not that great. For example when switching machines or using the Wiki on different machines.
Also here, I took Inspiration from Obsidian. I personally use only the Filename in the Wikilinks. For example [[Filename]]
. That means no path, no matter which subdirectory the file is in. This also currently works with the search features of Telekasten and is (I think) default in Obsidian and Foam I've used before.
Nevertheless an option like in Obsidian would be helpful for people that need relative/full paths:
I've not testet it on Linux, but I don't think it should be related to MacOS. Also probably a bit related to #12
Hello,
Thank you for all your work on this plug-in, I appreciate it!
This FR stems from my desire to reorganise my notes sometimes.
Occasionally I might come back to a note, and add something to it.
Then I might decide the note is really about something else it originally was and I might change the title.
Or I might grab notes that I think are related and stick them together in a directory.
In this case, the existing links to those files get broken.
I was wondering if there might be a relatively simple (or so I hope!) way of getting around this.
If every note gets an optional unique ID (for instance, date + time) in the yaml metadata, like so:
---
title: {{title}}
date: {{date}}
ID: 2022-01-15T19:14:33Z
---
Then links will be generated based of those ideas instead of the relative path of the file.
Should things get changed or shuffled around, the links should persist.
Thank you for considering this.
Sometimes I want to find an link a note whose title I do not know. In that case, I need to first do a search_notes() in order to find the appropriate note, then do the insert_note() with the correct title, or open the note and yank its name. Either case, this is a two-setp process which could be 1 step if I was able to paste the ID directly from a grep search.
This may actually be a really important feature for people that do not use title for their notes but just ID numbers, which is quite common in the ZK community I believe.
An other option (why not both?) is to implement telescope action mappings to the existing functions, so that pressing <C-CR>
for instance would always paste the link.
Please confirm
Is your feature request related to a problem? Please describe.
Some organizations use a goal-setting process called OKRs, where once a quarter you set some goals. It is now that time where I fill out mine and submit them up the chain, but in thinking about and using telekasten for the last few weeks, it occurs to me that much of this could be wrapped into this plugin if quartelry support were added.
Describe the solution you'd like
In the same way that we have a weekly template, and a weekly file, I think having a quarterly file and template would be pretty great. Template variables like {{thisquarter}}
or {{lastquarter}}
or some such could also be handy. A weekly template could have a link to this quarters goals to make it easier to refer back, etc.
Describe alternatives you've considered
Right now I'm using a tag to go back to a file that I know has what I want, which is just a weekly note.
Additional context
Quarters are not always aligned to the year, so having a way to tell when the quarter starts would be handy, but perhaps tricky to implement.
Please confirm
Describe the bug
NVChad custom plugins under lua and Packer appear to not be able to have variables working in config (or I'm doing something very wrong) via a local home = vim.fn.expand("~/custom_dir")
call preventing usage. Should this be set another way in the config = function()
under NVchad (the lua works fine in vanilla neovim as a lua << EOF ... EOF
directive.)?
Basically, I am unable to set a home directory. It works fine in vanilla neovim where I am using Plug. I have all other custom plugins working in NVChad under /lua/custom/
.
To Reproduce
I have the following block in my lua/custom/plugins/init.lua
- all other plugins in the block work fine (and plugin in installed).
Note: I am also unable to manually change the directory to home = "~/Documents/tk"
in the block and have it work either. Telekasten keeps asking if it can create the ~/zettelkasten
directory for me.
{
"renerocksai/telekasten.nvim",
after = "telescope.nvim",
config = function()
-- this is the line that's problematic, it seems...
local home = vim.fn.expand("~/Documents/tk")
require('telekasten').setup({
home = home, -- have also tried just setting this to the directories directly and removing local home above
take_over_my_home = true,
auto_set_filetype = true,
-- dir names for special notes (absolute path or subdir name)
dailies = home .. '/' .. 'dailies',
weeklies = home .. '/' .. 'weeklies',
templates = home .. '/' .. 'templates',
-- image (sub)dir for pasting
image_subdir = "img",
-- markdown file extension
extension = ".md",
-- following a link to a non-existing note will create it
follow_creates_nonexisting = true,
dailies_create_nonexisting = true,
weeklies_create_nonexisting = true,
-- template for new notes (new_note, follow_link)
template_new_note = home .. '/' .. 'templates/new_note.md',
template_new_daily = home .. '/' .. 'templates/daily.md',
template_new_weekly= home .. '/' .. 'templates/weekly.md',
-- image link style, wiki:v![[image name]], markdown: ![](image_subdir/xxxxx.png)
image_link_style = "markdown",
-- integrate with calendar-vim
plug_into_calendar = true,
calendar_opts = {
-- calendar week display mode: 1 .. 'WK01', 2 .. 'WK 1', 3 .. 'KW01', 4 .. 'KW 1', 5 .. '1'
weeknm = 2,
-- use monday as first day of week: 1 .. true, 0 .. false
calendar_monday = 4,
-- calendar mark: where to put mark for marked days: 'left', 'right', 'left-fit'
calendar_mark = 'left-fit',
},
-- telescope actions behavior
close_after_yanking = false,
insert_after_inserting = true,
-- tag notation: '#tag', ':tag:', 'yaml-bare'
tag_notation = "#tag",
command_palette_theme = "dropdown",
show_tags_theme = "dropdown",
subdirs_in_links = false,
template_handling = "smart",
new_note_location = "smart",
-- should all links be updated when a file is renamed
rename_update_links = true,
})
end,
}
Expected behavior
I would expect the telekasten plugin to pick up the home variable and incorporate it into the settings, so it can both find and create files for my zk system. Instead it keeps claiming no directory is configured/exists and offers to create ~/zettelkasten
.
(I should also point out I've removed the local home = vim.fn.expand("~/Documents/tk")
and simply replaced the home = home
with home = "~/Documents/tk"
and home = "/Users/me/Documents/tl"
but get the same error message.
Basically, how do you get variables inside a custom config block in NVChad?
Screenshots
nopes
Desktop (please complete the following information):
Additional context
Lua is a pretty new language to me, as is packer but happy to help try and resolve this issue. I also filed this with the NVChad repo but they pointed back at this most likely being an issue with telekasten (due to your note on setting the windows directory and vim.fn.expand
being a thing.
Another tool I'm using to read these notes operates on dates with RFC3339 formatting. It wold be handy to have such a template variable to use for this purpose.
Hi!
Absolutely amazing plugin. What I am missing in my neovim setup is the underlined links for [[LinkToNote]]. Though, in the readme it said that it should be underlined.
using NeoVIM v0.7.0-dev and gruvbox theme (morhetz/gruvbox).
Thanks
I'm using telekasten as wiki with subfolders to organize topics a bit.
When I'm in a file of a subfolder, say home/subfolder/file.md
and try to create a new link through insert_link()
new_note()
it creates it in the root home
.
Maybe one could do a setting like in Obsidian:
I think you addressed this a bit in #12 (comment) .
Currently I'm using wiki.vim
to create new notes in subfolders. Following a link there also creates it in the current directory like Obsidian/Foam/...
Anyway, great Plugin and refreshing approach with Telescope 👍
Please confirm
Is your feature request related to a problem? Please describe.
I'd like to be able to use ibhagwan/fzf-lua as the finder for telekasten.nvim, but it only seems to support Telescope.nvim
Describe the solution you'd like
Fzf-Lua integration into this plugin
Describe alternatives you've considered
Using Telescope, but I am already using Fzf-Lua for most things and I'd rather not load 2 big fuzzy finder plugins
Additional context
Currently, Fzf-Lua extensions support is not as good as telescope's See ibhagwan/fzf-lua/issues/57 for details
Also, I don't know how tightly integrated Telescope and Telekasten are integrated, so this may be a fairly difficult task.
Please confirm
Is your feature request related to a problem? Please describe.
I think it will be nice to allow the users to specify date format. For example, I prefer to have timestamp in this format: 20220217.
Describe alternatives you've considered
Or at least provide template for {{month}}, {{dayOfMonth}} so we can customize the date format ourselves.
Please confirm
Is your feature request related to a problem? Please describe.
When working with notes using telekasten, I need to remember exactly how I spelled all of my tags and notes
Describe the solution you'd like
LSP integration. The ability to auto complete tags and notes for linking
Describe alternatives you've considered
The built in insert_link
command works, but it would be nice to enter [[thi
and be able to suggest notes that start with thi
Additional context
Add any other context or screenshots about the feature request here.
Please confirm
Describe the bug
Updating telekasten.nvim with PackerSync
throws an error on pulling in the wiki submodule.
To Reproduce
Steps to reproduce the behavior:
packer.nvim
)PackerSync
✗ Failed to update renerocksai/telekasten.nvim
Errors:
Already up to date.
Cloning into '$HOME/.local/share/nvim/site/pack/packer/start/telekasten.nvim/wiki'...
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
fatal: clone of '[email protected]:renerocksai/telekasten.nvim.wiki.git' into submodule path '$HOME/.local/share/nvim/site/pack/packer/start/telekasten.nvim/wiki' failed
Failed to clone 'wiki'. Retry scheduled
Cloning into '$HOME/.local/share/nvim/site/pack/packer/start/telekasten.nvim/wiki'...
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
fatal: clone of '[email protected]:renerocksai/telekasten.nvim.wiki.git' into submodule path '$HOME/.local/share/nvim/site/pack/packer/start/telekasten.nvim/wiki' failed
Failed to clone 'wiki' a second time, aborting
fcfa869
Expected behavior
No errors on updating.
Operating system (please complete the following information):
Additional context
NVIM v0.7.0-dev+913-ge07a4b97f
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.