DEV Community

Cover image for How I handle my notes with symbolic links
John Cheng for Futurice

Posted on

5 3

How I handle my notes with symbolic links

Background

Handling notes has always been tricky for me. Should I use an app or have markdowns in a folder?

Lately, I decided to only use markdowns and have them centralised in a folder called notes while making them accessible in the relevant projects via symbolic links.

Objectives:

  1. Access only project specific notes in VSCode (or any IDE)
  2. Keep a folder containing all of my notes

How-To

Architecture

~
|-- .gitignore_global
|-- Documents/
    |-- notes/
        |-- project_foo/
    |-- project_foo/
        |-- .notes/ (ignore from version control)
Enter fullscreen mode Exit fullscreen mode

Instructions

The first step is to have the version control ignore the notes in each projects. For example, I decided to have my notes in a .notes folder under each project.

# Create a global gitignore
touch ~/.gitignore_global

# Add the folder that will contain the notes in each project
echo .notes >> ~/.gitignore_global

# Add the global gitignore to the git configurations
git config --global core.excludesfile ~/.gitignore_global
Enter fullscreen mode Exit fullscreen mode

Now, let's create the folder that will contain all the notes:

# Create the folder where all the notes will be centralised
mkdir ~/Documents/notes
Enter fullscreen mode Exit fullscreen mode

Finally, let's say we have a project called project_foo. We can now create the folder that will contain the notes and link it:

# Create the folder where the project specific notes will be found
mkdir ~/Documents/notes/project_foo

# Link the project specific notes folder into the project
ln -s ~/Documents/notes/project_foo ~/Documents/project_foo/.notes
Enter fullscreen mode Exit fullscreen mode

Summary

  • Folder notes contains all the notes
  • Each project has a .notes folder with only related notes and ignored by version control
  • All the notes are synced between the notes folder and the .notes one in each project

Thanks to this architecture, I am now able to access my project's notes in my IDE directly and avoid using another app for that. To add to that, because they are synced in the notes folder, I still have the possibility to open all my notes at once if needed.

Final words

Thank you for reading my first ever blog post and I hope it helps some of you :)

Let me know your thoughts and/or improvements!

Photo by David Travis

Speedy emails, satisfied customers

Postmark Image

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (1)

Collapse
 
hamatti profile image
Juha-Matti Santala

This is such a cool idea! My notes are bit all over the place and I haven't yet found a good solutions that fits my workflow but this seems interesting, I might give it a try.

Eliminate Context Switching and Maximize Productivity

Pieces.app

Pieces Copilot is your personalized workflow assistant, working alongside your favorite apps. Ask questions about entire repositories, generate contextualized code, save and reuse useful snippets, and streamline your development process.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay