typora-issues icon indicating copy to clipboard operation
typora-issues copied to clipboard

[Feature] Let user customize the behavior of `ENTER`

Open vassudanagunta opened this issue 4 years ago • 18 comments

There are three possible ways to end a line:

  • start a new paragraph.
  • insert a hard line break. This is necessary when typing verse (poetry, lyrics).
  • insert a soft line break. This matters for people who want to control the line breaks of the source code, e.g. for consistent diffs, or for people who configure Typora to render soft line breaks as hard line breaks, as allowed by the CommonMark spec:

    A renderer may also provide an option to render soft line breaks as hard line breaks.

Recommendation

Give user total control of how all three are entered, via Settings. For example, here are two possible configurations, a default, and one that addresses Issue #37:

default example alternative
new paragraph enter enter enter
soft line break ctrl-enter enter
hard line break shift-enter shift-enter

Advantages

  • As explained by Issue #37, not everyone wants enter to mean the same thing.
  • There are other issues such as #4760 for which people will want different key combinations.
  • Allows Typora to be updated without breaking existing user expectations: the default setting can reflect

Additional Recommendation: customizing hard line breaks

Let the user configure which CommonMark compatible) representation of hard line break is inserted at the end of the line:

  • two spaces[^1]
  • a backslash[^1]
  • a <br> tag

This would address #2435.


[^1]: <br> will always be used in a table, due to table limitations.

vassudanagunta avatar Oct 29 '21 17:10 vassudanagunta

Checking in to see if this is done. I won't be paying for Typora until this is addressed satisfactorily. Typora is a markdown editor. Markdown users shouldn't have to re-learn behaviors to use Typora. I'm encouraged that abner has been consolidating similar requests into a new feature request, makes me think he's on his way there. I hope that is true. Will be glad to purchase the app when it's ready.

tghuguenin avatar Dec 15 '21 18:12 tghuguenin

It's been six years now, since I originally asked in #37 for what seems like a simple and obvious option: to make Typora's Enter key work the same as literally every other Markdown editor. There have been a dozen people like me commenting that they love Typora overall, but unfortunately can't actually use it because of this. I'm still hopeful that someday soon I can use Typora. Please, just make a simple option to put a single newline instead of two! How hard can that be?

