Skip to content

Commit

Permalink
added god-mode tab command handler
Browse files Browse the repository at this point in the history
Also, added org-mode handler for god-tab-command
  • Loading branch information
Daniel Dinnyes authored and Daniel Dinnyes committed Nov 13, 2023
1 parent fd9c125 commit 9589505
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion init.el
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,17 @@
(cons
(quote mode-line-inactive)
god-modeline-inactive-face)))
(defvar god-tab-command-alist nil
"Associatiation list for major-mode specific command to execute for TAB key while in god-mode")
(defun god-tab-command ()
(interactive)
(let* ((mode
(apply (function derived-mode-p)
(mapcar (function car) god-tab-command-alist)))
(command
(and mode (alist-get mode god-tab-command-alist))))
(if command (or (funcall command) (indent-for-tab-command))
(indent-for-tab-command))))
:bind
("C-x C-0" . delete-window)
("C-x C-1" . delete-other-windows)
Expand All @@ -99,7 +110,7 @@
("<escape>" . suspend-frame)
("C-z" . god-mode-all)
(:map god-local-mode-map
("TAB" . indent-for-tab-command)
("TAB" . god-tab-command)
("[" . backward-paragraph)
("]" . forward-paragraph)
("C-S-Z" . repeat))
Expand Down Expand Up @@ -515,6 +526,7 @@
(set-face-background 'doom-modeline-bar (face-background 'mode-line)))

(use-package org
:after (god-mode)
:init
(defun org-archive-done-tasks ()
"Archive all DONE and CANCELED tasks in the subtree of the current entry"
Expand All @@ -534,6 +546,9 @@
:hook
(outline-mode . visual-line-mode)
:config
(add-to-list
(quote god-tab-command-alist)
(quote (org-mode . org-cycle)))
(custom-set-variables
'(org-agenda-span 'day)
'(org-startup-indented t)
Expand Down

0 comments on commit 9589505

Please sign in to comment.