0

I see on the Viper page that the way to turn on viper mode by default is

 (setq viper-mode t)
 (require 'viper)

I've been trying to move over to using customize to do emacs configuration. Is there a way to turn on viper mode on start using customize?

  • 1
    You can just write this code in your init file (~/.emacs or ~/.emacs.d/init.el), there is no need to use customize. – adl Feb 11 at 6:21
  • @adl So, is your answer that "no, there is no way to use customize"? – Roxy Feb 11 at 15:18
  • You could also M-x viper-mode RET – caisah Feb 11 at 18:08
  • The question is: How to use customize to turn on viper mode by default? – Roxy Feb 11 at 23:54
  • If I may ask, why are you using viper instead of evil-mode? – Jesse Feb 13 at 10:38
1

To enable viper using customize, you will need to do something like this.

Enable viper-mode for new buffers

  1. Load customize with M-x customize
  2. Search for package
  3. Then search for package load list
  4. Press <RET> to expand the arrow next to Package Load List
  5. After the last entry, press <RET> on the INS button to insert a new line.
  6. Press <RET> 1 on the Value Menu button on the second line to insert a specific package.
  7. Delete nil and put viper.
  8. Press the Apply and Save button at the top. At the prompt type yes.

enter image description here

These steps will not enable viper for the splash screen or the default *scratch* buffer. To do those, we will need to do more...

Change the default *scratch* mode to viper-mode

  1. From the main M-x customize menu, search for Initial Major Mode
  2. Press <RET> on the arrow next to Initial Major Mode to expand it.
  3. Replace list-interaction-mode with viper-mode
  4. Press <RET> on the Apply and Save button at the top and then type yes

enter image description here

Disable the splash screen

I'm not sure how to set the default mode for the splash screen using customize, so let's just disable it:

  1. From the main M-x customize menu, search for startup
  2. Press <RET> on the arrow next to Inhibit Startup Screen to expand it
  3. Press <RET> on the Toggle button
  4. Press <RET> on the Apply and Save button at the top and type yes

enter image description here

At some point in this process, or when you reload Emacs, you will be presented with the viper startup screen which asks whether you want to "Viperize". Follow the prompts accordingly.


I ran into lots of problems with the settings persisting while trying this out. Hopefully everything works for you!

In my opinion, while it is a noble effort to make Emacs more accessible to newcomers, the utility of customize is limited. You will get a far greater return on investment learning some basic Emacs Lisp. To start, I recommend reading the excellent documentation about init.el and An Introduction to Programming Emacs Lisp.

That said, here's how to do what you want using Emacs Lisp:

  1. Create a file named init.el in the ~/.emacs.d/ directory.
  2. In it, put

    (viper-mode)

The next time you start Emacs, viper-mode will be enabled.

  • The question is: How to use customize to turn on viper mode by default? – Roxy Feb 11 at 23:54

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.