This new issue binds it up and complicates it unnecessarily with a bunch of other things, like re-defining how shift-enter works, soft vs. hard line breaks, with customizable options for various automatically-added line endings. Those may be good ideas, but they're less important, and I'm afraid it will take another six years and many more pages of talking, before the perfect solution to everything is implemented. I don't care what shift-enter does. I don't have any need for it. I will manually type whatever line endings I need (which may change, depending on the source of the file I'm editing) like I always do. It's easier for me to type space-space-enter than to type shift-enter and have Typora replace it. I need the option to type in standard Markdown code, not using special key combinations that are unique to Typora. Can you please go ahead with a simple option for "enter=enter" now, and work out all these other questions later?

For the case where someone is using the option "ignore whitespace and single line break", I think it's ok for Enter to behave the same as shift-enter does now, i.e., it's ignored unless pressed twice, or preceeded by two spaces, etc.

However, I think that behavior is not ideal, because it should be possible to put a newline (soft break) into the file, which will be displayed as a space, in that mode. I think maybe a better behavior (in both cases) would be for the cursor to move to a new line the first time it's pressed, then either create a new paragraph if pressed again, or if other characters are entered, be rendered as a space back on the previous line (but it should be recorded as a newline in the file). This would be consistent with the way you see other markdown as you're typing it, which then gets rendered when you've finished and move on to the next word. On the other hand, please don't let implementing this suggestion stand in the way either! It would be better to simply get single-newline for Enter working first, and then address whether the current behavior in "ignore whitespace" mode needs to be changed, since it's relatively a much less important issue, and it would be good enough for now if it just did the same thing as shift-enter does.

sumyungguy avatar Jan 03 '22 03:01 sumyungguy

I'm also waiting for getting a single-newline by Enter for years.

givemeareasonLi avatar Jan 07 '22 05:01 givemeareasonLi

This is the single thing that is preventing me from paying for Typora. I really can't fathom why it isn't already a thing, and why there seems to be so much resistance to implement it.

chrisdaniells avatar Jan 15 '22 20:01 chrisdaniells

I would buy typora immediately after this issue is supported.

When writing a doc, the used frequce of "soft line break" is much more than paragrah break. User should be able to assign most-used enter button to this behavior.

yaonengjun avatar Jan 17 '22 11:01 yaonengjun

I tried AutoHotKey v2beta with very limited success, but ultimately no good.

a script to send a <Shift>+<Enter> in place of just an <Enter> would be:

Enter::
{
    Send "+{Enter}"
}

but that starts having side effects -- like when you're making a bullet list, etc. -- i.e. the behavior of the Enter key has to take into consideration the context of where you are in the document -- within a paragraph or a bullet list, for instance.

seems a bit too much to overcome in this particular way at the moment.

...adding, i managed to find something i like for the interim -- i just changed the CSS styling for many of the standard elements.

instructions at link, below -- basically:

https://support.typora.io/Add-Custom-CSS/

  1. create a file called base.user.css under the themes folder (File > Preferences > Appearance > Open Theme Folder),
  2. add your custom styles, and save
  3. restart Typora
  4. done.

As you can see, I just killed the massive margin-bottoms:

h1, h2, h3, h4, h5, h6 {
    margin-bottom: 0rem;
}

p,
ul,
dd,
ol,
hr,
address,
pre,
table,
iframe,
.wp-caption,
.wp-audio-shortcode,
.wp-video-shortcode {
    margin-bottom: 0rem;
    /* 24px */
}

psmithpagely avatar Feb 25 '22 00:02 psmithpagely

Downloaded the newest trial version today to see if this has been implemented—as far as I can tell, it hasn't. Still want to buy this when it handles markdown correctly

tghuguenin avatar Dec 19 '22 20:12 tghuguenin

margin-bottom: 0rem; /* 24px */

Better use margin-bottom: 0; - units are not necessary if a value is 0.

surrim avatar Mar 03 '23 13:03 surrim

Adding my comment along with the others that this is the single worst thing about Typora and it confuses me how this has not been addressed. Give people the option to have enter work the way it works in every other markdown editor. I agree with tghuguenin that this seems fairly straightforward and I worry that the issue as currently laid out is trying to address multiple feature requests. Just add an option in preferences to control enter/shift enter. There is no reason why this has been a problem for more than half a decade and trying to resolve several issues simultaneously risks this taking half a decade more to actually fix.

alextolkin avatar May 21 '23 03:05 alextolkin

It is presumptuous to think that only coders use markdown or Typora (although coders would also benefit from being able to customize this behavior). People use markdown editors to take notes and for many other use cases in which txt files are not sufficient.

The Enter key usage in Typora is inconsistent with every other word processor in history. It's unfathomable that this behavior is not customizable.

Knocks avatar Apr 02 '24 23:04 Knocks

I would like to throw some money on the table for this feature as well. It's weird to me that it doesn't already exist, given that Shortcut Keys ARE customizable already per https://support.typora.io/Shortcut-Keys , and both New Paragraph and New Line are in that list.

For the record, I think it's immaterial whether or not the current behavior is consistent with other text editors vs WYSIWYG editors vs word processors. The important issue is: The behavior of the Enter key represents a critical usability barrier for a number of people including myself, who would otherwise be singing the praises of Typora from the rooftops. Is it a better idea to leave them in the lurch for eight years, or to take an afternoon and implement a checkbox that swaps the behavior of Enter and Shift+Enter and accept their money?

metafarion avatar Aug 01 '24 00:08 metafarion

I would like to throw some money on the table for this feature as well. It's weird to me that it doesn't already exist, given that Shortcut Keys ARE customizable already per https://support.typora.io/Shortcut-Keys , and both New Paragraph and New Line are in that list.

For the record, I think it's immaterial whether or not the current behavior is consistent with other text editors vs WYSIWYG editors vs word processors. The important issue is: The behavior of the Enter key represents a critical usability barrier for a number of people including myself, who would otherwise be singing the praises of Typora from the rooftops. Is it a better idea to leave them in the lurch for eight years, or to take an afternoon and implement a checkbox that swaps the behavior of Enter and Shift+Enter and accept their money?

at this point i think the dev is just being willfully obstinate

tghuguenin avatar Aug 01 '24 01:08 tghuguenin

at this point i think the dev is just being willfully obstinate

From the age and sheer number of other open issues, we might infer that the team is small and already overextended by the current feature set. Maybe I'm wrong in thinking this is low-hanging fruit, but I do suspect it is turning away more users than they realize. Not the folks who are already familiar with the conventions of coding and data organization and Markdown itself, but people like me and my family who just appreciate an elegant, slightly-styled editor with a clean interface that encourages us to work with basic text files without feeling like stone age neckbeards.

metafarion avatar Aug 01 '24 02:08 metafarion

Just wanted to throw my voice in with the crowd here. I found this through a connection i made through work. Ive been looking for basically an editor as simple as notepad but with some options for files and tabs. Typora is basically perfect. This is the one thing though since ive found it thats been really tough to get past. I dont use markdown for pretty much anything and honestly didnt even know what it was before finding this. But Typora fits the bill better than anything else ive found. The only thing I wanted to duplicate was one of the plugins from obsidian to create a new daily checklist with the unfinished task. lil powershell script i made filled that need.

I am using this to take quick notes and keep track of tickets and other work I need to do and thats pretty much it. Literally every application I have ever used treats enter as a new line and enter enter as a new paragraph. this is an issue for me because if i copy and paste things out of Typora to other applications that are not markdown based none of the line breaks carry over, Not to mention that brainless typing with shift+enter isnt the easiest thing since im not used to and typing in br for breaks is also not automatic. It becomes problematic when im grabbing info and sending it to a co-worker in teams. Now from what I've read through out the issues related to this. Making that the default could cause some issues with those that are using this explicitly for Markdown. So making this some how a configurable change even if its updating a json or cfg file. But giving us ANY option would make this such a perfect application for those that find it and dont want to use it for markdown. And Id imagine there are probably quite a lot more than you might imagine that fall into that category.

I cant fathom why this isnt configurable in some way for the user.

Correcting this as i must have had a filter when I made this comment. Still this seems like a somewhat popular issue. And this is probably gatekeeping people like myself.

Especially since the several issues that have been opened due to this particular topic equate to the most commented on topic if you add everything together or at least tied for first.

Just doesnt make a ton of sense for how long this has been a request.

Edit: Wanted to add that I think that this is really the main hangup for me buying it. Only a day or two into the trial but I really like it. just this whole enter thing has me on the fence. Ive seen no reason from the dev on WHY it hasnt been made a configurable option. At this point i might just go use vscode even though it doesnt have checkboxes. Though im sure i could find a plugin for that.

ruschlucas8 avatar Oct 10 '24 01:10 ruschlucas8

enter enter is also how you make a new paragraph in markdown which is why we markdown users have been griping about this and many of us have long ago given up as it seems the dev has no interest in listening to potential customers. I use iWriter Pro now.On Oct 9, 2024, at 9:53 PM, ruschlucas8 @.***> wrote: Just wanted to throw my voice in with the crowd here. I found this through a connection i made through work. Ive been looking for basically an editor as simple as notepad but with some options for files and tabs. Typora is basically perfect. This is the one thing though since ive found it thats been really tough to get past. I dont use markdown for pretty much anything and honestly didnt even know what it was before finding this. But Typora fits the bill better than anything else ive found. The only thing I wanted to duplicate was one of the plugins from obsidian to create a new daily checklist with the unfinished task. lil powershell script i made filled that need. I am using this to take quick notes and keep track of tickets and other work I need to do and thats pretty much it. Literally every application I have ever used treats enter as a new line and enter enter as a new paragraph. this is an issue for me because if i copy and paste things out of Typora to other applications that are not markdown based none of the line breaks carry over, Not to mention that brainless typing with shift+enter isnt the easiest thing since im not used to and typing in br for breaks is also not automatic. It becomes problematic when im grabbing info and sending it to a co-worker in teams. Now from what I've read through out the issues related to this. Making that the default could cause some issues with those that are using this explicitly for Markdown. So making this some how a configurable change even if its updating a json or cfg file. But giving us ANY option would make this such a perfect application for those that find it and dont want to use it for markdown. And Id imagine there are probably quite a lot more than you might imagine that fall into that category. I cant fathom why this isnt configurable in some way for the user. Especially since the several issues that have been opened due to this particular topic equate to the most commented on topic if you add everything together or at least tied for first. Just doesnt make a ton of sense for how long this has been a request.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

tghuguenin avatar Oct 10 '24 19:10 tghuguenin

New user, I'm a novelist and would like to use Typora to write fiction. Would love the option to have enter give you a simple line break, like on a word processor, and shift-enter or 2x enter a white space. I don't think I'm gonna withhold my 15 bucks over this, and I know it may be an edge case, but it would be immensely helpful! Thank you

vodkabuddha avatar Mar 06 '25 14:03 vodkabuddha

...adding, i managed to find something i like for the interim -- i just changed the CSS styling for many of the standard elements...

This works well, thanks a lot!

vodkabuddha avatar Mar 06 '25 22:03 vodkabuddha

Please, for the love of God. Add a single line in the whitespace / line break settings: Enter key behavior: Typora default = new paragraph / next line (togglable). I'd really appreciate this. Love your program!

HomeHeartTherapy avatar Nov 22 '25 18:11 HomeHeartTherapy