Questions tagged [minor-mode]

provides optional features that users may enable or disable independently of the choice of major mode. Minor modes can be enabled individually or in combination with other modes.

Filter by
Sorted by
Tagged with
1
vote
1answer
32 views

Why is `key-chord-mode` not listed among enabled minor modes?

After starting Emacs with the following init.el file, key-chord-mode is turned on. ;; Speed up startup (setq gc-cons-threshold 402653184 gc-cons-percentage 0.6) (add-hook 'after-init-hook ...
0
votes
3answers
26 views

Swap Shift/non-shift key behavior for particular mode

I want to press - on my keyboard and have _ be inserted and vice-versa only for a particular mode. The following does this globally using the post-self-insert-hook, It checks the character just ...
0
votes
1answer
26 views

I can turn on minor modes like electric pair modes in my init, but they’re not having effect unless manually reactivated [duplicate]

So I can put a line like, (setq-default global-linum-mode t) or (setq-default electric-par-mode t) in my init file, and I can check with C-h v that the variables are in fact set to t (they are), but ...
0
votes
1answer
31 views

Treat initial numbers as argument to functions in minor mode

Is it possible to treat typed numbers similar to universal argument C-u 10 C-n, but make it so that there is no need to type C-u in a minor mode? So only 10 C-n would be needed to move 10 lines down ...
0
votes
0answers
17 views

how to get line wrap to had return at puncuation

I've see a few similar questions: Editing files with one-sentence-per-line https://stackoverflow.com/questions/41637313/how-to-make-a-function-that-straights-out-each-sentence-in-a-paragraph-to-...
0
votes
1answer
62 views

How to set key binding for read-only-mode? in order to simplify cursor movement

moving point command: next-line, previous-line, forward-char, backward-char, etc. How to omit Ctrl key in read-only-mode? How can I combine with read-only-mode-hook to automatically enable keybind ...
1
vote
1answer
84 views

How do you automatically enable writeoom-mode when org-mode starts?

I want to enable writeroom-mode whenever I startup org-mode because I don't really ever want writeroom-mode to be disabled if I'm using org-mode.
0
votes
0answers
16 views

Keybindigs conflict between minor modes

The configuration that I have for python mode implies loading both elpy.el and python.el. The things is that I found the python.el keybindings more natural than the elpy.el ones. And most of the ...
0
votes
0answers
53 views

Disable auto-fill mode in all the major modes

When try to disable 'auto-fill-mode`, I search the following answers how to disable minor mode (enabled using prog-mode-hook) for a particular major mode This answer narrow it focus on the python-...
1
vote
1answer
47 views

How to turn typopunct minor mode on globally

I want to be able to use typopunct minor mode globally. I have tried to add (global-typopunct-mode 1) to my init file, like so ;; Typopunct mode (require 'typopunct) (typopunct-change-language '...
2
votes
1answer
47 views

How to use `recover-session` and `dired-omit-mode` in Emacs 26 and lower?

Using Emacs 26.1, I have enabled dired-omit-mode globally with (add-hook 'dired-mode-hook #'dired-omit-mode). When using recover-session, I don't see any files. How to fix this? Creating a .dir-...
2
votes
1answer
103 views

How to enable the superword minor mode globally?

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) (...
1
vote
1answer
57 views

Enabling a minor mode in all but some buffers

I want to enable display-line-numbers-mode in all buffers except pdf buffers. Can I do that without making a list of all the major modes except pdf-view mode?
0
votes
1answer
22 views

Trouble adding post-self-insert-hook in define-minor-mode

I am trying to write a minor mode that upon visiting a word, it manipulate it. There is a list of words which is parsed from a file. Here is the problem: (define-minor-mode auto-gls-mode "...
1
vote
0answers
45 views

How are unrelated modes enabled?

I've been an emacs user for about a year now and I use it for Haskell programming. I chose to go the vanilla emacs route and customized a plain init file as I went along. Over time, however, I ...
0
votes
3answers
75 views

Invoke minor mode upon visiting an org file (on a per-file basis)

I have certain org files (scientific manuscripts) that I want to automatically show in Olivetti mode with a specified width upon opening. Is it possible to enable Olivetti (or generally, any minor ...
2
votes
2answers
202 views

Are there hooks for leaving modes?

There seems to be a bug in clojure-mode (mentioned here) because it does things in a mode hook (for paredit-mode) but doesn't undo them when the mode is turned off. I understand that add-hook can ...
2
votes
1answer
90 views

How to automatically remove a hook provided by a minor mode after disabling that mode?

I want to write a minor which evaluates some code in the buffer after saving a file. I activate after-save-hook for this mode: (add-hook 'my-minor-mode-name-hook #'(lambda () (add-hook 'after-save-...
1
vote
1answer
26 views

Set prefix key on load of minor mode

I am trying to change the default prefix key C-c @ to C-c for outline-minor-mode: (define-key outline-minor-mode-map (kbd "C-c") (lookup-key outline-minor-mode-map (kbd "C-c @"))) This ...
1
vote
1answer
35 views

Remove the verbose description in mode line

I started my Emacs Venture days ago with prelude. but find that the mode line is verbose UUU:----F1 scratch All of 144 (4,0) (EL guru FlyC- company ivy EditorConfig ws Projectile super-...
0
votes
0answers
59 views

impatient mode javascript 'Identifier has already been declared'

Impatient-mode dosen't work with my javascript code GitHub Repo Site works on first visit, but after any change in the buffor js throws error "Identifier 'Ball' has already been declared". How I can ...
4
votes
1answer
96 views

How to suppress a minor mode's key binding in only certain major modes?

Suppose that I use minor mode MIN with a whole bunch of major modes. In one of those major modes, call it MAJ1, MIN's binding for a specific key K is undesirable; I would therefore like to suppress ...
3
votes
1answer
103 views

Minor markdown-mode for comments

I like to use the markdown-mode for READMEs. And I would like to use the markdown-mode as a minor-mode for comments in other major-modes like sh-mode. Is this possible somehow?
3
votes
1answer
698 views

how to disable all the minor modes (when a specific major mode is enabled) with elisp

Is there any function do disable all the minor modes if I enable a specific major mode (let's take the text-mode as an example)?
0
votes
2answers
122 views

Disabling a minor mode in a specific buffer

Running spacemacs 0.200.13 on emacs 25.2.2 on Kubuntu 18.04. I have globally enabled golden-ratio-mode (a minor mode). But I would like to disable it in a particular buffer, *Org Agenda* to be ...
1
vote
2answers
221 views

cscope-minor-mode not enabled for C in emacs 25

I'm using Emacs 25 on Ubuntu 16.04, after a while spent on Emacs 24. One thing that I've noticed changed in version 25 is, cscope minor mode is not enabled by default when I edit C files, while it was ...
2
votes
2answers
60 views

How to conditionally abort a minor-mode invocation?

I have a minor mode definition like this, and I want to prevent it from being enabled when the config variable example-mode-config has not been defined. ;;; .... ;;;###autoload (define-minor-mode ...
1
vote
1answer
279 views

Bindings for source code when debugging in gdb/gud

We can define a bunch of bindings for gud-mode through gud-mode-map. But it seems these bindings only hold when the active window is one of the dedicated gdb windows (or simply the comint window if ...
2
votes
1answer
253 views

buffer-local advice

I am trying to create a buffer local advice to run some code when a minor mode is disabled. I looked through the documentation for add-function and saw this If PLACE is a symbol, its `default-value' ...
0
votes
0answers
85 views

lose reftex-isearch-minor-mode after refresh

I want to activate reftex-isearch-minor-mode and tried the solution in this post offered by giordano, (add-hook 'TeX-mode-hook (lambda () (reftex-isearch-minor-mode))) ; for AUCTeX it works when I ...
2
votes
1answer
685 views

How to disable `abbrev-mode`?

I am using Spacemacs and it always ask me to save .cache/abbrev_defs which is very annoying. I tried to put (abbrev-mode -1) in dotspacemacs/user-config function. But it still ask for save the ...
0
votes
0answers
150 views

term without line numbers and highlight for current line

I have the following settings in ~/.emacs: (setq linum-relative-current-symbol "") (linum-mode) (linum-relative-global-mode) (global-hl-line-mode t) In order to supress both these features in ...
2
votes
2answers
130 views

Keybinding in Julia minor mode

I am unable to change keybinding in a minor mode. Initiaton of minor mode: (add-hook 'julia-mode-hook 'julia-repl-mode) I tried a view variatons for the keybinding: (add-hook 'julia-repl-mode ...
2
votes
1answer
69 views

Global minor mode that requires another during its lifetime

Say I'm developing a minor mode A that happens to need minor mode B enabled during its lifetime. The most straightforward way is to do something like: (define-minor-mode A-mode :global t :...
2
votes
1answer
44 views

Enable minor-mode during function call

Similar to the somewhat neat, but in the end too clunky, hydra-goto-line, I'd like to customize goto-line to enable linum-mode, but only during the function call. I tried add-advice, :before and :...
0
votes
0answers
120 views

Create a minor mode only for prog-mode major modes

I am working on a minor-mode and I'd like it to be active only for major modes derived from prog-mode. So far I know that the macro define-minor-mode takes a argument :global to decide whether or not ...
0
votes
1answer
111 views

How to enable multiple minor modes in one shot?

In order to perform some debugging, I'd like to enable multiple (say n) modes: mode-1, mode-2, ..., mode-n. This can be done thanks to a C-x C-e at the end of each of the following lines: (mode-1 t) (...
1
vote
1answer
293 views

How to change mode-map of the minor mode?

I would like to change the mode-map of a minor mode with mode map. I mean replacing the original mode-map that was specified in the define-minor-mode call with another one. Keeping the two mode-map ...
1
vote
1answer
198 views

Syntax highlighting inside HTML5 <script> tags

I was curious if there was a way to get highlighting/indentation for any JavaScript that's inside of HTML5 tags? I don't frequently use JavaScript but for a class I'm in we're working with it. I ...
2
votes
1answer
910 views

How to make a specific read-only buffer writable?

The readonly status of the current buffer can be toggled with (read-only-mode) or pressing C-x C-q but I intend to make a buffer which is not current, writable. The below is what I am using (with-...
2
votes
1answer
564 views

Proper way to change prefix key for minor-mode map?

The package HideShow (hs-minor-mode) defines some key bindings with prefix key C-c @. What is the proper way to change this prefix key to C-c h? The new key binding should also replace the old key ...
3
votes
2answers
710 views

Making it clearer I'm in god-mode

I've been using emacs for a while, but am being quite dismayed by some quite hectic pinky-pain, so have just started using Chris Done's god-mode, which is great, I like it so far. The problem is that ...
0
votes
1answer
145 views

Save and restore variable

I am working on Spacemacs which gives you the ability toggle between Emacs "holy-mode" and Vim "evil-mode". However the evil-escape minor mode is still enabled. I am trying to find some way to disable ...
1
vote
1answer
54 views

File mode name with -mode suffix or not?

I am not sure when I should name file x-mode.el and when x.el. Note that because of established practice mode writer should put (provide 'x) or (provide x-mode) to the end of file and end-users load ...
2
votes
2answers
105 views

Disable minor mode when keys not in it's keymap are pressed

I was using this to implement line duplication in emacs and decided to bind it to C-c d and it works without problems What would be cooler though is if I can use C-c d do duplicate a line and then be ...
0
votes
0answers
61 views

Disabling automatic line highlighting

Every time I open a new file in emacs, hl-line-mode is enabled. I have put (global-hl-line-mode -1) (hl-line-mode -1) in my init.el, but to no avail. What am I doing wrong???
0
votes
2answers
1k views

How to stop a minor mode from auto-loading in Spacemacs?

The smartparens minor mode is quite annoying to me, so I want to have it disabled on default. However, I don't want to uninstall it, in case I need it someday. Can I disable a minor mode without ...
10
votes
1answer
733 views

Disabling electric-indent-mode for one mode (latex mode) only

I don't like the way electric indent mode works in latex-mode. Everywhere else (at least everywhere I use), it's great. How can I permanently disable electric indent mode for latex mode only, but ...
1
vote
1answer
200 views

Toggle minor mode with a custom keybinding

I'd like to be able to toggle M-x font-lock-mode with a custom keybinding like C-c l for example (or any minor mode for that matter). Can this be done relatively easily?
0
votes
2answers
378 views

How replace auto-complete-mode with company-mode in all major mode using it?

How I can replace auto-complete-mode with company-mode in all major mode using it? i.e. make all modes which activating auto-complete-mode (e.g. c-mode or sh-mode etc), activate company-mode instead ...