-
Notifications
You must be signed in to change notification settings - Fork 1
/
про-режим-бога.el
80 lines (63 loc) · 3.04 KB
/
про-режим-бога.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
;;; про-режим-бога.el --- Режим бога, постоянный Контрол -*- lexical-binding: t -*-
;;; Commentary:
;;; Code:
(require 'mule)
;;;; Функция для выключения русского
(defun toggle-off-input-method ()
"Выключение текущего метода ввода."
(interactive)
(if current-input-method (deactivate-input-method)))
;;;; Режим Бога (всегда Ctrl)
(defun курсор-бога ()
(setq cursor-type (if (or god-local-mode buffer-read-only) 'box '(bar . 3)))
(if (or god-local-mode buffer-read-only) (hl-line-mode 1) (hl-line-mode -1)))
(use-package god-mode
:if window-system ;; в консоли отключено, потому что курсоор не меняет цвет
:defines (god-local-mode-map god-local-mode)
:functions (god-mode-all)
:ensure t
:hook (((god-mode-disabled god-mode-enabled) . курсор-бога)
;;(god-mode-enabled . restore-input-method)
(god-mode-enabled . toggle-off-input-method))
:bind (
("M-i" . god-local-mode)
("<escape>" . god-local-mode)
:map god-local-mode-map
("C-\\" . nil)
("i" . god-local-mode)
("RET" . (lambda () (interactive)))
("j" . next-line)
("k" . previous-line)
("l" . forward-char)
("h" . backward-char)
("C-j" . next-line)
("C-k" . previous-line)
("q" . kill-current-buffer)
)
:custom
(god-exempt-major-modes
'(dired-mode wdired-mode image-mode help-mode grep-mode exwm-mode
xref--xref-buffer-mode minibuffer-mode help-mode
vc-annotate-mode eshell-mode shell-mode term-mode
neotree-mode w3m-mode kite-mini-console-mode mu4e-main-mode
mu4e-headers-mode mu4e-view-mode browse-kill-ring-mode
sx-question-mode Info-mode google-static-mode
google-maps-static-mode magit-status-mode magit-popup-mode magit-diff-mode git-commit-mode
magit-log-mode magit-revision-mode ahg-status-mode
elfeed-show-mode elfeed-log-mode imenu-mode
elfeed-search-mode treemacs-mode proced-mode prodigy-mode
exwm-mode calendar-mode customize-mode diary-mode
menu-bar-mode docker-mode docker-container-mode
docker-image-mode docker-network-mode docker-volume-mode
package-menu-mode org-agenda-mode calc-mode comint-mode
racket-repl-mode racket-mode telega-image-mode telega-chat-mode telega-root-mode
lsp-ui-imenu-mode vterm-mode dashboard-mode helpful-mode eww-mode occur-mode ibuffer-mode
flymake-diagnostics-buffer-mode profiler-report-mode custom-mode chatgpt-shell-mode))
(god-exempt-predicates (list #'god-exempt-mode-p))
:config
(global-set-key (kbd "C-<f1>") help-map)
(global-set-key (kbd "C-h") help-map)
(god-mode-all)
(курсор-бога))
(provide 'про-режим-бога)
;;; про-режим-бога.el ends here