Hello, I’m new having trouble with the linking feature.
I understand that in order to make a internal link from text, you just select the words you wanna make a link with, then just press ‘[[’ or ‘]]’ and it will automatically make a link for it, after that you can just press → then use pipe to display text from.
My problem is that I tend to write the paragraph first, but sometimes I want to make a link on the go from the previous sentence, example:
Suppose I have a paper names “This is a paper”, and I want to link this note from a text where I selected the previous word and make a internal link, but the words I selected should be the display text then after that I specify the note/header I’m linking which is “This is a paper”, It’s seems possible at first but when I try to do it backwards then pipe, its inconsistent.
Also I’m searching a quicker way to do it, bassically what I close in brackets first should be the display text, then it should give me the option to link a note after without pressing arrow keys every time. Also the pipe symbol is really weird in my keyboard, I have to press like “Alt Gr” and ESC for it to work, it’s like 4 keys for a simple task.
If you know you’re going to make that link, why not just type the double brackets, start typing the link, select it and type the pipe symbol and add the alias?
To me that is a lot faster than selecting the text, and do various stuff to get it to be an internal link. In fact, even when I go back to add a link I often just erase the text and do as described above.
If i understood your case correctly, usually I do it on of those 3 ways:
just open bracket [[ and start writing ‘paper’ (like @holroy mentioned in prev comment)
selecting word like you and than backspacing list letter inside, it will make it ‘pape’ and start searching. works instead of that pipe trick you trying to do
pressing cmd+shift+f to call global search and typing ‘paper’ there, it will search paper everywhere and then you could drag’n’drop exact note you need into text
Suppose I don’t know that I’m planning on making that link at first, I’m just typing a concept, then in the middle of the paragraph, I remember I have a note for that. I understand this is a really simple task you can do at the moment, but I wanna work with that flow as seems really natural for me.
Or in fact I’m just reading it again, doing a review, then I just select text and use that as display text for linking, not even modifying anything.
The problem with cmd+shift+f is that it still search the keywords I’m selecting, just asumme the selected text doesn’t have any keyword in common, and it’s just a display text doesn’t matter what, the workflow and steps are these:
I just select a random sentence typing/reviewing my text.
I press a shortcut then the sentence becomes the display text.
The file I’m trying to embed may or may not have anything related to the text I selected.
Example:
I have the note named:
ABOUT NOTE
I have the next text:
Hello this is a random sentence.
Then I proceed to select “random sentence”.
Hello this is a random sentence.
Then somehow random sentences becomes the display text, and I have the simple task to search for that note just like you would search any other note, then it links and becomes: [[ABOUT NOTE|random sentence.]]
Yeah that is what I’m doing so far, but maybe this could become a script somehow, or there is an actual keyboard shortcut/addon where this is suported just as a keyboard combination, in my keyboard is really hard to do that sequence naturally, and those are like 8 combinations with my keyboard lang.
Adding to this: The second options seems more reasonable, still would be amazing to have a shortcut for that in my case, that could happend just like “CTRL + Q” or anything I can bind it for.
Goto Settings > (Community plugins) Templater > Automatic jump to cursor, and enable it, if not done already. Continue down to the Template Hotkeys settings, and hit the Add new hotkey for template.
Locate your template, and hit the plus icon, and assign a hotkey to your newly create template command, i.e. cmd+opt+Z.
Now return to typing your documents…
How to use
Write your wonderful paragraph, and decide you want to link something. Select it, and hit Cmd+C to copy it to the clipboard
Hit your hotkey sequence, cmd+opt+Z
Autocomplete the link to the note, and hit enter, and continue typing
No pesky pipe character or arrow keys to type anymore. They’re automagically inserted!
Well this is an advance, just in case, if you could fix the next 2 things it would be amazing:
Is there a possibility that you dont need to copy it? like some sort of selected() method or something like that?.
When I do the bind, it actually works, but the cursor ends before the “[[” brackets, so I still have to do 2 right arrows, is there a chance for it to move exactly between “[” and “|”?
Okay I’m looking at templater documentation, I don’t think there is a possibility of doing that, or atleast I don’t understand how, for some reason obsidian decides to place the cursor before the “[[”, I made it a little bit better using a tp.file method which is selected, I don’t even need to copy it.
Still it doesn’t seem to work with “[[ ]]” because it automatically places the cursor before the link, it looks like a obsidian function, maybe it’s possible to work around it.
It uses the selected input I don’t even need to copy it. Also the problem with the two brackets fixed by itself don’t know why, maybe some internal spaghetti.
Oh, as I said “I don’t know…”. I’m glad you proved me wrong. That’s a neat little function, and as you might understand I’m still learning about what’s available in the various plugins and code library.
Your solution was really helpful and I appreciate it, didn’t know the existence of this cool addon, I found about obsidian not that long ago because I needed a lightweight text editor, but .md files are enough for my understanding.
Thanks you, I don’t know how to close this thread but I expect more people to find the same answer if they step on the same problem as me, or maybe I’m just weird for using a bind like that .