diff --git a/lisp/init-dired.el b/lisp/init-dired.el index 212d960..96f45a8 100644 --- a/lisp/init-dired.el +++ b/lisp/init-dired.el @@ -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 diff --git a/lisp/init-exwm.el b/lisp/init-exwm.el index 78f2da4..3a4b009 100644 --- a/lisp/init-exwm.el +++ b/lisp/init-exwm.el @@ -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-") . ,(kbd "C-")) + (,(kbd "M-d") . ,(kbd "C-")) + (,(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) diff --git a/lisp/init-kbd-func.el b/lisp/init-kbd-func.el index 5da7d9f..e516689 100644 --- a/lisp/init-kbd-func.el +++ b/lisp/init-kbd-func.el @@ -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) diff --git a/lisp/init-kbd.el b/lisp/init-kbd.el index 4fbfdb8..f88ba31 100644 --- a/lisp/init-kbd.el +++ b/lisp/init-kbd.el @@ -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-" 'persp-prev - "C-M-" '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-" 'shrink-window-horizontally - "M-" 'enlarge-window-horizontally - "M-" 'shrink-window - "M-" 'enlarge-window + "C-M-" 'shrink-window-horizontally + "C-M-" 'enlarge-window-horizontally + "C-M-" 'shrink-window + "C-M-" 'enlarge-window "M-`" 'popper-toggle "C-M-=" 'popper-toggle-type-delete-other-window "M-o" 'other-window diff --git a/lisp/init-package.el b/lisp/init-package.el index 9e5e8e7..d2a0b2d 100644 --- a/lisp/init-package.el +++ b/lisp/init-package.el @@ -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) diff --git a/lisp/init-prog.el b/lisp/init-prog.el index d6995de..3f5724b 100644 --- a/lisp/init-prog.el +++ b/lisp/init-prog.el @@ -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 diff --git a/lisp/init-startup.el b/lisp/init-startup.el index 91cf0bc..badbc0a 100644 --- a/lisp/init-startup.el +++ b/lisp/init-startup.el @@ -11,8 +11,7 @@ (toggle-frame-fullscreen) (global-unset-key (kbd "")) (global-set-key (kbd "") 'toggle-frame-fullscreen)) - (*is-linux* - (toggle-frame-fullscreen))) + (t nil)) ;; 配置备份文件和自动保存文件目录 (setq backup-directory-alist diff --git a/lisp/init-ui.el b/lisp/init-ui.el index f62818c..3d19be9 100644 --- a/lisp/init-ui.el +++ b/lisp/init-ui.el @@ -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 diff --git a/lisp/init-window.el b/lisp/init-window.el index e9abc54..8527ea6 100644 --- a/lisp/init-window.el +++ b/lisp/init-window.el @@ -36,6 +36,7 @@ "Buffers\\*$" "\\*Geiser Debug\\*" "\\*gptel-Kimi-Code\\*" + "^\\*sly" "\\*gptel-agent:.*\\*" "^magit" bookmark-bmenu-mode