~estraw/.emacs.d

ref: c72ecd5bd0c2e398a6527eaa752b82804a182fcd .emacs.d/modules/module-misc.el -rw-r--r-- 2.3 KiB
c72ecd5bEvan Straw Misc formatting and other changes 3 months ago
                                                                                
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
81
82
83
(use-package csv-mode
  :defer t)

(use-package yaml-mode
  :defer t)

(use-package ediff
  :defer t
  :config
  (setq ediff-window-setup-function 'ediff-setup-windows-plain))

(use-package debbugs
  :commands (debbugs-gnu))

(use-package disk-usage
  :commands (disk-usage disk-usage-here))

(use-package ace-window
  :commands (ace-window
	     ace-window-display-mode)
  :config
  (setq aw-dispatch-always t
	aw-display-mode-overlay nil
	aw-background nil)
  :bind ("C-x C-o" . ace-window)
  :hook (emacs-startup . ace-window-display-mode))

(use-package dired
  :config (setq dired-dwim-target t))

(use-package transient
  :init
  (defun find-code-dir ()
    (interactive)
    (find-file "~/Sync/code/"))
  (defun find-school-dir ()
    (interactive)
    (find-file "~/Sync/school/"))
  (defun find-guix-dir ()
    (interactive)
    (find-file "~/Sync/code/guix/"))
  (defun find-init-module ()
    (interactive)
    (let ((default-directory "~/.emacs.d/modules/"))
      (call-interactively 'find-file)))
  (defun find-manifest-file ()
    (interactive)
    (let ((default-directory "~/Sync/code/manifest/"))
      (call-interactively 'find-file)))
  (defun visit-file-truename ()
    (interactive)
    (if (eq major-mode 'dired-mode)
	(find-file (file-truename default-directory))
      (if (buffer-file-name)
	  (find-file (file-truename (buffer-file-name)))
	(message "Buffer is not visiting a file!"))))
  :config
  (define-transient-command quick-goto ()
    "Quickly runs a command from a popup window."
    ["Common directories and files"
     ("c" "Open code directory" find-code-dir)
     ("s" "Open school directory" find-school-dir)
     ("i" "Open init file" open-dotfile)
     ("m" "Open init module" find-init-module)
     ("p" "Open Guix manifest file" find-manifest-file)
     ("g" "Open guix checkout" find-guix-dir)]
    ["Common commands"
     ("a" "Org Agenda" org-agenda)
     ("M" "Mail" gnus)
     ("f" "Visit linked file" visit-file-truename)])
  :bind ("C-<menu>" . quick-goto))

(setq enable-remote-dir-locals t)

(use-package tramp
  :config
  (let ((process-environment tramp-remote-process-environment))
    (setenv "ENV" "$HOME/.profile")
    (setq tramp-remote-process-environment process-environment)))

(global-set-key (kbd "C-x <f5>") #'revert-buffer)
  
(provide 'module-misc)