zsh: use a ZLE widget to save command line when opening nvim with ctrl-v
This commit is contained in:
parent
3ac248c53d
commit
e0b35d87d4
1 changed files with 9 additions and 1 deletions
|
@ -194,6 +194,14 @@ fs_setup_zle() {
|
|||
zle accept-line
|
||||
}
|
||||
|
||||
# Open nvim, preserving the current command line.
|
||||
zle -N fs_zle_open_nvim
|
||||
fs_zle_open_nvim() {
|
||||
zle push-line
|
||||
BUFFER="nvim"
|
||||
zle accept-line
|
||||
}
|
||||
|
||||
autoload edit-command-line && zle -N edit-command-line # from zshcontrib
|
||||
|
||||
#############################
|
||||
|
@ -211,7 +219,7 @@ fs_setup_zle() {
|
|||
# ^r history search using fzf
|
||||
# ^t paste file/directory using fzf
|
||||
bindkey -M viins '^u' kill-whole-line
|
||||
bindkey -s '^v' '^unvim\r'
|
||||
bindkey -M viins '^v' fs_zle_open_nvim
|
||||
bindkey -M viins '^x^e' edit-command-line
|
||||
bindkey -M viins '^y' yank
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue