Git Product home page Git Product logo

obsidian-raycast's Introduction

Obsidian for Raycast

This is a raycast extension with commands for the note taking and knowledge management app Obsidian. To use it, install the extension from the Raycast Store, open Raycast Search and type one of the following commands.

Overview

Search Note

This command allows for quick access to all of your notes. By default you can search notes by title. Enabeling content search in the commands preferences allows you to search for notes by their content and title. If there doesn't exist a note with the title you searched for you can create a new note with that title right from the command. Use the tag filter in the top right corner to filter notes based on their tags (both YAML frontmatter and inline tags).

Enabeling Show Detail and Show Metadata in the extensions preferences will show a sidebar view with the following information:

  • Note content
  • Character Count
  • Word Count
  • Reading Time
  • Creation Date
  • File Size
  • Note Path

Search Note Command

Search Note Command Tag Filter

Actions for Search Note command

It features several actions which you can trigger with these keyboard shortcuts (or search for them with cmd + k):

Open Note Actions: Depending on the primary action set in preferences, the keyboard shortcuts can be different.

  • enter will open the note in "Quick Look"
  • cmd + enter will open the note in Obsidian
  • Open in new Pane will open the note in a new pane in Obsidian (only for vaults with advanced-uri plugin)

Other Actions:

  • opt + enter will open the notes path in Finder
  • opt + e will let you edit the note (supports templates)
  • opt + d will let you delete the note
  • opt + a will let you append text to the note (supports templates)
  • opt + s will append selected text to the note (supports templates)
  • opt + c will copy the notes content to your clipboard
  • opt + t will copy the notes title to your clipboard
  • opt + v will paste the notes content to the app you used before raycast
  • opt + l will copy a markdown link for the note to your clipboard
  • opt + u will copy the obsidian URI for the note to your clipboard (see: Obsidian URI)
  • opt + p will bookmark a note
  • opt + p will "unbookmark" a bookmarked note
  • Reload Notes, will reload notes from the vault (useful if you have just created a new note)

The primary action (enter) can be changed in the extensions preferences.

Search Note Command actions

Search Note Command actions

Quick Look Action

The Quick Look actions will open your note in Raycast itself.

obsidian-5

Search Media

This command allows for quick access to all of the media (images, video, audio and PDFs) in your vaults. Use the type filter in the top right corner (cmd + p) to filter the media by its type / file extension.

Actions for Search Media command

It features several actions which you can trigger with these keyboard shortcuts (or search for them with cmd + k):

  • enter will open the file in Apples Preview app
  • cmd + enter will open the file in Obsidian

obsidian-10

Random Note

This command will open a random note of a previously selected vault in Quick Look where all actions from the Search Note command are available.

Open Vault

This command will show a list of all of your Obsidian vaults which you can open by pressing enter. Actions that you can trigger with a keyboard shortcut:

  • cmd + enter will open the vaults folder in the Finder app

Create Note

This command lets you create new notes on the fly by entering a name, optionally a path to a subfolder in your vault and some content. You can use the tag picker to add tags to the notes YAML frontmatter.

Both the note name and note content support these templates:

  • {date}
  • {time}
  • {year}
  • {month}
  • {week}
  • {day}
  • {hour}
  • {minute}
  • {second}
  • {millisecond}
  • {timestamp}, {zettelkastenID}
  • {clipboard}, {clip}
  • {\n}, {nl}, {newline}

But also the table of tokens defined in the luxon documentation (such as dd, MM, YYYY,...).

Create Note Command

Daily Note

This command will open the daily note from the selected vault. If a daily note doesn't exist it will create one and open it. It requires the community plugin Advanced Obsidian URI and the core plugin "Daily notes" to be installed and enabled.

Append to Daily Note

This command will append text to the daily note from the selected vault. If a daily note doesn't exist it will create one and open it. To append as efficiently as possible, the text is provided as a parameter to the command, so there's no form to fill out.

