Changeset 3ec75a9 in dotfiles
- Timestamp:
- Sep 17, 2023, 3:21:53 PM (16 months ago)
- Branches:
- master
- Children:
- 8676811
- Parents:
- 864b0b5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
emacs/.emacs.d/.emacs-config.org
r864b0b5 r3ec75a9 254 254 #+end_src 255 255 256 ** EXWM 257 258 #+begin_src emacs-lisp :tangle init.el 259 (require 'exwm) 260 (require 'exwm-config) 261 (exwm-config-example) 262 #+end_src 263 264 256 265 ** Редакируем GUI 257 266 Удаляем ненужные бары, меняем шрифт и модлайн. Использую дефолтный для … … 261 270 делает его использование крайне неприятным. 262 271 263 #+begin_src emacs-lisp :tangle early-init.el272 #+begin_src emacs-lisp :tangle nil 264 273 ;; Change mode-line-modes to show only major mode 265 274 (defvar mode-line-major-mode … … 440 449 ;; Configuration stored in another directory, 441 450 ;; so I need to move files .emacs.d manually 442 (rename-file (concat config-dotfiles-path "early-init.el") config-path t)451 ;; (rename-file (concat config-dotfiles-path "early-init.el") config-path t) 443 452 (rename-file (concat config-dotfiles-path "init.el") config-path t)) 444 453 445 454 (defun config-load () 446 455 (interactive) … … 450 459 451 460 * Внешний вид 452 Я использую по большей части стандартную тему имакса и стараюсь не менять стандартное поведение.453 ** Назначение шрифтов454 А также отступа между строк455 #+BEGIN_SRC emacs-lisp :tangle nil456 ;;; Set font457 (setq-default line-spacing 0)458 459 (set-language-environment "UTF-8")460 (set-default-coding-systems 'utf-8-unix)461 462 (add-to-list 'default-frame-alist463 '(font . "Jetbrains Mono-14"))464 465 (setq mouse-wheel-progressive-speed nil)466 #+END_SRC467 461 468 462 ** Отображение номера строк и пробелов … … 475 469 (kbd "<f6>") 'whitespace-mode) 476 470 #+END_SRC 477 478 ** Скроллинг479 Помечает на время часть старого буфера при скроллинге.480 #+BEGIN_SRC emacs-lisp :tangle nil481 (when (package-loaded? "on-screen")482 (on-screen-global-mode t))483 484 (customize-set-variable 'fast-but-imprecise-scrolling t)485 (customize-set-variable 'scroll-conservatively 101)486 (customize-set-variable 'scroll-margin 0)487 (customize-set-variable 'scroll-preserve-screen-position t)488 #+END_SRC489 ** Объединение эхо зоны и модлайна490 #+begin_src emacs-lisp :tangle nil491 (when (package-loaded? "mini-modeline")492 (setq mini-modeline-r-format493 '("%e"494 mode-line-front-space495 496 mode-line-mule-info497 mode-line-client498 mode-line-modified499 mode-line-remote500 501 mode-line-frame-identification502 ;;long-path503 ;; mode-line-buffer-identification504 mode-line-misc-info505 506 mode-line-frame-identification507 mode-line-major-mode508 509 mode-line-frame-identification510 vc-mode511 mode-line-frame-identification512 513 mode-line-position))514 515 (setq mini-modeline-display-gui-line nil)516 (mini-modeline-mode))517 #+end_src518 519 ** Отображать полный путь в header line520 #+begin_src emacs-lisp :tangle nil521 (defun with-face (str &rest face-plist)522 (propertize str 'face face-plist))523 524 (defun sl/make-header ()525 ""526 (let* ((sl/full-header (abbreviate-file-name buffer-file-name))527 (sl/header (file-name-directory sl/full-header))528 (sl/drop-str "[...]"))529 (if (> (length sl/full-header)530 (window-body-width))531 (if (> (length sl/header)532 (window-body-width))533 (progn534 (concat (with-face sl/drop-str535 :background "blue"536 :weight 'bold537 )538 (with-face (substring sl/header539 (+ (- (length sl/header)540 (window-body-width))541 (length sl/drop-str))542 (length sl/header))543 ;; :background "red"544 :weight 'bold545 )))546 (concat (with-face sl/header547 ;; :background "red"548 :foreground "#8fb28f"549 :weight 'bold550 )))551 (concat (with-face sl/header552 ;; :background "green"553 ;; :foreground "black"554 :weight 'bold555 :foreground "#8fb28f"556 )557 (with-face (file-name-nondirectory buffer-file-name)558 :weight 'bold559 ;; :background "red"560 )))))561 562 (defun sl/display-header ()563 (setq header-line-format564 '("" ;; invocation-name565 (:eval (if (buffer-file-name)566 (sl/make-header)567 "%b")))))568 569 (add-hook 'buffer-list-update-hook570 'sl/display-header)571 #+end_src572 471 573 472 * Редактирование … … 599 498 600 499 *** Flycheck 601 #+BEGIN_SRC emacs-lisp :tangle init.el500 #+BEGIN_SRC emacs-lisp :tangle nil 602 501 ;; (require 'psalm) 603 502 … … 648 547 ** Дерево imenu 649 548 #+begin_src emacs-lisp :tangle init.el 650 (when (package-loaded? "imenu-list") 651 (setq imenu-list-focus-after-activation nil 652 imenu-list-auto-resize nil 653 imenu-list-mode-line-format '() 654 imenu-list-size 0.4) 655 (global-set-key (kbd "C-x C-d") #'imenu-list-smart-toggle)) 549 ;; (when (package-loaded? "imenu-list") 550 (setq imenu-list-focus-after-activation nil 551 imenu-list-auto-resize nil 552 imenu-list-mode-line-format '() 553 imenu-list-size 0.4) 554 (global-set-key (kbd "C-x C-d") #'imenu-list-smart-toggle) 555 ;; ) 656 556 #+end_src 657 557 … … 692 592 693 593 (package-loaded? "git-timemachine") 694 #+END_SRC695 696 *** Пометки о модифицированных строках697 Если строка добавлена, удалена или отредактирована относительно698 текущего git проекта, то строка помечается зеленым, красным или699 желтым цветом соответственно.700 701 #+BEGIN_SRC emacs-lisp :tangle nil702 ;;; Show added & removed git lines703 (when (package-loaded? "git-gutter")704 (progn705 (global-set-key (kbd "<f9>") 'git-gutter-mode)706 707 (setq git-gutter-window-width 1)708 709 (with-eval-after-load "git-gutter"710 '(set-face-background 'git-gutter:added "#99cc99")711 '(set-face-background 'git-gutter:deleted "#f2777a")712 '(set-face-background 'git-gutter:modified "#ffcc66")713 '(set-face-background 'git-gutter:unchanged "#f6f5f4"))714 715 (custom-set-variables716 '(git-gutter:modified-sign " ")717 '(git-gutter:unchanged-sign " ")718 '(git-gutter:added-sign " ")719 '(git-gutter:deleted-sign " "))))720 594 #+END_SRC 721 595 … … 804 678 ** Дополнение 805 679 ** Дебаггер 806 #+begin_src emacs-lisp :tangle init.el680 #+begin_src emacs-lisp :tangle nil 807 681 (when (package-loaded? "realgud") 808 682 (load "~/.emacs.d/site-lisp/realgud-xdebug/realgud-xdebug.el")) 809 683 #+end_src 810 684 811 #+begin_src emacs-lisp :tangle init.el685 #+begin_src emacs-lisp :tangle nil 812 686 (when (package-loaded? "geben") 813 687 (setq geben-dbgp-default-port 9003)) … … 816 690 *** Автодополнение кода и документация 817 691 По большей части я использую дефолтный Completion Buffer и Corfu 818 #+begin_src elisp :tangle init.el692 #+begin_src elisp :tangle nil 819 693 (when (package-loaded? "corfu") 820 694 (progn … … 850 724 #+end_src 851 725 *** Модификация дефолта 852 #+BEGIN_SRC emacs-lisp :tangle init.el726 #+BEGIN_SRC emacs-lisp :tangle nil 853 727 (setq completion-styles '(basic partial-completion substring flex emacs22) 854 728 completion-ignore-case t … … 860 734 (setq aggressive-completion-delay 0.5) 861 735 (aggressive-completion-mode t) 862 #+END_SRC863 *** HELM (не используется)864 #+BEGIN_SRC emacs-lisp :results nil :tangle nil865 (load "helm-autoloads")866 867 (setq helm-completion-style 'emacs868 helm-no-header t)869 870 (global-set-key (kbd "M-x") #'helm-M-x)871 (global-set-key (kbd "C-x r b") #'helm-filtered-bookmarks)872 (global-set-key (kbd "C-x C-f") #'helm-find-files)873 (global-set-key (kbd "C-x C-b") #'helm-buffers-list)874 (global-set-key (kbd "C-s") #'helm-occur)875 (global-set-key (kbd "M-y") #'helm-show-kill-ring)876 (global-set-key (kbd "C-x b") #'helm-mini)877 878 (define-key helm-map (kbd "<tab>") 'helm-execute-persistent-action)879 (define-key helm-map (kbd "C-i") 'helm-execute-persistent-action)880 (define-key helm-map (kbd "C-z") 'helm-select-action)881 (define-key minibuffer-local-map (kbd "C-c C-l") 'helm-minibuffer-history)882 883 (setq helm-display-header-line nil884 helm-split-window-in-side-p t885 helm-echo-input-in-header-line t886 helm-display-source-at-screen-top nil887 helm-autoresize-max-height 50888 helm-autoresize-min-height 5)889 890 (helm-adaptive-mode)891 (helm-autoresize-mode 1)892 893 (add-hook 'eshell-mode-hook894 (lambda ()895 (eshell-cmpl-initialize)896 (define-key eshell-mode-map (kbd "C-c C-l") 'helm-eshell-history)897 (define-key eshell-mode-map [remap eshell-pcomplete] 'helm-esh-pcomplete)898 (define-key eshell-mode-map (kbd "M-p") 'helm-eshell-history)))899 900 (add-hook 'eshell-mode-hook901 (lambda ()902 (define-key eshell-mode-map903 (kbd "M-p")904 'helm-eshell-history)))905 906 (defun pcomplete/sudo ()907 (let ((prec (pcomplete-arg 'last -1)))908 (cond ((string= "sudo" prec)909 (while (pcomplete-here*910 (funcall pcomplete-command-completion-function)911 (pcomplete-arg 'last) t))))))912 913 (helm-mode 1)914 915 736 #+END_SRC 916 737 ** Полнотекстовый поиск … … 946 767 947 768 ** Клиент LSP 948 #+begin_src emacs-lisp :tangle init.el769 #+begin_src emacs-lisp :tangle nil 949 770 (with-eval-after-load 'eglot 950 771 (add-to-list 'eglot-server-programs '((php-mode phps-mode) . ("~/projects/phpactor/bin/phpactor" "language-server" "-vvv"))) … … 967 788 968 789 ** Линтеры 969 #+begin_src emacs-lisp :tangle init.el790 #+begin_src emacs-lisp :tangle nil 970 791 (defun my-php-mode-setup () 971 792 "My PHP-mode hook." … … 1055 876 1056 877 ** Быстрый запуск программы 1057 #+begin_src emacs-lisp 878 #+begin_src emacs-lisp :tangle init.el 1058 879 (when (package-loaded? "quickrun") 1059 880 (define-key global-map (kbd "C-c C-c") 'quickrun)) … … 1064 885 ** Common Lisp 1065 886 *** REPL 1066 #+BEGIN_SRC emacs-lisp :tangle init.el887 #+BEGIN_SRC emacs-lisp :tangle nil 1067 888 (load "sly-autoloads") 1068 889 … … 1074 895 1075 896 ** Erlang 1076 #+BEGIN_SRC emacs-lisp :ta emngle nil897 #+BEGIN_SRC emacs-lisp :tangle nil 1077 898 (load "erlang-autoloads") 1078 899 #+END_SRC … … 1094 915 ** Python 1095 916 *** Автодополнение и линт 1096 #+BEGIN_SRC emacs-lisp :tangle init.el917 #+BEGIN_SRC emacs-lisp :tangle nil 1097 918 (when (package-loaded? "anaconda-mode") 1098 919 (progn … … 1124 945 Необходимо скачать и распаковать мануал PHP (в формате html) в 1125 946 директорию ~~/.emacs.d/php-manual/~. 1126 #+begin_src emacs-lisp :tangle init.el947 #+begin_src emacs-lisp :tangle nil 1127 948 ;; (add-to-list 'load-path "~/.emacs.d/site-lisp/realgud-xdebug/") 1128 949 ;; (require 'realgud-xdebug) … … 1450 1271 * Коммуникации 1451 1272 ** Telega 1452 #+BEGIN_SRC emacs-lisp :tangle nil1273 #+BEGIN_SRC emacs-lisp :tangle init.el 1453 1274 (when (package-loaded? "telega") 1454 1275 (setq telega-filter-custom-show-folders t … … 1497 1318 1498 1319 *** Автодополнение в echo при M-x и других командах 1499 #+begin_src emacs-lisp :tangle nil1320 #+begin_src emacs-lisp :tangle init.el 1500 1321 (icomplete-mode 1) 1501 1322 #+end_src … … 1572 1393 1573 1394 *** Меню 1574 По неизвестным причинам навигация в меню при помощи биндов Emacs1575 не работает1576 #+BEGIN_SRC emacs-lisp :tangle init.el1577 ;; GTK menu doesn't allow emacs-style navigation1578 (define-key global-map (kbd "<f10>") 'tmm-menubar)1579 #+END_SRC1580 1581 1395 *** Сохранять временные файлы не в той же директории 1582 1396 #+BEGIN_SRC emacs-lisp :tangle init.el … … 1637 1451 1638 1452 ** Браузер 1639 #+begin_src emacs-lisp :tangle init.el1453 #+begin_src emacs-lisp :tangle nil 1640 1454 (setq browse-url-browser-function #'eww-browse-url) 1641 1455 … … 1690 1504 #+end_src 1691 1505 1692 ** Vim1693 #+begin_src emacs-lisp :tangle init.el1694 (add-to-list 'auto-mode-alist '("\\.vim\\(rc\\)?\\'" . vimrc-mode))1695 #+end_src1696 1506 ** Direnv 1697 1507 #+BEGIN_SRC emacs-lisp :tangle nil … … 1767 1577 1768 1578 ** Длинные строки 1769 #+begin_src emacs-lisp :tangle init.el1579 #+begin_src emacs-lisp :tangle nil 1770 1580 ;; Better support for files with long lines 1771 1581 (setq-default bidi-paragraph-direction 'left-to-right)
Note:
See TracChangeset
for help on using the changeset viewer.