readded vi and emacs hooks