Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,17 @@ Note that `god-mode-describe-key` is only able to interpret key-bindings that ar

## Visual indicators for God mode

You can change the cursor style to visually indicate whether God mode is active
God mode allows you to customize its minor mode lighter by customizing the `god-mode-lighter-string` variable and the `god-mode-lighter` face.
For example, if you don't want any lighter, you can set the string to nil.
On the other hand, if you want the lighter to stand out, you can change the face, e.g. by making it inherit from `error`.
You can do this using `M-x customize-face RET god-mode-lighter` or as follows:

```emacs-lisp
(custom-set-faces
'(god-mode-lighter ((t (:inherit error)))))
```

Additionally, you can change the cursor style to visually indicate whether God mode is active
as follows:

```emacs-lisp
Expand Down
16 changes: 15 additions & 1 deletion god-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,18 @@ in God mode will be translated to `C-<f5>'."
:group 'god
:type 'boolean)

(defcustom god-mode-lighter-string
"God"
"String displayed on the mode line when God mode is active.
Set it to nil if you don't want a mode line indicator."
:group 'god
:type '(choice string (const :tag "None" nil)))

(defface god-mode-lighter
'((t))
"Face for God mode's lighter."
:group 'god)

(defun god-mode-make-f-key (n &optional shift)
"Get the event for numbered function key N, with shift status SHIFT.
For example, calling with arguments 5 and t yields the symbol `S-f5'."
Expand All @@ -134,7 +146,9 @@ For example, calling with arguments 5 and t yields the symbol `S-f5'."
(define-minor-mode god-local-mode
"Minor mode for running commands."
:init-value nil
:lighter " God"
:lighter (god-mode-lighter-string
((" "
(:propertize god-mode-lighter-string face god-mode-lighter))))
:keymap god-local-mode-map
(if god-local-mode
(run-hooks 'god-mode-enabled-hook)
Expand Down