Add zsh vi-mode settings
This commit is contained in:
parent
1920e5b76a
commit
4b70bc8f0e
|
@ -42,4 +42,8 @@ export RUBYOPT=rubygems
|
|||
|
||||
COMPLETION_WAITING_DOTS="true"
|
||||
|
||||
# Make zsh prompt act like vi
|
||||
zle -N edit-command-line
|
||||
bindkey '^f' edit-command-line
|
||||
|
||||
# vim:set ft=zsh:
|
||||
|
|
11
zsh/prompt
11
zsh/prompt
|
@ -28,6 +28,11 @@ ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}+%{$fg[white]%}"
|
|||
# Build Prompt #
|
||||
##################
|
||||
|
||||
prompt_vimode() {
|
||||
MODE_INDICATOR="-- COMMAND -- "
|
||||
echo -n "${${KEYMAP/vicmd/$MODE_INDICATOR}/(main|viins)/}"
|
||||
}
|
||||
|
||||
prompt() {
|
||||
echo -n "%{$FG[242]%}"
|
||||
echo -n '$(date "+%H:%M:%S")'
|
||||
|
@ -42,10 +47,14 @@ prompt() {
|
|||
# The prompt
|
||||
echo -n "%{$fg[red]%}"
|
||||
echo -n "%{$FX[bold]%}"
|
||||
echo -n " \$ %{$FX[no-bold]%}"
|
||||
echo -n " \$ "
|
||||
echo -n "%{$FX[no-bold]%}"
|
||||
|
||||
}
|
||||
|
||||
rprompt() {
|
||||
echo -n '$(prompt_vimode)'
|
||||
|
||||
# Make the rprompt a bright grey to set it apart
|
||||
echo -n "%{$FG[245]%}"
|
||||
echo -n '$(prompt_pwd)'
|
||||
|
|
2
zshrc
2
zshrc
|
@ -5,7 +5,7 @@ export ZSH=$HOME/.oh-my-zsh
|
|||
# ruby: https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/ruby
|
||||
# python: https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/python
|
||||
# brew: https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/brew
|
||||
plugins=(ruby python brew)
|
||||
plugins=(ruby python brew vi-mode)
|
||||
|
||||
# Liiiiive!
|
||||
source $ZSH/oh-my-zsh.sh
|
||||
|
|
Loading…
Reference in a new issue