It requires the community plugin Advanced Obsidian URI and the core plugin "Daily notes" to be installed and enabled.

Bookmarked Notes

This command will open a list of your bookmarked notes. All actions and preferences from the Search Note command are available. Bookmarking or unbookmarking a note will reflect in Obsidians Bookmarked notes. Bookmarking a note in Obsidian will also reflect in Raycast.

Additional actions:

  • opt + r will reset all bookmarked notes for the selected vault

Bookmarked Notes Command

Obsidian Menu Bar Item

Use this command to add a menu bar item to the top of the screen (Obsidian icon). Clicking it will reveal a list of your vaults. You can view your bookmarked notes, perform actions on them or open a daily note.

Obsidian Menu Bar Item

Preferences

General settings

  • set path/paths to your preferred vault/vaults (comma separated). By default, vaults will be detected from ~/Library/Application Support/obsidian/obsidian.json, which contains all vaults that have been opened with Obsidian before.
  • exclude folders, files and paths so they dont show up in the search (comma separated). Files and Folders that were excluded in Obsidian itself will also be excluded here.
  • hide YAML frontmatter in "Quick Look" and copy/paste
  • hide wikilinks in "Quick Look" and copy/paste
  • hide LaTeX in "Quick Look" and copy/paste

Search Note

  • templates for append actions
  • show note content in detail view
  • show metadata about note in detail view
  • enable content search
  • select primary action (for enter)

Create Note

  • blank note, if enabled, will create a note without any content
  • open note on creation
  • default path where a new note will be created
  • default tag (will be selected by default in the tag picker)
  • list of tags to be suggested in the tag picker (comma separated)
  • default note name (if note name is empty)
  • default note content
  • fill form with default values
  • list of folders that will create actions for creating notes inside of the specified folders

Append to Daily Note

  • template for the appended text (e.g. could set to - [ ] to create a checklist item)
  • vault in which the Daily Note will be appended (if not set, you will be prompted to select a vault when the command is run)
  • heading in which the appended text will be placed (if not set, the text will be appended to the end of the note)
  • silent mode, if enabled, will not open the note if it is currently not opened in an Obsidian tab or pane (Obsidian has to be running)

Bookmarked Notes

  • templates for append actions
  • show note content in detail view
  • show metadata about note in detail view
  • enable content search
  • select primary action (for enter)

Random Note

  • templates for append actions
  • select primary action (for enter)

Search Media

  • exclude folders, files and paths so they don't show up in the search
  • select image size (small, medium, large)

Previous Developer / Maintainer

This extension was originally developed by Marc Julian Schwarz. As of 15th May 2023, Marc Julian is no longer maintaining this extension due to time constraints related to his university studies. This extension will now be further developed and maintained by Kevin Batdorf. "Thank you for taking over this extension and keeping it alive for the community." -Marc Julian

Blog posts:

Disclaimer

This project is not affiliated, associated, authorized, endorsed by, or in any way officially connected with Obsidian. The official Obsidian website can be found at https://obsidian.md. "Obsidian" as well as related names, marks, emblems and images are registered trademarks of their respective owners.

obsidian-raycast's People

Contributors

adamadamsmusic avatar iancanderson avatar karbassi avatar kevinbatdorf avatar marcjulianschwarz avatar mikejongbloet avatar ryota-murakami avatar

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

Watchers

 avatar  avatar  avatar  avatar

obsidian-raycast's Issues

Feature Request: Edit obsidian .mds from inside Raycast?!?!

Hey there.

I don't code and don't know if this is even possible, but...

If it is, then this would be amazing.

Imagine how cool being able to edit obsidian notes from inside Raycast would be!

I would pay for this. I've been dreaming about pop-up notes inside spotlight for years.

Thanks!

Rob.

P.S. Probably should of said this first: your extension is amazing. Thanks so much for making it.

[FR] Use YAML frontmatter for filtering/searching notes.

