Giter VIP home page Giter VIP logo

telekasten.nvim's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

telekasten.nvim's Issues

[Wiki] Major wiki update

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

  1. Clone the original repo's wiki and cdinto it
  2. Pull my changes: git pull [email protected]:lambtho12/telekasten.nvim.wiki.git
  3. Push to master

Working with subdirectories

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).

[BUG] Following links doesn't appear to work if the link to be followed is a checklist item

Please confirm

  • [ x] I am running the latest version of this plugin

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):

  • OS: Linux

[BUG] Follow_link issue with headerlink

Please confirm

  • I am running the latest version of this plugin

Describe the bug
When using a header link, depending on the cursor position, the output of follow_link is not the same.

  1. If the cursor is on the filename, the picker works as expected
  2. If the cursor is on the header name or block id, the picker only looks for what goes after the #

This is true for headers or bloc-ids links.

To Reproduce
Steps to reproduce the behavior:

  1. Start nvim
  2. Place cursor on the header part of the link (or the block-id part)
  3. See error

Expected behavior
Picker output should be the same no matter the position of the cursor.

Operating system (please complete the following information):

  • OS: I use Arch (btw)

[FR] Support telekasten links for backlinking in taskpaper plain-text formatted documents

Please confirm

  • I am running the latest version of this plugin

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

Weekly note failed when week overlaps two years

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.

image

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 👍

Backlinks

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.

Make filetype telekasten optional

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?

[BUG] Weird behaviour while using backlinks

Please confirm

  • I am running the latest version of this plugin

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:

  1. Start nvim
  2. Go to a note that has backlinks
  3. Call the backlink function
  4. A weird path appears on the telescope searchbox instead of the filename correctly.

Expected behavior
The list of files that links to the current file should appear

Screenshots

Screen Shot 2022-02-21 at 23 11 13

Operating system (please complete the following information):

  • macOs

[BUG] Not opening files from telescope preview in folders outside of home in Windows

Please confirm

  • I am running the latest version of this plugin

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:

  1. Start nvim
  2. Go to a directory that isn't the home directory as listed in the config in init.vim
  3. Search for a file through one of the keyboard mappings or call a command (<leader>zf or <leader>zg are what I first used to replicate the problem)
  4. Select a Zettel that appears when searching in telescope.

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):

  • OS: Windows 10

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.

[FR] Weekly notes string should not be hardcoded

Please confirm

  • I am running the latest version of this plugin

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

Don't hardcode. Let the user choose.

Modifying the markdown syntax for telekasten files

Please confirm

  • I am running the latest version of this plugin

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.).

[Bug] Drodown panel display issue

I tried setting command_palette_theme = "dropdown", but it does not have the same layout as yours (see below)

Screenshot 2021-12-10 at 13 46 14.

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.

[Wiki additions]

Adding stuff to the wiki according to this method (see #75 (reply in thread)).

As the method says,

  1. I cloned the original repo's wiki
  2. I made some changes and pushed them on my fork of this remote's wiki (lambtho12/telekasten.nvim.wiki.git)

To merge, you need to

  1. Clone the original repo's wiki and cdinto it
  2. Pull my changes: git pull [email protected]:lambtho12/telekasten.nvim.wiki.git
  3. Push to master

This issue only serves to notify you that new changes have been added to (my fork of) the wiki and need to be pulled.

[FR] Option for `goto_today()` to jump straight to file

Please confirm

  • I am running the latest version of this plugin

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.

Add templates for issues, requests, PR, etc.

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...

[BUG] The offer to create the `img/` directory uses relative path

Please confirm

  • I am running the latest version of this plugin

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:

  1. Start nvim outside of the notes directory
  2. say yes to create the img directory.
  3. note that the new directory is outside of the notes path.

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):

  • OS: Linux

Templates should be optional

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.

[BUG] Home path duplicated on Windows

Please confirm

  • I am running the latest version of this plugin

Describe the bug
telekasten is looking for daily folder in Home/Home/daily instead of Home/daily
To Reproduce
Steps to reproduce the behavior:

  1. Start nvim

  2. Require Telekasten setup using example in README only changing home directory:
    local home = '/Users/[user]/zettelkasten'

  3. Run Telekasten new_note or search_notes

  4. 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

Screenshots
image

Operating system (please complete the following information):

  • OS: Windows 10

[FR] Several home directories

Please confirm

  • I am running the latest version of this plugin

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.

[BUG] Highlights not showing in file, but show in highlight test

Please confirm

  • I am running the latest version of this plugin

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.

image

However, running :so $VIMRUNTIME/syntax/hitest.vim shows the colors as expected (right side is a daily note I made with the plugin):

image

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):

  • Fedora 34
  • nvim 0.6.0
  • Alacritty & Terminator terminals were tested

Additional context
This looks awesome if I can get this worked out I'm really excited to try it out for a while.

When inserting image from clipboard telekasten doesn't save the image into subfolder.

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

Add follow_date() picker for journal entries

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.

Better handle cases where a file/directory is not present where it is expected

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.

FR : Open weekly note from Calendar view

A Feature Request to quickly open week notes :

When you press Enter on a day in the Calendar view, telekasten opens the corresponding daily note.

Why about having the same functionality to open the weekly note when selecting the week number ?

image

