Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Delete last part of path



At 10:13 AM +0100 07.11.29, tannhauser wrote:
>i typed
>% cd /home/example/one/
>and the cursor is at the end of the line. is there a shortcut to delete
>just the last part of the path (in this example "one/") ?

If you are using vi-keybinding (bindkey -v), then typing ctrl-W twice
will do what you want.
If you are using emacs-keybinding, then you can bind the command
'vi-backward-kill-word' to any key you like, e.g.,

bindkey '^W' vi-backward-kill-word

Another method is

% cd /home/example/one/../<TAB>

this will complete the directories in /home/example/.

-----
Jun



Messages sorted by: Reverse Date, Date, Thread, Author