;;;;;;;;;;;;;;;;;;;;;;;;;;; -*- Mode: Emacs-Lisp -*- ;;;;;;;;;;;;;;;;;;;;;;;;; ;; .emacs --- EMACS setup file for Linux!!! ;; ;; Update : 08/2023 (Jean-Yves Peterschmitt, Olivier Marti - LSCE) ;; ;; JYP's notes: https://wiki.lsce.ipsl.fr/pmip3/doku.php/other:emacs_doc ;; Official manual: https://www.gnu.org/software/emacs/manual/html_node/emacs/ ;; Emacs wiki: https://www.emacswiki.org/emacs/SiteMap ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Microsoft Windows specific section ;; ;; Search path where emacs should look for the 'unix-like' DiffUtils ;; binaries on Windows required for the ediff mode ;; ;; DiffUtils page: https://gnuwin32.sourceforge.net/packages/diffutils.htm ;; ;; More details on setting the 'path' below: ;; http://www.emacswiki.org/emacs/ExecPath ;; Check with: ;; (getenv "PATH") ;; (executable-find "diff") ;; ;; UNCOMMENT the following line on a MICROSOFT WINDOWS 7 or more ;; recent computer ;; ;; COMMENT it out on other (NON MICROSOFT WINDOWS) computer types (setq exec-path (append exec-path '("C:\\Program Files (x86)\\GnuWin32\\bin"))) ;; Do NOT display the Welcome/Info buffer when opening emacs without ;; specifying a file name (setq inhibit-startup-message t ) ;; Remove the tool bar ;; Who clicks on icons anyway? And we want to promote using keyboard ;; shortcuts (tool-bar-mode -1) ;; Turn on automatic syntax highlighting for all buffers (global-font-lock-mode t) ;; Disable ESC-ESC default 'Evaluate Lisp Expression' behavior ;; ;; Use C-x C-e to evaluate an expression, or another method below ;; https://www.gnu.org/software/emacs/manual/html_node/emacs/Lisp-Eval.html (put 'eval-expression 'disabled nil) ;;; Windows/frames' titles ;; ;; More details: https://www.emacswiki.org/emacs/FrameTitle ;; https://www.emacswiki.org/emacs/PercentConstruct ;; (setq frame-title-format "Emacs: %f (%m) %*%+" ) (setq frame-title-format "Emacs: %f" ) ;; Display line and column numbers ;; (setq line-number-mode t) ; Seems to be done by default, now (setq column-number-mode t) ;; Lines numbers' start at 1, and we want the column numbers to also ;; start at 1... (setq column-number-indicator-zero-based nil) ;;; Highlight a region (in which cases??) ; Seems to be done by default, now ; (transient-mark-mode t) ;; Do we still need that ? (put 'narrow-to-region 'disabled nil) ;; Do we still need that ? (put 'downcase-region 'disabled nil) ;; Default editing mode when creating/opening a file, when emacs can't ;; guess the file type (from the fime name extension, ...) (setq-default major-mode 'indented-text-mode) ;; Sets up time and date in the status line (setq display-time-day-and-date t) (display-time) ;; Display recent files in the File menu (recentf-mode t) (setq recentf-max-menu-items 100) (setq recentf-max-saved-items 100) ;;; Full buffer menus (setq complex-buffers-menu-p t) ;; No limitation of the number of buffers displayed in the menu "Buffers" (setq buffers-menu-max-size nil) ;; Try to add and document ferret support later ? ;; (add-to-list 'load-path "~/.emacs-dir" ) ;; (require 'ferret) ;; Define several useful keyboard shortcuts ! ;; Do we still need this, now that the keyboard shortcuts definition ;; has been simplified ? ;; (global-set-key "\e[" nil) (global-set-key [S-right] 'end-of-line) ; Shift + -> (global-set-key [S-left ] 'beginning-of-line) ; Shift + <- (global-set-key [S-down] 'end-of-buffer) (global-set-key [S-up ] 'beginning-of-buffer) (global-set-key "\C-x\C-g" 'goto-line) ;; Define what the functions keys do (global-set-key [f1] 'undo) (global-set-key [f2] 'query-replace-regexp) (global-set-key [f3] 'fill-paragraph) (global-set-key [f4] 'indent-region) (global-set-key [f5] 'comment-region) (global-set-key [f12] 'repeat-complex-command) ;; Override the default color of the interface ;; We could also try to use an existing "theme" or create a custom "theme" (add-to-list 'default-frame-alist '(background-color . "dark slate gray")) (add-to-list 'default-frame-alist '(mouse-color . "turquoise")) (add-to-list 'default-frame-alist '(cursor-color . "red")) (add-to-list 'default-frame-alist '(foreground-color . "LightGray")) ;;; ;;; Run emacs server ;;; Disabled for now. Need to experiment with this, especially on MS Win ;;; ;; (cond (window-system (server-start))) ;; tramp mode configuration ;; http://www.emacswiki.org/emacs/TrampMode ;; 18-11-2022 It seems we don't need the require line any more, and we ;; have to explicitely specify the ('ssh') method ;; open files with: /ssh:user@server:/path/file ;(require 'tramp) ;(setq tramp-default-method "ssh") ;(setq tramp-default-method "sshx") (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(default ((t (:family "Cascadia Code" :foundry "outline" :slant normal :weight normal :height 98 :width normal)))))