I’m trying to link every time a document says the word God.
I tried VScode but they only support multi-cursor on a single file not multiple files so I can’t make a tag on all the documents. I’ve searched around and can’t find a select all link option.
This has been working alright for me, it gives you control over which links you want to add, though, meaning you still have to press enter for every note. It will however link everything if you just keep pressing enter.]
(?<![[)(?<!#)(?<!#\s)(?<!#\s\s)\bWord\b worked for me. Excluding the “#” from the word search so you don’t accidentally update file names with that word cause brackets aren’t supported in the title. Also added potential extra spaces between a word and the “#” character. Note for anyone attempting this that the free version Visual Studio Code runs on a javascript regex and other flavors of regex won’t work!!!
If you simply replace God with [[God]] throughout the vault using search and replace, it will break any links that contain the word God. I am not sure what the regex would be to disregard occurrences of a word within a link, but I remember a thread where someone had a solution. I haven’t tried the regex mentioned above. In the meantime, it may be best to be extra careful and use the search and replace, manually ignore the problem matches before committing the changes. Fortunately this process is easy in VSCode.
There really should be a better or faster way to do this natively. Like keyboard shortcuts for the linking pane or a way to “link all” when you select a file, or even a link all across the whole vault.
Yes, sadly. I don’t think search and replace was available for me on my free version. Maybe I wasn’t at the root directory when I was searching. Very wierd.
Yes, sorry you are right VS code’s free version does have this capability shared. But you cannot limit the search to only documents excluding the title’s also that contain the keyword to be replaced. Markdown won’t allow me to have brackets in the name, and I cannot find a way in the regex to avoid title and replace document only occurrences of the keyword.