summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Ulmer <thomas.ulmer@redflagai.co>2026-02-11 15:37:32 -0800
committerThomas Ulmer <thomas.ulmer@redflagai.co>2026-02-11 16:02:01 -0800
commit67722ddb4200433493fecf5cfbac3690ef515f47 (patch)
treededd03202b9e4cfcb2f0b92d4a62aca963e68bdc
parente1740f662083ebcd5573e6876ad3ecc8a8488cd9 (diff)
emacs various prog tweaks and abbrevs
-rw-r--r--config/bash_profile4
-rw-r--r--config/emacs/abbrev_defs25
-rw-r--r--config/emacs/eshell/alias10
-rw-r--r--config/emacs/init.el35
-rw-r--r--config/emacs/site-lisp/my-eglot.el7
-rw-r--r--config/emacs/templates/c.eld5
6 files changed, 63 insertions, 23 deletions
diff --git a/config/bash_profile b/config/bash_profile
index 88f4ed4..ffb5007 100644
--- a/config/bash_profile
+++ b/config/bash_profile
@@ -30,3 +30,7 @@ if [ -d ~/.local/bin ]; then
export PATH=~/.local/bin:$PATH
fi
+if [ -d /usr/local/lib/pkgconfig ]; then
+ export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
+fi
+
diff --git a/config/emacs/abbrev_defs b/config/emacs/abbrev_defs
new file mode 100644
index 0000000..f7e175d
--- /dev/null
+++ b/config/emacs/abbrev_defs
@@ -0,0 +1,25 @@
+;; -*- coding: utf-8; lexical-binding: t -*-
+(define-abbrev-table 'c-mode-abbrev-table
+ '(
+ ("i16" "int16_t" nil :count 0)
+ ("i32" "int32_t" nil :count 1)
+ ("i64" "int64_t" nil :count 0)
+ ("i8" "int8_t" nil :count 1)
+ ("u16" "uint16_t" nil :count 0)
+ ("u32" "uint32_t" nil :count 0)
+ ("u64" "uint64_t" nil :count 0)
+ ("u8" "uint8_t" nil :count 2)
+ ))
+
+(define-abbrev-table 'c++-mode-abbrev-table
+'(
+("i16" "int16_t" nil :count 0)
+("i32" "int32_t" nil :count 1)
+("i64" "int64_t" nil :count 0)
+("i8" "int8_t" nil :count 1)
+("u16" "uint16_t" nil :count 0)
+("u32" "uint32_t" nil :count 0)
+("u64" "uint64_t" nil :count 0)
+("u8" "uint8_t" nil :count 2)
+))
+
diff --git a/config/emacs/eshell/alias b/config/emacs/eshell/alias
index 6dcd5cf..4e0652b 100644
--- a/config/emacs/eshell/alias
+++ b/config/emacs/eshell/alias
@@ -1,6 +1,6 @@
-alias ll ls -la $*
-alias gs git status $*
-alias gc git checkout $*
-alias gl git log --graph --all --oneline $*
-alias glt git log --graph --all --oneline --simplify-by-decoration $*
alias ff find-file $1
+alias glt git log --graph --all --oneline --simplify-by-decoration $*
+alias gl git log --graph --all --oneline $*
+alias gc git checkout $*
+alias gs git status $*
+alias ll ls -la $*
diff --git a/config/emacs/init.el b/config/emacs/init.el
index e35d458..c4cab29 100644
--- a/config/emacs/init.el
+++ b/config/emacs/init.el
@@ -101,12 +101,14 @@ reverse. Delete trailing whitespace."
(defun my/prog-buffer-setup ()
"Do setup in for code buffers."
- (superword-mode 1)
- (modify-syntax-entry ?_ "w")
+ ;; (superword-mode 1)
+ ;; (modify-syntax-entry ?_ "w")
(hs-minor-mode 1)
(display-fill-column-indicator-mode 1)
- ;; (when (derived-mode-p '(c-mode c++-mode))
- ;; (c-guess))
+ (smerge-mode 1)
+ (when (and (derived-mode-p '(c-mode c++-mode))
+ (> (car (buffer-line-statistics)) 0))
+ (c-guess))
(add-hook 'before-save-hook
(lambda ()
(unless (member major-mode my/prog-cleanup-excluded-modes)
@@ -441,6 +443,7 @@ With ARG, don't save the current layout."
(require 'comint)
(setq-default comint-scroll-to-bottom-on-input t)
(setq-default comint-scroll-to-bottom-on-output t)
+ (setq-default comint-buffer-maximum-size 1048576)
(add-to-list 'comint-output-filter-functions #'comint-truncate-buffer)
(add-to-list 'comint-output-filter-functions #'ansi-color-process-output))
@@ -556,7 +559,8 @@ With ARG, don't save the current layout."
;; misc vars
(setq delete-pair-blink-delay 0
enable-recursive-minibuffers t
- frame-resize-pixelwise t)
+ frame-resize-pixelwise t
+ c-guess-region-max 5000)
(electric-pair-mode 1)
(electric-indent-mode 1)
@@ -811,15 +815,18 @@ With ARG, don't save the current layout."
;; :custom
;; (sideline-backends-right '(sideline-flycheck sideline-flymake)))
-;; (use-package flycheck
-;; :config
-;; ;; flymake stuff to be less annoying
-;; ;; (face-spec-set 'flycheck-note '((t :underline nil)))
-;; ;; (face-spec-set 'flycheck-info '((t :underline nil)))
-;; ;; (face-spec-set 'flycheck-warning '((t :underline nil)))
-;; ;; (face-spec-set 'flycheck-error '((t :underline nil)))
-;; :hook
-;; (prog-mode . flycheck-mode))
+(use-package flycheck
+ :config
+ ;; flymake stuff to be less annoying
+ ;; (face-spec-set 'flycheck-note '((t :underline nil)))
+ ;; (face-spec-set 'flycheck-info '((t :underline nil)))
+ ;; (face-spec-set 'flycheck-warning '((t :underline nil)))
+ ;; (face-spec-set 'flycheck-error '((t :underline nil)))
+ :custom
+ (flycheck-check-syntax-automatically '(save mode-enabled))
+ ;; :hook
+ ;; (prog-mode . flycheck-mode)
+ )
(progn ; collected folding binds, hs + fold this
(define-prefix-command 'my/fold-map)
diff --git a/config/emacs/site-lisp/my-eglot.el b/config/emacs/site-lisp/my-eglot.el
index f4a00a3..5d5457b 100644
--- a/config/emacs/site-lisp/my-eglot.el
+++ b/config/emacs/site-lisp/my-eglot.el
@@ -4,4 +4,9 @@
:after eglot tempel
:config
(eglot-tempel-mode 1))
-
+(use-package flycheck-eglot
+ :ensure t
+ :after (flycheck eglot)
+ :custom (flycheck-eglot-exclusive nil)
+ :config
+ (global-flycheck-eglot-mode 1))
diff --git a/config/emacs/templates/c.eld b/config/emacs/templates/c.eld
index fdb899f..8e36296 100644
--- a/config/emacs/templates/c.eld
+++ b/config/emacs/templates/c.eld
@@ -1,5 +1,4 @@
-
c-mode
-(for > "for (" p "; " p "; " p ") {" n> (p "body;") n> "}")
-(fori > "for (int i = 0; i < " p "; ++i) {" n> (p "body;") n> "}")
+(for > "for (" p "; " p "; " p ") {" n> (p "body;") n "}")
+(fori > "for (int i = 0; i < " p "; ++i) {" n> (p "body;") n "}")