Comments on: Add Vim Editing Mode To Your ZSH Prompt https://pthree.org/2009/03/28/add-vim-editing-mode-to-your-zsh-prompt/ Linux. GNU. Freedom. Mon, 09 Oct 2017 10:42:05 +0000 hourly 1 https://wordpress.org/?v=4.9-alpha-41547 By: Paweł Gościcki https://pthree.org/2009/03/28/add-vim-editing-mode-to-your-zsh-prompt/#comment-116986 Sat, 22 Sep 2012 20:33:24 +0000 http://pthree.org/?p=1008#comment-116986 Here's how I solved the enter key problem:

function zle-line-finish {
VIMODE="INSERT"
}
zle -N zle-line-finish

]]>
By: Anonymous https://pthree.org/2009/03/28/add-vim-editing-mode-to-your-zsh-prompt/#comment-116519 Tue, 10 Apr 2012 14:07:59 +0000 http://pthree.org/?p=1008#comment-116519 been a while but I still find this useful
if you want to actually see "M:command" you need to have ${VIMODE} somewhere in your PROMPT or RPROMPT

also, in comments
1) it's "bindkey -v" not "bindkeys -v"
2) solution by NicDumZ does nothing for me except complaining about "doprompt"

]]>
By: dbbolton https://pthree.org/2009/03/28/add-vim-editing-mode-to-your-zsh-prompt/#comment-110870 Sun, 16 May 2010 21:14:39 +0000 http://pthree.org/?p=1008#comment-110870 How could you set $VIMODE to "INSERT" when not in command mode?

]]>
By: zshのvi keybindでモードを表示する « chocokanpan BLOG https://pthree.org/2009/03/28/add-vim-editing-mode-to-your-zsh-prompt/#comment-110860 Wed, 12 May 2010 01:34:27 +0000 http://pthree.org/?p=1008#comment-110860 [...] Aaron Toponce : Add Vim Editing Mode To Your ZSH Prompt http://pthree.org/2009/03/28/add-vim-editing-mode-to-your-zsh-prompt/ [...]

]]>
By: anon https://pthree.org/2009/03/28/add-vim-editing-mode-to-your-zsh-prompt/#comment-110563 Tue, 29 Dec 2009 10:52:04 +0000 http://pthree.org/?p=1008#comment-110563 I was using emacs mode, since I did not know what mode I was in when using vi mode. Finally I can use vi mode and know what mode I'm in. Thank You

]]>
By: joecan https://pthree.org/2009/03/28/add-vim-editing-mode-to-your-zsh-prompt/#comment-110524 Sun, 22 Nov 2009 06:42:53 +0000 http://pthree.org/?p=1008#comment-110524 Is there a way to do this in bash?

]]>
By: nasrulah https://pthree.org/2009/03/28/add-vim-editing-mode-to-your-zsh-prompt/#comment-110266 Wed, 14 Oct 2009 17:11:59 +0000 http://pthree.org/?p=1008#comment-110266 Thanks a lot....

]]>
By: NicDumZ https://pthree.org/2009/03/28/add-vim-editing-mode-to-your-zsh-prompt/#comment-110233 Thu, 01 Oct 2009 10:30:43 +0000 http://pthree.org/?p=1008#comment-110233 I was unhappy with this solution, becausing hitting "enter" in command mode would not reset the VIMODE variable.
Use case: enter command mode, search for a particular command, hit enter to run it.

Here is how I solved this problem:

1
2
3
4
5
6
7
function accept_line {
    VIMODE=''
    doprompt
    builtin zle .accept-line
}
zle -N accept_line
bindkey -M vicmd "^M" accept_line
]]>
By: Aaron https://pthree.org/2009/03/28/add-vim-editing-mode-to-your-zsh-prompt/#comment-109872 Mon, 30 Mar 2009 18:35:38 +0000 http://pthree.org/?p=1008#comment-109872 The file I'm linking to isn't my .zshrc, but just the prompt. If you want to add Vi keyboard bindings in your ZSH, then in your .zshrc:

1
bindkeys -v
]]>
By: Federico https://pthree.org/2009/03/28/add-vim-editing-mode-to-your-zsh-prompt/#comment-109871 Mon, 30 Mar 2009 18:07:26 +0000 http://pthree.org/?p=1008#comment-109871 I've tried your amazing .zshrc but vi keys don't work for me. If i press ESC nothing appen and zsh continue to work normally with the standard emacs keybinding

]]>