summaryrefslogtreecommitdiffstats
path: root/roles/edit/templates/emacsconf-edit.el
blob: 481892b825f341b3aadb45f68198ee7a7409f177 (plain) (blame)
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
;; {{ ansible_managed }}

(progn (require 'package)
       (let ((packages (seq-remove #'package-installed-p '({% for package in emacsconf_edit_packages %}{{ package }} {% endfor %}))))
         (when packages
           (package-refresh-contents)
           (mapc #'package-install packages))))
;; Configuration
(vertico-mode)
(show-paren-mode)
(fset 'yes-or-no-p 'y-or-n-p)
(global-set-key (kbd "C-x g") 'magit-status)
(global-set-key (kbd "C-x b") 'consult-buffer)
(global-set-key (kbd "M-g t") 'emacsconf-go-to-talk)
(global-set-key (kbd "C-.") 'embark-act)
(global-set-key (kbd "C-c .") 'embark-act)
(global-set-key (kbd "C-;") 'embark-act)
(modus-themes-load-vivendi)
(org-babel-do-load-languages  'org-babel-load-languages '((emacs-lisp . t) (shell . t)))
(setq backup-directory-alist '(("." . "~/.emacs.d/backups")))
(find-file "{{ emacsconf_private_dir }}/conf.org")
(split-window-horizontally)
(magit-status "{{ emacsconf_edit_wiki_dir }}")
(global-auto-revert-mode 1)
(with-eval-after-load 'projectile
  (projectile-mode +1)
  (define-key projectile-mode-map (kbd "C-c p") 'projectile-command-map)
  (setq projectile-completion-system 'default)
  (setq projectile-enable-caching t)
  (setq projectile-indexing-method 'alien)
  (add-to-list 'projectile-globally-ignored-files "node_modules")
  (add-to-list 'projectile-globally-ignored-files ".cache")
  (add-to-list 'projectile-globally-ignored-files "_cache"))

(setq completion-styles '(orderless))   
(setq completion-category-defaults nil) 
(setq completion-category-overrides '((file (styles orderless))))

(defhydra hydra-emacsconf ()
  ("e" embark-act "embark")
  ("t" emacsconf-go-to-talk "talk")
  ("c"
   (find-file emacsconf-org-file) "conf.org")
  ("C"
   (let ((default-directory (file-name-directory emacsconf-org-file)))
     (call-interactively #'projectile-find-file))
   "org dir")
  ("w"
   (let ((default-directory emacsconf-directory))
     (call-interactively #'projectile-find-file))
   "wiki")
  ("o" (find-file (expand-file-name (concat emacsconf-year "/organizers-notebook/index.org") emacsconf-directory))
   "org notes")
  ("a" (let ((default-directory emacsconf-ansible-directory))
         (call-interactively #'projectile-find-file))
   "ansible")
  ("i" (switch-to-buffer (erc-get-buffer "#emacsconf-org")))
  ("l" (let ((default-directory "{{ emacsconf_el_dir }}"))
         (call-interactively #'projectile-find-file))
   "lisp")
  ("b" emacsconf-backstage-dired "backstage")
  ("u" emacsconf-upload-dired "upload"))
(global-set-key (kbd "C-c e") #'hydra-emacsconf/body)

(require 'ox-md)
(server-start)