Questions tagged [zsh-zle]

Tag questions related to the zsh line editor, including prompts, zle widgets, and the `zle` and `bindkey` commands

ZLE is the line editor. It's the part of the shell that deals with what you type and edit. You can extend the line editor using shell functions. The functionality available is immensely powerful.

54 questions
0
votes
0 answers

after reset-prompt,the command line jump to next line automatically

①I have tried to use an dynamic clock with time refresh settings in ~/.zshrc TMOUT=1 TRAPALRM () { zle reset-prompt } ②my full modified theme file is bullet-train.zsh-theme my whole ~/.zshrc file is.zshrc My problem is: when my terminal enter…
user13268019
0
votes
1 answer

Make zsh zle restore characters on backspace in vi overwrite-mode

I am using Zsh in Vi-mode. When $KEYMAP == vicmd (i.e. command-mode), I want hitting backspace to move the cursor to the left by one character, without deleting anything. [working] When $KEYMAP == viins && $ZLE_STATE == *insert* (i.e. insert-mode),…
jinscoe123
  • 1,467
  • 14
  • 24
0
votes
3 answers

How can I maintain my last command’s exit-status while resetting my prompt in ZSH?

I’m trying to make an über-simple (single-character) prompt that gives me as much information as possible. Here’s what I have at the moment (had it for ages, can’t remember where I found the original): # RPS1="['%1v', '%2v', '%3v', '%4v', '%5v',…
ELLIOTTCABLE
  • 17,185
  • 12
  • 62
  • 78
0
votes
1 answer

Create custom accept-line to measure time taken by a command to run in zsh

I want to measure the time taken by a program to run in zsh. Based on the time difference, I want to print out the time taken. I edited the accept-line hook function for this: my-accept-line () { CMD="$BUFFER" CMDSTART=$(date +%s) zle…
kvs
  • 1
0
votes
0 answers

Use OS X clipboard with zsh vi-mode

I am using vi-mode with zsh at the moment. I am also using this to get a visual mode so I can include this in the right prompt. I haven't yet been able to get this to work with OS X clipboard, pbcopy and pbpaste. I'd really like to be able to yank…
barters
  • 169
  • 4
0
votes
1 answer

widgets for case manipulation: `gU` in normal and `U` in visual mode

I reckon there's already a widget for the g~ action in zle. So g~iw will invert the case of a word. I read the zshzle manual and did not find a widget that would give me the behaviour of gU (capitalize action) in vim. for example: for the word…
ninrod
  • 523
  • 6
  • 25
0
votes
1 answer

How to correctly bind `` in zle vi visual mode in zsh 5.0.8

The standard behaviour of zle vi-mode when in visual mode is to do nothing. But I want that the action of pressing in vi-mode visual mode switches the keymap to vi-normal mode (vicmd). As it does in standard vi. I tried this: bindkey…
ninrod
  • 523
  • 6
  • 25
0
votes
1 answer

Why can't I grep zle from setopt?

I came across this by chance, and it's been nagging me since: % setopt alwaystoend autocd autonamedirs ... sharehistory shinstdin zle % % setopt | grep zle # nothing printed % % setopt | cat…
dev
  • 1,648
  • 16
  • 25
0
votes
1 answer

zsh-bindings: noremap on vi mode

I want to bind 'dd' in the zsh's vicmd into something like 'ddi', If i use: bindkey -M vicmd -s dd 'ddi' It will give me this output: zsh: string inserting another one too many times
Ary Purnomoz
  • 131
  • 2
  • 9
1 2 3
4