Prefix plugin

Hi , is there any plugin add prefix to every line
I need to

  1. Add - to each line to form list
    2 .add ## to each line to from heading

To form a list, you can select multiple lines, and run the command “Toggle bullet list”. That will add a dash to each line.

There is also a command “Toggle heading”, but I’m having trouble with it. Possibly it is a new bug with Live Preview.

@Grover93 : You could use the technique that @rigmarole suggested to toggle the bullet list, then use a find and replace (ctrl h) on that note to replace - with ## . If your note has many occurrences of ”- “ throughout, you could use the toggle checklist (or select your lines and press ctrl enter three times). This will add the prefix of - [x] before the selected lines. It is pretty unlikely that you will often have many occurrences of those characters throughout a note (other than notes that have checklists), so it proves to be a helpful find and replace target. In your example, you would then press ctrl h and do a find - [x] and replace ##.

I know it is a strange workaround. As a side note, sometimes it could be helpful to go into VSCode or the like, and do a search and replace utilizing regex \n then the characters at the beginning of the line that you want to be replaced with your prefix. This way it will only replace the occurrences of your target characters when they are at the beginning of a line. Now that I am off on a tangent, I am remembering a release or two ago, seeing that the find and replace had a regexp option, but that has since vanished. I found it quite exciting that that may be around the corner.

Anyways, good luck!

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.