2

I am just wondering how to enable the superword-mode globally?

I tried to enable it following the answers found here:

How to enable ido-mode forever?

, using:

(require 'superword-mode)
(superword-mode t)

But I am getting an error:

File is missing: Cannot open load file, No such file or directory, superword-mode

I am using Emacs 26 under Ubuntu 18.04. Using M-x superword-mode manually enables the mode right. But I just don't want to enable the mode every time.

I also tried (superword-mode t) alone, but it does not work and emacs is still stopping at underscores when moving forward a word (M-f).

I guess a related question is, is there a generic way of enabling a minor mode?

-- Update --

I tried:

(require 'superword)

as suggested in the comments. But I am still getting the same error:

Warning (initialization): An error occurred while loading ‘/home/user/.emacs.d/init.el’:

File is missing: Cannot open load file, No such file or directory, superword

This is with GNU Emacs 26.2 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.22.30)

  • 1
    Try (require 'superword) instead. – Dan Jun 13 at 18:20
  • See C-h f require. – Drew Jun 13 at 19:32
  • @Dan superword-mode is defined in the library subword of Emacs 26.2 so it must be (require 'subword) instead of (require 'superword). On the other hand subword is bundled with Emacs 26.2 and the mode function it is autoloaded so require should not be necessary. No idea what is going on there. Maybe, the OP tried to install some other shadowing version and that failed. E.g., an empty subword.el somewhere with higher prio in load-path would display such effects. – Tobias Jun 13 at 21:07
  • My last comment implies that you should definitively test with emacs -Q. Note for Windows-users: You can start emacs -Q from a running Emacs by M-& emacs -Q <RET>. – Tobias Jun 13 at 21:10
  • It could also mean that the autoload files are not correctly provided by the installation. In that case (require 'subword) should help. But, you should seriously check your installation in that case. – Tobias Jun 13 at 21:14
3

I am just wondering how to enable the superword-mode globally?

Use (global-superword-mode t).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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