summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Ulmer <thomasmulmer02@gmail.com>2025-03-17 15:56:01 -0700
committerThomas Ulmer <thomasmulmer02@gmail.com>2025-03-17 15:56:01 -0700
commit3bf89f4ceb8494848f5ca17cb4c3987b9eb706ba (patch)
treef6c26dd1bb44f268ca9f1d51193a4d6ed384fb8b
parentd33a9964ecf98b0b5e14d1a3a237d9b23425081d (diff)
emacs cleanup and evil sandboxing
-rw-r--r--emacs/init.el73
-rwxr-xr-xemacs/site-lisp/coding-config.el23
-rw-r--r--emacs/site-lisp/evil-config.el2
-rw-r--r--emacs/site-lisp/my-funcs.el28
4 files changed, 68 insertions, 58 deletions
diff --git a/emacs/init.el b/emacs/init.el
index 29a39fc..c4d0db7 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -141,16 +141,16 @@
'(helm-minibuffer-history-key "M-p")
'(menu-bar-mode nil)
'(package-selected-packages
- '(2048-game all-the-icons-completion amsreftex auctex benchmark-init
- bongo buffer-move cape chinese-conv cmake-mode
- company-go corfu corfu-terminal counsel-projectile
- cuda-mode dockerfile-mode doom-modeline dumb-jump eat
- edit-indirect eglot embark-consult ement
- emms-player-simple-mpv emms-state esh-help
- eshell-fringe-status eshell-vterm esup evil-collection
- evil-easymotion evil-snipe evil-surround
- exwm-firefox-evil exwm-modeline eyebrowse fish-mode
- flycheck-aspell flymake-aspell
+ '(2048-game all-the-icons-completion amsreftex auctex balanced-windows
+ benchmark-init bongo buffer-move cape chinese-conv
+ cmake-mode company-go corfu corfu-terminal
+ counsel-projectile cuda-mode dockerfile-mode
+ doom-modeline dumb-jump eat edit-indirect eglot
+ embark-consult ement emms-player-simple-mpv emms-state
+ esh-help eshell-fringe-status eshell-vterm esup
+ evil-collection evil-easymotion evil-snipe
+ evil-surround exwm-firefox-evil exwm-modeline eyebrowse
+ fish-mode flycheck-aspell flymake-aspell
flymake-diagnostic-at-point fold-this folding free-keys
frog-jump-buffer gdscript-mode gxref haskell-mode
helm-exwm helm-hoogle highlight hindent hl-todo
@@ -164,7 +164,7 @@
simple-httpd spell-fu telephone-line tempel
tree-sitter-langs treemacs treemacs-evil
vertico-prescient vimgolf visible-mark volume which-key
- workgroups yaml-mode))
+ winum workgroups yaml-mode))
'(pyim-assistant-scheme 'cangjie)
'(safe-local-variable-values '((LEXICAL-binding . t)))
'(scroll-bar-mode nil)
@@ -203,6 +203,10 @@
(setq-default proced-auto-update-interval 1)
;; always auto update proced
+;; this is to avoid loading evil entirely, and ease some of the
+;; internconnection complexity of the config
+(setq want-evil t)
+
;; --------------------------------------------------------------------
;; external packages
@@ -242,7 +246,7 @@
("C-h B" . embark-bindings) ;; alternative for `describe-bindings'
)
:init
- (add-hook 'eldoc-documentation-functions #'embark-eldoc-first-target)
+ ;; (add-hook 'eldoc-documentation-functions #'embark-eldoc-first-target)
:config
;; Hide the mode line of the Embark live/completions buffers
(add-to-list 'display-buffer-alist
@@ -275,9 +279,9 @@
(use-package corfu-terminal
:init
- ;; (corfu-terminal-mode 1)
+ (corfu-terminal-mode 1)
:custom
- (corfu-terminal-disable-on-gui nil))
+ (corfu-terminal-disable-on-gui t))
(use-package cape
;; extend completion frameworks
@@ -286,16 +290,14 @@
(advice-add 'pcomplete-completions-at-point :around 'cape-wrap-silent)
(advice-add 'pcomplete-completions-at-point :around 'cape-wrap-purify)
:init
- (setq completion-at-point-functions '(cape-dict
- tags-completion-at-point-function
+ (setq completion-at-point-functions '(tags-completion-at-point-function
cape-keyword
cape-dabbrev
- cape-symbol)))
+ cape-symbol
+ cape-dict)))
(use-package dabbrev
- ;; Swap M-/ and C-M-/
- :bind ( ;; ("M-/" . completion-at-point)
- ("C-M-/" . dabbrev-expand))
+ :bind (("C-M-/" . dabbrev-expand))
:config
(add-to-list 'dabbrev-ignored-buffer-regexps "\\` ")
;; Since 29.1, use `dabbrev-ignored-buffer-regexps' on older.
@@ -355,14 +357,24 @@
" " filename-and-process)
(mark " "
(name 16 -1)
- " " filename))))
+ " " filename)))
+ :bind
+ ("C-x C-b" . ibuffer)
+ :hook
+ (ibuffer . (lambda ()
+ (unless (eq ibuffer-sorting-mode 'alphabetic)
+ (ibuffer-do-sort-by-alphabetic)))))
(use-package buffer-move
:bind ("C-x -" . buf-move-right))
+(use-package winum
+ :init
+ (winum-mode 1))
+
(use-package consult
- :custom (consult-preview-excluded-buffers '(major-mode . exwm-mode))
- :bind ("C-x b" . consult-buffer))
+ :custom (consult-preview-excluded-buffers t)
+ :bind (("C-x b" . consult-buffer)))
;; (use-package beacon
;; :init
@@ -382,6 +394,12 @@
(visible-mark-max 1)
)
+(use-package avy
+ :bind (("C-'" . avy-goto-char-2)))
+
+(use-package balanced-windows
+ :bind ("C-x w b" . balanced-windows-mode))
+
;; eshell stuff
(use-package eshell
:init
@@ -395,9 +413,8 @@
(keymap-set eshell-hist-mode-map "C-c C-p" 'previous-line)
(keymap-set eshell-mode-map "C-l" 'eshell/clear)
(add-hook 'eshell-mode-hook 'eldoc-mode)
- (add-hook 'eshell-mode-hook (lambda () (evil-local-mode -1)))
- :custom
- (eshell-prefer-lisp-functions t))
+ (if want-evil
+ (add-hook 'eshell-mode-hook (lambda () (evil-local-mode -1)))))
(use-package eat
:init
@@ -406,6 +423,8 @@
;; file browser
(use-package treemacs
+ :init
+ (if want-evil (use-package treemacs-evil))
:bind (("C-c t" . treemacs)))
;; password integration
@@ -420,7 +439,7 @@
;; ----------------------------------------------------------------------
;; my custom stuff
-(require 'evil-config)
+(if want-evil (require 'evil-config))
(require 'my-funcs)
(require 'my-binds)
(require 'coding-config)
diff --git a/emacs/site-lisp/coding-config.el b/emacs/site-lisp/coding-config.el
index 143da4c..a8f34a9 100755
--- a/emacs/site-lisp/coding-config.el
+++ b/emacs/site-lisp/coding-config.el
@@ -52,16 +52,6 @@
(setq imenu-auto-rescan t)
-;; make ibuffer play with projectile
-(use-package ibuffer
- :bind
- ("C-x C-b" . ibuffer)
- :hook
- (ibuffer . (lambda ()
- (unless (eq ibuffer-sorting-mode 'alphabetic)
- (ibuffer-do-sort-by-alphabetic)))))
-
-
;; make shells and whatnot slightly better
(require 'comint)
(setq comint-scroll-to-bottom-on-input t)
@@ -96,12 +86,13 @@
(hs-minor-mode 1)
(hl-todo-mode 1)
(superword-mode 1)
- (modify-syntax-entry ?_ "w") )
- (display-fill-column-indicator-mode 1)
- (add-hook 'before-save-hook
- (lambda ()
- (if (not (eq major-mode 'makefile-gmake-mode))
- (clean-prog-file (current-buffer))))))
+ (modify-syntax-entry ?_ "w")
+
+ (display-fill-column-indicator-mode 1)
+ (add-hook 'before-save-hook
+ (lambda ()
+ (if (not (eq major-mode 'makefile-gmake-mode))
+ (clean-prog-file (current-buffer)))))))
;; haskell flavor and tags
(use-package haskell-mode
diff --git a/emacs/site-lisp/evil-config.el b/emacs/site-lisp/evil-config.el
index b64a720..582617e 100644
--- a/emacs/site-lisp/evil-config.el
+++ b/emacs/site-lisp/evil-config.el
@@ -76,5 +76,3 @@
(evil-define-key 'normal global-map (kbd "SPC s f") 'counsel-find-file)
(evil-define-key 'normal global-map (kbd "SPC s r") 'counsel-rg)
(evil-define-key 'normal global-map (kbd "SPC ;") 'frog-jump-buffer)
-
-(use-package treemacs-evil)
diff --git a/emacs/site-lisp/my-funcs.el b/emacs/site-lisp/my-funcs.el
index b1cfdec..8bed290 100644
--- a/emacs/site-lisp/my-funcs.el
+++ b/emacs/site-lisp/my-funcs.el
@@ -91,19 +91,21 @@ BEG and END define the region."
(let ((transient-mark-mode nil))
(yank-advised-indent-function (region-beginning) (region-end)))))
-(defadvice evil-paste-before (after yank-indent activate)
- "If current mode is one of 'yank-indent-modes, indent yanked text (with prefix arg don't indent)."
- (if (and (not (ad-get-arg 0))
- (member major-mode yank-indent-modes))
- (let ((transient-mark-mode nil))
- (yank-advised-indent-function (region-beginning) (region-end)))))
-
-(defadvice evil-paste-after (after yank-indent activate)
- "If current mode is one of 'yank-indent-modes, indent yanked text (with prefix arg don't indent)."
- (if (and (not (ad-get-arg 0))
- (member major-mode yank-indent-modes))
- (let ((transient-mark-mode nil))
- (yank-advised-indent-function (region-beginning) (region-end)))))
+(if want-evil
+ (progn
+ (defadvice evil-paste-before (after yank-indent activate)
+ "If current mode is one of 'yank-indent-modes, indent yanked text (with prefix arg don't indent)."
+ (if (and (not (ad-get-arg 0))
+ (member major-mode yank-indent-modes))
+ (let ((transient-mark-mode nil))
+ (yank-advised-indent-function (region-beginning) (region-end)))))
+
+ (defadvice evil-paste-after (after yank-indent activate)
+ "If current mode is one of 'yank-indent-modes, indent yanked text (with prefix arg don't indent)."
+ (if (and (not (ad-get-arg 0))
+ (member major-mode yank-indent-modes))
+ (let ((transient-mark-mode nil))
+ (yank-advised-indent-function (region-beginning) (region-end)))))))
(defun fold-this-fold-forward (&optional arg)
"Fold forward ARG number of sexps, defaulting to one."