Logo

dev-resources.site

for different kinds of informations.

Create a New Note for Your Obsidian Vault from the Terminal

Published at
10/25/2024
Categories
obsidian
neovim
terminal
productivity
Author
gokayburuc
Author
10 person written this
gokayburuc
open
Create a New Note for Your Obsidian Vault from the Terminal

Hereโ€™s a grammar-checked and slightly expanded version of your text with added clarity:


New Note From Terminal

Create a New Note in Your Obsidian Vault Directly From the Terminal

#obsidian #terminal #vault

To set this up, follow the steps below:

  1. Open your .zshrc file (if you are using bash, open .bashrc instead) to add the following configuration:
nn() {
  # Navigate to the programming directory
  # WARN: Replace <vaultpath> with the actual path to your vault
  cd "$HOME/Documents/vaults/programming/00-inbox/" || return

  # Get the current date
  current_date=$(date +"%Y-%m-%d")

  # Create the filename using the current date and user input
  filename="${current_date}_$1.md"

  # Create the new note file
  touch "$filename"

  # FIXME: Enhance this function to add Markdown properties like tags, date, ID, or classes

  # Open the newly created file with Neovim
  nvim "$filename"
}
Enter fullscreen mode Exit fullscreen mode

What This Script Does

  • Automates Note Creation: This function allows you to create new notes in a specified "inbox" folder within your Obsidian vault.
  • Date Prefix: It automatically prefixes the filename with the current date in the YYYY-MM-DD format for better organization.
  • Custom Filenames: You can specify the rest of the filename as a parameter when calling the function.
  • Opens in Neovim: After creating the file, it opens it in Neovim for immediate editing.

How to Use It

  1. Add the above function to your .zshrc or .bashrc file and save it.
  2. Reload your shell configuration with:
   source ~/.zshrc  # For zsh users
   source ~/.bashrc  # For bash users
Enter fullscreen mode Exit fullscreen mode
  1. Create a new note by running:
   nn "note-title"
Enter fullscreen mode Exit fullscreen mode

This will create a file named YYYY-MM-DD_note-title.md in your designated folder.

Next Steps

  • Update the script to include Markdown properties like:
    • Tags (#example)
    • Date metadata (date: YYYY-MM-DD)
    • Unique identifiers or custom front matter
  • Use tools like echo or printf within the script to populate the file with these properties automatically.

This script makes note-taking more streamlined, especially for Obsidian users managing their notes through the terminal.

obsidian Article's
30 articles in total
Favicon
Exporting Mac OSX Book Highlights into an Obsidian Vault or Markdown Files
Favicon
Mi plugin de Obsidian para facilitar el estudio de AWS!
Favicon
How Smart Notes with Obsidian Helped Me
Favicon
Obsidian 101: How to Get Started and Stay Organized!
Favicon
TIL: Styling Obsidian text paragraphs
Favicon
Journey Developing an Obsidian Plugin Part 2 - Improving the Architecture, Basic Error Handling and more!
Favicon
Free Obsidian PC Android sync
Favicon
Atomic Note-Taking Guide
Favicon
โœ๏ธ Obsidian: Journaling
Favicon
โœ๏ธ Obsidian: Journaling
Favicon
How to Install, Activate, and Update Obsidian Plugins
Favicon
Obsidian's New Web Clipper - You'll Want to Try It
Favicon
How to Sync Obsidian Across All Your Devices (Including Free Methods)
Favicon
How to sync your Obsidian vault using GitHub: A complete guide
Favicon
Create a New Note for Your Obsidian Vault from the Terminal
Favicon
Project Planning
Favicon
Obsidian - How to create Daily note every day, even if I don't open it
Favicon
Deploy obsidian as container
Favicon
ovm (Obsidian Vaults Manager)
Favicon
Obsidian: The All-in-One Knowledge Management Tool for Efficient Information Organization
Favicon
Information flow - how I capture the notes
Favicon
How to install latest Obsidian on Ubuntu 24.04 or older versions
Favicon
Migrating From DokuWiki to Obsidian
Favicon
My Obsidian + Hugo blogging setup
Favicon
Leaving the Comfort Zone Behind: The Journey to Developing a Plugin for Obsidian.md
Favicon
Journey: Developing an Obsidian Plugin Part 1 - Getting Started
Favicon
Why Obsidian Falls Short as a Note-Taking Tool
Favicon
Plugins de Obsidian para Programadores
Favicon
Building A SimpleNote to Obsidian notes converter
Favicon
don't know the title yet

Featured ones: