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

Конфигурация для пакета 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-old 'tiny)
 5(desire-old 'personal)
 6;;
 7;; Mule
 8;;
 9(desire-old 'mule)
10;;(desire-old 'mule-fontset)
11;; ----------------------------------------------------------------------
12;;
13;;{{{ Xemacs
14
15(if (string-match "XEmacs" emacs-version)
16    (desired 'xemacs))
17
18;;}}}
19;;; Package {{{
20
21;;; Packaging
22(desire 'package)
23
24;;; Build and install your Emacs Lisp packages on-the-fly and directly from source
25(desire 'quelpa)
26
27;;; A declarative package management system with a command line interface
28;; (desire 'straight)
29
30;;; Auto update packages
31(desire 'auto-package-update)
32
33;;;}}}

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

3.2.1 compile-angel

  • Подключим пакет:
    1;;; compile-angel.el
    2(desire 'compile-angel)
    
    Распечатка 2: 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;;;
    
    Распечатка 3: 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;;;
    
    Распечатка 4: packages/compile-angel/desire.ecf

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

 1
 2;; (desire 'esup)
 3
 4(desire-old 'site-stuff)
 5
 6;;{{{ Window System
 7
 8(if (null window-system)
 9    ()
10  (progn
11    (desire-old 'window-system)
12                                      ;    (desire-old  'faces)
13                                      ;    (desire-old  'multi-frame)
14    )
15  )
16
17
18;; (if (null window-system)
19;;  ()
20;;  (desire-old 'window-system)
21;; )
22
23;; (desire-old 'window-system)
24;; (desire-old '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-old  'faces)
40;;      (desire-old  'multi-frame)
41;;    )
42;; )
43
44;;}}}
45;;{{{ Serve
46
47;;; Gnuserv
48;;(desire-old '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-old '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;; ----------------------------------------------------------------------
70
71;;{{{ Session Management
72
73(desire 'savehist)
74
75;;}}}
76
77(desire 'uniquify)
78
79(desire-old 'keys)
80(desire-old 'dialog)
81(desire-old 'mouse)
82
83;; (desire 'xclip)
84
85(desire 'which-key)
86;; (desire 'keycast)
87
88;; ----------------------------------------------------------------------
89
90(desire 'pcache)
91(desire 'persistent-soft)
92
93(desire 'alert)
94
95(desire 'rg :precondition-system-executable "rg")
  • В файле используется фолдинг по тройной скобке.

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

  • Файл rc.packages.el:
     1;;; UI {{{
     2
     3;; (desire 'ligature)
     4
     5;; (desire 'all-the-icons)
     6(desire 'nerd-icons)
     7;; (desire 'mixed-pitch)
     8
     9(desire-old 'fontset)
    10(desire-old 'font-lock)
    11(desire-old 'font-lock-jit)
    12;; (desire-old 'font-lock-lazy)
    13;; (desire-old 'font-lock-fast)
    14;; (desire-old 'faces)
    15;; (desire-old 'color-theme nil "color-theme")
    16;; (desire-old 'fira-code-mode nil "fira-code-mode" t) ;; Simple minor mode for Fira Code ligatures
    17
    18(desire 'unicode-fonts)
    19
    20;; (desire-old 'theme)
    21;; (desire-old 'modeline)
    22
    23;; (desire 'zoom)
    24
    25;; (desire 'centaur-tabs)
    26(desire 'tab-bar)
    27(desire 'tab-line)
    28
    29;;;}}}
    

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

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

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

3.6.1 Начало

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

3.6.2 Ido

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

3.6.3 Helm

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

3.6.4 Ivy

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

3.6.5 Selectrum

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

3.6.6 Vertico

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

3.6.7 Конец

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

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

3.7.1 Начало

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

3.7.2 Windmove

  • Emacs. Окна. Windmove

  • Файл rc.packages.el:

    1(desire 'windmove)
    
    Распечатка 6: 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
    
    Распечатка 7: packages/windmove.ecf
  • По умолчанию используется комбинация Shift + стрелки. Но это конфликтует с org-mode:

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

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

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

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

3.7.3 Конец

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

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

3.9 Поддержка LSP

3.9.1 Начало

  • Файл rc.packages.el:

    1;;; LSP mode {{{
    
    Распечатка 13: rc.packages.el
  • Включаем поддержку emacs-lsp-booster:

    1(desired 'emacs-lsp-booster :precondition-system-executable "emacs-lsp-booster")
    
    Распечатка 14: rc.packages.el

3.9.2 Eglog

  • Файл rc.packages.el:
    1(desire 'eglot)
    
    Распечатка 15: 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;;;
    
    Распечатка 16: 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;;;
    
    Распечатка 17: 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;;;
    
    Распечатка 18: packages/eglot/emacs-lsp-booster.ecf

3.9.3 Lsp-mode

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

3.9.4 Конец

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

3.10 Casual Suite

3.10.1 Начало

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

3.10.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;;;
    
    Распечатка 20: 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;;;
    
    Распечатка 21: packages/casual/desire.ecf
  • Файл сделан под все элементы пакета.
  • Необходимо будет разделить всё это по разным пакетам.

3.10.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;;;
    
    Распечатка 22: packages/casual/avy.ecf

3.10.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;;;
    
    Распечатка 23: packages/casual/symbol-overlay.ecf

3.10.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;;;
    
    Распечатка 24: packages/org/casual.ecf

3.11 Разное

  • Файл rc.packages.el:
  1;;
  2
  3(desire 'tree-sitter)
  4
  5(desire 'hydra)
  6
  7(desire 'bicycle)
  8(desire 'hideshow)
  9
 10(desire-old 'show-paren)
 11;; (desire-old 'folding)
 12;; (desire-old 'outline)
 13
 14
 15(desire 'origami)
 16
 17;;
 18
 19(desire 'imenu)
 20
 21(desire 'ace-window)
 22
 23
 24;; (desire-old 'toolbar)
 25
 26;; Parentesis
 27(desire 'smartparens)
 28
 29;;; Spell {{{
 30
 31;; (desire-old 'spell)
 32(desire 'ispell)
 33(desire 'flyspell)
 34;;(desire-old 'speck)
 35;;(desire-old 'wcheck)
 36
 37;; (desire 'flycheck-languagetool)
 38;; (desire 'langtool)
 39
 40;; (desire 'lsp-ltex :recipe '(:fetcher github :repo "emacs-languagetool/lsp-ltex" :branch "master" :files ("*.el")))
 41;; (desire 'eglot-ltex :recipe '(:fetcher github :repo "emacs-languagetool/eglot-ltex" :branch "master" :files ("*.el")))
 42
 43;;;}}}
 44;;; Adress book {{{
 45
 46(desired 'vcard)
 47(desire 'khardel :precondition-system-executable "khard")
 48(desire 'khalel :precondition-system-executable "khal")
 49;; (desire 'org-vcard)
 50;; (desire 'vdirel)
 51;; (desire 'bbdb)
 52
 53;;;}}}
 54;;; Bibliography {{{
 55
 56(desire 'biblio)
 57(desire 'bibtex)
 58
 59;;;}}}
 60;;; Projects {{{
 61
 62;; (desire 'project)
 63(desire 'projectile)
 64
 65;;;}}}
 66
 67;;(desire-old 'yasnippet)
 68
 69;;; Text {{{
 70
 71(desire 'texfrag)
 72
 73;; (desire 'adaptive-wrap)
 74(desired 'visual-line-mode)
 75
 76;; (desired 'prettify-symbols-mode)
 77;; (desire 'pretty-mode)
 78;; (desire 'prettify-math)
 79;; (desire 'math-preview)
 80
 81(desire 'pandoc-mode)
 82
 83(desire' mermaid-mode :precondition-system-executable "mmdc")
 84
 85(desire-old 'text)
 86(desire-old 'markdown-mode nil "markdown-mode" t)
 87
 88(desire 'plantuml-mode)
 89
 90(desire 'pdf-tools)
 91(desire 'nov)
 92(desire 'fb2-reader)
 93
 94;; (desire 'valign)
 95
 96;;;}}}
 97;;; Time management {{{
 98
 99(desire 'pomm)
100(desire 'org-pomodoro)
101;; (desire 'hammy)
102
103;;;}}}
104;;; LaTeX {{{
105
106(desire 'xenops)
107;; (desire 'lsp-latex :precondition-system-executable "texlab")
108
109(desire 'cdlatex)
110
111(desire-old 'xdvi nil "xdvi-search")
112(desired 'reftex)
113;; (desire-old 'tex)
114(desired 'preview-latex)
115(desire 'auctex)
116;; (desire 'auctex :initname "latex")
117;; (desire 'auctex :initname "latex" :precondition-lisp-library "tex-site")
118
119;;;}}}

3.12 Org-mode

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

3.12.1 Babel

  • Emacs. Org Babel
  • Общие настройки babel:
    1;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    2;;; Org-Babel
    
    Распечатка 26: packages/org/desire.ecd/babel.ecf
  • Отключим подтверждение запутывания:
    1;;; Org-babel confirm before evaluation
    2(setq org-confirm-babel-evaluate nil)
    
    Распечатка 27: 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)
      
      Распечатка 28: packages/org/desire.ecd/babel.ecf
  1. Конец

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

3.12.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)
Распечатка 30: rc.packages.el

3.12.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)
Распечатка 31: rc.packages.el

3.12.4 org-gtd

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

3.12.5 mobileorg

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

3.12.6 org-mode

1(desire 'org)
2
3;;; For messaging
4;; (desire 'org-msg)
5
6;;;}}}
Распечатка 34: 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
      
      Распечатка 35: packages/org/desire.ecd/preview-latex.ecf
    • Зададим каталог для создаваемых изображений (по умолчанию они создаются в рабочем каталоге):
      1;;; LaTeX image directory
      2(setq org-preview-latex-image-directory (concat home-cache-path "org-latex/"))
      
      Распечатка 36: 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"))
      
      Распечатка 37: 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"))))
      
      Распечатка 38: 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")
      
      Распечатка 39: 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;;;
      
      Распечатка 40: packages/org/desire.ecd/preview-latex.ecf

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

3.13.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.13.2 Denote

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

3.14 Разное

 1;; XML, XHTML, HTML {{{
 2
 3;;(desire-old 'nxml nil "rng-auto")
 4                                      ; (desire-old 'psgml)
 5
 6;;;}}}
 7;;;{{{ Palm pilot support
 8
 9                                      ;(desire-old 'palm)
10
11;;;}}}
12;;; Desktop {{{
13
14;; (desire-old 'desktop)
15(desire-old 'session nil "session")
16(desire-old 'saveplace nil "saveplace")
17
18(desire 'ibuffer)
19;; (desire 'persp-mode)
20;; (desire 'perspective)
21;; (desire 'bufler)
22;; (desire 'tabspaces)
23
24;;}}}
25;;; Appointments, diary, calendar {{{
26
27;; Use "M-x calendar RET" to display the calendar and start
28;; appointment warnings.
29
30;; (desire-old 'appt)
31(desire 'calendar)
32;; (desire-old 'todo-mode)
33;; (desire-old 'diary "diary-lib")
34
35;;;}}}
36;;; These provide options for the various message handling packages {{{
37
38(desire 'browse-url)
39;; (desire-old 'mailcrypt)
40;; (desire 'supercite)
41
42;;;}}}
43;;; Message {{{
44
45(desire 'smtpmail)
46;; (desire 'gnus)
47(desire 'message)
48;; (desire-old 'vm)
49;; (desire 'wl :ensurename 'wanderlust)
50;; (desire-old 'sendmail)
51;; (desire 'mu4e-dashboard :recipe '(:fetcher github :repo "rougier/mu4e-dashboard"))
52(desire 'mu4e :precondition-system-executable "mu")
53
54;;;}}}
 1;;; Blogs {{{
 2
 3;; (desire-old 'hexo nil "hexo")
 4;; (desire-old 'blog-admin nil "blog-admin") ;; Blog admin for emacs with hexo/org-page supported
 5(desire-old 'easy-hugo  nil "easy-hugo" t) ;; Emacs major mode for managing hugo
 6
 7;;;}}}
 8;;; Miscellaneous {{{
 9
10(desire 'ebuku)
11(desire-old 'graphviz-dot-mode nil "graphviz-dot-mode")
12;; (desire-old 'abbrev)
13;; (desire-old 'bibtex)
14;; (desire-old 'calc)
15;; (desire-old 'eiffel-mode)
16;; (desire-old 'filladapt)
17;; (desire-old 'hugs-mode)
18;; (desire-old 'html-helper-mode)
19;; (desire-old 'lispdir)
20;; (desire-old 'php-mode)
21;; (desire-old 'ps-print)
22;; (desire-old 'sh-script)
23;; (desire-old 'shell)
24;; (desire-old 'sql-mode)
25;; (desire-old 'w3)
26(desire 'web-mode)
27(desire 'gnuplot)
28
29(desire 'pass)
30
31
32(desire 'multiple-cursors)
33
34(desire 'telega)
35(desire 'pocket-reader)
36
37;;;}}}
38
39;; (desire 'grammarly)
40
41;; (desire 'flycheck-grammarly)
42
43(desire 'dashboard)
44
45;; PERSONAL
46
47;; (require 'chord-mode)  ; edit guitar music.
48;; (require 'discography) ; variant of BibTeX mode for discographies.

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

3.15.1 Начало

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

3.15.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.15.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"))
    
    Распечатка 42: 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)
    
    Распечатка 43: packages/ebuild-mode/loaddefs.ecf

3.15.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")))
      
      Распечатка 44: 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;;;
      
      Распечатка 45: 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;;;
    
    Распечатка 46: packages/org/desire.ecd/ob-asymptote.ecf

3.15.5 kmonad-файлы

  • Поддержка синтаксиса конфигурационных файлов kmonad.
  • Файл rc.packages.el:
    1;;; kbd-mode
    2;; (desire 'kbd-mode :recipe '(:fetcher github :repo "kmonad/kbd-mode" :branch "master"))
    
    Распечатка 47: 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;;;
    
    Распечатка 48: packages/kbd-mode.ecf

3.15.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.15.7 Разное

 1(desire 'speedbar)
 2;; (desire-old 'semantic nil "semantic")
 3
 4;; (desire-old 'cedet nil "cedet")
 5;; (desire-old 'ecb nil "ecb")
 6
 7;; (desire-old 'php-mode nil "php-mode")
 8;; (desire-old '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.15.8 Конец

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

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

3.16.1 Начало

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

3.16.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.16.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.16.4 Конец

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

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

3.17.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;; (desire 'diredc)
    13
    14;;;}}}
    

3.17.2 Neotree

3.17.3 Treemacs

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

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

3.18.1 Начало

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

3.18.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.18.3 Конец

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

3.19 Темы

  • Подключаем темы в файле 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.19.1 Modus-themes

3.19.2 Ef-themes

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

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

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

  • Финализируем файл rc.packages.el:
    1
    2;;; rc.packages.el ends here
    

Дмитрий Сергеевич Кулябов
Дмитрий Сергеевич Кулябов
Профессор кафедры теории вероятностей и кибербезопасности

Мои научные интересы включают физику, администрирование Unix и сетей.

Похожие