3 ms·
I use vi-mode and when i need to make more elaborate edits, I have this binding in zsh to edit the current line in $EDITOR: autoload -Uz edit-command-line
by lambdaba 2y ago
I use vi-mode and when i need to make more elaborate edits, I have this binding in zsh to edit the current line in $EDITOR:
autoload -Uz edit-command-line
zle -N edit-command-line
bindkey -M vicmd v edit-command-line
For "normal" Emacs keybinds this is the standard:
bindkey '^x^e' edit-command-line
As others have mentioned this goes well with fzf and its shell history plugin.
But, in truth, the shell interface could use a major overhaul to make it more like a notebook, there are early attempts at this (e.g. Warp), but it's still quite timid IMO.
I'll also say this is one of the perks of being a vi user, it's the CLI usage where it really shines, I can make surgical edits really quickly, thanks to all the jump and change keybinds that are so central to vi usage.