patleeman / VSNotes

Simple VS Code extension for plain text note taking.
https://marketplace.visualstudio.com/items?itemName=patricklee.vsnotes
MIT License
174 stars 33 forks source link

add instant note #17

Closed phelma closed 6 years ago

phelma commented 6 years ago

Instant note skips the filename part, for even quicker note taking!

16

patleeman commented 6 years ago

This looks great. Thanks for the PR @phelma!

I'm going to pull it down and test it out. Can you update the Readme with the new functionality? Maybe stick a new section above ### File Path Detection with instant note, what it does, and what users should know?

phelma commented 6 years ago

Yes, I will have a look this evening.

Its a bit rough and not very DRY. (my first VSCode extension code)

We could perhaps just make it a config option to skip the file naming part of the new note command?

patleeman commented 6 years ago

Yeah, it would be a lot cleaner to extract line 36-64 of newNote.js into a separate function that takes a note name as a parameter.

Then you can easily export it from newNote.js and use it in instantNote.js.

One thing is that there should probably be a setting associated with this feature as well so a user can set the path and any tokens they want in the setting and it'll get replaced whenever they generate an instant note. So perhaps of taking a fully formed file name in this extracted function, you can grab the setting from the configuration (see lines 11 - 17 newNote.js) and pass it into replaceTokens and continue on from there.

I like the idea!

patleeman commented 6 years ago

Whoops, closed this by accident

patleeman commented 6 years ago

I hope you don't mind @phelma but I added a setting for default note name and pre-populated the create new note functionality so one can easily create a new note.

https://github.com/patleeman/VSNotes/pull/18/commits/ba6d07c049ae7fc9ecdf37c447365f5cf16bad62

Going to close this because the functionality is pretty close.