zsh-users
 help / color / mirror / code / Atom feed
* zsh-no-ps2: A plugin that inserts a newline on Enter instead of displaying PS2
@ 2023-11-12 13:48 Roman Perepelitsa
  2023-11-12 14:00 ` zeurkous
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Roman Perepelitsa @ 2023-11-12 13:48 UTC (permalink / raw)
  To: Zsh Users

tl;dr: zsh-no-ps2 changes the behavior of Enter key to insert a
newline instead of going into PS2

    git clone https://github.com/romkatv/zsh-no-ps2.git ~/zsh-no-ps2
    source ~/zsh-no-ps2/zsh-no-ps2.plugin.zsh

Normally, when you press Enter in zsh, one of two things happens: if
the currently typed command is complete, zsh attempts to execute it;
if it's incomplete, zsh displays the secondary prompt, also known as
PS2, to invite you to continue typing the command. I hate when zsh
goes into PS2 because to fix the command most of the time I need to
*edit what I've already typed*, which cannot be done. Those of you who
are using zsh4humans have been able to change this behavior so that
Enter inserts a newline if the typed command is incomplete. I've just
created a standalone plugin to make this feature available to
everybody: https://github.com/romkatv/zsh-no-ps2. No more PS2!

Also posted to r/zsh:
https://www.reddit.com/r/zsh/comments/17tgjit/zshnops2_a_plugin_that_inserts_a_newline_on_enter/

Roman.


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-11-14  2:11 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-12 13:48 zsh-no-ps2: A plugin that inserts a newline on Enter instead of displaying PS2 Roman Perepelitsa
2023-11-12 14:00 ` zeurkous
     [not found] ` <6550dda9.170a0220.4fe72.dd3bSMTPIN_ADDED_BROKEN@mx.google.com>
2023-11-12 18:59   ` Bart Schaefer
2023-11-12 19:18     ` zeurkous
2023-11-13 14:20     ` Michal Politowski
2023-11-13  7:29 ` Stephane Chazelas
2023-11-13  8:46   ` Roman Perepelitsa
2023-11-14  2:10     ` Bart Schaefer
2023-11-14  1:38   ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).