Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HOWTO] Disable rainbow-delimiters #2280

Closed
Shooooooooo opened this issue Dec 31, 2019 · 4 comments
Closed

[HOWTO] Disable rainbow-delimiters #2280

Shooooooooo opened this issue Dec 31, 2019 · 4 comments
Labels
is:support A request for user support: questions, how-to's, and discussions module:core Relevant to Doom core module:lang/cc Pertains to Doom's :lang cc module module:term/vterm Pertains to Doom's :term vterm module module:ui/modeline Pertains to Doom's :ui modeline module re:elisp Personal configuration issues, conflicts or questions status:resolved Issue was addressed internally

Comments

@Shooooooooo
Copy link
Contributor

What are you trying to achieve?
Trying to disable rainbow-delimiters and use a different parentheses highlighter.

What have you tried?
I have set package.el to:
(package! rainbow-delimiters :disable t)
and doom refresh.

Now, I am getting this warning/error if I open up my C++ file:
File mode specification error: (void-function rainbow-delimiters-mode)

May I know if there is a more elegant way of disabling rainbow-delimiters? I could not find and reference of doing so. Thanks!

@Shooooooooo Shooooooooo added the is:support A request for user support: questions, how-to's, and discussions label Dec 31, 2019
@hlissner hlissner added module:core Relevant to Doom core module:lang/cc Pertains to Doom's :lang cc module re:elisp Personal configuration issues, conflicts or questions labels Dec 31, 2019
@hlissner
Copy link
Member

You should not disable core packages with package!. If they are in core, the rest of Doom assumes it is always present. Instead, remove rainbow-delimiters-mode from c-mode-common-hook:

(after! cc-mode
  (remove-hook 'c-mode-common-hook #'rainbow-delimiters-mode))

I will be moving some of these packages into modules soon.

@Shooooooooo
Copy link
Contributor Author

Thanks for pointing this out! I am trying to migrate some of my settings from my vanilla Emacs setup to doom. Really like doom-emacs so far!
I have another 2 questions during the migrate process.

  1. What is the recommended way for dynamically choose whether to load a module?
    e.g. Only load doom's modeline if running in GUI. Otherwise, use some other modeline package.
    The only way I can think of currently is to disable the module, and declare and configure the doom-modeline package manually. But, I guess that will lose some stuff in the modeline module?

  2. After enabling vterm module and load up a terminal, my modeline disappears for the terminal buffer. Is it by design?

Thanks again!

@hlissner
Copy link
Member

hlissner commented Dec 31, 2019

What is the recommended way for dynamically choose whether to load a module?

It depends on the condition. Whenever your module list (i.e. doom! block) changes, you have to run doom sync (same as doom refresh). If the condition could change from startup-to-startup, without running doom sync, then it won't work.

If the condition is more stable, e.g. what OS you're on, or what version of Emacs you're running, you can use :if, :when, :unless and :cond as demonstrated here.

Only load doom's modeline if running in GUI. Otherwise, use some other modeline package.

In this case, you could add this to your ~/.doom.d/config.el:

(unless (display-graphic-p)
  (remove-hook 'after-init-hook #'doom-modeline-mode))

After enabling vterm module and load up a terminal, my modeline disappears for the terminal buffer. Is it by design?

Yes. To reverse this:

(after! vterm
  (remove-hook 'vterm-mode-hook #'hide-mode-line-mode))

@hlissner hlissner added module:term/vterm Pertains to Doom's :term vterm module module:ui/modeline Pertains to Doom's :ui modeline module labels Dec 31, 2019
@Shooooooooo
Copy link
Contributor Author

Thanks for helping out~ Happy new year!

@hlissner hlissner added the status:resolved Issue was addressed internally label Dec 31, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 31, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
is:support A request for user support: questions, how-to's, and discussions module:core Relevant to Doom core module:lang/cc Pertains to Doom's :lang cc module module:term/vterm Pertains to Doom's :term vterm module module:ui/modeline Pertains to Doom's :ui modeline module re:elisp Personal configuration issues, conflicts or questions status:resolved Issue was addressed internally
Projects
None yet
Development

No branches or pull requests

2 participants