vscode-markdown
vscode-markdown copied to clipboard
Increase and decrease heading levels in selected text
When selecting some text with headings, please make it possible to increase and decrease heading levels within the selection.
For instance, if the following text is selected:
# abc
def
And then the command Increase heading levels
is run, then it should result as:
## abc
def
Have you tried ctrl + shift + ]
?
Have you tried
ctrl + shift + ]
?
That just increases the heading level on the last line in the selected text, not all headings. And it converts regular text to a heading, when I don't think it should.
Actually, it is designed to increase/decrease the heading level under cursor (not selection).
bump
Actually, it is designed to increase/decrease the heading level under cursor (not selection).
It being designed that way is the issue. VSCode generally applies modifications like this to all lines selected, whether that is through multi-line selection or through multi-cursor selection. This particular shortcut only applies it to the beginning of whatever the first line of the selection is, which severely limits the utility of the shortcut since you might as well just type in the characters rather than use the shortcut.
Thanks for the feedback. I agree it would be better to be selection-aware.
Hello! I would upvote this feature. While writing long notes or research articles – especially when there are lots of edit to do (like moving of sections within a file) – this feature becomes indispensable.
Thanks for all the feedback. However, I may not have enough time to do this (especially test it).
In case there is someone interested, it can be easily changed to iterate over the lineIndex
in selection
(line 55) rather than selection.active.line
.
https://github.com/yzhang-gh/vscode-markdown/blob/83f602638bf96f5249e3b9856baf9f31b933fad1/src/formatting.ts#L53-L66