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

[FR] Provide global minor mode #5

Closed
s-kostyaev opened this issue Nov 25, 2024 · 1 comment
Closed

[FR] Provide global minor mode #5

s-kostyaev opened this issue Nov 25, 2024 · 1 comment
Assignees

Comments

@s-kostyaev
Copy link

Hi. Thank you for this useful package.
Please provide global minor mode. You can create it like this:

  (define-global-minor-mode
    my-global-outline-indent-minor-mode
    outline-indent-minor-mode
    (lambda () (outline-indent-minor-mode 1)))
@jamescherti
Copy link
Owner

jamescherti commented Nov 25, 2024

Hi. Thank you for this useful package.

You're very welcome! Thank you for your feedback on outline-indent.

Please provide global minor mode. You can create it like this:

Activating outline-indent globally would enable it in contexts where it may not be appropriate (e.g., the minibuffer, or file types that do not rely on indentation, etc.). By keeping outline-indent mode local, users have greater control over where it is activated.

You can activate it across all programming modes the text modes, which behaves similarly to a global mode:

;; All programming modes
(add-hook 'prog-mode-hook #'outline-indent-minor-mode)
(add-hook 'text-mode-hook #'outline-indent-minor-mode)

However, I do not recommend the above.

It is preferable to enable outline-indent-minor-mode for specific modes like Python and YAML:

;; Python
(add-hook 'python-mode-hook #'outline-indent-minor-mode)
(add-hook 'python-ts-mode-hook #'outline-indent-minor-mode)

;; YAML
(add-hook 'yaml-mode-hook #'outline-indent-minor-mode)
(add-hook 'yaml-ts-mode-hook #'outline-indent-minor-mode)

This gives you greater control over which specific file types have outline-indent enabled.

@jamescherti jamescherti self-assigned this Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants