Minor improvements and updated for C#

This commit is contained in:
Andrew Scott 2023-11-26 23:54:45 -05:00
parent f6f0df4654
commit 30f5ca39b9
Signed by: a
GPG key ID: 7CD5A5977E4931C1
2 changed files with 40 additions and 24 deletions

View file

@ -31,6 +31,22 @@
;;; Code: ;;; 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 ;; Disable package.el
(setq package-enable-at-startup nil) (setq package-enable-at-startup nil)
@ -75,25 +91,9 @@
{{- end }} {{- end }}
;; Some GUI options ;; Some GUI options
(push '(tool-bar-lines . 0) default-frame-alist)
(push '(menu-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) (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) (provide 'early-init)
;;; early-init.el ends here ;;; early-init.el ends here

View file

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