Set editor to VIM. Bind edit command for shells.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Sun, 14 Aug 2011 22:18:39 +0300
changeset 179 ed15e30ff41a
parent 178 8f02d11f289d
child 180 176106ed8e46
Set editor to VIM. Bind edit command for shells.
.bashrc
.zshrc
--- a/.bashrc	Sun Aug 14 22:15:22 2011 +0300
+++ b/.bashrc	Sun Aug 14 22:18:39 2011 +0300
@@ -5,7 +5,7 @@
 [ -d ~/usr/bin ] && export PATH="$PATH":~/usr/bin || :
 
 # XXX for mc, cvs, svn, ...
-# export EDITOR=vim
+export EDITOR=vim
 
 # XXX vim and gnome-terminal have support for 256 colours in fedora 8 at least
 # Note debian/ubuntu users should install the ncurses-term package to support this
@@ -145,6 +145,7 @@
 set -o emacs
 
 bind '"\e/": dabbrev-expand'
+bind '"\ee": edit-and-execute-command'
 
 ################################################################
 # Completion.
--- a/.zshrc	Sun Aug 14 22:15:22 2011 +0300
+++ b/.zshrc	Sun Aug 14 22:18:39 2011 +0300
@@ -1,3 +1,5 @@
+
+EDITOR=vim
 
 HISTFILE=~/.histfile
 HISTSIZE=1000
@@ -10,6 +12,10 @@
 setopt hist_ignore_space
 setopt hist_no_functions
 
+autoload -U edit-command-line
+zle -N edit-command-line
+bindkey '\ee' edit-command-line
+
 # Emacs like editing.
 bindkey -e