pajoma / vscode-journal

Lightweight journal and simple notes support for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=pajoma.vscode-journal
GNU General Public License v3.0
233 stars 41 forks source link

"journal.base" should work cross-platform #38

Closed PxlBuzzard closed 6 years ago

PxlBuzzard commented 6 years ago

I would love to see support for:

The advantage of adding cross-platform path support hopefully comes with a secondary benefit of allowing the use of environment variables. The reason I thought of this is is that "journal.base": "%USERPROFILE%/Documents/Journal" failed to resolve correctly on Windows.

pajoma commented 6 years ago

Thanks for this suggestion, but I am not sure I fully understand the problem. Journal base should be a setting in the user properties, which is stored in the local user profile (regardless of the machine you are using). I have my notes synced on various linux and windows environments, each having its own base directory defined. Having separated path definitions by environment makes only sense if

Resolving environment variables like %USERPROFILE% is apparently not supported by NodeJS (whose Path I use to resolve the directory path. I could try to resolve them manually, but this might lead to whole new set of problems (e.g. different environment variables on different windows machines).

PxlBuzzard commented 6 years ago

I use Settings Sync to keep my user settings synced across machines. I can use the same settings across OSs, and while it isn't the end of the world to not sync the journal it would still be an enhancement. Though since I'm asking, how do you sync your journal?

As for the environment variable problem, that's a bummer that Path doesn't support variable expansion but I wouldn't ask you to be the one to solve that if node hasn't done it.

Thank you for the response and I love all the work you've done making this extension. I started using it a couple days ago and I love it.

pajoma commented 6 years ago

Ok, I've updated the configuration to resolve the variable ${homeDir}, the path should also work cross-plattform now ("/" are replaced with "\" on windows machines).

I use resilio (bittorrent sync in the past) to sync my journal across my machines.

pajoma commented 6 years ago

Works in new version