Emacs. Desire. Конфигурация

2024-06-11 · 31 мин. для прочтения

Конфигурация для пакета desire.

Содержание

1 Каталоги конфигурации

2 Установка переменных

3 Конфигурационные файлы

3.1 Заголовок

  • В файле rc.packages.el находится список используемых пакетов.
  • Заголовок файла:
 1;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; origami-fold-style: triple-braces; -*-
 2;;; rc.packages.el
 3
 4;;; Commentary:
 5
 6;;
 7;;  File id
 8;;
 9;;      Copyright (C)  2002-2024 Dmitry S. Kulyabov
10;;      Keywords:      rc.packages
11;;      Author:        Dmitry S. Kulyabov <yamadharma@gmail.com>
12;;      Maintainer:    Dmitry S. Kulyabov <yamadharma@gmail.com>
13;;
14;;      This code is free software in terms of GNU Gen. pub. Lic. v3 or later
15;;
16;;  Description
17;;
18;;
19
20;;; Change Log:
Распечатка 1: rc.packages.el
  • Файл:
 1
 2;;; Code:
 3
 4;; (desire-conf 'tiny)
 5(desire-conf 'personal)
 6;;
 7;; Mule
 8;;
 9(desire-conf 'mule)
10;;(desire-conf 'mule-fontset)
11;; ----------------------------------------------------------------------
12;;
13;;{{{ Xemacs
14
15(if (string-match "XEmacs" emacs-version)
16    (desired 'xemacs))
17
18;;}}}

3.2 Управление пакетами

1;;; Package {{{

3.2.1 Встроенный пакетный менеджер

1;;; Packaging
2(desire 'package)

3.2.2 Пакетный менеджер quelpa

  • Необходим для emacs-29 и старше.
  • Начиная с emacs-30 используется package-vc.
  • Подключение:
    1;;; Build and install your Emacs Lisp packages on-the-fly and directly from source
    2;; (desire 'quelpa)
    
    Распечатка 2: rc.packages.el

3.2.3 Пакетный менеджер straight

1;;; A declarative package management system with a command line interface
2;; (desire 'straight)
1;;; Auto update packages
2(desire 'auto-package-update)
3
4;;;}}}

3.3 Компиляция файлов

3.3.1 compile-angel

  • Подключим пакет:
    1;;; compile-angel.el
    2(desire 'compile-angel)
    
    Распечатка 3: rc.packages.el
  • Настроим начальную конфигурацию:
    1;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    2;;; Compile Emacs Lisp libraries automatically.
    3;;; https://github.com/jamescherti/compile-angel.el
    4
    5;; (require 'compile-angel)
    6
    7;;;
    
    Распечатка 4: packages/compile-angel/loaddefs.ecf
  • Настроим основные параметры:
     1;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
     2;;; Compile Emacs Lisp libraries automatically.
     3;;; https://github.com/jamescherti/compile-angel.el
     4
     5;;; Ensure Emacs loads the most recent byte-compiled files.
     6(setq load-prefer-newer t)
     7
     8;;; Ensure JIT compilation is enabled for improved performance by
     9;;; native-compiling loaded .elc files asynchronously
    10(setq native-comp-jit-compilation t)
    11(setq native-comp-deferred-compilation t) ; Deprecated in Emacs > 29.1
    12
    13;;; Enable/Disable byte compilation and native compilation
    14(setq compile-angel-enable-byte-compile t)
    15(setq compile-angel-enable-native-compile t)
    16
    17;;; Enable verbose (Set it to t while debugging)
    18(setq compile-angel-verbose nil)
    19
    20';; Display the *Compile-Log* buffer (Set it to t while writing elisp)
    21(setq compile-angel-display-buffer nil)
    22
    23;;; Perform byte/native compilation of .el files only once during initial loading
    24;;; (Setting this to nil will try to compile each time an .el file is loaded)
    25(setq compile-angel-on-load-mode-compile-once t)
    26
    27;;; Ignore certain files, for example, for users of the `dir-config` package:
    28(setq compile-angel-excluded-files-regexps '("/\\.dir-config\\.el$"))
    29
    30;;; Function that determines if an .el file should be compiled. It takes one
    31;;; argument (an EL file) and returns t if the file should be compiled,
    32;;; (By default, `compile-angel-predicate-function` is set to nil, which
    33;;; means that the predicate function is not called.)
    34(setq compile-angel-predicate-function
    35      #'(lambda(el-file)
    36       ;; Show a message
    37       (message "PREDICATE: %s" el-file)
    38       ;; Return t (Compile all)
    39       t))
    40
    41;; Ensure that quitting only occurs once Emacs finishes native compiling,
    42;; preventing incomplete or leftover compilation files in `/tmp`.
    43(setq native-comp-async-query-on-exit t)
    44(setq confirm-kill-processes t)
    45
    46;;; Show buffer when there is a warning.
    47;;; (NOT RECOMMENDED, except during development).
    48;; (setq warning-minimum-level :warning)
    49;; (setq byte-compile-verbose t)
    50;; (setq byte-compile-warnings t)
    51;; (setq native-comp-async-report-warnings-errors t)
    52;; (setq native-comp-warning-on-missing-source t)
    53
    54;;; Non-nil means to natively compile packages as part of their installation.
    55(setq package-native-compile t)
    56
    57(add-hook 'emacs-lisp-mode-hook #'compile-angel-on-save-local-mode)
    58
    59(compile-angel-on-save-mode)
    60(compile-angel-on-load-mode)
    61
    62;;;
    
    Распечатка 5: packages/compile-angel/desire.ecf

3.4 Системные настройки

 1
 2;; (desire 'esup)
 3
 4(desire-conf 'site-stuff)
 5
 6;;{{{ Window System
 7
 8(if (null window-system)
 9    ()
10  (progn
11    (desire-conf 'window-system)
12                                      ;    (desire-conf  'faces)
13                                      ;    (desire-conf  'multi-frame)
14    )
15  )
16
17
18;; (if (null window-system)
19;;  ()
20;;  (desire-conf 'window-system)
21;; )
22
23;; (desire-conf 'window-system)
24;; (desire-conf 'test)
25
26;; (if (eq window-system 'w32)
27;;  (progn
28;;    (desired 'window-system)
29;;    (desired 'window-system-w32)
30;;  )
31;; )
32
33;; (if (and window-system
34;;	 (member window-system '(x gtk))
35;;	 (x-display-color-p)
36;;    )
37;;    (progn
38;;      (desired 'window-system)
39;;      (desire-conf  'faces)
40;;      (desire-conf  'multi-frame)
41;;    )
42;; )
43
44;;}}}
45;;{{{ Serve
46
47;;; Gnuserv
48;;(desire-conf 'gnuserv nil "gnuserv")
49;; Rely on dtemacs to do this, otherwise a race condition can cause
50;; dtemacs to fail.
51;; (gnuserv-start)
52
53;;; Emacs daemon
54;; (desire-conf 'emacs-daemon)
55
56;;; Emacs server
57(desire 'server)
58
59;;}}}
60
61(desire 'general)
62
63(desire 'exec-path-from-shell)
64(desire 'compat)
65
66(desire 'async)
67;; (desire 'gcmh)
68
69;; ----------------------------------------------------------------------

3.5 Общие настройки мод

3.6 Поддержка LSP

3.6.1 Начало

  • Файл rc.packages.el:
    1;;; LSP mode {{{
    
    Распечатка 6: rc.packages.el

3.6.2 emacs-lsp-booster

  • Включаем поддержку emacs-lsp-booster:
    1(desired 'emacs-lsp-booster :precondition-system-executable "emacs-lsp-booster")
    
    Распечатка 7: rc.packages.el

3.6.3 Eglog

  1. Сам Eglot

    • Файл rc.packages.el:
      1;; (desire 'eglot)
      
      Распечатка 8: rc.packages.el
    • Начальная загрузка:
      1;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
      2;;; A client for Language Server Protocol servers
      3;;; https://github.com/joaotavora/eglot
      4
      5;;;
      
      Распечатка 9: packages/eglot/loaddefs.ecf
    • Загрузка самого пакета:
       1;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
       2;;; A client for Language Server Protocol servers
       3;;; https://github.com/joaotavora/eglot
       4
       5(require 'eglot)
       6
       7;;; Control blocking of LSP connection attempts
       8(setq eglot-sync-connect nil)
       9
      10(setq eglot-connect-timeout 10)
      11(setq eglot-autoshutdown t)
      12(setq eglot-send-changes-idle-time 0.5)
      13
      14;;; Disable `eglot-auto-display-help-buffer` because :select t in its popup rule causes eglot to steal focus too often.
      15(setq eglot-auto-display-help-buffer nil)
      16
      17;;; Disable any debug logging and may speed things up
      18(setq eglot-events-buffer-size 0)
      19
      20;;;
      
      Распечатка 10: packages/eglot/desire.ecf
    • Загрузка emacs-lsp-booster:
      1;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
      2;;; Boost eglot using lsp-booster
      3;;; https://github.com/jdtsmith/eglot-booster
      4
      5(desire 'eglot-booster :recipe '(:fetcher github :repo "jdtsmith/eglot-booster" :branch "main" :files ("*.el")))
      6(require 'eglot-booster)
      7(eglot-booster-mode)
      8
      9;;;
      
      Распечатка 11: packages/eglot/emacs-lsp-booster.ecf
  1. Дополнительные пакеты

    1. LaTeX

      • Загрузим поддержку LSP для LaTeX:
         1;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
         2;;; A client for Language Server Protocol servers
         3;;; https://github.com/joaotavora/eglot
         4
         5(require 'eglot)
         6
         7;;; Change order
         8(let ((item (assoc '(tex-mode context-mode texinfo-mode bibtex-mode) eglot-server-programs)))
         9  ;; (setf (car item) '(tex-mode context-mode texinfo-mode bibtex-mode))
        10  (setf (cdr item) '("texlab")))
        11
        12(add-hook 'tex-mode-hook #'eglot-ensure)
        13(add-hook 'latex-mode-hook #'eglot-ensure)
        14(add-hook 'LaTeX-mode-hook #'eglot-ensure)
        15
        16;;;
        
        Распечатка 12: packages/auctex/eglot.ecf

3.6.4 Lsp-mode

  1. Собственно lsp-mode

    • Подключим lsp-mode:
      1(desire 'lsp-mode)
      
      Распечатка 13: rc.packages.el
    • Первоначальная конфигурация:
      1;;; Language Server Protocol support for Emacs  -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
      2;; https://emacs-lsp.github.io/
      3;; https://github.com/emacs-lsp/lsp-mode
      4
      5;;;
      
      Распечатка 14: packages/lsp-mode/loaddefs.ecf
    • Конфигурация:
       1;;; Language Server Protocol support for Emacs  -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
       2;; https://emacs-lsp.github.io/
       3;; https://github.com/emacs-lsp/lsp-mode
       4
       5(require 'lsp-mode)
       6
       7;;; https://emacs-lsp.github.io/lsp-ui/
       8(desire 'lsp-ui)
       9
      10;;; set prefix for lsp-command-keymap (few alternatives - "C-l", "C-c l")
      11(setq lsp-keymap-prefix "C-l")
      12
      13;;;
      
      Распечатка 15: packages/lsp-mode/desire.ecf
  1. Дополнительные пакеты

    1. LaTeX (texlab)

      • Загрузим поддержку LSP для LaTeX:
        1;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
        2;;; Emacs lsp-mode client for LaTeX, on texlab
        3;;; https://github.com/ROCKTAKEY/lsp-latex
        4
        5(require 'lsp-mode)
        6(desire 'lsp-latex :precondition-system-executable "texlab")
        7
        8;;;
        
        Распечатка 16: packages/auctex/lsp-mode.ecf
      • Загрузка lsp-latex:
         1;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
         2;;; Emacs lsp-mode client for LaTeX, on texlab
         3;;; https://github.com/ROCKTAKEY/lsp-latex
         4
         5(require 'lsp-latex)
         6
         7;;; "texlab" executable must be located at a directory contained in `exec-path'.
         8;;; If you want to put "texlab" somewhere else, you can specify the path to "texlab" as follows:
         9;; (setq lsp-latex-texlab-executable "/path/to/texlab")
        10
        11;;;
        
        Распечатка 17: packages/lsp-latex/loaddefs.ecf
      • Настройка lsp-latex:
         1;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
         2;;; Emacs lsp-mode client for LaTeX, on texlab
         3;;; https://github.com/ROCKTAKEY/lsp-latex
         4
         5(add-hook 'tex-mode-hook #'lsp)
         6(add-hook 'latex-mode-hook #'lsp)
         7(add-hook 'LaTeX-mode-hook #'lsp)
         8
         9;;; For YaTeX
        10(with-eval-after-load "yatex"
        11  (add-hook 'yatex-mode-hook #'lsp))
        12
        13;;; For bibtex
        14(with-eval-after-load "bibtex"
        15  (add-hook 'bibtex-mode-hook #'lsp))
        16
        17;;;
        
        Распечатка 18: packages/lsp-latex/desire.ecf
    1. lsp-treemacs

      • Подключение интеграции treemacs и lsp-mode:
         1;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
         2;;; lsp-mode ❤️ treemacs
         3;;; https://github.com/emacs-lsp/lsp-treemacs
         4
         5(require 'lsp-mode)
         6
         7(desire 'lsp-treemacs)
         8(require 'lsp-treemacs)
         9
        10;;; Enable bidirectional synchronization of lsp workspace folders and treemacs projects
        11(lsp-treemacs-sync-mode 1)
        12
        13;;;
        
        Распечатка 19: packages/treemacs/lsp-mode.ecf
    1. which-key

      • Подключение интеграции treemacs и lsp-mode:
        1;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
        2;;; lsp which-key integration
        3;;; https://emacs-lsp.github.io/lsp-mode/page/keybindings/
        4
        5(with-eval-after-load 'lsp-mode
        6  (add-hook 'lsp-mode-hook #'lsp-enable-which-key-integration))
        7
        8;;;
        
        Распечатка 20: packages/which-key/lsp-mode.ecf

3.6.5 Конец

  • Файл rc.packages.el:
    1
    2;;; }}}
    

3.7 Сессии

1;;{{{ Session Management
2
3(desire 'savehist)
4
5;;}}}

3.8 Утилиты

1(desire 'uniquify)
2
3(desire-conf 'keys)
4(desire-conf 'dialog)
5(desire-conf 'mouse)
6
7;; (desire 'xclip)

3.8.1 which-key

  • Подключение:
    1(desire 'which-key)
    
    Распечатка 21: rc.packages.el
  • Загрузка:
    1;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    2;;; Emacs package that displays available keybindings in popup
    3;;; https://github.com/justbur/emacs-which-key
    4
    5(require 'which-key)
    6
    7;;;
    
    Распечатка 22: packages/which-key/loaddefs.ecf
  • Конфигурация:
     1;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
     2;;; Emacs package that displays available keybindings in popup
     3;;; https://github.com/justbur/emacs-which-key
     4
     5;;; Key-Based replacement
     6(which-key-add-key-based-replacements "C-x C-f" "find files")
     7(which-key-add-major-mode-key-based-replacements
     8 'org-mode
     9 "C-c C-c" "Org C-c C-c"
    10 "C-c C-a" "Org Attach")
    11
    12;;; Key and Description replacement
    13(add-to-list 'which-key-replacement-alist '(("TAB" . nil) . ("↹" . nil)))
    14(add-to-list 'which-key-replacement-alist '(("RET" . nil) . ("⏎" . nil)))
    15(add-to-list 'which-key-replacement-alist '(("DEL" . nil) . ("⇤" . nil)))
    16(add-to-list 'which-key-replacement-alist '(("SPC" . nil) . ("␣" . nil)))
    17
    18;; Set the special keys. These are automatically truncated to one character and
    19;; have which-key-special-key-face applied. Disabled by default. An example
    20;; setting is
    21;; (setq which-key-special-keys '("SPC" "TAB" "RET" "ESC" "DEL"))
    22(setq which-key-special-keys nil)
    23
    24
    25;;; Sorting Options
    26;;;; Default
    27(setq which-key-sort-order 'which-key-key-order)
    28;;;; Same as default, except single characters are sorted alphabetically
    29;; (setq which-key-sort-order 'which-key-key-order-alpha)
    30;;;; Same as default, except all prefix keys are grouped together at the end
    31;; (setq which-key-sort-order 'which-key-prefix-then-key-order)
    32;;;; Same as default, except all keys from local maps shown first
    33;; (setq which-key-sort-order 'which-key-local-then-key-order)
    34;;;; Sort based on the key description ignoring case
    35;; (setq which-key-sort-order 'which-key-description-order)
    36
    37;;; Popup Type Options
    38;;; minibuffer | side-window | frame | custom
    39(setq which-key-popup-type 'minibuffer)
    40
    41;;; Set the time delay (in seconds) for the which-key popup to appear
    42(setq which-key-idle-delay 1.0)
    43
    44;;; Set the maximum length (in characters) for key descriptions (commands or prefixes)
    45(setq which-key-max-description-length 27)
    46
    47;;; Use additional padding between columns of keys
    48(setq which-key-add-column-padding 0)
    49
    50;;; The maximum number of columns to display in the which-key buffer
    51(setq which-key-max-display-columns nil)
    52
    53;;; Set the separator used between keys and descriptions
    54(setq which-key-separator " → " )
    55(setq which-key-unicode-correction 3)
    56
    57;;; Set the prefix string that will be inserted in front of prefix commands
    58(setq which-key-prefix-prefix "+" )
    59
    60;;; Show the key prefix on the left, top, or bottom (nil means hide the prefix)
    61(setq which-key-show-prefix 'left)
    62
    63;; Set to t to show the count of keys shown vs. total keys in the mode line
    64(setq which-key-show-remaining-keys nil)
    65
    66
    67
    68(which-key-mode)
    69
    70;;;
    
    Распечатка 23: packages/which-key/desire.ecf

3.8.2 Разное

 1;; (desire 'keycast)
 2
 3;; ----------------------------------------------------------------------
 4
 5(desire 'pcache)
 6(desire 'persistent-soft)
 7
 8(desire 'alert)
 9
10(desire 'rg :precondition-system-executable "rg")
  • В файле используется фолдинг по тройной скобке.

3.9 Оформление интерфейса

  • Файл rc.packages.el:
1;;; UI {{{
Распечатка 24: rc.packages.el

3.9.1 Наборы иконок

1;;; Icons
Распечатка 25: rc.packages.el
  1. all-the-icons

    1;; (desire 'all-the-icons)
    
  1. nerd-icons

    • Загрузка пакета:
      1(desire 'nerd-icons)
      
      Распечатка 26: rc.packages.el
    1. tab-line

      • Emacs. Пакет tab-line
      • Поддержка nerd-icons в tab-line:
      • Пакет применяет иконки из nerd-icons к вкладкам tab-line.
      • Минорный режим tab-line-nerd-icons-global-mode добавляет к функции по умолчанию tab-line-tab-name-format-default иконки для форматирования имён вкладок.
       1;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
       2;;; Emacs package that uses the nerd-icons package to apply appropriate icons to tab-line tabs
       3;;; https://github.com/lucius-martius/tab-line-nerd-icons
       4
       5(desire 'tab-line-nerd-icons)
       6(require 'tab-line-nerd-icons)
       7
       8;;; Enable
       9(tab-line-nerd-icons-global-mode)
      10
      11;;;
      
      Распечатка 27: packages/tab-line/nerd-icons.ecf

3.9.2 Шрифты

 1;; (desire 'mixed-pitch)
 2
 3(desire-conf 'fontset)
 4(desire-conf 'font-lock)
 5(desire-conf 'font-lock-jit)
 6;; (desire-conf 'font-lock-lazy)
 7;; (desire-conf 'font-lock-fast)
 8;; (desire-conf 'faces)
 9;; (desire-conf 'color-theme nil "color-theme")
10;; (desire-conf 'fira-code-mode nil "fira-code-mode" t) ;; Simple minor mode for Fira Code ligatures
11
12(desire 'unicode-fonts)
13
14;; (desire 'ligature)
15
16;; (desire-conf 'theme)
17
18;; (desire 'zoom)

3.9.3 Табы

1;;; Tabs
Распечатка 28: rc.packages.el
  1. centaur-tabs

  1. tab-bar

    • Подключение:
      1(desire 'tab-bar)
      
      Распечатка 30: rc.packages.el
  1. tab-line

    • Emacs. Пакет tab-line
    • Подключение:
      1(desire 'tab-line)
      
      Распечатка 31: rc.packages.el
    • Загрузка:
      1;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
      2;;; Emacs Tab Bar
      3
      4(require 'tab-line)
      5
      6;;;
      
      Распечатка 32: packages/tab-line/loaddefs.ecf
    • Настройка:
       1;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
       2;;; Emacs Tab Line
       3
       4;;; Show the tabline in the top of the frame
       5(global-tab-line-mode t)
       6
       7;;; Do not show add-new button
       8;; (setq tab-line-new-button-show nil)
       9
      10;;; Do not show close button
      11;; (setq tab-line-close-button-show nil)
      12
      13;;; Change the separator between tabs
      14;; (setq tab-line-separator "")
      15
      16;;;
      
      Распечатка 33: packages/tab-line/desire.ecf

3.9.4 Нумерация строк

  1. display-line-numbers

    • Подключаем моду:
      1(desire 'display-line-numbers)
      
      Распечатка 34: rc.packages.el
    • Файл настройки:
      1;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
      2;;; Interface for display-line-numbers
      
      Распечатка 35: packages/display-line-numbers.ecf
    • Глобальная настройка:
      1;;; Global
      2;; (global-display-line-numbers-mode 1)
      
      Распечатка 36: packages/display-line-numbers.ecf
    • Глобальная настройка:
      1;;; Per mode
      2(add-hook 'prog-mode-hook #'display-line-numbers-mode)
      3(add-hook 'text-mode-hook #'display-line-numbers-mode)
      
      Распечатка 37: packages/display-line-numbers.ecf
    • Завершение:
      1;;;
      
      Распечатка 38: packages/display-line-numbers.ecf
  1. nlinum

    • Подключаем моду:
      1;; (desire 'nlinum)
      
      Распечатка 39: rc.packages.el
    • Загрузка пакета:
      1;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
      2;;; Show line numbers in the margin
      3;;; https://elpa.gnu.org/packages/nlinum.html
      4
      5(require 'nlinum)
      
      Распечатка 40: packages/nlinum.ecf
    • Глобальная настройка:
      1;;; Global settings
      2;; (global-nlinum-mode 1)
      
      Распечатка 41: packages/nlinum.ecf
    • Настройка по модам:
      1;;; Per mode configuration
      2(add-hook 'prog-mode-hook #'nlinum-mode)
      3(add-hook 'text-mode-hook #'nlinum-mode)
      
      Распечатка 42: packages/nlinum.ecf
    • Завершение:
      1;;;
      
      Распечатка 43: packages/nlinum.ecf

3.9.5 Завершение

1;;;}}}
Распечатка 44: rc.packages.el

3.10 Автодополнение

  • Файл rc.packages.el:
    1;;; Completion {{{
    2
    3;; (desire 'company)
    4(desire 'corfu)
    5
    6;;;}}}
    

3.11 Автодополнение в минибуфере

3.11.1 Начало

  • Файл rc.packages.el:
    1;;; Minibuffer completion {{{
    

3.11.2 Ido

  • Файл rc.packages.el:
    1;; (desire 'ido)
    

3.11.3 Helm

  • Файл rc.packages.el:
    1;; (desire 'helm-posframe)
    2;; (desire 'helm)
    

3.11.4 Ivy

  • Файл rc.packages.el:
    1;; (desire 'ivy)
    

3.11.5 Selectrum

  • Файл rc.packages.el:
    1;; (desire 'selectrum)
    

3.11.6 Vertico

  • Файл rc.packages.el:
    1(desire 'vertico)
    

3.11.7 Конец

  • Файл rc.packages.el:
    1
    2;;;}}}
    

3.12 Навигация по окнам

3.12.1 Начало

  • Файл rc.packages.el:
    1;;; Window navigation {{{
    
    Распечатка 45: rc.packages.el

3.12.2 Windmove

  • Emacs. Окна. Windmove

  • Файл rc.packages.el:

    1(desire 'windmove)
    
    Распечатка 46: rc.packages.el
  • Настройка пакета:

    1;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    2;;; Directional window-selection routinesdirectional window-selection routines
    3;;; https://www.emacswiki.org/emacs/WindMove
    
    Распечатка 47: packages/windmove.ecf
  • По умолчанию используется комбинация Shift + стрелки. Но это конфликтует с org-mode:

    1;;; Shifted arrow keys
    2;; (windmove-default-keybindings)
    
    Распечатка 48: packages/windmove.ecf
  • Будем использовать Ctrl + стрелки:

    1;;; Ctrl + arrow keys
    2(windmove-default-keybindings 'ctrl)
    
    Распечатка 49: packages/windmove.ecf
  • Что-то делает:

    1;;; Wrap around at edges
    2(setq windmove-wrap-around t)
    
    Распечатка 50: packages/windmove.ecf
  • Завершим файл:

    1;;;
    
    Распечатка 51: packages/windmove.ecf

3.12.3 Конец

  • Файл rc.packages.el:
    1;;;}}}
    
    Распечатка 52: rc.packages.el

3.13 Casual Suite

3.13.1 Начало

  • Файл rc.packages.el:
    1;;; Casual Suite
    2(desire 'casual)
    
    Распечатка 53: rc.packages.el

3.13.2 Основная библиотека

  • Файл packages/casual/loaddefs.ecf:
    1;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    2;;; A collection of opinionated keyboard-driven user interfaces for various built-in Emacs modes
    3;;; https://github.com/kickingvegas/casual
    4
    5(require 'casual)
    6
    7;;;
    
    Распечатка 54: packages/casual/loaddefs.ecf
  • Файл packages/casual/desire.ecf:
     1;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
     2;;; A collection of opinionated keyboard-driven user interfaces for various built-in Emacs modes
     3;;; https://github.com/kickingvegas/casual
     4
     5(require 'casual-calc)
     6(require 'casual-dired)
     7(require 'casual-isearch)
     8(require 'casual-ibuffer)
     9(require 'casual-info)
    10(require 'casual-re-builder)
    11(require 'casual-bookmarks)
    12(require 'casual-editkit)
    13
    14(keymap-set calc-mode-map "C-o" #'casual-calc-tmenu)
    15(keymap-set dired-mode-map "C-o" #'casual-dired-tmenu)
    16(keymap-set isearch-mode-map "C-o" #'casual-isearch-tmenu)
    17(keymap-set ibuffer-mode-map "C-o" #'casual-ibuffer-tmenu)
    18(keymap-set ibuffer-mode-map "F" #'casual-ibuffer-filter-tmenu)
    19(keymap-set ibuffer-mode-map "s" #'casual-ibuffer-sortby-tmenu)
    20(keymap-set Info-mode-map "C-o" #'casual-info-tmenu)
    21(keymap-set reb-mode-map "C-o" #'casual-re-builder-tmenu)
    22(keymap-set reb-lisp-mode-map "C-o" #'casual-re-builder-tmenu)
    23(keymap-set bookmark-bmenu-mode-map "C-o" #'casual-bookmarks-tmenu)
    24(keymap-global-set "C-o" #'casual-editkit-main-tmenu)
    25
    26;;;
    
    Распечатка 55: packages/casual/desire.ecf
  • Файл сделан под все элементы пакета.
  • Необходимо будет разделить всё это по разным пакетам.

3.13.3 Поддержка Avy

  • Файл packages/casual/avy.ecf:
     1;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
     2;;; An opinionated Transient menu for Avy.
     3;;; https://github.com/kickingvegas/casual-avy
     4
     5(desire 'casual-avy)
     6(require 'casual-avy)
     7
     8(keymap-global-set "M-g" #'casual-avy-tmenu)
     9
    10;;; Imenu (index) Support
    11(add-hook 'markdown-mode-hook #'imenu-add-menubar-index)
    12(add-hook 'makefile-mode-hook #'imenu-add-menubar-index)
    13(add-hook 'prog-mode-hook #'imenu-add-menubar-index)
    14(add-hook 'org-mode-hook #'imenu-add-menubar-index)
    15
    16;;;
    
    Распечатка 56: packages/casual/avy.ecf

3.13.4 Поддержка Symbol Overlay

  • Файл packages/casual/symbol-overlay.ecf:
     1;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
     2;;; An opinionated Transient user interface for the Emacs package Symbol Overlay.
     3;;; https://github.com/kickingvegas/casual-symbol-overlay
     4
     5(desire 'casual-symbol-overlay)
     6(require 'casual-symbol-overlay)
     7
     8(keymap-set symbol-overlay-map "C-o" #'casual-symbol-overlay-tmenu)
     9
    10;;;
    
    Распечатка 57: packages/casual/symbol-overlay.ecf

3.13.5 Поддержка Org-agenda

  • Файл packages/org/casual.ecf:
     1;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
     2;;; A collection of opinionated keyboard-driven user interfaces for various built-in Emacs modes
     3;;; https://github.com/kickingvegas/casual
     4
     5(require 'casual-agenda)
     6
     7(keymap-set org-agenda-mode-map "C-o" #'casual-agenda-tmenu)
     8(keymap-set org-agenda-mode-map "M-j" #'org-agenda-clock-goto) ; optional
     9(keymap-set org-agenda-mode-map "J" #'bookmark-jump) ; optional
    10
    11;;;
    
    Распечатка 58: packages/org/casual.ecf

3.14 Разное

  • Файл rc.packages.el:
 1;;
 2
 3(desire 'tree-sitter)
 4
 5(desire 'hydra)
 6
 7(desire 'bicycle)
 8(desire 'hideshow)
 9
10(desire-conf 'show-paren)
11;; (desire-conf 'folding)
12;; (desire-conf 'outline)
13
14
15(desire 'origami)
16
17;;
18
19(desire 'imenu)
20
21(desire 'ace-window)
22
23
24;; (desire-conf 'toolbar)
25
26;; Parentesis
27(desire 'smartparens)

3.15 Проверка правописания

1;;; Spell {{{
2
3;; (desire-conf 'spell)
4(desire 'ispell)
5;; (desire 'flyspell)
6;;(desire-conf 'speck)
7;;(desire-conf 'wcheck)

3.15.1 jinx

  • https://github.com/minad/jinx
  • Подключение:
    1(desire 'jinx)
    
    Распечатка 59: rc.packages.el
  • Начальная загрузка:
     1;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
     2;;; Enchanted Spell Checker
     3;;; https://github.com/minad/jinx
     4
     5(require 'jinx)
     6
     7;;; Alternative 1: Enable Jinx globally
     8;; (add-hook 'emacs-startup-hook #'global-jinx-mode)
     9
    10;;; Alternative 2: Enable Jinx per mode
    11(dolist (hook '(text-mode-hook prog-mode-hook conf-mode-hook))
    12  (add-hook hook #'jinx-mode))
    13
    14;;;
    
    Распечатка 60: packages/jinx/loaddefs.ecf
  • Настройки:
     1;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
     2;;; Enchanted Spell Checker
     3;;; https://github.com/minad/jinx
     4
     5
     6;;; M-$ triggers correction for the misspelled word before point.
     7;;; C-u M-$ triggers correction for the entire buffer.
     8;;; C-u C-u M-$ forces correction of the word at point, even if it is not misspelled.
     9(keymap-global-set "M-$" #'jinx-correct)
    10(keymap-global-set "C-M-$" #'jinx-languages)
    11
    12;;;
    
    Распечатка 61: packages/jinx/desire.ecf
  • Поддержка vertico:
     1;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
     2;;; Enchanted Spell Checker
     3;;; https://github.com/minad/jinx
     4
     5(require 'vertico-multiform)
     6(add-to-list 'vertico-multiform-categories
     7             '(jinx grid (vertico-grid-annotate . 20)))
     8
     9(vertico-multiform-mode 1)
    10
    11;;;
    
    Распечатка 62: packages/jinx/vertico.ecf

3.15.2 Langtool

1;; (desire 'langtool)
2;; (desire 'flycheck-languagetool)
3;; (desire 'lsp-ltex :recipe '(:fetcher github :repo "emacs-languagetool/lsp-ltex" :branch "master" :files ("*.el")))
4;; (desire 'eglot-ltex :recipe '(:fetcher github :repo "emacs-languagetool/eglot-ltex" :branch "master" :files ("*.el")))

3.15.3 Завершение

1;;;}}}

3.16 Адресная книга

 1;;; Adress book {{{
 2
 3(desired 'vcard)
 4(desire 'khardel :precondition-system-executable "khard")
 5(desire 'khalel :precondition-system-executable "khal")
 6;; (desire 'org-vcard)
 7;; (desire 'vdirel)
 8;; (desire 'bbdb)
 9
10;;;}}}
11;;; Bibliography {{{
12
13(desire 'biblio)
14(desire 'bibtex)
15
16;;;}}}

3.17 Проекты

3.17.1 Начало

1;;; Projects {{{

3.17.2 Project

1(desire 'project)

3.17.3 Projectile

1;; (desire 'projectile)

3.17.4 Завершение

1;;;}}}

3.18 Сниппеты

1
2;;(desire-conf 'yasnippet)

3.19 Отображение текста

 1;;; Text {{{
 2
 3(desire 'texfrag)
 4
 5;; (desire 'adaptive-wrap)
 6(desired 'visual-line-mode)
 7
 8;; (desired 'prettify-symbols-mode)
 9;; (desire 'pretty-mode)
10;; (desire 'prettify-math)
11;; (desire 'math-preview)

3.20 Текстовые режимы

 1(desire 'pandoc-mode)
 2
 3(desire' mermaid-mode :precondition-system-executable "mmdc")
 4
 5(desire-conf 'text)
 6(desire-conf 'markdown-mode nil "markdown-mode" t)
 7
 8(desire 'plantuml-mode)
 9
10(desire 'pdf-tools)
11(desire 'nov)
12(desire 'fb2-reader)
13
14;; (desire 'valign)
15
16;;;}}}

3.21 Управление временем

1;;; Time management {{{
2
3(desire 'pomm)
4(desire 'org-pomodoro)
5;; (desire 'hammy)
6
7;;;}}}

3.22 LaTeX

 1;;; LaTeX {{{
 2
 3(desire 'xenops)
 4
 5(desire 'cdlatex)
 6
 7(desire-conf 'xdvi nil "xdvi-search")
 8(desired 'reftex)
 9;; (desire-conf 'tex)
10(desired 'preview-latex)
11(desire 'auctex)
12;; (desire 'auctex :initname "latex")
13;; (desire 'auctex :initname "latex" :precondition-lisp-library "tex-site")
14
15;;;}}}

3.23 Org-mode

  • Org-mode
  • Конфигурация для org-mode:
    1;;; Org-mode {{{
    
    Распечатка 63: rc.packages.el

3.23.1 Babel

  • Emacs. Org Babel
  • Общие настройки babel:
    1;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    2;;; Org-Babel
    
    Распечатка 64: packages/org/desire.ecd/babel.ecf
  • Отключим подтверждение запутывания:
    1;;; Org-babel confirm before evaluation
    2(setq org-confirm-babel-evaluate nil)
    
    Распечатка 65: packages/org/desire.ecd/babel.ecf
  1. org-auto-tangle

    • Репозиторий: https://github.com/yilkalargaw/org-auto-tangle/
    • Подключим org-auto-tangle:
      1;;; A simple emacs package to allow org file tangling upon save
      2;;; https://github.com/yilkalargaw/org-auto-tangle/
      3(desire 'org-auto-tangle)
      4(require 'org-auto-tangle)
      5(add-hook 'org-mode-hook 'org-auto-tangle-mode)
      6
      7;;; Auto-tangle as the default behavior for all org buffers
      8;; (setq org-auto-tangle-default t)
      
      Распечатка 66: packages/org/desire.ecd/babel.ecf
  1. Конец

    1;;;
    
    Распечатка 67: packages/org/desire.ecd/babel.ecf

3.23.2 Разное

 1;; (desire 'org-ql)
 2
 3(desire 'org-appear)
 4(desire 'org-fragtog)
 5(desire 'org-custom-cookies)
 6;; (desire 'svg-tag-mode)
 7(desire 'org-superstar)
 8;; (desire 'org-modern-indent :recipe '(:fetcher github :repo "jdtsmith/org-modern-indent" :branch "main" :files ("*.el")))
 9(desire 'org-modern)
10;; (desire 'org-contacts)
11;; (desire 'google-contacts)
12(desire 'org-edna)
13(desire 'org-ref)
14(desire 'org-tree-slide)
Распечатка 68: rc.packages.el

3.23.3 Повестка дня

  • Конфигурация повестки дня:
 1;;; Agenda
 2(desire 'org-super-agenda)
 3
 4;;(if (desiredp 'org-ql)
 5;; (desire 'org-agenda-files-track-ql)
 6(desire 'org-agenda-files-track)
 7;;)
 8
 9;;(if (desiredp 'org-ql)
10;; (desire 'org-agenda-files-track-ql :recipe '(:fetcher github :repo "nicolas-graves/org-agenda-files-track" :branch "master" :files ("org-agenda-files-track-ql.el")))
11;; (desire 'org-agenda-files-track :recipe '(:fetcher github :repo "nicolas-graves/org-agenda-files-track" :branch "master" :files ("org-agenda-files-track.el")))
12;;)
13
14;;; Literate
15(desire 'org-tanglesync)
16
17;; (desire 'org-gcal)
18(desire 'org-journal)
19
20(desire 'org-noter)
21;; (desire 'org-noter :recipe '(:fetcher github :repo "org-noter/org-noter" :branch "feature/org-roam-integration" :files ("*.el" "modules/*.el")))
22
23(desire 'org-transclusion)
Распечатка 69: rc.packages.el

3.23.4 org-gtd

  1. Клавиатурные сочетания

3.23.5 mobileorg

1(desired 'mobileorg)
Распечатка 71: rc.packages.el

3.23.6 org-mode

1(desire 'org)
2
3;;; For messaging
4;; (desire 'org-msg)
5
6;;;}}}
Распечатка 72: rc.packages.el
  1. Предпросмотр LaTeX

    • Org-mode. Предпросмотр TeX
      1;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
      2;;; Previewing LaTeX fragments
      3;;; https://orgmode.org/manual/Previewing-LaTeX-fragments.html
      
      Распечатка 73: packages/org/desire.ecd/preview-latex.ecf
    • Зададим каталог для создаваемых изображений (по умолчанию они создаются в рабочем каталоге):
      1;;; LaTeX image directory
      2(setq org-preview-latex-image-directory (concat home-cache-path "org-latex/"))
      
      Распечатка 74: packages/org/desire.ecd/preview-latex.ecf
    • Зададим опции создания изображений:
      1;;; Output format
      2(setq org-format-latex-options (plist-put org-format-latex-options :scale 1.0))
      3(setq org-format-latex-options (plist-put org-format-latex-options :density 600))
      4(setq org-format-latex-options (plist-put org-format-latex-options :background "Transparent"))
      
      Распечатка 75: packages/org/desire.ecd/preview-latex.ecf
    • Зададим формат изображений. В данном случае это формат svg:
       1(setq org-latex-create-formula-image-program 'dvisvgm)
       2(setq org-preview-latex-process-alist
       3      '((dvipng :programs
       4              ("lualatex" "dvipng")
       5              :description "dvi > png" :message "you need to install the programs: latex and dvipng." :image-input-type "dvi" :image-output-type "png" :image-size-adjust
       6              (1.0 . 1.0)
       7              :latex-compiler
       8              ("lualatex -output-format dvi -interaction nonstopmode -output-directory %o %f")
       9              :image-converter
      10              ("dvipng -D %D -T tight -o %O %f"))
      11      (dvisvgm :programs
      12               ("latex" "dvisvgm")
      13               :description "dvi > svg" :message "you need to install the programs: latex and dvisvgm." :use-xcolor t :image-input-type "xdv" :image-output-type "svg" :image-size-adjust
      14               (1.7 . 1.5)
      15               :latex-compiler
      16               ("xelatex -no-pdf -interaction nonstopmode -output-directory %o %f")
      17               :image-converter
      18               ("dvisvgm %f -n -b min -c %S -o %O"))
      19      (imagemagick :programs
      20                   ("latex" "convert")
      21                   :description "pdf > png" :message "you need to install the programs: latex and imagemagick." :use-xcolor t :image-input-type "pdf" :image-output-type "png" :image-size-adjust
      22                   (1.0 . 1.0)
      23                   :latex-compiler
      24                   ("xelatex -no-pdf -interaction nonstopmode -output-directory %o %f")
      25                   :image-converter
      26                   ("convert -density %D -trim -antialias %f -quality 100 %O"))))
      
      Распечатка 76: packages/org/desire.ecd/preview-latex.ecf
    • Теперь зададим настройки для LaTeX:
      1;;; Configure latex
      2(setq org-latex-inputenc-alist '(("utf8" . "utf8x")))
      3;;; Default position for LaTeX figures
      4(setq org-latex-default-figure-position "!htbp")
      
      Распечатка 77: packages/org/desire.ecd/preview-latex.ecf
    • Опишем используемые пакеты:
       1;;; Unicode fonts
       2(add-to-list 'org-latex-packages-alist '("" "unicode-math") t)
       3;;; Physics2 package
       4;; (add-to-list 'org-latex-packages-alist '("" "physics2") t)
       5;;; Math
       6(add-to-list 'org-latex-packages-alist '("" "amsmath") t)
       7(add-to-list 'org-latex-packages-alist '("" "mathtools") t)
       8;;; Local definitions
       9;; (add-to-list 'org-latex-packages-alist '("" "local-define") t)
      10
      11;;;
      
      Распечатка 78: packages/org/desire.ecd/preview-latex.ecf

3.24 Заметочники

3.24.1 Org-roam

 1;;; Org-roam {{{
 2
 3(desire 'emacsql)
 4
 5;; (desire 'delve :recipe '(:fetcher github :repo "publicimageltd/delve" :branch "main"))
 6(desire 'zetteldesk)
 7
 8;; (desire 'org-roam-server)
 9;; (desire 'org-roam-ui :recipe '(:host github :repo "org-roam/org-roam-ui" :files ("*.el" "out")))
10;; (desire 'org-roam-ui :recipe '(:fetcher github :repo "org-roam/org-roam-ui" :files ("*.el" "out")))
11(desire 'org-roam-ui)
12
13
14(desire 'magit-section)
15(desire 'org-roam)
16
17;;;}}}

3.24.2 Denote

1
2(desire 'deft)
3;; (desire-conf 'zetteldeft nil "zetteldeft" t)
4
5;; (desire 'denote)
6
7;;}}}

3.25 Диаграммы

3.25.1 Диаграммы Ганта

  1. org-gantt-mode

    • Добавим пакет:
      1;; (desire 'org-gantt-mode :recipe '(:fetcher gitlab :repo "joukeHijlkema/org-gantt-mode" :branch "master"))
      
      Распечатка 80: rc.packages.el
    • Загрузка пакета:
      1;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
      2;;; Create SVG gantt charts from an org-mode subtree
      3;;; https://gitlab.com/joukeHijlkema/org-gantt-mode
      4
      5(autoload 'org-gantt-mode "org-gantt-mode" "Create SVG gantt charts" t)
      6
      7;;;
      
      Распечатка 81: packages/org-gantt-mode.ecf
  1. elgantt

    • Добавим пакет:
      1(desire 'elgantt :recipe '(:fetcher github :repo "legalnonsense/elgantt" :branch "master"))
      
      Распечатка 82: rc.packages.el
    • Загрузка пакета:
      1;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
      2;;;  A Gantt Chart (Calendar) for Org Mode
      3;;; https://github.com/legalnonsense/elgantt
      4
      5(require 'elgantt)
      6
      7;;;
      
      Распечатка 83: packages/elgantt/loaddefs.ecf
  1. taskjuggler

    • Загрузка пакета:
      1;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
      2;;;  Exporting Gantt charts with Taskjuggler
      3
      4(require 'ox-taskjuggler)
      5
      6;;;
      
      Распечатка 84: packages/org/desire.ecd/ox-taskjuggler.ecf

3.26 Разное

 1;; XML, XHTML, HTML {{{
 2
 3;;(desire-conf 'nxml nil "rng-auto")
 4                                      ; (desire-conf 'psgml)
 5
 6;;;}}}
 7;;;{{{ Palm pilot support
 8
 9                                      ;(desire-conf 'palm)
10
11;;;}}}

3.27 Управление сессиями

1;;; Desktop {{{

3.27.1 Сохранение состояния

1;; (desire-conf 'desktop)
2(desire-conf 'session nil "session")
3(desire-conf 'saveplace nil "saveplace")

3.27.2 Организация рабочего пространства

  1. one-tab-per-project

    • Автоматическое создание вкладки для каждого проекта, обеспечивающее легкое управление рабочим пространством на основе панели вкладок для Emacs.
    • https://github.com/abougouffa/one-tab-per-project
    • Подключение пакета:
      1(desire 'otpp)
      
      Распечатка 85: rc.packages.el
    • Предварительные настройки:
      1;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
      2;;; Automatically create a tab per project, providing a light tab-bar based workspace management for Emacs
      3;;; https://github.com/abougouffa/one-tab-per-project
      4
      5;;;
      
      Распечатка 86: packages/otpp/loaddefs.ecf
    • Загрузка пакета:
      1;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
      2;;; Automatically create a tab per project, providing a light tab-bar based workspace management for Emacs
      3;;; https://github.com/abougouffa/one-tab-per-project
      4
      5(require 'otpp)
      
      Распечатка 87: packages/otpp/desire.ecf
    • Задание параметров:
       1;;; If you like to define some aliases for better user experience
       2(defalias 'one-tab-per-project-mode 'otpp-mode)
       3(defalias 'one-tab-per-project-override-mode 'otpp-override-mode)
       4
       5;;; Enable `otpp-mode` globally
       6(otpp-mode 1)
       7
       8;;; If you want to advice the commands in `otpp-override-commands`
       9;;; to be run in the current's tab (so, current project's) root directory
      10(otpp-override-mode 1)
      11
      12;;;
      
      Распечатка 88: packages/otpp/desire.ecf
    • Подключение к project.el:
      1;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
      2;;; Automatically create a tab per project, providing a light tab-bar based workspace management for Emacs
      3;;; https://github.com/abougouffa/one-tab-per-project
      4
      5(require 'otpp)
      6
      7;;;
      
      Распечатка 89: packages/project/otpp.ecf
  1. iBuffer

    1(desire 'ibuffer)
    2;; (desire 'persp-mode)
    3;; (desire 'perspective)
    4;; (desire 'bufler)
    5;; (desire 'tabspaces)
    6
    7;;}}}
    

3.28 Календарь

 1;;; Appointments, diary, calendar {{{
 2
 3;; Use "M-x calendar RET" to display the calendar and start
 4;; appointment warnings.
 5
 6;; (desire-conf 'appt)
 7(desire 'calendar)
 8;; (desire-conf 'todo-mode)
 9;; (desire-conf 'diary "diary-lib")
10
11;;;}}}

3.29 Почта

3.29.1 Общие опции

1;;; These provide options for the various message handling packages {{{
2
3(desire 'browse-url)
4;; (desire-conf 'mailcrypt)
5;; (desire 'supercite)
6
7;;;}}}

3.29.2 Работа с почтой

 1;;; Message {{{
 2
 3(desire 'smtpmail)
 4;; (desire 'gnus)
 5(desire 'message)
 6;; (desire-conf 'vm)
 7;; (desire 'wl :ensurename 'wanderlust)
 8;; (desire-conf 'sendmail)
 9;; (desire 'mu4e-dashboard :recipe '(:fetcher github :repo "rougier/mu4e-dashboard"))
10(desire 'mu4e :precondition-system-executable "mu")
11
12;;;}}}

3.30 Блоги

 1;;; Blogs {{{
 2
 3;; (desire-conf 'hexo nil "hexo")
 4;; (desire-conf 'blog-admin nil "blog-admin") ;; Blog admin for emacs with hexo/org-page supported
 5(desire-conf 'easy-hugo  nil "easy-hugo" t) ;; Emacs major mode for managing hugo
 6
 7;;;}}}
 8;;; Miscellaneous {{{
 9
10(desire 'ebuku)
11(desire-conf 'graphviz-dot-mode nil "graphviz-dot-mode")
12;; (desire-conf 'abbrev)
13;; (desire-conf 'bibtex)
14;; (desire-conf 'calc)
15;; (desire-conf 'eiffel-mode)
16;; (desire-conf 'filladapt)
17;; (desire-conf 'hugs-mode)
18;; (desire-conf 'html-helper-mode)
19;; (desire-conf 'lispdir)
20;; (desire-conf 'php-mode)
21;; (desire-conf 'ps-print)
22;; (desire-conf 'sh-script)
23;; (desire-conf 'shell)
24;; (desire-conf 'sql-mode)
25;; (desire-conf 'w3)
26(desire 'web-mode)
27(desire 'gnuplot)
28
29(desire 'pass)
30
31
32(desire 'multiple-cursors)

3.31 Мессенджеры

1(desire 'telega)

3.32 Отложенное чтение

3.32.1 Pocket reader

1(desire 'pocket-reader)

3.32.2 Wallabag

  • Подключение пакета:
    1(desire 'wallabag :recipe '(:fetcher github :repo "chenyanming/wallabag.el" :branch "master" :files ("*.el" "*.alist" "*.css")))
    
    Распечатка 90: rc.packages.el
  • Начальные настройки:
    1;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    2;;; Emacs wallabag client - A Read It Later/Web Archiving Solution in Emacs
    3;;; https://github.com/chenyanming/wallabag.el
    4
    5
    6;;;
    
    Распечатка 91: packages/wallabag/loaddefs.ecf
  • Загрузка пакета:
     1;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
     2;;; Emacs wallabag client - A Read It Later/Web Archiving Solution in Emacs
     3;;; https://github.com/chenyanming/wallabag.el
     4
     5(require 'wallabag)
     6
     7;;; Retrieve new entries after `M-x wallabag`
     8(add-hook 'wallabag-after-render-hook 'wallabag-search-update-and-clear-filter)
     9
    10;;; Image Caching. Setting url-automatic-caching non-nil causes documents to be cached automatically
    11(setq url-automatic-caching t)
    12
    13;;;
    
    Распечатка 92: packages/wallabag/desire.ecf
  • Шаблон настройки параметров для пользователя:
     1;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
     2;;; Emacs wallabag client - A Read It Later/Web Archiving Solution in Emacs
     3;;; https://github.com/chenyanming/wallabag.el
     4
     5;;; Wallabag server host name
     6;; (setq wallabag-host "https://xx.xx.xx")
     7
     8;;; Username
     9;; (setq wallabag-username "xx")
    10
    11;;; Password
    12;; (setq wallabag-password "xx")
    13
    14;;; Created with API clients management
    15;; (setq wallabag-clientid "xx")
    16
    17;;; Created with API clients management
    18;; (setq wallabag-secret "xx")
    19
    20;;;
    
    Распечатка 93: packages/wallabag/personal.ecf

3.33 Dashboard

 1
 2;;;}}}
 3
 4;; (desire 'grammarly)
 5
 6;; (desire 'flycheck-grammarly)
 7
 8(desire 'dashboard)
 9
10;; PERSONAL
11
12;; (require 'chord-mode)  ; edit guitar music.
13;; (require 'discography) ; variant of BibTeX mode for discographies.

3.34 Разные программные режимы

3.34.1 Начало

  • Файл rc.packages.el:
    1;;; Different program modes {{{
    

3.34.2 Пакет csv-mode

  • Emacs. cvs-mode
  • Файл rc.packages.el:
    1;;; csv-mode
    2(desire 'csv-mode)
    
  • Установим вызов cvs-mode для расширения .cvs.
    • Файл packages/csv-mode/loaddefs.ecf:
      1;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
      2;;; Major mode for editing comma/char separated values
      3;;; https://elpa.gnu.org/packages/csv-mode.html
      4
      5(add-to-list 'auto-mode-alist '("\\.[Cc][Ss][Vv]\\'" . csv-mode))
      6
      7;;;
      
  • Загружаем пакет при необходимости.
    • Файл packages/csv-mode/desire.ecf:
      1;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
      2;;; Major mode for editing comma/char separated values
      3;;; https://elpa.gnu.org/packages/csv-mode.html
      4
      5(require 'csv-mode)
      
  • Подключим режим визуального выравнивания полей.
    • Файл packages/csv-mode/desire.ecf:
      1;;; Keeps fields visually aligned, on-the-fly
      2(add-hook 'csv-mode-hook 'csv-align-mode)
      
  • Настроим визуально представление длинных строк.
    • Файл packages/csv-mode/desire.ecf:
      1(add-hook 'csv-mode-hook '(lambda () (interactive) (toggle-truncate-lines nil)))
      2
      3;;;
      

3.34.3 Поддержка ebuild-файлов

  • Сайт: https://wiki.gentoo.org/wiki/Project:Emacs
  • Файл rc.packages.el:
    1;;; Ebuild files
    2(desire 'ebuild-mode :recipe '(:fetcher github :repo "emacsmirror/ebuild-mode" :branch "master"))
    
    Распечатка 94: rc.packages.el
  • Настроим загрузку:
     1;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
     2;;; Edit ebuild and eclass files
     3;;; https://wiki.gentoo.org/wiki/Project:Emacs
     4;;; https://github.com/emacsmirror/ebuild-mode
     5
     6(add-to-list 'load-path "/usr/share/emacs/site-lisp/ebuild-mode")
     7(autoload 'ebuild-mode "ebuild-mode"
     8  "Major mode for Gentoo .ebuild files." t)
     9(autoload 'ebuild-eclass-mode "ebuild-mode"
    10  "Major mode for Gentoo .eclass files." t)
    11(autoload 'ebuild-repo-mode "ebuild-mode"
    12  "Minor mode for files in an ebuild repository." t)
    13(autoload 'ebuild-repo-mode-maybe-enable "ebuild-mode")
    14(autoload 'devbook-mode "devbook-mode"
    15  "Major mode for editing the Gentoo Devmanual." t)
    16(autoload 'gentoo-newsitem-mode "gentoo-newsitem-mode"
    17  "Major mode for Gentoo GLEP 42 news items." t)
    18(autoload 'glep-mode "glep-mode"
    19  "Major mode for Gentoo Linux Enhancement Proposals." t)
    20
    21(add-to-list 'auto-mode-alist '("\\.ebuild\\'" . ebuild-mode))
    22(add-to-list 'auto-mode-alist '("\\.eclass\\'" . ebuild-eclass-mode))
    23(add-to-list 'auto-mode-alist '("/devmanual.*\\.xml\\'" . devbook-mode))
    24(add-to-list 'auto-mode-alist
    25         '("/[0-9]\\{4\\}-[01][0-9]-[0-3][0-9]-.+\\.[a-z]\\{2\\}\\.txt\\'"
    26           . gentoo-newsitem-mode))
    27(add-to-list 'auto-mode-alist '("/glep.*\\.rst\\'" . glep-mode))
    28(add-to-list 'auto-mode-alist
    29         '("/\\(package\\.\\(mask\\|unmask\\|use\\|env\
    30\\|license\\|properties\\|accept_\\(keywords\\|restrict\\)\\)\
    31\\|\\(package\\.\\)?use.\\(stable\\.\\)?\\(force\\|mask\\)\\)\\'"
    32           . conf-space-mode))
    33(add-to-list 'auto-mode-alist
    34         '("/make\\.\\(conf\\|defaults\\)\\'" . conf-unix-mode))
    35(add-to-list 'interpreter-mode-alist '("openrc-run" . sh-mode))
    36(add-to-list 'interpreter-mode-alist '("runscript" . sh-mode))
    37(add-hook 'find-file-hook #'ebuild-repo-mode-maybe-enable)
    38(modify-coding-system-alist 'file "\\.\\(ebuild\\|eclass\\)\\'" 'utf-8)
    
    Распечатка 95: packages/ebuild-mode/loaddefs.ecf

3.34.4 Asymptote

  1. Редактирование файлов Asymptote

    • Поддержка редактирования файлов Asymptote.
    • Файл rc.packages.el:
      1;;; Asymptote
      2(desire 'asy-mode :recipe '(:fetcher github :repo "vectorgraphics/asymptote" :branch "master" :files ("base/asy-mode.el")))
      
      Распечатка 96: rc.packages.el
    • Конфигурационный файл:
       1;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
       2;;; 2D & 3D TeX-Aware Vector Graphics Language
       3;;; https://github.com/vectorgraphics/asymptote
       4
       5(autoload 'asy-mode "asy-mode.el" "Asymptote major mode." t)
       6(autoload 'lasy-mode "asy-mode.el" "hybrid Asymptote/Latex major mode." t)
       7(autoload 'asy-insinuate-latex "asy-mode.el" "Asymptote insinuate LaTeX." t)
       8(add-to-list 'auto-mode-alist '("\\.asy$" . asy-mode))
       9
      10;;;
      
      Распечатка 97: packages/asy-mode.ecf
  1. Поддержка Asymptote в Babel

    1;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    2;;; Org-Babel support for evaluating asymptote
    3;;; https://github.com/hurrja/ob-asymptote
    4
    5(desire 'ob-asymptote)
    6(require 'ob-asymptote)
    7
    8;;;
    
    Распечатка 98: packages/org/desire.ecd/ob-asymptote.ecf

3.34.5 kmonad-файлы

  • Поддержка синтаксиса конфигурационных файлов kmonad.
  • Файл rc.packages.el:
    1;;; kbd-mode
    2;; (desire 'kbd-mode :recipe '(:fetcher github :repo "kmonad/kbd-mode" :branch "master"))
    
    Распечатка 99: rc.packages.el
  • Конфигурационный файл:
    1;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    2;;; Emacs mode for syntax highlighting kmonad's .kbd files.
    3;;; https://github.com/kmonad/kbd-mode
    4
    5(autoload 'kdb-mode "kbd-mode.el" "Kmonad's .kbd files" t)
    6(add-to-list 'auto-mode-alist '("\\.kbd$" . kbd-mode))
    7
    8;;;
    
    Распечатка 100: packages/kbd-mode.ecf

3.34.6 Julia

1;;; Julia {{{
2
3;;; Code completion and syntax checking
4                                      ;(desire 'eglot-jl)
5;;; REPL integration
6(desire 'julia-snail)
7;; (desire 'julia-repl)
8;;; Syntax highlighting and latex symbols
9(desire 'julia-mode)
  1. Конец

    • Файл rc.packages.el:
      1;;;}}}
      

3.34.7 Поддержка командной оболочки fish

  • Загрузка пакета:
    1;;; https://github.com/wwwjfy/emacs-fish
    2(desire 'fish-mode)
    
    Распечатка 101: rc.packages.el
  • Настройка пакета:
    1;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    2;;; fish-mode for emacs
    3;;; https://github.com/wwwjfy/emacs-fish
    4
    5;;; run fish_indent before save
    6(add-hook 'fish-mode-hook (lambda ()
    7                        (add-hook 'before-save-hook 'fish_indent-before-save)))
    8
    9;;;
    
    Распечатка 102: packages/fish-mode.ecf

3.34.8 Разное

 1(desire 'speedbar)
 2;; (desire-conf 'semantic nil "semantic")
 3
 4;; (desire-conf 'cedet nil "cedet")
 5;; (desire-conf 'ecb nil "ecb")
 6
 7;; (desire-conf 'php-mode nil "php-mode")
 8;; (desire-conf 'eiffel-mode nil "eiffel-mode")
 9
10(desire 'ebib)
11
12(desire 'lua-mode)
1
2
3(desire 'yaml-mode)
4(desire 'ini-mode)
5(desire 'hcl-mode)
6
7(desire 'magit-gitflow)
8(desire 'magit)

3.34.9 Конец

  • Файл rc.packages.el:
    1;;;}}}
    

3.35 Редактирование текста в броузере

3.35.1 Начало

  • Файл rc.packages.el:
    1;;; Edit text areas in browsers {{{
    

3.35.2 Edit with Emacs

  • Файл rc.packages.el:
    1(desire 'edit-server)
    
  • Файл packages/edit-server.ecf:
     1;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
     2;;; A Chromium/Firefox "clone" of It's All Text for spawning an editor to edit text areas in browsers. Based on David Hilley's original Chromium extension.
     3;;; https://github.com/stsquad/emacs_chrome
     4
     5(require 'edit-server)
     6
     7(setq edit-server-new-frame nil)
     8(edit-server-start)
     9
    10(setq edit-server-url-major-mode-alist
    11      '(("github\\.com" . markdown-mode)))
    12
    13;;;
    

3.35.3 Ghost Text

  • Файл rc.packages.el:
    1;; (desire 'atomic-chrome)
    
  • Файл packages/atomic-chrome.ecf:
     1;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
     2;;; Edit text area on Chrome with Emacs using Atomic Chrome
     3;;; https://github.com/alpha22jp/atomic-chrome
     4
     5(require 'atomic-chrome)
     6(atomic-chrome-start-server)
     7
     8;;; Atomic Chrome for Emacs automatically reflects modifications to the browser by default
     9(setq atomic-chrome-enable-auto-update t)
    10
    11;;; The default major mode of editing buffer is `text-mode`. You can change the major mode manually
    12(setq atomic-chrome-default-major-mode 'markdown-mode)
    13
    14;;; Choose the major mode for a specific website
    15(setq atomic-chrome-url-major-mode-alist
    16      '(("github\\.com" . gfm-mode)
    17        ("redmine" . textile-mode)))
    18
    19;;; Select editing buffer style
    20;;; full: Open in the selected window.
    21;;; split: Open in the new window by splitting the selected window (default).
    22;;; frame: Create a new frame and window in it.
    23;; (setq atomic-chrome-buffer-open-style split)
    24
    25;;;
    

3.35.4 Конец

  • Файл rc.packages.el:
    1;;;}}}
    

3.36 Навигация по файлам

3.36.1 dired

  1. dired

    • Файл rc.packages.el:
       1;;; Dired {{{
       2
       3(desire 'mouse3 :recipe '(:fetcher github :repo "emacsmirror/mouse3" :branch "master" :files ("*.el")))
       4
       5(desire 'dired)
       6(desire 'dired+ :recipe '(:fetcher github :repo "emacsmirror/dired-plus" :branch "master" :files ("*.el")))
       7
       8;; (desire 'ranger)
       9;; (desire 'efar)
      10;; (desire 'sunrise-commander :recipe '(:fetcher github :repo "sunrise-commander/sunrise-commander"))
      11(desire 'dirvish)
      12;;;}}}
      
  1. diredc

    • Репозиторий: https://github.com/Boruch-Baum/emacs-diredc
    • Двупанельный (как в midnight commander) режим.
    • Подключение:
      1;;; Midnight Commander features (plus) for emacs dired-mode
      2;; (desire 'diredc)
      
      Распечатка 103: rc.packages.el

3.36.2 Neotree

3.36.3 Treemacs

  • Файл rc.packages.el:
    1(desire 'treemacs)
    

3.37 Навигация по тексту

3.37.1 Начало

  • Файл rc.packages.el:
    1;;; Text navigation {{{
    

3.37.2 line-reminder

  • Line annotation for changed and saved lines: https://github.com/emacs-vs/line-reminder
  • Файл rc.packages.el:
    1;;; Line annotation for changed and saved lines
    2(desire 'line-reminder)
    
  • Файл rc.packages.el:
     1;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
     2;;; Line annotation for changed and saved lines
     3;;; https://github.com/emacs-vs/line-reminder
     4
     5;;; Enable for all buffers
     6(global-line-reminder-mode t)
     7
     8;;; Display Annotation
     9;;; linum | indicators
    10(setq line-reminder-show-option 'linum)
    11
    12;;; Display thumbnail
    13(setq line-reminder-thumbnail t)
    14
    15;;;
    

3.37.3 Конец

  • Файл rc.packages.el:
    1;;;}}}
    

3.38 Перевод

3.38.1 go-translate

  • Подключаем:
    1;;; Translator on Emacs
    2(desire 'go-translate)
    
    Распечатка 104: rc.packages.el
  • Загрузка:
    1;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    2;;; Translator on Emacs. Supports multiple engines such as Google, Bing, deepL, ChatGPT, StarDict, Youdao and so on
    3;;; https://github.com/lorniu/go-translate
    4
    5(require 'go-translate)
    6
    7;;;
    
    Распечатка 105: packages/go-translate/loaddefs.ecf
  • Конфигурация:
    1;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    2;;; Translator on Emacs. Supports multiple engines such as Google, Bing, deepL, ChatGPT, StarDict, Youdao and so on
    3;;; https://github.com/lorniu/go-translate
    4
    5
    6;;;
    
    Распечатка 106: packages/go-translate/desire.ecf
  • Простейшая конфигурация:
    1;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    2;;; Translator on Emacs. Supports multiple engines such as Google, Bing, deepL, ChatGPT, StarDict, Youdao and so on
    3;;; https://github.com/lorniu/go-translate
    4
    5;;; Initialize the default translator, let it translate between en and ru via Google Translate, and the result will be displayed in the Echo Area.
    6(setq gt-langs '(en ru))
    7(setq gt-default-translator (gt-translator :engines (gt-google-engine)))
    8
    9;;;
    
    Распечатка 107: packages/go-translate/desire.ecd/google-simple.ecf

3.39 Modeline

3.39.1 Начало

  • Файл rc.packages.el:
    1;;; Modeline {{{
    
    Распечатка 108: rc.packages.el

3.39.2 Общие настройки modeline

  • Загрузим только конфигурационный файл:

    1(desire-conf 'modeline)
    
    Распечатка 109: rc.packages.el
  • Заголовок файла:

    1;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    2;;; Configure modeline
    
    Распечатка 110: packages/modeline.ecf
  • Показывать столбец, в котором находится курсор (https://www.gnu.org/software/emacs/manual/html_node/efaq/Displaying-the-current-line-or-column.html):

    1;;; Show column number
    2(setq column-number-mode t)
    
    Распечатка 111: packages/modeline.ecf
  • Задаём 24-часовой формат времени:

    1;;; Time in 24 hour format, plus day and date.
    2(setq display-time-day-and-date t)
    3(setq display-time-24hr-format t)
    
    Распечатка 112: packages/modeline.ecf
  • Мы можем захотеть видеть и секунды:

    1;;; Display time in seconds in the mode line
    2;;; %H is the hour on a 24-hour clock, %I is on a 12-hour clock,
    3;;; %k is like %H only blank-padded, %l is like %I blank-padded.
    4;;; %p is the locale's equivalent of either AM or PM.
    5;;; %M is the minute, %S is the second.
    6(setq display-time-format "%H:%M:%S")
    7(setq display-time-interval 1)
    
    Распечатка 113: packages/modeline.ecf
  • Разрешим показывать время в модлайн:

    1;;; Enable the display of time and CPU load average in the modeline
    2(display-time-mode 1)
    3
    4;;;
    
    Распечатка 114: packages/modeline.ecf

3.39.3 Конец

  • Файл rc.packages.el:
    1;;;}}}
    
    Распечатка 115: rc.packages.el

3.40 Темы

  • Подключаем темы в файле rc.packages.el:
     1;;; Themes {{{
     2
     3;;; Nested menu for minor modes
     4(desire 'minions)
     5
     6;;; Tabs and ribbons for the mode-line
     7(desire 'moody)
     8
     9;;; Spacemacs theme
    10;; (desire 'spacemacs-theme :precondition-lisp-library "spacemacs-theme-pkg")
    11
    12;;; Doom themes
    13;; (desire 'doom-themes)
    14
    15;; (desire 'zenburn-theme)
    16;; (desire 'lambda-themes :recipe '(:fetcher github :repo "Lambda-Emacs/lambda-themes" :branch "main"))
    17;; (desire 'tao-theme)
    18
    19;;; N Λ N O Theme
    20;; (desire 'nano-theme)
    21
    22;;; Increase the padding/spacing of frames and windows
    23;; (desire 'spacious-padding)
    

3.40.1 Modus-themes

3.40.2 Ef-themes

3.40.3 Финализирование

  • Финализируем раздел в rc.packages.el:
    1
    2;;;}}}
    

3.41 Финализирование

  • Финализируем файл rc.packages.el:
    1
    2;;; rc.packages.el ends here
    
Дмитрий Сергеевич Кулябов
Authors
Профессор кафедры теории вероятностей и кибербезопасности
Мои научные интересы включают физику, администрирование Unix и сетей.