2022-04-22 02:54:47 +00:00
|
|
|
;; -*- lexical-binding: t; -*-
|
|
|
|
;; TURN ON IN INIT FILE!!!!!
|
|
|
|
|
|
|
|
;; Make gc pauses faster by decreasing the threshold.
|
|
|
|
(setq gc-cons-threshold (* 2 1000 1000))
|
|
|
|
|
2022-11-08 17:52:56 +00:00
|
|
|
;; disable warnings from popping up, they are still logged
|
|
|
|
(setq warning-suppress-types '((comp)))
|
|
|
|
|
2022-04-22 02:54:47 +00:00
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
; helper functions
|
|
|
|
;; Figure out if inside Termux
|
|
|
|
(require 'subr-x)
|
|
|
|
(setq kmn/is-termux
|
|
|
|
(string-suffix-p "Android" (string-trim (shell-command-to-string "uname -a"))))
|
|
|
|
|
2023-04-11 16:08:54 +00:00
|
|
|
;; day job env?
|
|
|
|
(setq kmn/is-dayjob
|
|
|
|
(string= "PCE" (getenv "USERDOMAIN"))
|
|
|
|
)
|
|
|
|
|
2022-04-22 02:54:47 +00:00
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
; os specific config
|
2023-04-11 16:21:15 +00:00
|
|
|
(when (and (eq system-type 'windows-nt)
|
|
|
|
(not kmn/is-termux))
|
2022-04-22 02:54:47 +00:00
|
|
|
; Fix resolution of ~ to match other client paths
|
|
|
|
(setenv "HOME" "C:/Users/mcros/Nextcloud")
|
|
|
|
(setq default-directory "C:/Users/mcros/Nextcloud")
|
|
|
|
|
|
|
|
; add executables to path ahead of them being used by extensions / emacs stuff
|
|
|
|
(add-to-list 'exec-path "C:/Users/mcros/OneDrive/Programs/PortableApps/sqlite3")
|
2022-08-25 15:14:22 +00:00
|
|
|
(add-to-list 'exec-path "C:/Users/mcros/OneDrive/Programs/PortableApps/MultiMarkdown-Windows-6.6.0/bin")
|
2022-04-22 02:54:47 +00:00
|
|
|
)
|
2023-04-11 16:08:54 +00:00
|
|
|
(when kmn/is-dayjob
|
|
|
|
(setenv "HOME" "I:/")
|
|
|
|
(setq default-directory "I:/")
|
|
|
|
)
|
2022-04-22 02:54:47 +00:00
|
|
|
(when kmn/is-termux
|
|
|
|
; setup storage locations -- cheat so mobile/desktop look alike for file urls
|
|
|
|
;(setq user-init-file "/data/data/com.termux/files/home/storage/shared/.emacs")
|
|
|
|
;(setq user-emacs-directory "/data/data/com.termux/files/home/storage/shared/.emacs.d/")
|
|
|
|
;(setenv "HOME" "/data/data/com.termux/files/home/storage/shared/")
|
|
|
|
;(load user-init-file)
|
|
|
|
|
|
|
|
; Fix resolution of ~ to match other client paths
|
2022-04-26 12:06:30 +00:00
|
|
|
(setenv "HOME" "/data/data/com.termux/files/home/")
|
|
|
|
(setq default-directory "/data/data/com.termux/files/home/")
|
2022-08-26 17:14:12 +00:00
|
|
|
|
2022-04-22 02:54:47 +00:00
|
|
|
; Setup xdg-open as the default for opening files (except for the few we want emacs to open native)
|
|
|
|
; xdg-open is linked to termux-open by default ; if you need 'more' look into tmux-open and adjust accordingly
|
|
|
|
; (add-to-list 'org-file-apps '("\\.doc.*" . "open %s"))
|
2022-08-26 16:48:45 +00:00
|
|
|
(setq browse-url-browser-function 'browse-url-xdg-open)
|
2022-04-22 02:54:47 +00:00
|
|
|
(setq org-file-apps
|
|
|
|
'(;; default
|
|
|
|
(auto-mode . emacs)
|
|
|
|
("\\.org" . emacs)
|
|
|
|
("\\.txt" . emacs)
|
|
|
|
(".*" . "xdg-open %s")))
|
|
|
|
)
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
; global config
|
|
|
|
(load "~/.emacs.d.profiles/common/_global.el")
|
2023-04-08 16:53:12 +00:00
|
|
|
(load "~/.emacs.d.profiles/common/generic_functions.el")
|
|
|
|
(load "~/.emacs.d.profiles/common/workspaces.el")
|
|
|
|
|
2022-04-22 02:54:47 +00:00
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
2022-06-02 18:33:30 +00:00
|
|
|
; compile bytecode for this profile
|
|
|
|
(unless (was-compiled-p "~/.emacs.d.profiles/code")
|
|
|
|
(byte-recompile-directory "~/.emacs.d.profiles/code" 0))
|
2022-04-22 02:54:47 +00:00
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
; additional packages
|
|
|
|
(add-to-list 'package-selected-packages
|
2023-04-11 19:27:41 +00:00
|
|
|
'(json-mode python-mode powershell rust-mode origami go-mode yaml-mode lua-mode)
|
2023-04-11 15:35:56 +00:00
|
|
|
)
|
|
|
|
(when (not kmn/is-dayjob)
|
|
|
|
(add-to-list 'package-selected-packages
|
|
|
|
'(auctex-latexmk auctex dockerfile-mode)
|
|
|
|
)
|
2022-04-22 02:54:47 +00:00
|
|
|
)
|
|
|
|
|
2022-08-26 14:25:29 +00:00
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
2022-09-06 19:08:49 +00:00
|
|
|
; activate helm after its fully configured (may be configured beyond global defaults in other profiles so we have to activate locally)
|
|
|
|
(helm-mode 1)
|
|
|
|
|
2023-04-08 16:14:10 +00:00
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
; tab line via centaur tabs
|
|
|
|
(centaur-tabs-mode t)
|
|
|
|
|
2022-04-22 02:54:47 +00:00
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
; programming
|
|
|
|
; code folding
|
|
|
|
(require 'origami)
|
|
|
|
|
|
|
|
; lua
|
|
|
|
(autoload 'lua-mode "lua-mode" "Lua editing mode." t)
|
|
|
|
(add-to-list 'auto-mode-alist '("\\.lua$" . lua-mode))
|
|
|
|
(add-to-list 'interpreter-mode-alist '("lua" . lua-mode))
|
|
|
|
(setq lua-indent-level 4)
|
|
|
|
|
|
|
|
; dockerfile
|
2023-04-11 15:35:56 +00:00
|
|
|
(when (not kmn/is-dayjob)
|
2022-04-22 02:54:47 +00:00
|
|
|
(autoload 'dockerfile-mode "dockerfile-mode" "Dockerfile editing mode." t)
|
|
|
|
(add-to-list 'auto-mode-alist '("Dockerfile\\'" . dockerfile-mode))
|
2023-04-11 15:35:56 +00:00
|
|
|
)
|
2022-04-22 02:54:47 +00:00
|
|
|
|
|
|
|
; yaml
|
|
|
|
(autoload 'yaml-mode "yaml-mode" "YAML editing mode." t)
|
|
|
|
(add-to-list 'auto-mode-alist '("\\.ya?ml\\'" . yaml-mode))
|
|
|
|
|
|
|
|
; go
|
|
|
|
(autoload 'go-mode "go-mode" "go editing mode." t)
|
|
|
|
(add-to-list 'auto-mode-alist '("\\.go\\'" . go-mode))
|
|
|
|
|
|
|
|
; rust
|
|
|
|
(autoload 'rust-mode "rust-mode" "rust editing mode" t)
|
|
|
|
(add-to-list 'auto-mode-alist '("\\.rs\\'" . rust-mode))
|
|
|
|
|
|
|
|
; c/cpp
|
|
|
|
(autoload 'cc-mode "cc-mode" "c/cpp editing mode" t)
|
|
|
|
(add-to-list 'auto-mode-alist '("\\.h\\'" . cc-mode))
|
|
|
|
(add-to-list 'auto-mode-alist '("\\.c\\'" . cc-mode))
|
|
|
|
(add-to-list 'auto-mode-alist '("\\.cpp\\'" . cc-mode))
|
|
|
|
|
|
|
|
; shell
|
|
|
|
(autoload 'sh-script "sh-script" "shell script editing mode" t)
|
|
|
|
(add-to-list 'auto-mode-alist '("\\.sh\\'" . sh-script))
|
|
|
|
|
|
|
|
; makefile
|
|
|
|
(autoload 'make-mode "make-mode" "makefile editing mode" t)
|
|
|
|
(add-to-list 'auto-mode-alist '("Makefile\\'" . make-mode))
|
|
|
|
|
|
|
|
; powershell
|
|
|
|
(autoload 'powershell "powershell" "powershell editing mode" t)
|
|
|
|
(add-to-list 'auto-mode-alist '("\\.ps1\\'" . powershell))
|
|
|
|
|
|
|
|
; [la]tex
|
2023-04-11 15:35:56 +00:00
|
|
|
(when (not kmn/is-dayjob)
|
2022-08-25 17:42:37 +00:00
|
|
|
(use-package tex
|
|
|
|
:ensure auctex)
|
|
|
|
(setq TeX-parse-self t)
|
|
|
|
(setq-default TeX-master nil)
|
2023-04-11 15:35:56 +00:00
|
|
|
)
|
2022-04-22 02:54:47 +00:00
|
|
|
|
|
|
|
; python
|
|
|
|
(autoload 'python-mode "python-mode" "python editing mode" t)
|
|
|
|
(add-to-list 'auto-mode-alist '("\\.py\\'" . python-mode))
|
|
|
|
|
|
|
|
; json
|
|
|
|
(autoload 'json-mode "json-mode" "json editing mode" t)
|
|
|
|
(add-to-list 'auto-mode-alist '("\\.json\\'" . json-mode))
|
2023-02-21 18:23:55 +00:00
|
|
|
(custom-set-variables
|
|
|
|
;; custom-set-variables was added by Custom.
|
|
|
|
;; If you edit it by hand, you could mess it up, so be careful.
|
|
|
|
;; Your init file should contain only one such instance.
|
|
|
|
;; If there is more than one, they won't work right.
|
|
|
|
'(custom-safe-themes
|
2023-04-08 16:14:10 +00:00
|
|
|
'("dde643b0efb339c0de5645a2bc2e8b4176976d5298065b8e6ca45bc4ddf188b7" default)))
|
2023-02-21 18:23:55 +00:00
|
|
|
(custom-set-faces
|
|
|
|
;; custom-set-faces was added by Custom.
|
|
|
|
;; If you edit it by hand, you could mess it up, so be careful.
|
|
|
|
;; Your init file should contain only one such instance.
|
|
|
|
;; If there is more than one, they won't work right.
|
|
|
|
'(default ((t (:family "MonoLisa Variable" :height 100))))
|
|
|
|
'(fixed-pitch ((t (:family "MonoLisa Variable" :height 120))))
|
|
|
|
'(variable-pitch ((t (:family "Atkinson Hyperlegible" :height 120)))))
|
2023-04-08 17:33:01 +00:00
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
2023-04-12 17:52:39 +00:00
|
|
|
; set ui to standard empty code workspace at launch
|
2023-04-08 17:33:01 +00:00
|
|
|
(add-hook 'after-init-hook (lambda ()
|
|
|
|
(kmn/workspace-code-empty)
|
|
|
|
))
|