1

I've set up my emacs so that it automatically uses Octave mode when I open a .m file (really I'm working on Matlab files). I like to use viper-mode. However, when I open a .m file, viper mode gets turned off, and I have to manually restart it. Is there a way to modify my configuration so that viper mode stays on?

.emacs.d/init.el:

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

(require 'vista-c-style)
(add-hook 'c-mode-common-hook 'vista-set-c-style)
(add-to-list 'auto-mode-alist '("\\.h" . c++-mode)) ;; open .h files in c++ mode


;; octave mode
(autoload 'octave-mode "octave-mod" nil t)
(setq auto-mode-alist
  (cons '("\\.m$" . octave-mode) auto-mode-alist) )

;; other config (relate to org-mode) and definition of 'vista-c-style are snipped
Dave
  • 7,555
  • 8
  • 46
  • 88
  • Rather than the setq+require dance, you should just use `(viper-mode 1)`. You might also want to remove the `autoload` since it's unneeded currently and will be wrong in Emacs-24.4. where the file was renamed to `octave.el`. – Stefan Jun 14 '13 at 02:53

1 Answers1

1

This

(add-to-list 'viper-vi-state-mode-list 'octave-mode)

adapted from this question worked.

Community
  • 1
  • 1
Dave
  • 7,555
  • 8
  • 46
  • 88