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:
@@ -15,7 +15,9 @@
|
|||||||
dired-listing-switches
|
dired-listing-switches
|
||||||
"-l --almost-all --human-readable --group-directories-first --no-group"
|
"-l --almost-all --human-readable --group-directories-first --no-group"
|
||||||
dired-recursive-deletes 'always
|
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))
|
(put 'dired-find-alternate-file 'disabled nil))
|
||||||
|
|
||||||
;; dirvish
|
;; dirvish
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
(when *is-linux*
|
(when *is-linux*
|
||||||
(use-package exwm
|
(use-package exwm
|
||||||
:config
|
:config
|
||||||
|
(setq pop-up-windows nil)
|
||||||
(setq exwm-workspace-number 1)
|
(setq exwm-workspace-number 1)
|
||||||
(exwm-input-set-key (kbd "s-&")
|
(exwm-input-set-key (kbd "s-&")
|
||||||
(lambda (command)
|
(lambda (command)
|
||||||
@@ -24,21 +25,6 @@
|
|||||||
(eshell-command "fcitx5 -d"))
|
(eshell-command "fcitx5 -d"))
|
||||||
(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)
|
(defun my--exwm-switch-to-workspace (delta)
|
||||||
(let ((target
|
(let ((target
|
||||||
(mod (+ exwm-workspace-current-index delta)
|
(mod (+ exwm-workspace-current-index delta)
|
||||||
@@ -83,7 +69,6 @@
|
|||||||
XF86AudioRaiseVolume
|
XF86AudioRaiseVolume
|
||||||
XF86AudioMute
|
XF86AudioMute
|
||||||
))
|
))
|
||||||
|
|
||||||
(define-key exwm-mode-map [?\C-q] 'exwm-input-send-next-key)
|
(define-key exwm-mode-map [?\C-q] 'exwm-input-send-next-key)
|
||||||
|
|
||||||
(setq exwm-input-global-keys
|
(setq exwm-input-global-keys
|
||||||
@@ -96,6 +81,7 @@
|
|||||||
([?\s-s] . desktop-environment-screenshot-part)
|
([?\s-s] . desktop-environment-screenshot-part)
|
||||||
([?\s-w] . exwm-workspace-switch)
|
([?\s-w] . exwm-workspace-switch)
|
||||||
([?\s-o] . other-window)
|
([?\s-o] . other-window)
|
||||||
|
([?\s-m] . exwm-layout-toggle-mode-line)
|
||||||
([?\s-`] . (lambda () (interactive) (exwm-workspace-switch-create 0)))
|
([?\s-`] . (lambda () (interactive) (exwm-workspace-switch-create 0)))
|
||||||
,@(mapcar (lambda (i)
|
,@(mapcar (lambda (i)
|
||||||
`(,(kbd(format "s-%d" i)) .
|
`(,(kbd(format "s-%d" i)) .
|
||||||
@@ -104,6 +90,27 @@
|
|||||||
(exwm-workspace-switch-create ,i))))
|
(exwm-workspace-switch-create ,i))))
|
||||||
(number-sequence 0 9))))
|
(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 ()
|
(defun my/exwm-update-class ()
|
||||||
(exwm-workspace-rename-buffer exwm-class-name))
|
(exwm-workspace-rename-buffer exwm-class-name))
|
||||||
|
|
||||||
@@ -111,7 +118,6 @@
|
|||||||
|
|
||||||
(require 'exwm-xim)
|
(require 'exwm-xim)
|
||||||
(exwm-xim-mode)
|
(exwm-xim-mode)
|
||||||
|
|
||||||
(exwm-wm-mode))
|
(exwm-wm-mode))
|
||||||
|
|
||||||
(use-package desktop-environment
|
(use-package desktop-environment
|
||||||
@@ -133,10 +139,7 @@
|
|||||||
(add-hook 'exwm-init-hook
|
(add-hook 'exwm-init-hook
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(restart-fcitx5)
|
(restart-fcitx5)
|
||||||
(unless (zerop (shell-command "pgrep -x mihomo"))
|
(my-desktop-init)))
|
||||||
(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")))
|
|
||||||
|
|
||||||
(use-package xdg-launcher
|
(use-package xdg-launcher
|
||||||
:straight
|
:straight
|
||||||
@@ -149,8 +152,7 @@
|
|||||||
(with-eval-after-load 'consult
|
(with-eval-after-load 'consult
|
||||||
(unless (memq 'xdg-launcher-consult-source consult-buffer-sources)
|
(unless (memq 'xdg-launcher-consult-source consult-buffer-sources)
|
||||||
(setq 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)
|
(provide 'init-exwm)
|
||||||
|
|
||||||
|
|||||||
@@ -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."
|
"Run `consult-ripgrep' in current project's root."
|
||||||
(interactive)
|
(interactive)
|
||||||
(when-let* ((proj (project-current t)))
|
(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)
|
(provide 'init-kbd-func)
|
||||||
|
|
||||||
|
|||||||
@@ -156,6 +156,13 @@
|
|||||||
"n" 'magit-section-forward-sibling
|
"n" 'magit-section-forward-sibling
|
||||||
"M-n" 'magit-section-forward)
|
"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
|
;; flycheck
|
||||||
(general-def flycheck-mode-map
|
(general-def flycheck-mode-map
|
||||||
"M-{" 'flycheck-previous-error
|
"M-{" 'flycheck-previous-error
|
||||||
@@ -225,8 +232,6 @@
|
|||||||
;; perspective
|
;; perspective
|
||||||
(general-def persp-mode-map
|
(general-def persp-mode-map
|
||||||
"C-c p c" nil
|
"C-c p c" nil
|
||||||
"C-M-<left>" 'persp-prev
|
|
||||||
"C-M-<right>" 'persp-next
|
|
||||||
"C-c p d" 'persp-kill
|
"C-c p d" 'persp-kill
|
||||||
"C-x M-b" 'persp-ibuffer)
|
"C-x M-b" 'persp-ibuffer)
|
||||||
|
|
||||||
@@ -301,12 +306,14 @@
|
|||||||
"C-M-'" 'avy-goto-word-1
|
"C-M-'" 'avy-goto-word-1
|
||||||
"M-g g" 'avy-goto-line
|
"M-g g" 'avy-goto-line
|
||||||
"M-g M-g" 'consult-goto-line
|
"M-g M-g" 'consult-goto-line
|
||||||
|
"M-g i" 'consult-imenu
|
||||||
|
"M-g M-i" 'consult-imenu
|
||||||
|
|
||||||
;; window
|
;; window
|
||||||
"M-<left>" 'shrink-window-horizontally
|
"C-M-<left>" 'shrink-window-horizontally
|
||||||
"M-<right>" 'enlarge-window-horizontally
|
"C-M-<right>" 'enlarge-window-horizontally
|
||||||
"M-<down>" 'shrink-window
|
"C-M-<down>" 'shrink-window
|
||||||
"M-<up>" 'enlarge-window
|
"C-M-<up>" 'enlarge-window
|
||||||
"M-`" 'popper-toggle
|
"M-`" 'popper-toggle
|
||||||
"C-M-=" 'popper-toggle-type-delete-other-window
|
"C-M-=" 'popper-toggle-type-delete-other-window
|
||||||
"M-o" 'other-window
|
"M-o" 'other-window
|
||||||
|
|||||||
@@ -230,6 +230,14 @@ targets."
|
|||||||
(name . "^*Geiser")))
|
(name . "^*Geiser")))
|
||||||
("gptel" (or
|
("gptel" (or
|
||||||
(name . "^\\*gptel")))
|
(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
|
("Text" (or
|
||||||
(mode . org-mode)
|
(mode . org-mode)
|
||||||
(mode . markdown-mode)
|
(mode . markdown-mode)
|
||||||
|
|||||||
@@ -33,6 +33,11 @@
|
|||||||
|
|
||||||
(use-package geiser-guile)
|
(use-package geiser-guile)
|
||||||
|
|
||||||
|
;; common-lisp
|
||||||
|
(use-package sly
|
||||||
|
:config
|
||||||
|
(setq sly-lisp-implementations nil))
|
||||||
|
|
||||||
;; markdown
|
;; markdown
|
||||||
(use-package markdown-mode
|
(use-package markdown-mode
|
||||||
:bind
|
:bind
|
||||||
|
|||||||
@@ -11,8 +11,7 @@
|
|||||||
(toggle-frame-fullscreen)
|
(toggle-frame-fullscreen)
|
||||||
(global-unset-key (kbd "<f12>"))
|
(global-unset-key (kbd "<f12>"))
|
||||||
(global-set-key (kbd "<f12>") 'toggle-frame-fullscreen))
|
(global-set-key (kbd "<f12>") 'toggle-frame-fullscreen))
|
||||||
(*is-linux*
|
(t nil))
|
||||||
(toggle-frame-fullscreen)))
|
|
||||||
|
|
||||||
;; 配置备份文件和自动保存文件目录
|
;; 配置备份文件和自动保存文件目录
|
||||||
(setq backup-directory-alist
|
(setq backup-directory-alist
|
||||||
|
|||||||
@@ -120,14 +120,15 @@
|
|||||||
(column-number-mode t)
|
(column-number-mode t)
|
||||||
|
|
||||||
;; 显示时间
|
;; 显示时间
|
||||||
(setq display-time-default-load-average nil
|
(unless (or *is-linux* *is-android*)
|
||||||
display-time-string-forms
|
(setq display-time-default-load-average nil
|
||||||
'((propertize
|
display-time-string-forms
|
||||||
(concat
|
'((propertize
|
||||||
(propertize (format-time-string " %H:%M") 'face 'display-time-date-and-time)
|
(concat
|
||||||
(propertize (format-time-string "-%p") 'face 'font-lock-comment-face))
|
(propertize (format-time-string " %H:%M") 'face 'display-time-date-and-time)
|
||||||
'help-echo (format-time-string "%A, %B %d, %Y"))))
|
(propertize (format-time-string "-%p") 'face 'font-lock-comment-face))
|
||||||
(display-time-mode)
|
'help-echo (format-time-string "%A, %B %d, %Y"))))
|
||||||
|
(display-time-mode))
|
||||||
|
|
||||||
;; 添加个人字体到 cnfonts
|
;; 添加个人字体到 cnfonts
|
||||||
(setq cnfonts-personal-fontnames
|
(setq cnfonts-personal-fontnames
|
||||||
|
|||||||
@@ -36,6 +36,7 @@
|
|||||||
"Buffers\\*$"
|
"Buffers\\*$"
|
||||||
"\\*Geiser Debug\\*"
|
"\\*Geiser Debug\\*"
|
||||||
"\\*gptel-Kimi-Code\\*"
|
"\\*gptel-Kimi-Code\\*"
|
||||||
|
"^\\*sly"
|
||||||
"\\*gptel-agent:.*\\*"
|
"\\*gptel-agent:.*\\*"
|
||||||
"^magit"
|
"^magit"
|
||||||
bookmark-bmenu-mode
|
bookmark-bmenu-mode
|
||||||
|
|||||||
Reference in New Issue
Block a user