kortina / vscode-markdown-notes

Install from: https://ark.dance/md-notes
GNU General Public License v3.0
419 stars 64 forks source link

Add function to create new note from selected text #70

Open nixsee opened 3 years ago

nixsee commented 3 years ago

Is your feature request related to a problem? Please describe. I am transitioning my notes to markdown files right now and I have many very large files that I would like to split into smaller notes in order to better make use of linking, graphs and the zettelkasten methodology that is becoming popular nowadays.

Describe the solution you'd like It would be great if I could select a section of text and a new note would be created using the selection as its content. Following the successful creation of the new note, the content would then be removed from the original note and replaced with a [[new note name]] link.

Describe alternatives you've considered I spent most of a day messing with various extensions, snippets, tasks, macros, etc.. and eventually made what you can see in the GIF below. It is clumsy, doesn't correct for spaces in filenames (because I was unable to get it to work with your New Note command - the input prompt kept disappearing immediately). It also relies on numerous files and extensions, which seems very unoptimal.

I hope you are keen to implement something like this!

Additional context

vXBw8e0SPc

kortina commented 3 years ago

This is a cool idea, but I am wondering if it is redundant with the creation of new notes on Go To Definition?

Eg, if you type a new wiki-link in your current file, [[some-file-that-does-not-exist]], and trigger Go To Definition with your cursor over it, it will create the note.

kortina commented 3 years ago

Ohhh, you are saying you want this to be the body of the note, not the note name? That makes more sense now that I have looked at the gif more closely.

This is a cool idea. Happy to review a PR if you want to submit, maybe as a new command?

nixsee commented 3 years ago

Yeah, I'd like to cut and paste the selected text into a new note. I don't have the capability to make anything for a PR - hence my clunky macro!

A similar idea is to send the selected text to an existing note - the text box would have an autocomplete function, allowing you to select an existing file and it would be appended to the bottom.

nixsee commented 3 years ago

Here's a tool that the creator of Markdown Memo is making that does this, among other things. It is still primitive, but I'm sure he'll fix it up soon enough. https://github.com/svsool/vscode-markdown-kit

Here's a new gif of what my macro looks like right now - I've made a few changes since the original.

ARh5TWQFt1