@@ -5778,6 +5778,20 @@ They provide the following functions for defining hydras:
5778
5778
)
5779
5779
#+end_src
5780
5780
5781
+ ** Transient
5782
+
5783
+ [[https://github.com/magit/transient][Transient]] is the library used to implement the keyboard-driven /menus/ in [[https://github.com/magit/magit/][Magit]].
5784
+ It is distributed as a separate package, so that it can be used to implement similar menus in other packages.
5785
+
5786
+ #+begin_src emacs-lisp :tangle config/init-basic-system.el
5787
+ ;;
5788
+ ;; Magit requires a newer version than the built-in.
5789
+ ;;
5790
+ (use-package transient
5791
+ :demand t
5792
+ )
5793
+ #+end_src
5794
+
5781
5795
** Info system
5782
5796
5783
5797
Add the [[https://www.msys2.org/][MSYS2]] info pathes to the *Emacs Info* search path.
@@ -6766,6 +6780,9 @@ Tab stop positions: =M-i=, i.e. =tab-to-tab-stop= moves to the next position.
6766
6780
(setq tab-stop-list '(4 8))
6767
6781
#+end_src
6768
6782
6783
+ *** Highlight indentation
6784
+
6785
+ **** highlight-indent-guides package
6769
6786
6770
6787
[[https://github.com/DarthFennec/highlight-indent-guides][highlight-indent-guides]] is a minor mode that
6771
6788
highlights indentation levels via font-lock.
@@ -6775,14 +6792,18 @@ By default, this mode also inspects your theme dynamically, and automatically ch
6775
6792
for highlighting. This mode works properly around hard tabs and mixed indentation, and it behaves well
6776
6793
in large buffers.
6777
6794
6795
+ This was the package used by *Psimacs* for a long time. It is still installed but not activated automatically
6796
+ anymore. Instead *Psimacs* uses the =indent-bars= package on default.
6797
+
6798
+
6778
6799
#+begin_src emacs-lisp :tangle config/init-basic-ui.el
6779
6800
;;
6780
6801
;; highlight-indent-guides
6781
6802
;;
6782
6803
(use-package highlight-indent-guides
6783
- :hook ((prog-mode . (lambda ()
6784
- (highlight-indent-guides-mode)
6785
- (highlight-indent-guides-auto-set-faces))))
6804
+ ; :hook ((prog-mode . (lambda ()
6805
+ ; (highlight-indent-guides-mode)
6806
+ ; (highlight-indent-guides-auto-set-faces))))
6786
6807
:custom
6787
6808
(highlight-indent-guides-auto-odd-face-perc 5)
6788
6809
:config
@@ -6791,6 +6812,49 @@ in large buffers.
6791
6812
)
6792
6813
#+end_src
6793
6814
6815
+ **** indent-bars package
6816
+
6817
+ [[https://github.com/jdtsmith/indent-bars][indent-bars]] is a minor mode that provides indentation guide bars
6818
+ in *Emacs*, with optional tree-sitter enhancement.
6819
+
6820
+ #+begin_src emacs-lisp :tangle config/init-basic-ui.el
6821
+ ;;
6822
+ ;; indent-bars
6823
+ ;;
6824
+ (use-package indent-bars
6825
+ :straight (indent-bars :host github :repo "jdtsmith/indent-bars")
6826
+ :hook
6827
+ (prog-mode . (lambda ()
6828
+ (when (and (not (member major-mode '(emacs-lisp-mode scheme-mode lisp-mode)))
6829
+ (display-graphic-p))
6830
+ (indent-bars-mode 1)
6831
+ )))
6832
+ :config
6833
+ (setq indent-bars-treesit-support t
6834
+ indent-bars-treesit-ignore-blank-lines-types '("module")
6835
+ indent-bars-treesit-wrap '((c argument_list parameter_list init_declarator)
6836
+ (python
6837
+ argument_list parameters ; for python, as an example
6838
+ list
6839
+ list_comprehension
6840
+ dictionary
6841
+ dictionary_comprehension
6842
+ parenthesized_expression
6843
+ subscript))
6844
+ )
6845
+ (setq indent-bars-no-descend-string t
6846
+ indent-bars-color '(highlight :face-bg t :blend 0.15)
6847
+ indent-bars-pattern "."
6848
+ indent-bars-width-frac 0.1
6849
+ indent-bars-pad-frac 0.1
6850
+ indent-bars-zigzag nil
6851
+ indent-bars-color-by-depth '(:regexp "outline-\\([0-9]+\\)" :blend 1) ; blend=1: blend with BG only
6852
+ indent-bars-highlight-current-depth '(:blend 0.5) ; pump up the BG blend on current
6853
+ indent-bars-display-on-blank-lines t
6854
+ )
6855
+ )
6856
+ #+end_src
6857
+
6794
6858
*** Lock file
6795
6859
6796
6860
Disable creation of lock-files named =.#<filename>=. I do not have problem with simultaneous file editing.
@@ -7017,6 +7081,148 @@ identifier uniquely based on its name.
7017
7081
)
7018
7082
#+end_src
7019
7083
7084
+ *** Symbol overlay mode
7085
+
7086
+ The package [[https://github.com/wolray/symbol-overlay][Symbol Overlay]] highlight symbols with overlays while providing a keymap for
7087
+ various operations about highlighted symbols. It was originally inspired by the package =highlight-symbol=. The fundamental difference
7088
+ is that in =symbol-overlay= every symbol is highlighted by the Emacs built-in function =overlay-put= rather than the =font-lock= mechanism
7089
+ used in =highlight-symbol=. On start up the =symbol-overlay-mode= is not activated.
7090
+
7091
+ Additionally, the package [[https://github.com/xenodium/symbol-overlay-mc][symbol-overlay-mc]] is a tiny Emacs package enabling
7092
+ multiple cursors on symbol overlays.
7093
+
7094
+ | Key binding | Command | Description |
7095
+ |-------------+--------------------------------------+---------------------------------------------------------------------|
7096
+ | =H-x H-s m= | =M-x symbol-overlay-mode= | Toggle the automatic symbol highlight. This is disabled on default. |
7097
+ | =H-x H-s i= | =M-x symbol-overlay-put= | Toggle all overlays of symbol at point. |
7098
+ | =H-x H-s a= | =M-x symbol-overlay-mc-mark-all= | place a cursor on every symbol currently highlighted. |
7099
+ | =H-x H-s x= | =M-x symbol-overlay-remove-all= | Remove all highlighted symbols in the buffer. |
7100
+ | =H-x H-s b= | =M-x symbol-overlay-switch-backward= | Switch backward to another symbol. |
7101
+ | =H-x H-s f= | =M-x symbol-overlay-switch-forward= | Switch forward to another symbol. |
7102
+ | =H-x H-s h= | =M-x symbol-overlay-map-help= | Display the bindings in ‘symbol-overlay-map’. |
7103
+ |-------------+--------------------------------------+---------------------------------------------------------------------|
7104
+
7105
+ The bindings in ‘symbol-overlay-map’ that are active when the cursor points a highlighted symbol.
7106
+
7107
+ | Key binding | Command | Description |
7108
+ |-------------+-----------------------------------------+---------------------------------------------------------------------|
7109
+ | =H-x H-s i= | =M-x symbol-overlay-put= | Toggle all overlays of symbol at point. |
7110
+ | =H-x H-s n= | =M-x symbol-overlay-jump-next= | Jump to the next location of symbol at point. |
7111
+ | =H-x H-s p= | =M-x symbol-overlay-jump-prev= | Jump to the previous location of symbol at point. |
7112
+ | =H-x H-s <= | =M-x symbol-overlay-jump-first= | Jump to the first location of symbol at point. |
7113
+ | =H-x H-s >= | =M-x symbol-overlay-jump-last= | Jump to the last location of symbol at point. |
7114
+ | =H-x H-s w= | =M-x symbol-overlay-save-symbol= | Copy symbol at point. |
7115
+ | =H-x H-s t= | =M-x symbol-overlay-toggle-in-scope= | Toggle overlays to be showed in buffer or only in scope. |
7116
+ | =H-x H-s e= | =M-x symbol-overlay-echo-mark= | Jump back to the mark. |
7117
+ | =H-x H-s d= | =M-x symbol-overlay-jump-to-definition= | Jump to the definition of symbol at point. |
7118
+ | =H-x H-s s= | =M-x symbol-overlay-isearch-literally= | Isearch symbol at point literally. |
7119
+ | =H-x H-s q= | =M-x symbol-overlay-query-replace= | Query replace symbol at point. |
7120
+ | =H-x H-s r= | =M-x symbol-overlay-rename= | Rename symbol at point on all its occurrences. |
7121
+ |-------------+-----------------------------------------+---------------------------------------------------------------------|
7122
+
7123
+ #+begin_src emacs-lisp :tangle config/init-basic-ui.el
7124
+ ;;
7125
+ ;; Setup of symbol-overlay
7126
+ ;;
7127
+ (use-package symbol-overlay
7128
+ :commands (symbol-overlay-mc-mark-all)
7129
+ :config
7130
+ (setq symbol-overlay-idle-time 0.1)
7131
+
7132
+ (let ((map (make-sparse-keymap)))
7133
+ (define-key map (kbd "H-x H-s i") 'symbol-overlay-put)
7134
+ (define-key map (kbd "H-x H-s n") 'symbol-overlay-jump-next)
7135
+ (define-key map (kbd "H-x H-s p") 'symbol-overlay-jump-prev)
7136
+ (define-key map (kbd "H-x H-s <") 'symbol-overlay-jump-first)
7137
+ (define-key map (kbd "H-x H-s >") 'symbol-overlay-jump-last)
7138
+ (define-key map (kbd "H-x H-s w") 'symbol-overlay-save-symbol)
7139
+ (define-key map (kbd "H-x H-s t") 'symbol-overlay-toggle-in-scope)
7140
+ (define-key map (kbd "H-x H-s e") 'symbol-overlay-echo-mark)
7141
+ (define-key map (kbd "H-x H-s d") 'symbol-overlay-jump-to-definition)
7142
+ (define-key map (kbd "H-x H-s s") 'symbol-overlay-isearch-literally)
7143
+ (define-key map (kbd "H-x H-s R") 'symbol-overlay-query-replace)
7144
+ (define-key map (kbd "H-x H-s r") 'symbol-overlay-rename)
7145
+ (setq symbol-overlay-map map)
7146
+ )
7147
+
7148
+ :bind (
7149
+ :map psimacs/config/global-key-map/execute
7150
+ ("H-s m" . symbol-overlay-mode)
7151
+ ("H-s i" . symbol-overlay-put)
7152
+ ("H-s x" . symbol-overlay-remove-all)
7153
+ ("H-s b" . symbol-overlay-switch-backward)
7154
+ ("H-s f" . symbol-overlay-switch-forward)
7155
+ ("H-s h" . symbol-overlay-map-help)
7156
+
7157
+ :map psimacs/config/global-key-map/hydra ("H-s" . psimacs/hydra/symbol-overlay/body)
7158
+ )
7159
+
7160
+ :hydra (psimacs/hydra/symbol-overlay (:color pink :hint nil)
7161
+ "
7162
+ Symbol Overlay:
7163
+
7164
+ ^^Symbols ^^Navigate ^^Edit ^^Exit
7165
+ --------------------------------------------------------------------
7166
+ _i_ : insert _p_ : prev _r_ : rename _e_ : return
7167
+ _t_ : toggle _n_ : next _R_ : replace _x_ : remove all
7168
+ _w_ : save _b_ : switch backward _a_ : cursors _q_ : quit
7169
+ _m_ : auto _f_ : switch forward
7170
+ _h_ : help _d_ : jump definition
7171
+ ^^_<_ : jump first
7172
+ ^^_>_ : jump last
7173
+ ^^_s_ : search
7174
+ "
7175
+ ("m" symbol-overlay-mode)
7176
+ ("i" symbol-overlay-put)
7177
+ ("x" symbol-overlay-remove-all :color blue)
7178
+ ("b" symbol-overlay-switch-backward)
7179
+ ("f" symbol-overlay-switch-forward)
7180
+ ("h" symbol-overlay-map-help)
7181
+ ("n" symbol-overlay-jump-next)
7182
+ ("p" symbol-overlay-jump-prev)
7183
+ ("<" symbol-overlay-jump-first)
7184
+ (">" symbol-overlay-jump-last)
7185
+ ("w" symbol-overlay-save-symbol)
7186
+ ("t" symbol-overlay-toggle-in-scope)
7187
+ ("e" symbol-overlay-echo-mark :color blue)
7188
+ ("d" symbol-overlay-jump-to-definition)
7189
+ ("s" symbol-overlay-isearch-literally)
7190
+ ("R" symbol-overlay-query-replace)
7191
+ ("a" symbol-overlay-mc-mark-all)
7192
+ ("r" symbol-overlay-rename)
7193
+ ("q" nil :color blue)
7194
+ )
7195
+ )
7196
+
7197
+ (use-package symbol-overlay-mc
7198
+ :straight (symbol-overlay-mc :host github :repo "xenodium/symbol-overlay-mc")
7199
+ :commands (psimacs/config/disable-lsp-ui-sideline-mode)
7200
+ :config
7201
+ (defun psimacs/config/disable-lsp-ui-sideline-mode (orig-fun &rest args)
7202
+ (let ((enabled (bound-and-true-p lsp-ui-sideline-mode))
7203
+ (result nil))
7204
+ (when enabled
7205
+ (ignore-errors
7206
+ (lsp-ui-sideline-mode -1)
7207
+ (lsp-ui-sideline--delete-ov)
7208
+ ))
7209
+ (setq result (apply orig-fun args))
7210
+
7211
+ (when enabled
7212
+ (lsp-ui-sideline-mode 1)
7213
+ )
7214
+ result
7215
+ )
7216
+ )
7217
+
7218
+ (advice-add 'symbol-overlay-mc-mark-all :around #'psimacs/config/disable-lsp-ui-sideline-mode)
7219
+ :bind (
7220
+ :map psimacs/config/global-key-map/execute
7221
+ ("H-s H-a" . symbol-overlay-mc-mark-all)
7222
+ )
7223
+ )
7224
+ #+end_src
7225
+
7020
7226
*** Fill column indicator
7021
7227
7022
7228
*Emacs* allows to [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Displaying-Boundaries.html][display boundaries]]. *Psimacs* uses this to show an indicator at the fill column position.
@@ -14435,7 +14641,7 @@ The package [[https://github.com/hatlafax/projectile-b2][projectile-b2]] gives f
14435
14641
:map projectile-b2-command-map
14436
14642
("h" . hydra-projectile-b2/body)
14437
14643
:map psimacs/config/global-key-map/hydra
14438
- ("C-p " . hydra-projectile-b2/body)
14644
+ ("C-P " . hydra-projectile-b2/body)
14439
14645
)
14440
14646
:hook (projectile-mode . projectile-b2-global-mode)
14441
14647
:config
0 commit comments