tags:

views:

202

answers:

3

I've tried putting (setq term-setup-hook 'vip-mode) in my .emacs file but this only seems to load the vip module and I have to manually call vip-change-mode-to-vi and C-z doesn't work as an alias for that method.

What am I doing wrong here?

p.s. Please spare me any religious sentiments.

+1  A: 

You answered your own question, really: you need to call vip-change-mode-to-vi. EMACS is just a lisp interpreter with some glossy side-effects; if you want to always be in vip vi mode, call the function.

A couple things:

  1. You should use add-hook. What you're using will remove any other hooks.

    (add-hook 'term-setup-hook ...)

  2. Consider using a lambda expression to stick things together, as

    (add-hook 'term-setup-hook '(lambda () (vip-mode)))

    That means you have one closure that you can put all this stuff into

Charlie Martin
How do I call the function? I tried (vip-change-mode-to-vi) but it tells me that `Symbol's function definition is void`. I guess it need to wait for the module to load or something.
Pierre-Antoine LaFayette
I happen to be on the one computer I won wih no emacs, but yeah, that indicates something isn't loaded. There are a couple options: you need to `require` something, or vip-mode is an autoloaded package. Get into the scratch buffer in a clean EMACS, and enter `(require vip-mode)` followed by C-j to execute it, and see what happens. It ikf returns `t`, then add that require to your ,emacs.
Charlie Martin
+1  A: 
 (setq viper-mode t)
 (require 'viper)
J.F. Sebastian
A: 

I was able to get emacs started in vip-mode by doing what I found here. If you scroll to the bottom, there's a link to a .emacs file, and I copied the first three commands from there:

(setq term-setup-hook 'vip-mode)
(global-unset-key "\e\e")
(put 'eval-expression 'disabled nil)

I also saw an entry elsewhere from someone who just added to their .emacs:

(vip-mode)

I tried that, but the first time I started emacs with it, it prompted me with an "inhibit vip-mode something", to which I responded n, and after that, subsequent startups wouldn't use vip-mode.

Rob Hruska