I think I'm going telekasten-adict 🥇

[BUG] Renaming a file keeps the old file and creates another file with a new name

Please confirm

  • I am running the latest version of this plugin

Describe the bug
When I rename file I get an error and have 2 files: old and new with new name
image
image

To Reproduce
Steps to reproduce the behavior:

  1. Start nvim
  2. Try to rename file
  3. Get an error and two files width old name and new name
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):

  • OS: Fedora 35

Additional context
Add any other context about the problem here.

Find_file() should only create the file if it is selected in telescope

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).

attempt to index field 'ui' (a nil value) when creating a new note.

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.

[BUG] show_tags doesn't finish

Please confirm

  • I am running the latest version of this plugin

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:

  1. Start nvim
  2. :Telekasten show_tags
  3. See error

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):

  • OS: Linux

Additional context

If I copy the rg command mentioned in the error (quoting the regex), the command finishes.

Unable to create new note

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?

[FR] Sort options for find_notes

Please confirm

  • I am running the latest version of this plugin

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

Find_file not working after 1bd06e5d3642970f7cde3c2edb01631603c0b67e

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.

[BUG] Doesn't update name correctly

Please confirm

  • I am running the latest version of this plugin

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Start nvim
  2. rename_note with the name that ends with m letter
  3. get new name without m 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
image
It doesn't use m letter for name:
image

Operating system (please complete the following information):

  • OS: Fedora 35

[BUG] Tag is not utf8 compliant

Please confirm

  • I am running the latest version of this plugin

Describe the bug
When writing tags with non ascii characters, the highlight don't work.

To Reproduce
Steps to reproduce the behavior:

  1. Start nvim
  2. Open a Telekasten note
  3. Type a tag with non ascii char, eg. :Héritage:
  4. See error : the tag is not highlighted.

Expected behavior
Tags are highlighted.

Screenshots

image

Operating system (please complete the following information):

  • OS: Debian Gnu/Linux, nvim 0.7.0
  • OS: Windows WSL2, nvim 0.7.0

Additional context
Using #tag style, the highlight ends just before the char : #Héritage

[BUG] Backlink search do not work well with Block IDs

Please confirm

  • I am running the latest version of this plugin.

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:

  1. Start nvim.
  2. create the following files.
  • hello.md
Hello world!
^a-block-id
  • backlink.md
I would like to link [[hello#^a-block-id]]
  1. In backlink.md use <cmd> lua require('telekasten').follow_link()<CR>. This should send you to hello.md at ^a-block-id.
  2. Attempt to use <cmd> lua require('telekasten').show_backlinks()<CR>, your results should be zero.
  3. you can remove \]\] to see the backlink.

Expected behavior
Step 4 should of resulted with at least backlink.md

Operating system (please complete the following information):

  • OS: Linux

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

It seems that telekasten is not working properly on windows.

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.
1

An error occurs when executing follow link command.
2

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

[BUG] `Show tags` consider code as a tag

Please confirm

  • I am running the latest version of this plugin

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:

  1. Start nvim
  2. run show tags
  3. we get all #... patterns as a tag even if it is inside code block

Screenshots
image
image
Uploading image.png…

Operating system (please complete the following information):

  • OS: Fedora 35

I think it's worth disabling this behavior by default or giving the opportunity to somehow regulate it

[BUG] same issue as 'show_tags doesn't finish' #68 but with #tag

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:

  1. Start nvim
  2. Telekasten show_tags
  3. See error:
  4. E5108: Error executing lua .../site/pack/packer/start/plenary.nvim/lua/plenary/job.lua:493: 'rg --vimgrep -o (^|\s|'|")#[a-zA-Z]+[a-zA-Z0-9/-_]* -- /home/dwlawren/obsidian' 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: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

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):

  • OS: WSL2 ubuntu 20.04

Additional context
Add any other context about the problem here.

Insert file name in Wikilink on `insert_link`

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:

image

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

FR: Unique IDs for notes

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.

Add an insert_note() that works with grep

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.

[FR] Quarterly file support

Please confirm

  • I am running the latest version of this plugin

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.

[BUG] Packer/NVChad issue with setting home directory for telekasten (not windows related)

Please confirm

  • I am running the latest version of this plugin

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):

  • OSX 12.13.1
  • kitty 0.25
  • neovim 0.6.1
  • all plugins PackerSync-ed and working cetp telekasten

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.

Links inside square brackets are not underlined

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

Support for subfolders insert new note

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:

image

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 👍

[FR] FZF-Lua Support

Please confirm

  • I am running the latest version of this plugin

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.

[FR] Custom Date Format

Please confirm

  • I am running the latest version of this plugin

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.

[FR] LSP Integration

Please confirm

  • I am running the latest version of this plugin

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.

[BUG] error pulling in `wiki` submodule with fresh install

Please confirm

  • I am running the latest version of this plugin

Describe the bug
Updating telekasten.nvim with PackerSync throws an error on pulling in the wiki submodule.

To Reproduce
Steps to reproduce the behavior:

  1. Install telekasten.nvim (in my case with packer.nvim)
  2. Start nvim
  3. Update packages with PackerSync
  4. See error below
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):

  • OS: Gentoo Linux

Additional context

NVIM v0.7.0-dev+913-ge07a4b97f
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.