Proposed Addition

  • use keys from the YAML frontmatter to enhance searches (fuzzy search)
  • Related Issue: #1

Questions

  • should keys be read automatically or should there be a predefined list of keys that will be used for searching (e.g. title, subtitle, etc.)?
  • should keys be saved in the Note object?

Steps

  • function for reading YAML frontmatter keys already exists yamlPropertyForString(content, "title")
  • ...

feature: Configure primary action

It would be great if I could use enter instead of cmd + enter to open the note in Obsidian, as I'd never want to open it in Raycast. The Snippets extension seems to do this with 'primary action'

[Feature] Don't jump to note after append

It would be useful to have a toggle or an alternate shortcut for not going to a note after appending. I'm interested in using "Append to Daily Note" to throw random thoughts in my daily note without interrupting the flow, and not moving focus would help a lot with that.

[Feature Request] Search by tag

Suggested Addition

New command Search by Tag. Showing a list of all tags. Selecting one will show all notes tagged with it.

To-Dos

  • search tags in all notes (maybe performance issues?)

Search through .canvas?

It looks like the plugin ignores .canvas files in the search.

Hey, I could assist with the development, but I see there is a month-old PR. Would you happen to accept outside collaborators?

Feature request: Add Obsidian tags as searchable keywords

The Raycast List.Item allows for a string[] of keywords that are indexed for searching, which would allow for tags to be fuzzily-searchable in the Search Note command in addition to note titles.

https://developers.raycast.com/api-reference/user-interface/list#props-5

I'm currently aware of two different approaches for Obsidian tagging: in YAML front matter or else in the body with # hashtags, which might complicate this feature.

https://help.obsidian.md/How+to/Working+with+tags

[FR] Unify some of the preferences

Proposed Changes

  • unify "Excluded Folders"
  • unify "Search Content"
  • unify "Template for Append Action" and "Template for Append Selected Text Action"
  • unify "Remove Content" options

These preferences should be left independent:

  • show detail
  • show metadata
  • primary action

Use Case

  • Users won't have to fill in the preferences for each command (gets worse when more commands will be added).
  • Makes preferences more "visible"

[FR] support search markdown headings in the notes

It would be great if I can search headings in notes by prefixing the keyword with # char. for example:

  1. keyword #introduction to search introduction in headings of all notes.
  2. keyword markdown#introduction to search introduction heading in note with markdown in the title.

when use opening the searched note, heading parameter in https://vinzent03.github.io/obsidian-advanced-uri/actions/navigation can be used to open the note and navigate to the target heading.

Daily Note command not working with a vault

I have only two vaults. Both vaults are configured with the Daily Notes plugin and I also have the Advanced URI plugin installed. For some reason, the extension is telling me that the Daily Note plugin is not installed in one of my vaults when I invoke the Daily Note command.

image

Any clues?

Vault Not Found using Open in Obsidian

Search Note works great when I use Quick Look as my primary action. When I change that to Open in Obsidian, search still works, but opening the selected item takes me to Obsidian and displays an error message:

Vault not found
Unable to find a vault for the URL obsidian://open?path=%2Fusers%2Fmyusername%2FObsidian%2FVault%20Name%2Ftest%20file.md

Fallback Action

Thanks for this plugin. Just started using it -- and apologies if I'm missing something obvious. But is there a way to configure Obsidian note search to work as a fallback command in Raycast so that it would be available (along with Google search, etc.) to use on any text that is typed directly into the search bar?

Add "Append task"

Feature idea:

There are two 'quick capture' problems I'm trying to solve - quick capture a note and quick capture a task.

It would be amazing if it were possible to either specify two templates, or if I could set up a second quick capture command somehow.

Do you have any thoughts or guidance?

Thank you

[FR] Show list of headings in note action

A new action that works similarly to the "Copy Code Action" by showing a list of all headings in a note.
Selecting one of the headings will open the note right at that heading using the Advanced URI plugin.

