| Title: Simple emacs config | |
| Author: Solène | |
| Date: 02 May 2016 | |
| Tags: emacs cheatsheet | |
| Description: | |
| Here is a dump of my emacs config file. That may be useful for some | |
| emacs users who begin. | |
| If you doesn't want to have your_filename.txt~ files with a tilde at | |
| the end (this is a default backup file), add this | |
| (setq backup-inhibited t) | |
| (setq auto-save-default nil) | |
| To have parenthesis highlighting on match, which is very useful, you | |
| will need this | |
| ; show match parenthesis | |
| (show-paren-mode 1) | |
| I really like this one. It will save the cursor position in every file | |
| you edit. When you edit it again, you start exactly where you leaved | |
| the last time. | |
| (setq save-place-file "~/.emacs.d/saveplace") | |
| (setq-default save-place t) | |
| (require 'saveplace)` | |
| If you write in utf-8 (which is very common now) you should add this. | |
| ; utf8 | |
| (prefer-coding-system 'utf-8) | |
| Emacs modes are used depending on the extension of a file. Sometime | |
| you need to edit files with a custom extension but you want to use a | |
| mode for it. So, you just need to add some line like this to get your | |
| mode automatically when you load the file. | |
| (add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-mode)) | |
| (add-to-list 'auto-mode-alist '("\\.tpl$" . html-mode)) | |
| My Org-mode part in the config file | |
| (require 'org) | |
| (define-key global-map "\C-ca" 'org-agenda) | |
| (setq org-log-done t) | |
| (setq org-agenda-files (list "~/Org/work.org" "~/Org/home.org")) | |
| Stop mixing tabs and space when indenting | |
| (setq indent-tabs-mode nil) |