Jacob Waller
Jacob Waller

Reputation: 4239

Zsh Mac OSx Mountain Lion vim promt

I am wondering if anybody is able to get the vim prompt working properly using Mac OSx Mountain Lion the latest version. I am able to edit in vim mode on the command line but I have seen with zsh before that you can go into Vim mode which launches a vim editor and you can write you command there and then write and quit and it will add it to the next line in the terminal. There may be a plugin to do this I am not sure? Any help would be great.

Upvotes: 0

Views: 502

Answers (1)

Marshall Eubanks
Marshall Eubanks

Reputation: 264

This answer was posted here: https://stackoverflow.com/a/903973/1031826

Basically, if you're using vi mode, you can add the following lines to your .zshrc:

autoload -U edit-command-line
zle -N edit-command-line
bindkey -M vicmd v edit-command-line

And you can press ESC-V to edit the current line in whatever your default editor is.

You can adjust the last line ("bindkey...") if you want to change the key binding used.

Upvotes: 1

Related Questions