Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Modify Zsh Configuration to Make M-backspace Remove Last Path Component
- X-seq: zsh-users 22447
- From: Markus Zeindl <su_ld@xxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: Modify Zsh Configuration to Make M-backspace Remove Last Path Component
- Date: Sat, 11 Feb 2017 17:20:15 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mailbox.org; h= content-transfer-encoding:content-type:content-type:mime-version :references:in-reply-to:message-id:subject:subject:from:from :date:date:received; s=mail20150812; t=1486830017; bh=pUOgY048pR FsxfJHE1HyD22AVNMWLSlRHF+eFHdcOFI=; b=Vn2FSlprImsMEO5Q6cX1bvMmpp /Z+LLQj/Ty/mzPUApR9D/b633XUxM2Zg87R+yNYDV3WLINSH2Gj/HSu3eqaQf+yR Z8PRiPoWzSmMWHCrlw6KYHDzTw+H4JRbYBaZvMhP4GOPw8+IvO0EroYdChVH6Flc QStSqojQLXLrDDodO+H+v8umKBggn710/s9p35mmuwwcZLPzFsLf0w/G/EOhpxHG p702TegFwFevW7As0DG7ZOEz0anINhlfgjYKS5mMl0lyG25TK9OOLawPKwkhLKps Tze7+hCaXkm0Yp6KqNorz/wN3I0PzxCzh9Vnjkh9AF44F6evpuexanSC4ReA==
- In-reply-to: <CADweS+YA+VjDmFkYJm1+-pk55BZOJd6G=+ODHyKWnfQTgNpRZw@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <20170211162624.457f5cbe@priamos.m9net.local> <CADweS+YA+VjDmFkYJm1+-pk55BZOJd6G=+ODHyKWnfQTgNpRZw@mail.gmail.com>
Thank you!
This was exactly what I was looking for!
Am Sat, 11 Feb 2017 17:01:31 +0100
schrieb Julien Jehannet <julien@xxxxxxxx>:
> You can change the WORDCHARS setting by removing slash character:
>
> WORDCHARS=${WORDCHARS:s@/@}
>
> 2017-02-11 16:26 GMT+01:00 Markus Zeindl <su_ld@xxxxxxxxxxx>:
>
> > Hello Zsh-Community,
> >
> > I've started using zsh on GNU/Linux recently.
> > When editing commands on the prompt (assumingly in the zle), I
> > sometimes want to remove the last path component of an entered path
> > descriptor, i.e. remove the basename of a path. The following
> > description considers "M" to be the alt-key (or meta-key as in
> > emacs key notation)
> >
> > Intuitively, I type M-backspace. This removes the whole path.
> > Scenario 1 illustrates this.
> >
> > Scenario 1: Target: Change directory to /foo/bar/oof/rab
> > Step 1: type target incorrectly as "% cd /foo/bar/oof/ran"
> > Step 2: press M-backspace leading to a command-line of "% cd"
> > Step 3: type target again completely leading to "%
> > cd /foo/bar/oof/rab"
> >
> > I'm not familiar with Zsh Key notation at all. So, I'm not sure,
> > what zle-command (or widget?) will be triggered on M-backspace
> > using the key mapping in Mapping 1. Is it "backward-kill-word"?
> >
> > Mapping 1: Output of "% bindkey"
> > "^@" set-mark-command
> > "^A" beginning-of-line
> > "^B" backward-char
> > "^D" delete-char-or-list
> > "^E" end-of-line
> > "^F" forward-char
> > "^G" send-break
> > "^H" backward-delete-char
> > "^I" expand-or-complete
> > "^J" accept-line
> > "^K" kill-line
> > "^L" clear-screen
> > "^M" accept-line
> > "^N" down-line-or-history
> > "^O" accept-line-and-down-history
> > "^P" up-line-or-history
> > "^Q" push-line
> > "^R" history-incremental-search-backward
> > "^S" history-incremental-search-forward
> > "^T" transpose-chars
> > "^U" kill-whole-line
> > "^V" quoted-insert
> > "^W" backward-kill-word
> > "^X^B" vi-match-bracket
> > "^X^F" vi-find-next-char
> > "^X^J" vi-join
> > "^X^K" kill-buffer
> > "^X^N" infer-next-history
> > "^X^O" overwrite-mode
> > "^X^U" undo
> > "^X^V" vi-cmd-mode
> > "^X^X" exchange-point-and-mark
> > "^X*" expand-word
> > "^X=" what-cursor-position
> > "^XG" list-expand
> > "^Xg" list-expand
> > "^Xr" history-incremental-search-backward
> > "^Xs" history-incremental-search-forward
> > "^Xu" undo
> > "^Y" yank
> > "^[^D" list-choices
> > "^[^G" send-break
> > "^[^H" backward-kill-word
> > "^[^I" self-insert-unmeta
> > "^[^J" self-insert-unmeta
> > "^[^L" clear-screen
> > "^[^M" self-insert-unmeta
> > "^[^_" copy-prev-word
> > "^[ " expand-history
> > "^[!" expand-history
> > "^[\"" quote-region
> > "^[\$" spell-word
> > "^['" quote-line
> > "^[-" neg-argument
> > "^[." insert-last-word
> > "^[0" digit-argument
> > "^[1" digit-argument
> > "^[2" digit-argument
> > "^[3" digit-argument
> > "^[4" digit-argument
> > "^[5" digit-argument
> > "^[6" digit-argument
> > "^[7" digit-argument
> > "^[8" digit-argument
> > "^[9" digit-argument
> > "^[<" beginning-of-buffer-or-history
> > "^[>" end-of-buffer-or-history
> > "^[?" which-command
> > "^[A" accept-and-hold
> > "^[B" backward-word
> > "^[C" capitalize-word
> > "^[D" kill-word
> > "^[F" forward-word
> > "^[G" get-line
> > "^[H" run-help
> > "^[L" down-case-word
> > "^[N" history-search-forward
> > "^[OA" up-line-or-history
> > "^[OB" down-line-or-history
> > "^[OC" forward-char
> > "^[OD" backward-char
> > "^[OF" end-of-line
> > "^[OH" beginning-of-line
> > "^[P" history-search-backward
> > "^[Q" push-line
> > "^[S" spell-word
> > "^[T" transpose-words
> > "^[U" up-case-word
> > "^[W" copy-region-as-kill
> > "^[[2~" overwrite-mode
> > "^[[3~" delete-char
> > "^[[A" up-line-or-history
> > "^[[B" down-line-or-history
> > "^[[C" forward-char
> > "^[[D" backward-char
> > "^[_" insert-last-word
> > "^[a" accept-and-hold
> > "^[b" backward-word
> > "^[c" capitalize-word
> > "^[d" kill-word
> > "^[f" forward-word
> > "^[g" get-line
> > "^[h" run-help
> > "^[l" down-case-word
> > "^[n" history-search-forward
> > "^[p" history-search-backward
> > "^[q" push-line
> > "^[s" spell-word
> > "^[t" transpose-words
> > "^[u" up-case-word
> > "^[w" copy-region-as-kill
> > "^[x" execute-named-cmd
> > "^[y" yank-pop
> > "^[z" execute-last-named-cmd
> > "^[|" vi-goto-column
> > "^[^?" backward-kill-word
> > "^_" undo
> > " " magic-space
> > "!"-";" self-insert
> > ";5C" emacs-forward-word
> > ";5D" emacs-backward-word
> > "<"-"~" self-insert
> > "^?" backward-delete-char
> > "\M-^@"-"\M-." self-insert
> > "\M-/" complete-word
> > "\M-0"-"\M-^?" self-insert
> >
> > How can I modify my configuration to achieve Scenario 2?
> >
> > Scenario 2: Target: Change directory to /foo/bar/oof/rab
> > Step 1: type target incorrectly as "% cd /foo/bar/oof/ran"
> > Step 2: press M-backspace leading to a command-line of
> > "% cd /foo/bar/oof/"
> > Step 3: type only last path component "rab" again leading to
> > "cd /foo/bar/oof/rab"
> >
> > Thanks a lot for every answer, helping me to improve my
> > Zsh-experience.
> >
> > All The Best,
> > Markus
> >
>
>
>
Messages sorted by:
Reverse Date,
Date,
Thread,
Author