Difference between revisions of "Emacs"
| Line 79: | Line 79: | ||
(show-paren-mode 1) | (show-paren-mode 1) | ||
| + | |||
| + | ;;;;;;;;;;;;;;;;;; | ||
| + | ;; el-get setup ;; | ||
| + | ;;;;;;;;;;;;;;;;;; | ||
| + | (add-to-list 'load-path "~/.emacs.d/el-get/el-get") | ||
| + | (unless (require 'el-get nil t) | ||
| + | (with-current-buffer | ||
| + | (url-retrieve-synchronously "https://raw.github.com/golodhrim/el-get/master/el-get-install.el") | ||
| + | (end-of-buffer) | ||
| + | (eval-print-last-sexp))) | ||
| + | |||
| + | (el-get 'sync) | ||
| + | |||
| + | ;;;;;;;;;;;;;;; | ||
| + | ;; mediawiki ;; | ||
| + | ;;;;;;;;;;;;;;; | ||
| + | (require 'mediawiki) | ||
| + | |||
| + | ;;;;;;;;;;;;;;;;;;;; | ||
| + | ;; Org-mode stuff ;; | ||
| + | ;;;;;;;;;;;;;;;;;;;; | ||
| + | |||
| + | ;; Tell emacs where org-mode is | ||
| + | ;;(setq load-path (cons "/usr/share/emacs/site-lisp/org-mode/" load-path)) | ||
| + | ;;(setq load-path (cons "/usr/share/emacs/site-lisp/org-mode/contrib/" load-path)) | ||
| + | (require 'org-install) ;; Tell emacs to use org-mode | ||
| + | (add-to-list 'auto-mode-alist '("\\.org$" . org-mode)) ;; Turn on org-mode for all *.org files | ||
| + | |||
| + | ;; Some key sequences | ||
| + | (define-key global-map "\C-cl" 'org-store-link) | ||
| + | (define-key global-map "\C-ca" 'org-agenda) | ||
| + | (global-set-key [f9] 'org-archive-subtree-default) | ||
| + | |||
| + | (setq org-log-done t) ;; I have no idea what this does, it was in the manual -- think it controls whether or not to log time completed for tasks | ||
| + | |||
| + | (setq org-directory "~/notes") | ||
| + | |||
| + | ;; Files that should be included in agenda views: | ||
| + | (setq org-agenda-files (list "~/notes/business.org" | ||
| + | "~/notes/personal.org" | ||
| + | "~/notes/projects/" | ||
| + | "~/notes/projects/writing/")) | ||
| + | |||
| + | (setq org-todo-keywords '((type "TODO" "Postponed" "Upcoming" "Doing" "|" "DONE(#)"))) ;; TODO workflows | ||
| + | |||
| + | (setq org-tag-alist '(("work" . ?k) ("personal" . ?p) ("organization" . ?o) ("writing" . ?w) ("code" . ?c) ("blog" . ?b) ("funtoo" . ?f) ("social" . ?s))) ;; Most-used tags, with shortcuts | ||
| + | |||
| + | ;; Capture stuff | ||
| + | (setq org-default-notes-file "~/.org/capture.org") | ||
| + | (define-key global-map "\C-cc" 'org-capture) | ||
| + | (setq org-refile-targets '((org-agenda-files :level . 1)(org-agenda-files :level . 2))) | ||
| + | (setq org-refile-use-outline-path 'file) | ||
| + | |||
| + | (setq org-capture-templates | ||
| + | '(("t" "Todo" entry (file+headline "~/.org/capture.org" "Tasks") | ||
| + | "- TODO %?\n %i\n %a") | ||
| + | ("j" "Journal" entry (file+datetree "~/.org/journal.org") | ||
| + | "- %?\nEntered on %U\n %i\n %a"))) | ||
| + | |||
| + | (setq org-mobile-directory "~/Dropbox/MobileOrg") | ||
| + | (setq org-mobile-use-encryption) | ||
| + | (setq org-mobile-use-encryption-password "HTAckk3o") | ||
| + | (setq org-mobile-inbox-for-pull "~/notes/mobileorg/inbox.org") | ||
</pre> | </pre> | ||
Revision as of 18:22, 4 April 2012
Emacs is a famous text editor, famous by its flexibility and extensibility. One manual describes it as "the extensible, customizable, self-documenting, real-time display editor".
This page is designed to give users a good place to share their config and settings for a nice emacs setup.
Contents |
installing emacs
emerge -avt emacs
for the standard gnu emacs and
emerge -avt xemacs
for the 1980 created fork of emacs, both should handle the same, while emacs on its own stands here for both. If you install additional extensions for both you might need to add app-emacs or app-xemacs to the package as there are two different versions for both.
What emacs is and what it is not
(X)Emacs is primarily a text editor and not a word processor, it concentrates on manipulating any kind of text, rather than manipulating the font and look. It is client and GUI based, so can be used on local box in graphical environments with a GUI and remote on a server in a client mode. (X)Emacs provides commands for manipulate every kind of text and syntax highlighting.
Customizability
(X)Emacs is highly customizable in many ways through:
- the customize extension, which allows settings of customized variables, such as color themes, graphical interface, etc. This part is intended for emacs beginners, who do not want to work with Emacs lisp code.
- combine keystrokes to execute complex makros.
- using Emacs Lisp. Designed for the emacs professional.
Extensibility
As a result of the above points, (X)Emacs behaviour can be easily definied to all text behavings without limit. Like some of the examples below show you:
- AUCTeX, A suite for LaTeX and other TeX versions,
- ERC, A Emacs IRC client,
- ORG-mode, A Emacs PIM and Orga tool
- Wanderlust, A highly flexible Mail tool for Emacs
User Configs
golodhrim's config
.emacs
;;;;;;;;;;;;;;;;;;;;;;
;; General Settings ;;
;;;;;;;;;;;;;;;;;;;;;;
(setq emacs-root-dir (concat (getenv "HOME") "/em/"))
(setq inhibit-startup-message t) ;; Suppress the startup message
(setq standard-indent 4) ;; Default indent level is 3 chars
(setq-default indent-tabs-mode nil) ;; Indent with spaces, not tabs
(setq make-backup-files nil) ;; Enable backup files.
(setq version-control nil) ;; Enable versioning with default values
(setq backup-directory-alist (quote ((".*" . "~/.emacs_backups/")))) ;; Save all backup file in this directory.
(line-number-mode 1) ;; Show line-number in the mode line
(column-number-mode 1) ;; Show column-number in the mode line
(setq auto-fill-mode 1) ;; Line wrap
(set-default-font "Inconsolata-12")
(setq browse-url-browser-function 'browse-url-generic
browse-url-generic-program "google-chrome")
(global-set-key (kbd "C-<prior>") 'previous-buffer)
(global-set-key (kbd "C-<next>" ) 'next-buffer )
(setq load-path (cons "~/.emacs.d/plugins" load-path))
(setq global-font-lock-mode 1)
(show-paren-mode 1)
;;;;;;;;;;;;;;;;;;
;; el-get setup ;;
;;;;;;;;;;;;;;;;;;
(add-to-list 'load-path "~/.emacs.d/el-get/el-get")
(unless (require 'el-get nil t)
(with-current-buffer
(url-retrieve-synchronously "https://raw.github.com/golodhrim/el-get/master/el-get-install.el")
(end-of-buffer)
(eval-print-last-sexp)))
(el-get 'sync)
;;;;;;;;;;;;;;;
;; mediawiki ;;
;;;;;;;;;;;;;;;
(require 'mediawiki)
;;;;;;;;;;;;;;;;;;;;
;; Org-mode stuff ;;
;;;;;;;;;;;;;;;;;;;;
;; Tell emacs where org-mode is
;;(setq load-path (cons "/usr/share/emacs/site-lisp/org-mode/" load-path))
;;(setq load-path (cons "/usr/share/emacs/site-lisp/org-mode/contrib/" load-path))
(require 'org-install) ;; Tell emacs to use org-mode
(add-to-list 'auto-mode-alist '("\\.org$" . org-mode)) ;; Turn on org-mode for all *.org files
;; Some key sequences
(define-key global-map "\C-cl" 'org-store-link)
(define-key global-map "\C-ca" 'org-agenda)
(global-set-key [f9] 'org-archive-subtree-default)
(setq org-log-done t) ;; I have no idea what this does, it was in the manual -- think it controls whether or not to log time completed for tasks
(setq org-directory "~/notes")
;; Files that should be included in agenda views:
(setq org-agenda-files (list "~/notes/business.org"
"~/notes/personal.org"
"~/notes/projects/"
"~/notes/projects/writing/"))
(setq org-todo-keywords '((type "TODO" "Postponed" "Upcoming" "Doing" "|" "DONE(#)"))) ;; TODO workflows
(setq org-tag-alist '(("work" . ?k) ("personal" . ?p) ("organization" . ?o) ("writing" . ?w) ("code" . ?c) ("blog" . ?b) ("funtoo" . ?f) ("social" . ?s))) ;; Most-used tags, with shortcuts
;; Capture stuff
(setq org-default-notes-file "~/.org/capture.org")
(define-key global-map "\C-cc" 'org-capture)
(setq org-refile-targets '((org-agenda-files :level . 1)(org-agenda-files :level . 2)))
(setq org-refile-use-outline-path 'file)
(setq org-capture-templates
'(("t" "Todo" entry (file+headline "~/.org/capture.org" "Tasks")
"- TODO %?\n %i\n %a")
("j" "Journal" entry (file+datetree "~/.org/journal.org")
"- %?\nEntered on %U\n %i\n %a")))
(setq org-mobile-directory "~/Dropbox/MobileOrg")
(setq org-mobile-use-encryption)
(setq org-mobile-use-encryption-password "HTAckk3o")
(setq org-mobile-inbox-for-pull "~/notes/mobileorg/inbox.org")
