-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathinit.el
More file actions
130 lines (97 loc) · 4.07 KB
/
init.el
File metadata and controls
130 lines (97 loc) · 4.07 KB
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
;;; init.el --- my uber kewl init.el
;;; Commentary:
;;; Code:
;; Added by Package.el. This must come before configurations of
;; installed packages. Don't delete this line. If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
;; You may delete these explanatory comments.
(package-initialize)
(require 'cl-lib)
(setq debug-on-error t)
;; debug-on-signal t
;; debug-on-quit t)
;; set PATH to use standalone texlive instead
(setenv "PATH" "/opt/texlive/2023/bin/x86_64-linux:$PATH" t)
;; load path for elisp files
(add-to-list 'load-path (expand-file-name "~/.emacs.d/lisp"))
;; ;; kill old org before adding new org path
;; (load-file "~/.emacs.d/kill-old-org.el")
;; (add-to-list 'load-path (expand-file-name "~/build/org-mode/lisp"))
;; Emacs C source directory
(setq find-function-C-source-directory "~/build/emacs/src")
;; load custom file
(setq custom-file "~/.emacs.d/emacs-custom.el")
(load-file custom-file)
;; turn on ibuffer by default
(progn (ibuffer) (switch-to-buffer "*scratch*"))
;; to get correct versions of remote programs from PATH
(require 'tramp)
(add-to-list 'tramp-remote-path 'tramp-own-remote-path)
(require 'session)
(setq session-save-file-coding-system 'utf-8)
;;; Source: https://www.emacswiki.org/emacs/EmacsSession - LeWang
(defun sa-reveal-dwim ()
"Expand folded secitons as required."
(when (and (or (memq major-mode '(org-mode outline-mode))
(and (boundp 'outline-minor-mode)
outline-minor-mode))
(outline-invisible-p))
(if (eq major-mode 'org-mode)
(org-reveal)
(show-subtree))))
; needed, as this is interpreted as C-x C-/ - don't know why
(global-set-key (kbd "C-x C-_") 'session-jump-to-last-change)
(add-hook 'after-init-hook 'session-initialize)
(add-hook 'session-after-jump-to-last-change-hook 'sa-reveal-dwim)
(add-hook 'after-save-hook 'session-save-session)
(require 'orgalist)
;; Colour theme and other gui related config
(load-file "~/.emacs.d/ui-config.el") ; requires Emacs 24 themes
;; Important movement and editing config with some essential libraries
(load-file "~/.emacs.d/keybindings.el")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Mode hooks and other mode specific customisations ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(load-file "~/.emacs.d/ivy-config.el")
(load-file "~/.emacs.d/lsp-config.el")
;; (load-file "~/.emacs.d/copilot-config.el")
;; Version control related customisations
(load-file "~/.emacs.d/vc-config.el")
;; C/C++
(load-file "~/.emacs.d/cpp-config.el")
;; `text-mode' and `org-mode' madness ;)
(load-file "~/.emacs.d/org-mode-config.el")
(load-file "~/.emacs.d/text-mode-config.el") ; has some org dependence
;; use with mutt, ItsAllText and eml files
(load-file "~/.emacs.d/email-config.el") ; has some org dependence
;; mode to edit markdown files (e.g. StackOverflow answers with ItsAllText)
(autoload 'markdown-mode "markdown-mode"
"Major mode for editing Markdown files" t)
(add-to-list 'auto-mode-alist (cons "\\.md\\'" 'markdown-mode))
;; `taskjuggler-mode' for tjp files
(autoload 'taskjuggler-mode "taskjuggler-mode"
"Major mode for editing TaskJuggler input files." t)
(add-to-list 'auto-mode-alist (cons "\\.tjp\\'" 'taskjuggler-mode))
;; Lisp/Elisp customisations
(defun sa-lisp-mode-hook ()
"Emacs list mode hook."
;; (paredit-mode t)
(eldoc-mode t))
(add-hook 'lisp-mode-hook 'sa-lisp-mode-hook)
(add-hook 'emacs-lisp-mode-hook 'sa-lisp-mode-hook)
;; Python
(load-file "~/.emacs.d/py-config.el")
;; Flycheck
(load-file "~/.emacs.d/flyc-config.el")
;; shell-script-mode customisations
(add-hook 'after-save-hook 'executable-make-buffer-file-executable-if-script-p)
;; ANSI colours in Emacs shell
(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)
(add-hook 'compilation-mode-hook 'ansi-color-for-comint-mode-on)
;; NOTE: to customise behaviour of special buffers, see:
;; `display-buffer-alist' & `display-buffer'). E.g. special buffers:
;; '("*grep*" "*tex-shell*" "*compilation*" "*find*")
;;; init.el ends here
;; Local Variables:
;; flycheck-disabled-checkers: (emacs-lisp emacs-lisp-checkdoc)
;; End: