Changeset 43feba7 in dotfiles


Ignore:
Timestamp:
Sep 17, 2022, 11:51:27 PM (2 years ago)
Author:
Mikhail Kirillov <w96k@…>
Branches:
master
Children:
7c5cbf8
Parents:
3a705ab
Message:

Emacs: update config

File:
1 edited

Legend:

Unmodified
Added
Removed
  • emacs/.emacs.d/.emacs-config.org

    r3a705ab r43feba7  
    101101менеджер. Я использую Guix для большей части взаимодействий со сторонним
    102102кодом.
    103 #+begin_src elisp :tangle init.el
     103#+begin_src elisp :tangle nil
    104104  (require 'package)
    105105  (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
     
    541541Использую встроенный Flymake и Flycheck
    542542*** Flymake
    543 #+BEGIN_SRC emacs-lisp :tangle init.el
     543#+BEGIN_SRC emacs-lisp :tangle nil
    544544  ;;(add-hook 'prog-mode-hook 'flymake-mode)
    545545
     
    617617
    618618    ;; Fix for transient to behave like a normal buffer
    619   (with-eval-after-load 'transient
    620     (setq
    621      transient--buffer-name "*transient*"
    622      ;; transient-detect-key-conflicts t
    623      ;; transient-highlight-mismatched-keys t
    624      ;; transient--debug t
    625      transient-enable-popup-navigation t
    626      transient-mode-line-format mode-line-format
    627      transient-display-buffer-action '(display-buffer-below-selected))
    628 
    629     (let ((map transient-base-map))
    630       (define-key map (kbd "C-g") 'transient-quit-all)
    631       (define-key map (kbd "C-q") 'transient-quit-one)
    632       (define-key map (kbd "DEL") 'transient-quit-one))
    633 
    634     (define-key transient-map (kbd "C-h") nil)
    635 
    636     (let ((map transient-popup-navigation-map))
    637       (define-key map (kbd "<tab>") 'transient-forward-button)
    638       (define-key map (kbd "<backtab>") 'transient-backward-button ))
    639 
    640     (transient-suffix-put 'transient-common-commands
    641                           "C-g" :command 'transient-quit-all)
    642     (transient-suffix-put 'transient-common-commands
    643                           "C-q" :command 'transient-quit-one)
    644 
    645     (defun al/transient-fix-window ()
    646       "Return `transient--window' to a 'normal' state."
    647       (set-window-dedicated-p transient--window nil)
    648       (set-window-parameter transient--window 'no-other-window nil)
    649       (with-selected-window transient--window
    650         (setq
    651         window-size-fixed nil
    652         cursor-in-non-selected-windows t
    653         cursor-type (default-value 'cursor-type)
    654         mode-line-buffer-identification
    655         (list ""
    656                (symbol-name (oref transient--prefix command))
    657                " " (default-value 'mode-line-buffer-identification)))))
    658 
    659     (define-derived-mode al/transient-mode special-mode "al/transient"
    660       (setq buffer-read-only nil)
    661       (al/transient-fix-window))
    662 
    663     (defun al/transient-push-keymap (map)
    664       (with-demoted-errors "al/transient-push-keymap: %S"
    665         (internal-push-keymap (symbol-value map) 'al/transient-mode-map)))
    666 
    667     (defun al/transient-pop-keymap (map)
    668       (with-demoted-errors "al/transient-pop-keymap: %S"
    669         (internal-pop-keymap (symbol-value map) 'al/transient-mode-map)))
    670 
    671     (defun al/transient-fix-show (&rest _)
    672       (transient--debug 'al/transient-fix-show)
    673       (al/transient-fix-window)
    674       (select-window transient--window))
    675 
    676     (defun al/transient-fix-init (&rest _)
    677       (transient--debug 'al/transient-fix-init)
    678       (with-current-buffer transient--buffer-name
    679         (al/transient-mode)))
    680 
    681     (defun al/transient-fix-pre/post-command (fun &rest args)
    682       (transient--debug 'al/transient-fix-pre/post-command)
    683       ;; Do anything only for transient commands.
    684       (when (or (get this-command 'transient--prefix)
    685                 (string-match-p "\\`transient"
    686                                 (symbol-name this-command))
    687                 (and transient--transient-map
    688                      (string= (buffer-name) transient--buffer-name)
    689                      (lookup-key transient--transient-map
    690                                 (this-single-command-raw-keys))))
    691         (apply fun args)))
    692 
    693     (defun al/transient-fix-delete-window (fun &rest args)
    694       (unless (eq transient--exitp 'suspend)
    695         (apply fun args)))
    696 
    697     (advice-add 'transient--minibuffer-setup :override #'ignore)
    698     (advice-add 'transient--minibuffer-exit :override #'ignore)
    699     (advice-add 'transient--push-keymap :override #'al/transient-push-keymap)
    700     (advice-add 'transient--pop-keymap :override #'al/transient-pop-keymap)
    701     (advice-add 'transient--pre-command :around #'al/transient-fix-pre/post-command)
    702     (advice-add 'transient--post-command :around #'al/transient-fix-pre/post-command)
    703     (advice-add 'transient--show :after #'al/transient-fix-show)
    704     (advice-add 'transient--init-transient :after #'al/transient-fix-init)
    705     (advice-add 'transient--delete-window :around #'al/transient-fix-delete-window))
     619  ;; (with-eval-after-load 'transient
     620  ;;   (setq
     621  ;;    transient--buffer-name "*transient*"
     622  ;;    ;; transient-detect-key-conflicts t
     623  ;;    ;; transient-highlight-mismatched-keys t
     624  ;;    ;; transient--debug t
     625  ;;    transient-enable-popup-navigation t
     626  ;;    transient-mode-line-format mode-line-format
     627  ;;    transient-display-buffer-action '(display-buffer-below-selected))
     628
     629  ;;   (let ((map transient-base-map))
     630  ;;     (define-key map (kbd "C-g") 'transient-quit-all)
     631  ;;     (define-key map (kbd "C-q") 'transient-quit-one)
     632  ;;     (define-key map (kbd "DEL") 'transient-quit-one))
     633
     634  ;;   (define-key transient-map (kbd "C-h") nil)
     635
     636  ;;   (let ((map transient-popup-navigation-map))
     637  ;;     (define-key map (kbd "<tab>") 'transient-forward-button)
     638  ;;     (define-key map (kbd "<backtab>") 'transient-backward-button ))
     639
     640  ;;   (transient-suffix-put 'transient-common-commands
     641  ;;                    "C-g" :command 'transient-quit-all)
     642  ;;   (transient-suffix-put 'transient-common-commands
     643  ;;                    "C-q" :command 'transient-quit-one)
     644
     645  ;;   (defun al/transient-fix-window ()
     646  ;;     "Return `transient--window' to a 'normal' state."
     647  ;;     (set-window-dedicated-p transient--window nil)
     648  ;;     (set-window-parameter transient--window 'no-other-window nil)
     649  ;;     (with-selected-window transient--window
     650  ;;       (setq
     651  ;;        window-size-fixed nil
     652  ;;        cursor-in-non-selected-windows t
     653  ;;        cursor-type (default-value 'cursor-type)
     654  ;;        mode-line-buffer-identification
     655  ;;        (list ""
     656  ;;         (symbol-name (oref transient--prefix command))
     657  ;;         " " (default-value 'mode-line-buffer-identification)))))
     658
     659  ;;   (define-derived-mode al/transient-mode special-mode "al/transient"
     660  ;;     (setq buffer-read-only nil)
     661  ;;     (al/transient-fix-window))
     662
     663  ;;   (defun al/transient-push-keymap (map)
     664  ;;     (with-demoted-errors "al/transient-push-keymap: %S"
     665  ;;       (internal-push-keymap (symbol-value map) 'al/transient-mode-map)))
     666
     667  ;;   (defun al/transient-pop-keymap (map)
     668  ;;     (with-demoted-errors "al/transient-pop-keymap: %S"
     669  ;;       (internal-pop-keymap (symbol-value map) 'al/transient-mode-map)))
     670
     671  ;;   (defun al/transient-fix-show (&rest _)
     672  ;;     (transient--debug 'al/transient-fix-show)
     673  ;;     (al/transient-fix-window)
     674  ;;     (select-window transient--window))
     675
     676  ;;   (defun al/transient-fix-init (&rest _)
     677  ;;     (transient--debug 'al/transient-fix-init)
     678  ;;     (with-current-buffer transient--buffer-name
     679  ;;       (al/transient-mode)))
     680
     681  ;;   (defun al/transient-fix-pre/post-command (fun &rest args)
     682  ;;     (transient--debug 'al/transient-fix-pre/post-command)
     683  ;;     ;; Do anything only for transient commands.
     684  ;;     (when (or (get this-command 'transient--prefix)
     685  ;;          (string-match-p "\\`transient"
     686  ;;                          (symbol-name this-command))
     687  ;;          (and transient--transient-map
     688  ;;               (string= (buffer-name) transient--buffer-name)
     689  ;;               (lookup-key transient--transient-map
     690  ;;                          (this-single-command-raw-keys))))
     691  ;;       (apply fun args)))
     692
     693  ;;   (defun al/transient-fix-delete-window (fun &rest args)
     694  ;;     (unless (eq transient--exitp 'suspend)
     695  ;;       (apply fun args)))
     696
     697  ;;   (advice-add 'transient--minibuffer-setup :override #'ignore)
     698  ;;   (advice-add 'transient--minibuffer-exit :override #'ignore)
     699  ;;   (advice-add 'transient--push-keymap :override #'al/transient-push-keymap)
     700  ;;   (advice-add 'transient--pop-keymap :override #'al/transient-pop-keymap)
     701  ;;   (advice-add 'transient--pre-command :around #'al/transient-fix-pre/post-command)
     702  ;;   (advice-add 'transient--post-command :around #'al/transient-fix-pre/post-command)
     703  ;;   (advice-add 'transient--show :after #'al/transient-fix-show)
     704  ;;   (advice-add 'transient--init-transient :after #'al/transient-fix-init)
     705  ;;   (advice-add 'transient--delete-window :around #'al/transient-fix-delete-window))
    706706
    707707    ;; Use magit only when built-in VC fails
     
    717717желтым цветом соответственно.
    718718
    719 #+BEGIN_SRC emacs-lisp :tangle init.el
     719#+BEGIN_SRC emacs-lisp :tangle nil
    720720  ;;; Show added & removed git lines
    721721  (when (package-loaded? "git-gutter")
     
    827827** Дополнение
    828828** Дебаггер
    829 #+begin_src emacs-lisp :tangle init.el
     829#+begin_src emacs-lisp :tangle nil
    830830  (when (package-loaded? "realgud")
    831831    (load "~/.emacs.d/site-lisp/realgud-xdebug/realgud-xdebug.el"))
     
    835835По большей части я использую дефолтный Completion Buffer и Corfu
    836836#+begin_src elisp :tangle init.el
    837   (require 'corfu)
    838   (require 'corfu-doc)
    839 
    840837  (when (package-loaded? "corfu")
    841838    (progn
    842839      (setq corfu-preview-current 'nil)
     840      (corfu-mode 1)
    843841      (defun show-default-completion-buffer ()
    844842          (interactive)
     
    849847      (define-key corfu-map (kbd "M-TAB") 'show-default-completion-buffer)
    850848      (define-key corfu-map (kbd "TAB") 'show-default-completion-buffer)
    851       (define-key corfu-map (kbd "C-M-i") 'show-default-completion-buffer)
     849      (define-key corfu-map (kbd "C-M-i") 'show-default-completion-buffer)     
     850      (corfu-mode -1)
    852851      (add-hook 'prog-mode-hook 'corfu-mode)))
    853852
     
    940939  (when (package-loaded? "undo-tree")
    941940    (progn
    942       (global-undo-tree-mode)
     941      (add-hook 'prog-mode-hook #'undo-tree-mode)
    943942      (setq undo-tree-auto-save-history nil)))
    944943#+end_src
     
    985984
    986985** Сессия
    987 #+BEGIN_SRC emacs-lisp :tangle nil
    988   (desktop-save-mode nil)
     986#+BEGIN_SRC emacs-lisp :tangle init.el
     987  (desktop-save-mode 1)
    989988#+END_SRC
    990989** Скроллинг
     
    10391038*** REPL
    10401039#+BEGIN_SRC emacs-lisp :tangle init.el
     1040  (load "slime-autoloads")
    10411041  (setq slime-contribs '(slime-fancy slime-repl slime-banner))
    10421042#+END_SRC
     
    13261326
    13271327      ;; (load "org-roam-ui-autoloads")
    1328       (org-roam-db-sync)
     1328      ;; (org-roam-db-sync)
    13291329
    13301330      (org-roam-db-autosync-mode t)
     
    15571557
    15581558** Tramp
    1559 #+begin_src emacs-lisp :tangle init.el
     1559#+begin_src emacs-lisp :tangle nil
    15601560    (add-to-list 'tramp-remote-path 'tramp-own-remote-path)
    15611561#+end_src
     
    15771577#+begin_src emacs-lisp :tangle init.el
    15781578  (package-loaded? "geiser-guile")
    1579   (require 'geiser-guile)
    15801579
    15811580  (package-loaded? "guix")
     
    15851584  (with-eval-after-load 'geiser-guile
    15861585    (progn
    1587       ;; (require 'compile)
    1588       ;;   (let* ((shell-command "guile -c '(write %load-path)'")
    1589       ;;             (shell-output (shell-command-to-string shell-command))
    1590       ;;             (load-paths (car (read-from-string shell-output))))
    1591       ;;        (dolist (path load-paths)
    1592       ;;          (add-to-list 'compilation-search-path path)))
    15931586    (add-to-list 'geiser-guile-load-path "~/projects/guix/")))
    15941587
Note: See TracChangeset for help on using the changeset viewer.