Page 1 of 2

plugin Markdown Editing

Posted: 02.02.2019 21:43
by Alexey
Plugin for CudaText.
Supports features during editing of Markdown documents.

Symbols *_` (asterisk, underscore, tick)
- auto-paired on typing
- if they are typed with selected text, selection is enclosed in symbols pair
- with pair of symbols, and BackSpace pressed - both symbols are deleted
- with pair of symbols, and Space pressed - right symbol is deleted

List items (bullet symbol -+* with space)
- if caret at the end of non-empty list item, and Enter pressed - newline is added with empty list item (on the same indent as previous item)
- if caret at the end of empty list item, and Enter pressed - bullet is deleted and caret goes to bullet position
- after empty list item, and Tab pressed - list item's indent is increased, and bullet kind is changed (by loop: +-*)
- after empty list item, and Shift+Tab pressed - list item's indent is decreased, and bullet kind is changed

Tasks
- [x] foo
- [x] baz
- [ ] bim
if caret at the end of a task, and Enter pressed - newline with empty unchecked task is added.

Block-quotes
- if caret at the end of quoted line, and Enter pressed - newline with quote symbol is added
- if text is selected, and > pressed - selection is enclosed in block-quote. First and last lines of multiline selection must not be fully selected. Single line must not be fully selected.

Links
- if text selected, and ( or [ pressed - selection is enclosed into pair () or []

Crossed text
- if text selected, and ~ pressed - selection is enclosed like this: ~~text~~

Headers
- if text selected (single line), and # pressed - # symbol is added in front of selection. If plugin option "match_header_hashes" is on - # symbol mirrors to the end of header. Next # presses will increase header level (##, ###, up to level 6, then # symbols removed).
- if caret at the and of header, and Enter pressed, and option "match_header_hashes" is on - # symbols are mirrored
- Setext headers (text with --- or === underline on the next line) - pressing Tab at the end of underline - changes underline length to match the length of header text


Plugin has config file, which you may call via "Options / Settings-plugins / Markdown Editing / Config". Options:
- list_indent_bullets - allowed bullets (from +-*), for changing bullet kind; for ex, value "-+" means only -+ bullets
- match_header_hashes - boolean, 0/1 - allows to mirror leading # symbols to the end of header


Author: Medvosa, https://github.com/medvosa

markdown editing plugin list items

Posted: 27.01.2024 10:22
by SamC
The readme of markdown editing plugin says:
List items (bullet symbol -+* with space)
- if caret at the end of non-empty list item, and Enter pressed - newline is added with empty list item (on the same indent as previous item)
- if caret at the end of empty list item, and Enter pressed - bullet is deleted and caret goes to bullet position
- after empty list item, and Tab pressed - list item's indent is increased, and bullet kind is changed (by loop: +-*)
- after empty list item, and Shift+Tab pressed - list item's indent is decreased, and bullet kind is changed
In use:
When using un-number list,the tab key will not increase the indent, just change the bullet kind.
When using number list,the tab key will not increase the indent, the item number will changed to 1.

Thanks!

Re: markdown preview plugin list items

Posted: 27.01.2024 12:06
by main Alexey
Markdown Preview plugin or Markdown Editing plugin?
Seems quote is from latter's docs.
So what do you suggest?

Re: markdown preview plugin list items

Posted: 27.01.2024 13:32
by SamC
Sorry,it's from markdown editing...
My question is the tab key can't generate indent as the description.

Re: markdown editing plugin list items

Posted: 27.01.2024 13:46
by main Alexey
Readme tells:
- after empty list item, and Tab pressed - list item's indent is increased, and bullet kind is changed (by loop: +-*)
- after empty list item, and Shift+Tab pressed - list item's indent is decreased, and bullet kind is changed
it is wrong info. I update it to OK info:

- after empty list item, if Tab pressed - bullet kind is changed (by loop: +-*)
- after _indented_ empty list item, if Shift+Tab pressed - list item's indent is decreased

>When using un-number list,the tab key will not increase the indent, just change the bullet kind.
Correct
>When using number list,the tab key will not increase the indent, the item number will changed to 1.
No, I don't see this. I typed new line "1. " and pressed Tab - no any change. How can I repeat your behaviour?

Re: markdown editing plugin list items

Posted: 27.01.2024 15:08
by SamC
[/quote]
No, I don't see this. I typed new line "1. " and pressed Tab - no any change. How can I repeat your behaviour?
[/quote]

Type new line "2. " and pressed Tab - It will become to "1. "

And,
If tab can doesn't generate tab character in list,we can just use space key to make indent in list?

Re: markdown editing plugin list items

Posted: 27.01.2024 16:13
by main Alexey
now I see, yes, even "4. " changes to "1. " , even in OK numbered list. it is not good. SublimeText plugin (MarkdownEditing too) don't do it. I should disable this change.

Re: markdown editing plugin list items

Posted: 27.01.2024 16:22
by main Alexey
>we can just use space key to make indent in list?

I don't understand. what do you suggest?
check my changes - tab-key now makes indent in numbered list.

Re: markdown editing plugin list items

Posted: 28.01.2024 00:06
by SamC
main Alexey wrote: 27.01.2024 16:22 >we can just use space key to make indent in list?

I don't understand. what do you suggest?
check my changes - tab-key now makes indent in numbered list.
For un-numbered list,how to make indent?I suppose the original description maybe OK,tab key will generate intent and also the bullet?

Re: markdown editing plugin list items

Posted: 28.01.2024 09:04
by main Alexey
>For un-numbered list,how to make indent?
you cannot. I don't know where original author (not me) took the toggling of bullet-kind. but it is useful IMHO. do we need to add indent after bullet? after bullet, we write a text. why to indent?