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:
- Access only project specific notes in VSCode (or any IDE)
- Keep a folder containing all of my notes
How-To
Architecture
~
|-- .gitignore_global
|-- Documents/
|-- notes/
|-- project_foo/
|-- project_foo/
|-- .notes/ (ignore from version control)
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
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
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
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!