This will be helpful when searching for specific parts of a long note.

Similar to #37.

Tag problems when creating a new note:

Hi @marcjulianschwarz

Thanks for this awesome project!

There are two problems I am facing with this extension when I want to create a new note:

  1. I have to set suggested tags in Raycast preference so I can add the tag for my new note. Is this the intended behaviour? I hope I can add any tag when I create a new note without setting anything before.

截圖 2023-01-07 下午4 46 00

  1. As stated above, when I use the tag I had set in Raycast preference, the tag format in my new note is like this:
Untitle
---
tags: ["js", "others"]
---

But I hope it can be like:

Untitle
#js #others

截圖 2023-01-07 下午4 47 35

[BUG] Inline tags on first line of note won't be recognized

Steps to reproduce

  1. Write inline tag on first line of note (e.g. #todo)
  2. Open Raycast Search and use the dropdown cmd + p to search for tags
  3. Tag #todo won't appear if there is no other file with that tag
  4. OR when selecting tag, note will not show up in the filtered list

What could be a fix?

  • Maybe the regex for inline tags is not working correctly

Support for appending to notes from Periodic Notes plugin

Love the Append to Daily Note plugin. It would be nice if this also supported the extended features from Periodic Notes plugin, at very least appending to Weekly/Monthly/Yearly Notes. This would really make Raycast a killer app for quick note taking...

Feature: Switch between vaults

Hey, trying this (and Raycast) out now, looks great! One limitation of this, is that you can only use one vault. However, I use multiple! Is there any chance this will support multiple vaults?

Can't seem to set the Path in preferences

I have no idea what I'm doing wrong but I can't get search to work.

But every time I try to search, I get "The path set in preferences doesn't exist Please set a valid path in preferences".

I've checked 10 different times and I've tried the root of a Vault, the parent directory of the Vaults, dereferenced all the symbolic links. Nothing works.

[FR] Add create option to search

I would love to use this extension with the Notational Velocity-style combined search/create action.

That is, results filter as you search, but at any time if you're not seeing the results you want, you can create a note with the contents of your search.

In terms of how this would work in Raycast, I would think just adding a cmd-K action for "Create new note…" in the search context, and then maybe when you search and have no results, you get a "create note" result so you can just hit return.

JS heap out of memory when using detail view

Hello, thanks for building this! Unfortunately, every time I attempt to search my vault, I can see a list of my notes for a split second, then I get an error. Message copied below. Thanks for any help!

Error: Worker terminated due to reaching memory limit: JS heap out of memory

__node_internal_captureLargerStackTrace:errors:464:5
NodeError:errors:371:5
Worker.[kOnExit]:worker:279:26
Worker..onexit:worker:201:20

Correct way to access Obsidian Vault on iCloud Drive?

Having difficulty using Obsidian extension with Vault on iCloud drive. Installed Obsidian via IOS and MACOS according to Obsidian instructions to use iCloud as sync mechanism. Obsidian works properly on both platforms, changes made via either sync properly to the other.

First time running Obsidian extension, no matter how I format the path to Vault, the "Something went wrong" error pops up. Have tried formatting the path to the iCloud Vault in various ways ( /Users/xxx/Library/Mobile Documents/iCloudmdobsidian/ ), etc.

Not sure if it's a formatting problem on my part or an issue accessing iCloud vaults

Search notes is very slow

Hello,

Thanks a lot for building this extension.

But I'm noticing a weird behaviour (I don't know if I have to change anything from my side).

When I search for a note, it takes a very long time to show up. Sometimes it keeps loading without showing anything.

Screen.Recording.2022-07-31.at.22.01.00.mov

Append to note formatting with {content}

Hello!

Love this - thanks so much for creating and publishing your Raycast commands.

I saw in the tooltip the variable {content} which I've tried to use in my append template as I want the content to be wrapped by square brackets:
* <small>**[{hour}:{minute}]**</small>[💭 Thought:: {content}]

When I capture a note it's capturing like this:
image

Essentially the variable isn't being replaced and the contents are instead being appended to the end, rather than being wrapped in the square bracket.

Mike

Directory containing multiple vaults

Is it possible to point the prefs to a directory that contains multiple vaults ?

Assume that every directory underneath the one specified is an individual vault ?

Thanks

[FR] Command (or action) to quickly append text to the current daily note

To Do

  • should this be yet another command that can only be used together with the Advanced URI plugin or rather restructure the existing daily note command to add actions?
    • reduce number of commands that not every user can use
    • adds possibility for more daily note actions
    • Con: adds one extra step to interact with daily notes

Feature Request from @carlosflorencio on Raycast Slack.

Can template be used in the default note name?

Hi, thanks for this amazing extension! I downloaded Raycast just for your extension 🤣

I wonder if I can use some basic templates, like {{time}}, in the default note name, prefix for append, etc.? The use case is that I use this extension to quick capture things that I don't want to spend time naming them, yet I still want to log the time.

[FR] Append to Note Command

Add command that allows to directly append content to a note (from selection).

Similar to Lazy.

Preferences:

  • Append template
  • Default Note (if not specified user will be able to select from all notes)

Should support:

  • text
  • url
  • image
  • files? (local file link)

Silent Mode not working

Hey!

'Silent mode' doesn't seem to be working for me when using "Append to Daily Note". Even if I shut Obsidian down completely it still opens the application and note.

A bug perhaps?

[FR] Custom URI commands

Using advanced URI makes tons of sense, but it feels like we're missing a lot of its power! It would be great to be able to configure custom URI commands.

For example, if I use Periodic Notes for my daily notes instead of the core daily notes plugin, it would be nice to be able to call the proper command from raycast.

I don't think that adding support for every single command/plugin is particularly sustainable, but allowing custom commands might be. 😄

Feature: Append to search note

Requirement

  • User can append new content in an existing note.

Scenario

I know there is a todo list in my vault like this

# Todos
- [ ] take out the trash

When I'm working on something and an idea pops into my mind. I have to wash the dish for my Mom. So I want to add a checkbox in the above note like - [ ] wash the dish and no need to interrupt current work (switch to Obsidian...etc)

Determine existing Vault locations from obsidian.json

Obsidian creates a json file that has the location of every vault that has been opened with Obsidian, with the following content:

{
  "vaults": {
    "531c5e4cb86fe7f1": {
      "path": "/Users/<user>/Development/cuddlecake/Notes",
      "ts": 1634469919450,
      "open": true
    }
  }
}

With path being the interesting part, of course.

On my machine, that file is located in:

/Users/<user>/Library/Application Support/obsidian/obsidian.json

And I believe it could be leveraged at the very least for configuration, or serve as the standard source for vault locations:

function loadVaults(): Promise<Vault[]> {
  return readFile(path.resolve(`${homedir()}/Library/Application Support/obsidian/obsidian.json`), "utf8").then(
    (data) => {
      const parsed = JSON.parse(data);
      return Object.values(parsed.vaults);
    }
  );
}

I am not 100% sure whether this file exists on every system in the same location, but it could also be a best-effort thing that could be ignored if the file is not found.

At least this is the way I implemented it in my personal extension, and I do recognize that most people do not "spam vaults" like I do 😄 But if you're interested, this could at least make onboarding for this extension a bit smoother, and for my use case, a setting to track vaults using this file would be great.

If you give me the go ahead and a quick outline of what you'd like to see, I could also try to implement this.

Command palette

Can you show the command palette with all its commands within raycast ?

Feature request: Create a new note in Inbox using template

Would be great to have a command to create a new note in Inbox that uses the template assigned to new notes in Inbox via the templater plugin (eg I have a template for any new note in Inbox that creates a prefix for the filename with today's date in almost-Zettel format). Thx for this plugin!

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.