Skip to content
This repository has been archived by the owner on Feb 19, 2023. It is now read-only.

shortcut for placing ID inside brackets #33

Open
vod3 opened this issue Jul 15, 2021 · 1 comment
Open

shortcut for placing ID inside brackets #33

vod3 opened this issue Jul 15, 2021 · 1 comment

Comments

@vod3
Copy link

vod3 commented Jul 15, 2021

hi there,

I have a idea for easier linking between documents. instead of using 'gzZ', which is only placing the ID of the telescope result into vim, it would be nice to place them automaticly inside brackets, like so:
[[ DOCUMENT ID ]]

one way to achieve this could be a custom mapping, but my vim/lua scripting skills are near zero:

map(
      "i",
      "[[",
      "[[ <cmd> lua require 'neuron/telescope'.find_zettels {insert=true} <CR> ]] "
)

this command does not work properly, it adds the ID after the closing brackets, maybe someone could help out with this?
It would be a nice addition in the README

Thanks!

@SiasMey
Copy link

SiasMey commented Aug 4, 2021

Its real ugly, but I use this... VimL since im still using that for keybinds

inoremap [[]]lua require'neuron/telescope'.find_zettels {insert = true}

Maps Ctrl-l during insert mode to [[ID of selected note]]

So, basically, because they go async, I think the telescope mappings end up happening after other stuff.
In my case, I set up [[]] and then left arrow one past the middle, since te search insert for zettels inserts them 1 character past where the search starts.

Odly, the tag search does not act the same way.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants