zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Steve Dondley <s@dondley.com>
Cc: Zsh Users <zsh-users@zsh.org>
Subject: Re: How do I disable the mode for using j-k keys to scroll through history?
Date: Tue, 15 Mar 2022 16:25:21 -0700	[thread overview]
Message-ID: <CAH+w=7aO3WopHvxw-TojxuwAt1OAtNKHkZmOeMRdnzOX7N8csw@mail.gmail.com> (raw)
In-Reply-To: <1e2f7baa61218066c154da4a0901a7f8@dondley.com>

On Tue, Mar 15, 2022 at 4:02 PM Steve Dondley <s@dondley.com> wrote:
>
> On 2022-03-15 06:55 PM, Steve Dondley wrote:
> >>
> >> Are you sure you want to disable it?  Why are you using vi commands if
> >> you never want to be in command mode?
> >
> > Because I want the insert mode commands.

There is one "insert mode command" that works slightly differently
than emacs mode, and that's ^W for vi-backward-kill-word.
vi-kill-line would work differently, but you'd have to have exited
from and then re-entered insert mode to notice.  (Of course there are
MORE commands in emacs mode, all bound to ctrl+something.)

> > I have no idea how I would
> > use vi command mode from a command line.

Example:  Hit ESC, and then hit "b" twice to move backward two words,
and then hit "cw" to change the word you're on.

Or:  Hit ESC, and then "I" to go to insert something at the beginning
of the command, and then ESC and "A" to go back to appending at the
end.

Do you never move left and right except one character at a time with
the arrow keys, or by deleting?

> At a minimum, I need to change the bind key for entering command mode so
> it's not accidentally triggered.

To see what's bound:
bindkey -M viins

You're interested in anything that's bound to vi-cmd-mode, e.g.:
"^[" vi-cmd-mode

To remove that:
bindkey -M viins -r '^['

To add a different one, in this example two ESC in sequence:
bindkey -M viins '^[^[' vi-cmd-mode


  parent reply	other threads:[~2022-03-15 23:28 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-15 22:38 Steve Dondley
2022-03-15 22:46 ` Bart Schaefer
2022-03-15 22:55   ` Steve Dondley
2022-03-15 22:57     ` Steve Dondley
2022-03-15 23:24       ` Steve Dondley
2022-03-15 23:25       ` Bart Schaefer [this message]
2022-03-15 23:27       ` Lawrence Velázquez
2022-03-15 23:57         ` Steve Dondley
2022-03-15 23:59           ` Bart Schaefer
2022-03-15 23:24     ` Lawrence Velázquez
2022-03-15 23:47   ` Steve Dondley
2022-03-16  0:21 ` Steve Dondley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAH+w=7aO3WopHvxw-TojxuwAt1OAtNKHkZmOeMRdnzOX7N8csw@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=s@dondley.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).