Fourre Tout

C'est mon pense-bête

Outils pour utilisateurs

Outils du site


emacs

Ceci est une ancienne révision du document !


Outils pour Emacs

masquer des portions de code

hs-minor-mode

Minor mode to selectively hide/show code and comment blocks. With a prefix argument ARG, enable the mode if ARG is positive, and disable it otherwise. If called from Lisp, enable the mode if ARG is omitted or nil.

possibilités :

  • un bloc : C-c @ C-h, C-c @ C-s
  • tout : C-c @ C-M-h, C-c @ C-M-s
  • blocs de niveau supérieur au bloc actuel : C-c @ C-l

dé/masquer les blocs de niveau supérieur

(eval-after-load 'hideshow
'(progn
  (global-set-key (kbd "C-+") 'hs-toggle-hiding)))

set-selective-display

C-x $ : When the value of ‘selective-display’ is a number > 0, lines whose indentation is >= that value are not displayed.

dé/masquer le code dont l'indentation est >= curseur

;; attach function to some key
(global-set-key (kbd "<f5>") 'set-selective-display-dlw)
 
;; the function
(defun set-selective-display-dlw (&optional level)
"Fold text indented same of more than the cursor.
If level is set, set the indent level to LEVEL.
If 'selective-display' is already set to LEVEL, clicking
F5 again will unset 'selective-display' by setting it to 0."
(interactive "P")
(if (eq selective-display (1+ (current-column)))
    (set-selective-display 0)
    (set-selective-display (or level (1+ (current-column))))))

idem, directement avec ''C-x $''

(advice-add 'set-selective-display
      :filter-args (lambda (args)
		     (if (or (car args) selective-display)
			 args
		       (list (1+ (current-column)))))
      '((name . set-selective-display-from-cursor-column)))

afficher les occurrences d'une regexp

dans le buffer courant

M-s o : Show all lines in the current buffer containing a match for REGEXP.

dans plusieurs buffers

  • multi-occur : Show all lines in buffers BUFS containing a match for REGEXP.
  • multi-occur-in-matching-buffers : Show all lines matching REGEXP in buffers specified by BUFREGEXP.

ggtags

trouver les occurrences d'un identificateur

  • M-. : If point is at a definition tag, find references, and vice versa. If point is at a line that matches ‘ggtags-include-pattern’, find the include file instead.
  • M-n, M-p : concordance suivante/précédente
  • M-}, M-{ : fichier suivant/précédent
  • M-, : Pop back to where M-x xref-find-definitions (M-.) was last invoked

org-mode

Pour charger le fichier qui contient des options pour org-mode :

emacs --batch --load ~/share/emacs/options.el --file Algorithmique_et_Programmation.org --funcall org-html-export-to-html
emacs.1642495956.txt.gz · Dernière modification: 2022/01/18 09:52 de jce