Created
August 24, 2021 23:32
-
-
Save GitMurf/2736fd66f17d7aa54dab825b454b9bd3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%* | |
const search = app.workspace.getLeavesOfType("search")[0]; | |
let thisFile = app.workspace.getActiveFile(); | |
search.view.setSortOrder("byCreatedTime"); | |
search.view.setCollapseAll(false); | |
search.view.setExtraContext(true); | |
let myString = thisFile.basename; | |
myString = myString.replace(/[-[\]{}()+?.,\\^$|#]/g, '\\$&'); | |
search.view.setQuery(`/\\[\\[${myString}(\\]\\]|\\|)/`); | |
app.workspace.revealLeaf(search); | |
%> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment