Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision

Target

Select target project
  • dosch5/emacs
1 result
Select Git revision
Show changes
Commits on Source (4)
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
(append (append
'( '(
"/home/phil/.lisp/" "/home/phil/.lisp/"
"/home/phil/.lisp/org-reveal/"
"/home/phil/.lisp/Emacs-langtool/" "/home/phil/.lisp/Emacs-langtool/"
) )
load-path)) load-path))
...@@ -71,6 +72,7 @@ ...@@ -71,6 +72,7 @@
;; On affiche l'heure et le numéro de ligne ;; On affiche l'heure et le numéro de ligne
(display-time) (display-time)
(setq display-time-24hr-format t)
(line-number-mode t) (line-number-mode t)
;; Autorevert par défaut ;; Autorevert par défaut
...@@ -230,6 +232,13 @@ ...@@ -230,6 +232,13 @@
(use-package flycheck (use-package flycheck
:ensure t) :ensure t)
;; Les couleurs ansi
(require 'ansi-color)
(defun display-ansi-colors ()
(interactive)
(ansi-color-apply-on-region (point-min) (point-max)))
;; Pour une ouverture intelligente des fichiers recherchés ;; Pour une ouverture intelligente des fichiers recherchés
;; en fonction du contexte ;; en fonction du contexte
(use-package ffap (use-package ffap
...@@ -456,10 +465,8 @@ ...@@ -456,10 +465,8 @@
(add-hook 'magit-post-refresh-hook 'diff-hl-magit-post-refresh)) (add-hook 'magit-post-refresh-hook 'diff-hl-magit-post-refresh))
;; org-reveal ;; org-reveal
;; (use-package ox-reveal (require 'ox-reveal)
;; :ensure t (setq org-reveal-root "file:///home/phil/divers/presentation/reveal.js")
;; :config
;; (setq org-reveal-root "file:///home/phil/divers/presentation/reveal.js"))
;; Openwith : utilsation de programmes externe lors de ;; Openwith : utilsation de programmes externe lors de
;; l'ouverture pour certains types de fichiers ;; l'ouverture pour certains types de fichiers
...@@ -1003,6 +1010,52 @@ ...@@ -1003,6 +1010,52 @@
;; whitespace next to cursor ;; whitespace next to cursor
(global-set-key (kbd "S-SPC") 'insert-postfix-whitespace) (global-set-key (kbd "S-SPC") 'insert-postfix-whitespace)
;; Le support des abbréviations
(setq abbrev-file-name "~/.emacs.d/mes_abbrevs")
(quietly-read-abbrev-file)
;; 1. Fonction pour gérer TAB sans récursion
(defun my-expand-or-indent ()
"Essaie YASnippet, puis abbrev, puis indente, sans récursion."
(interactive)
(let ((expanded nil))
;; Essayer YASnippet
(when (and (bound-and-true-p yas-minor-mode)
(yas-expand))
(setq expanded t))
;; Si YASnippet n’a rien fait, essayer abbrev
(when (and (not expanded)
(bound-and-true-p abbrev-mode)
(expand-abbrev))
(setq expanded t))
;; Si rien n’a été expansé, indenter
(unless expanded
(indent-for-tab-command))))
;; 2. Associer TAB à la fonction
(global-set-key (kbd "TAB") #'my-expand-or-indent)
;; 3. Désactiver l’expansion automatique d’abbrev sur l’espace
(defun my-space-no-expand ()
"Insère un espace sans expanser d’abréviation."
(interactive)
(insert " "))
;; Associer l’espace à cette fonction dans les modes souhaités
(dolist (hook '(text-mode-hook prog-mode-hook))
(add-hook hook
(lambda ()
(local-set-key (kbd "SPC") #'my-space-no-expand))))
;; 4. Activer abbrev-mode globalement
(setq-default abbrev-mode t)
;; 5. Activer YASnippet globalement
(yas-global-mode 1)
;; 6. Définir une abréviation de test
(define-abbrev global-abbrev-table "btw" "by the way")
;; Macro Google ;; Macro Google
(defun google () (defun google ()
"Google the selected region if any, display a query prompt otherwise." "Google the selected region if any, display a query prompt otherwise."
......