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)
C-h f require
.superword-mode
is defined in the librarysubword
of Emacs 26.2 so it must be(require 'subword)
instead of(require 'superword)
. On the other handsubword
is bundled with Emacs 26.2 and the mode function it is autoloaded sorequire
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 emptysubword.el
somewhere with higher prio inload-path
would display such effects.emacs -Q
. Note for Windows-users: You can startemacs -Q
from a running Emacs byM-& emacs -Q <RET>
.(require 'subword)
should help. But, you should seriously check your installation in that case.