Compare commits

...

2 commits

3 changed files with 55 additions and 32 deletions

View file

@ -2,29 +2,30 @@
# ~/.bash_profile
#
# Default text editors
export EDITOR=nvim
export VISUAL=emacs
# Ensure XDG env vars are set
# Add ~/.local/bin to $PATH
export PATH="${HOME}/.local/bin:${PATH}"
# XDG Base Directories
export XDG_CACHE_HOME="${HOME}"/.cache
export XDG_CONFIG_HOME="${HOME}"/.config
export XDG_DATA_HOME="${HOME}"/.local/share
export XDG_STATE_HOME="${HOME}"/.local/state
# add .local/bin to $PATH
export PATH="${HOME}/.local/bin:${PATH}"
# make Java behave when not using a DE
# Force Java to behave when not using a DE
export _JAVA_AWT_WM_NONREPARENTING=1
# Sometimes needed for gpg passphrase prompt
# GPG passphrase prompt
export GPG_TTY=$(tty)
# Mozilla + Wayland
export MOZ_ENABLE_WAYLAND=1
{{ if eq .chezmoi.hostname "helix" -}}
# scale GTK applicatons on hidpi screens
# Scale GTK applicatons
export GDK_SCALE=2 GDK_DPI_SCALE=0.50
{{- end }}
@ -36,6 +37,13 @@ export HISTFILE="${XDG_STATE_HOME}"/bash_history
# cargo
export CARGO_HOME="${XDG_DATA_HOME}"/cargo
# dotnet
export DOTNET_BUNDLE_EXTRACT_BASE_DIR="${XDG_CACHE_HOME}/dotnet_bundle_extract"
export DOTNET_CLI_HOME="${XDG_DATA_HOME}/dotnet/cli"
export DOTNET_CLI_TELEMETRY_OPTOUT=true
export DOTNET_TOOLS_PATH="${XDG_DATA_HOME}/dotnet/tools"
export PATH="${DOTNET_TOOLS_PATH}:${PATH}"
# go
export GOPATH="${XDG_DATA_HOME}"/go
export GOMODCACHE="${XDG_CACHE_HOME}"/go/mod
@ -68,4 +76,3 @@ export XAUTHORITY="${XDG_RUNTIME_DIR}"/Xauthority
# start river
[[ -z "${DISPLAY}" && "${XDG_VTNR}" -eq 1 ]] && exec dbus-run-session river

View file

@ -31,6 +31,22 @@
;;; Code:
;; Relocate emacs-user-directory to XDG_DATA_HOME
(setq user-emacs-directory
(expand-file-name "emacs/" (or (getenv "XDG_DATA_HOME") "~/.local/share/")))
;; Set cache directory
(setq xdg_cache_home
(expand-file-name "emacs/" (or (getenv "XDG_CACHE_HOME") "~/.cache/")))
(unless (file-directory-p xdg_cache_home)
(make-directory xdg_cache_home))
;; Move eln-cache to XDG_CACHE_HOME
(when (fboundp 'startup-redirect-eln-cache)
(if (< emacs-major-version 29)
(push (expand-file-name "eln-cache/" xdg_cache_home) native-comp-eln-load-path)
(startup-redirect-eln-cache (expand-file-name "eln-cache/" xdg_cache_home))))
;; Disable package.el
(setq package-enable-at-startup nil)
@ -75,25 +91,9 @@
{{- end }}
;; Some GUI options
(push '(tool-bar-lines . 0) default-frame-alist)
(push '(menu-bar-lines . 0) default-frame-alist)
(push '(tool-bar-lines . 0) default-frame-alist)
(push '(vertical-scroll-bars) default-frame-alist)
;; Relocate emacs-user-directory to XDG_DATA_HOME
(setq user-emacs-directory
(expand-file-name "emacs/" (or (getenv "XDG_DATA_HOME") "~/.local/share/")))
;; Set cache directory
(setq xdg_cache_home
(expand-file-name "emacs/" (or (getenv "XDG_CACHE_HOME") "~/.cache/")))
(unless (file-directory-p xdg_cache_home)
(make-directory xdg_cache_home))
;; Move eln-cache to XDG_CACHE_HOME
(when (fboundp 'startup-redirect-eln-cache)
(if (< emacs-major-version 29)
(push (expand-file-name "eln-cache/" xdg_cache_home) native-comp-eln-load-path)
(startup-redirect-eln-cache (expand-file-name "eln-cache/" xdg_cache_home))))
(provide 'early-init)
;;; early-init.el ends here

View file

@ -10,7 +10,7 @@
;;; Commentary:
;; My personal Emacs configuration.
;; My Emacs initialization file.
;;; License:
@ -39,6 +39,7 @@
(float-time
(time-subtract (current-time) before-init-time)))
gcs-done)))
;;; Initialize elpaca
(defvar elpaca-installer-version 0.6)
(defvar elpaca-directory (expand-file-name "elpaca/" user-emacs-directory))
@ -88,6 +89,9 @@
(use-package emacs
:elpaca nil
:init
;; Initial mode
(setq initial-major-mode 'fundamental-mode)
;;; Vertico
;; Add prompt to `completing-read-multiple'
(defun crm-indicator (args)
@ -124,7 +128,7 @@
scroll-conservatively 1000
scroll-preserve-screen-position t)
(when (fboundp 'pixel-scroll-precision-mode)
(pixel-scroll-precision-mode t))
(pixel-scroll-precision-mode))
;; Cursor
(setq-default cursor-type 'bar
@ -169,6 +173,8 @@
:elpaca nil
:config
(let ((auto_save_directory (concat xdg_cache_home "auto-save-list/")))
(unless (file-directory-p auto_save_directory)
(make-directory auto_save_directory))
(setq backup-directory-alist `((".*" . ,auto_save_directory))
auto-save-file-name-transforms `((".*" ,auto_save_directory t))))
(setq backup-by-copying t
@ -183,7 +189,9 @@
:elpaca nil
:defer 3
:hook
(((git-commit-mode markdown-mode) . flyspell-mode)
(((git-commit-mode
markdown-mode
text-mode) . flyspell-mode)
(lsp-mode . flyspell-prog-mode)))
(use-package mwheel
@ -262,7 +270,7 @@
(moody_inactive (face-attribute 'mode-line-inactive :background)))
(set-face-attribute 'mode-line nil :overline moody_line)
(set-face-attribute 'mode-line-inactive nil :overline moody_line)
(set-face-attribute 'mode-line-inactive nil :underline moody_line)
(set-face-attribute 'mode-line-inactive nil :underline moody_inactive)
(set-face-attribute 'mode-line nil :box nil)
(set-face-attribute 'mode-line-inactive nil :box nil)
(set-face-attribute 'mode-line-inactive nil :background moody_inactive))
@ -573,6 +581,7 @@
:hook
(((c-ts-mode
c++-ts-mode
csharp-ts-mode
go-ts-mode
python-ts-mode
zig-mode) . lsp)
@ -601,7 +610,8 @@
([remap xref-find-apropos] . consult-lsp-symbols)))
(use-package lsp-treemacs
:after (lsp-mode treemacs))
:after (lsp-mode treemacs)
:config (lsp-treemacs-sync-mode))
;; Debugging
(use-package dap-mode
@ -684,10 +694,16 @@
:custom
(web-mode-attribute-indent-offset 2)
(web-mode-code-indent-offset 2)
(web-mode-enable-front-matter-block t)
(web-mode-css-indent-offset 2)
(web-mode-markup-indent-offset 2)
(web-mode-enable-front-matter-block t)
(web-mode-engines-alist '(("blade" . "\\.blade\\.")
("razor" . "\\.cshtml\\'")))
:mode
((("\\.astro\\'" "\\.html?\\'") . web-mode)))
((("\\.astro\\'"
"\\.cshtml\\'"
"\\.html?\\'"
"\\.razor\\'") . web-mode)))
;; Zig
(use-package zig-mode