URL: https://linuxfr.org/forums/astucesdivers/posts/%C3%A9diteuremacs-le-de-vi Title: [Éditeur/Emacs] Le % de vi ! Authors: Sebastien Date: 2001年10月05日T23:38:57+02:00 Tags: Score: 0 Un grand regret sous emacs, ne pas avoir une correspondance des parenthèses aussi simple que le "%" de vi ! Une petite fonction à charger au demarage qui repare les dommages. (global-set-key "%" 'match-paren) (defun match-paren (arg) "Go to the matching paren if on a paren; otherwise insert %." (interactive "p") (cond ((looking-at "\\s\(") (forward-list 1) (backward-char 1)) ((looking-at "\\s\)") (forward-char 1) (backward-list 1)) (t (self-insert-command (or arg 1))))) Si on est sur une parenthèse, % deplace le curseur sur l'autre, sinon il insère un % comme d'hab. foX