zsh-zle

Zsh zle shift selection

血红的双手。 提交于 2020-06-10 12:44:46
问题 How to use shift to select part of the commandline (like in many text editors) ? 回答1: shift-arrow() { ((REGION_ACTIVE)) || zle set-mark-command zle $1 } shift-left() shift-arrow backward-char shift-right() shift-arrow forward-char shift-up() shift-arrow up-line-or-history shift-down() shift-arrow down-line-or-history zle -N shift-left zle -N shift-right zle -N shift-up zle -N shift-down bindkey $terminfo[kLFT] shift-left bindkey $terminfo[kRIT] shift-right bindkey $terminfo[kri] shift-up

Multi-dot paths in zsh, like `cd …`

☆樱花仙子☆ 提交于 2020-01-01 03:17:19
问题 All shells understand these commands: $ cd . $ cd .. And zsh will also understand: $ cd ... $ cd .... Provided you say: $ alias -g ...='../..' $ alias -g ....='../../..' Now, how can I make it do proper tab-completion when I've started typing cd ..../<TAB> ? I recall it was implemented in oh-my-zsh but I've stopped using it now. It would also be appreciated if it would work not only for cd , say I want to execute cat ..../a/b/..../c/d | less . 回答1: I wasn't happy with the other answers so I

Multi-dot paths in zsh, like `cd …`

痞子三分冷 提交于 2019-12-03 14:22:40
All shells understand these commands: $ cd . $ cd .. And zsh will also understand: $ cd ... $ cd .... Provided you say: $ alias -g ...='../..' $ alias -g ....='../../..' Now, how can I make it do proper tab-completion when I've started typing cd ..../<TAB> ? I recall it was implemented in oh-my-zsh but I've stopped using it now. It would also be appreciated if it would work not only for cd , say I want to execute cat ..../a/b/..../c/d | less . I wasn't happy with the other answers so I spent a bit of time getting something more to my liking. The following will expand the dots when you hit ↵

Constantly updated clock in zsh prompt?

半腔热情 提交于 2019-11-30 11:09:49
问题 I know that I can exec a date command in my zsh prompt. However, it shows the old time; to see the current time, I have to hit <return> and get a new prompt with the current time. Is there a way to configure the zsh prompt to constantly update itself every second? 回答1: This would be .... unpleasant in a standard zsh prompt (or bash, or other shells). I suggest you'd be better off using Gnu Screen. Screen can have a status line which can show the time. Here's an example screenrc scroll down to

Constantly updated clock in zsh prompt?

大兔子大兔子 提交于 2019-11-30 00:55:14
I know that I can exec a date command in my zsh prompt. However, it shows the old time; to see the current time, I have to hit <return> and get a new prompt with the current time. Is there a way to configure the zsh prompt to constantly update itself every second? This would be .... unpleasant in a standard zsh prompt (or bash, or other shells). I suggest you'd be better off using Gnu Screen. Screen can have a status line which can show the time. Here's an example screenrc scroll down to "Red Hat Magazine A guide to GNU Screen" to see the sample (i'll reproduce that here) which will, when