feat: Add SLY Common Lisp support and refine EXWM configuration

- Add SLY package with custom keybindings and ibuffer groups Replace
- removed power commands with consolidated `my-desktop-init` Add
- Emacs key simulation for EXWM windows Enable mouse drag-and-drop
- for Dired Disable display-time on Linux/Android Rebind window
- resize to C-M-arrow keys
This commit is contained in:
2026-05-27 20:27:27 +08:00
parent 61d09a4625
commit 6848afd4da
9 changed files with 90 additions and 41 deletions

View File

@@ -15,7 +15,9 @@
dired-listing-switches
"-l --almost-all --human-readable --group-directories-first --no-group"
dired-recursive-deletes 'always
dired-recursive-copies 'always)
dired-recursive-copies 'always
dired-mouse-drag-files t
mouse-drag-and-drop-region-cross-program t)
(put 'dired-find-alternate-file 'disabled nil))
;; dirvish

View File

@@ -7,6 +7,7 @@
(when *is-linux*
(use-package exwm
:config
(setq pop-up-windows nil)
(setq exwm-workspace-number 1)
(exwm-input-set-key (kbd "s-&")
(lambda (command)
@@ -24,21 +25,6 @@
(eshell-command "fcitx5 -d"))
(eshell-command "fcitx5 -d")))
(defun reboot ()
"Execute loginctl reboot command."
(interactive)
(eshell-command "loginctl reboot"))
(defun poweroff ()
"Execute loginctl poweroff command"
(interactive)
(eshell-command "loginctl poweroff"))
(defun suspend ()
"Execute loginctl suspend command"
(interactive)
(eshell-command "loginctl suspend"))
(defun my--exwm-switch-to-workspace (delta)
(let ((target
(mod (+ exwm-workspace-current-index delta)
@@ -83,7 +69,6 @@
XF86AudioRaiseVolume
XF86AudioMute
))
(define-key exwm-mode-map [?\C-q] 'exwm-input-send-next-key)
(setq exwm-input-global-keys
@@ -96,6 +81,7 @@
([?\s-s] . desktop-environment-screenshot-part)
([?\s-w] . exwm-workspace-switch)
([?\s-o] . other-window)
([?\s-m] . exwm-layout-toggle-mode-line)
([?\s-`] . (lambda () (interactive) (exwm-workspace-switch-create 0)))
,@(mapcar (lambda (i)
`(,(kbd(format "s-%d" i)) .
@@ -104,6 +90,27 @@
(exwm-workspace-switch-create ,i))))
(number-sequence 0 9))))
(setq exwm-input-simulation-keys
`((,(kbd "C-f") . [right])
(,(kbd "C-b") . [left])
(,(kbd "C-p") . [up])
(,(kbd "C-n") . [down])
(,(kbd "C-a") . [home])
(,(kbd "C-e") . [end])
(,(kbd "M-f") . [C-right])
(,(kbd "A-f") . [C-right])
(,(kbd "M-b") . [C-left])
(,(kbd "A-b") . [C-left])
(,(kbd "C-d") . [delete])
(,(kbd "C-k") . [S-end delete])
(,(kbd "M-<backspace>") . ,(kbd "C-<backspace>"))
(,(kbd "M-d") . ,(kbd "C-<delete>"))
(,(kbd "M-w") . [?\C-c])
(,(kbd "C-y") . [?\C-v])
(,(kbd "C-w") . [?\C-x])
(,(kbd "C-/") . [?\C-z])
(,(kbd "C-?") . ,(kbd "C-S-z"))))
(defun my/exwm-update-class ()
(exwm-workspace-rename-buffer exwm-class-name))
@@ -111,7 +118,6 @@
(require 'exwm-xim)
(exwm-xim-mode)
(exwm-wm-mode))
(use-package desktop-environment
@@ -133,10 +139,7 @@
(add-hook 'exwm-init-hook
(lambda ()
(restart-fcitx5)
(unless (zerop (shell-command "pgrep -x mihomo"))
(start-process-shell-command "mihomo" nil "mihomo -d ~/.config/mihomo/"))
(start-process-shell-command "xrandr-refresh" nil "xrandr --output DP-4 --mode 2560x1440 --rate 165.00")
(start-process-shell-command "xinput" nil "xinput set-prop 12 'libinput Accel Speed' -0.45")))
(my-desktop-init)))
(use-package xdg-launcher
:straight
@@ -149,8 +152,7 @@
(with-eval-after-load 'consult
(unless (memq 'xdg-launcher-consult-source consult-buffer-sources)
(setq consult-buffer-sources
(append consult-buffer-sources '(xdg-launcher-consult-source))))))
)
(append consult-buffer-sources '(xdg-launcher-consult-source)))))))
(provide 'init-exwm)

View File

@@ -164,7 +164,31 @@ Disable jinx-mode if it's enable and global-jinx-mode is disable , otherwise tog
"Run `consult-ripgrep' in current project's root."
(interactive)
(when-let* ((proj (project-current t)))
(consult-ripgrep (project-root proj))))
(consult-ripgrep (project-root proj))))
(when *is-linux*
(defun reboot ()
"Execute loginctl reboot command."
(interactive)
(eshell-command "loginctl reboot"))
(defun poweroff ()
"Execute loginctl poweroff command"
(interactive)
(eshell-command "loginctl poweroff"))
(defun suspend ()
"Execute loginctl suspend command"
(interactive)
(eshell-command "loginctl suspend"))
(defun my-desktop-init ()
"Launch something for linux desktop."
(interactive)
(unless (zerop (shell-command "pgrep -x mihomo"))
(start-process-shell-command "mihomo" nil "mihomo -d ~/.config/mihomo/"))
(start-process-shell-command "xrandr-refresh" nil "xrandr --output DP-4 --mode 2560x1440 --rate 165.00")
(start-process-shell-command "xinput" nil "xinput set-prop 12 'libinput Accel Speed' -0.45")))
(provide 'init-kbd-func)

View File

@@ -156,6 +156,13 @@
"n" 'magit-section-forward-sibling
"M-n" 'magit-section-forward)
;; sly-mode
(general-def (sly-mode-map sly-editing-mode-map)
"M-p" 'backward-paragraph
"M-n" 'forward-paragraph
"M-{" 'sly-previous-note
"M-}" 'sly-next-note)
;; flycheck
(general-def flycheck-mode-map
"M-{" 'flycheck-previous-error
@@ -225,8 +232,6 @@
;; perspective
(general-def persp-mode-map
"C-c p c" nil
"C-M-<left>" 'persp-prev
"C-M-<right>" 'persp-next
"C-c p d" 'persp-kill
"C-x M-b" 'persp-ibuffer)
@@ -301,12 +306,14 @@
"C-M-'" 'avy-goto-word-1
"M-g g" 'avy-goto-line
"M-g M-g" 'consult-goto-line
"M-g i" 'consult-imenu
"M-g M-i" 'consult-imenu
;; window
"M-<left>" 'shrink-window-horizontally
"M-<right>" 'enlarge-window-horizontally
"M-<down>" 'shrink-window
"M-<up>" 'enlarge-window
"C-M-<left>" 'shrink-window-horizontally
"C-M-<right>" 'enlarge-window-horizontally
"C-M-<down>" 'shrink-window
"C-M-<up>" 'enlarge-window
"M-`" 'popper-toggle
"C-M-=" 'popper-toggle-type-delete-other-window
"M-o" 'other-window

View File

@@ -230,6 +230,14 @@ targets."
(name . "^*Geiser")))
("gptel" (or
(name . "^\\*gptel")))
("Common-lisp" (or
(mode . common-lisp-mode)
(mode . lisp-mode)
(mode . sly-mrepl-mode)))
("Sly" (or
(mode . lisp-data-mode)
(mode . sly-db-mode)
(name . "\\*sly-compilation\\*")))
("Text" (or
(mode . org-mode)
(mode . markdown-mode)

View File

@@ -33,6 +33,11 @@
(use-package geiser-guile)
;; common-lisp
(use-package sly
:config
(setq sly-lisp-implementations nil))
;; markdown
(use-package markdown-mode
:bind

View File

@@ -11,8 +11,7 @@
(toggle-frame-fullscreen)
(global-unset-key (kbd "<f12>"))
(global-set-key (kbd "<f12>") 'toggle-frame-fullscreen))
(*is-linux*
(toggle-frame-fullscreen)))
(t nil))
;; 配置备份文件和自动保存文件目录
(setq backup-directory-alist

View File

@@ -120,14 +120,15 @@
(column-number-mode t)
;; 显示时间
(setq display-time-default-load-average nil
display-time-string-forms
'((propertize
(concat
(propertize (format-time-string " %H:%M") 'face 'display-time-date-and-time)
(propertize (format-time-string "-%p") 'face 'font-lock-comment-face))
'help-echo (format-time-string "%A, %B %d, %Y"))))
(display-time-mode)
(unless (or *is-linux* *is-android*)
(setq display-time-default-load-average nil
display-time-string-forms
'((propertize
(concat
(propertize (format-time-string " %H:%M") 'face 'display-time-date-and-time)
(propertize (format-time-string "-%p") 'face 'font-lock-comment-face))
'help-echo (format-time-string "%A, %B %d, %Y"))))
(display-time-mode))
;; 添加个人字体到 cnfonts
(setq cnfonts-personal-fontnames

View File

@@ -36,6 +36,7 @@
"Buffers\\*$"
"\\*Geiser Debug\\*"
"\\*gptel-Kimi-Code\\*"
"^\\*sly"
"\\*gptel-agent:.*\\*"
"^magit"
bookmark-bmenu-mode