diff --git a/init.el b/init.el index 23011d6..f706ad8 100644 --- a/init.el +++ b/init.el @@ -35,35 +35,31 @@ PACKAGE is installed and the current version is deleted." (package-desc-vers (cdr pkg-desc))))) (package-install package)))) -(let ((packages - '(ac-geiser ; Auto-complete backend for geiser - ac-slime ; An auto-complete source using slime completions - ace-jump-mode ; quick cursor location minor mode - auto-compile ; automatically compile Emacs Lisp libraries - auto-complete ; auto completion - elscreen ; window session manager - expand-region ; Increase selected region by semantic units - flx-ido ; flx integration for ido - ido-vertical-mode ; Makes ido-mode display vertically. - geiser ; GNU Emacs and Scheme talk to each other - haskell-mode ; A Haskell editing mode - jedi ; Python auto-completion for Emacs - magit ; control Git from Emacs - markdown-mode ; Emacs Major mode for Markdown-formatted files. - monokai-theme ; A fruity color theme for Emacs. - move-text ; Move current line or region with M-up or M-down - multiple-cursors ; Multiple cursors for Emacs. - org ; Outline-based notes management and organizer - paredit ; minor mode for editing parentheses - pretty-lambdada ; the word `lambda' as the Greek letter. - ;; slime ; Superior Lisp Interaction Mode for Emacs - smex ; M-x interface with Ido-style fuzzy matching. - ))) - ;; 'remove-if' is a part of the cl-library, so we require this feature. - (require 'cl) - (package-refresh-contents) - ;; Filter out installed packages and install the remaining. - (mapc 'upgrade-or-install-package packages)) +(package-refresh-contents) +(dolist (package + '(ac-geiser ; Auto-complete backend for geiser + ac-slime ; An auto-complete source using slime completions + ace-jump-mode ; quick cursor location minor mode + auto-compile ; automatically compile Emacs Lisp libraries + auto-complete ; auto completion + elscreen ; window session manager + expand-region ; Increase selected region by semantic units + flx-ido ; flx integration for ido + ido-vertical-mode ; Makes ido-mode display vertically. + geiser ; GNU Emacs and Scheme talk to each other + haskell-mode ; A Haskell editing mode + jedi ; Python auto-completion for Emacs + magit ; control Git from Emacs + markdown-mode ; Emacs Major mode for Markdown-formatted files. + monokai-theme ; A fruity color theme for Emacs. + move-text ; Move current line or region with M-up or M-down + multiple-cursors ; Multiple cursors for Emacs. + org ; Outline-based notes management and organizer + paredit ; minor mode for editing parentheses + pretty-lambdada ; the word `lambda' as the Greek letter. + smex ; M-x interface with Ido-style fuzzy matching. + )) + (upgrade-or-install-package package)) (dolist (feature '(auto-compile ; auto-compile .el files @@ -89,6 +85,10 @@ PACKAGE is installed and the current version is deleted." auto-fill-function 'do-auto-fill ; Auto-fill-mode everywhere. ) +(let ((default-directory (concat user-emacs-directory "site-lisp/"))) + (normal-top-level-add-to-load-path '(".")) + (normal-top-level-add-subdirs-to-load-path)) + (fset 'yes-or-no-p 'y-or-n-p) (defvar emacs-autosave-directory @@ -152,11 +152,6 @@ PACKAGE is installed and the current version is deleted." (smex-initialize) (global-set-key (kbd "M-x") 'smex) -(setq user-full-name "Lars Tveito" - user-mail-address "larstvei@ifi.uio.no" - smtpmail-smtp-server "smtp.uio.no" - smtpmail-smtp-service 587) - (defun calendar-show-week (arg) "Displaying week number in calendar-mode." (interactive "P") @@ -238,6 +233,8 @@ PACKAGE is installed and the current version is deleted." (global-set-key (kbd "C-c a") 'mc/mark-all-like-this) (global-set-key (kbd "C-c n") 'mc/mark-next-like-this) +(global-set-key (kbd "C-c m") 'magit-status) + (global-set-key (kbd "C-c SPC") 'ace-jump-mode) (global-set-key (kbd "C-c t") 'org-agenda-list) diff --git a/init.org b/init.org index bf1f4cb..9e2c7c9 100644 --- a/init.org +++ b/init.org @@ -66,7 +66,7 @@ (package-desc-vers (cdr newest-pkg-desc)))))) #+END_SRC - Let's write a function to install the package if it is not installed or + Let's write a function to install a package if it is not installed or upgrades it if a new version has been released. Here our predicate comes in handy. @@ -88,35 +88,31 @@ configurations are also dependent on them). #+BEGIN_SRC emacs-lisp :tangle yes - (let ((packages - '(ac-geiser ; Auto-complete backend for geiser - ac-slime ; An auto-complete source using slime completions - ace-jump-mode ; quick cursor location minor mode - auto-compile ; automatically compile Emacs Lisp libraries - auto-complete ; auto completion - elscreen ; window session manager - expand-region ; Increase selected region by semantic units - flx-ido ; flx integration for ido - ido-vertical-mode ; Makes ido-mode display vertically. - geiser ; GNU Emacs and Scheme talk to each other - haskell-mode ; A Haskell editing mode - jedi ; Python auto-completion for Emacs - magit ; control Git from Emacs - markdown-mode ; Emacs Major mode for Markdown-formatted files. - monokai-theme ; A fruity color theme for Emacs. - move-text ; Move current line or region with M-up or M-down - multiple-cursors ; Multiple cursors for Emacs. - org ; Outline-based notes management and organizer - paredit ; minor mode for editing parentheses - pretty-lambdada ; the word `lambda' as the Greek letter. - ;; slime ; Superior Lisp Interaction Mode for Emacs - smex ; M-x interface with Ido-style fuzzy matching. - ))) - ;; 'remove-if' is a part of the cl-library, so we require this feature. - (require 'cl) - (package-refresh-contents) - ;; Filter out installed packages and install the remaining. - (mapc 'upgrade-or-install-package packages)) + (package-refresh-contents) + (dolist (package + '(ac-geiser ; Auto-complete backend for geiser + ac-slime ; An auto-complete source using slime completions + ace-jump-mode ; quick cursor location minor mode + auto-compile ; automatically compile Emacs Lisp libraries + auto-complete ; auto completion + elscreen ; window session manager + expand-region ; Increase selected region by semantic units + flx-ido ; flx integration for ido + ido-vertical-mode ; Makes ido-mode display vertically. + geiser ; GNU Emacs and Scheme talk to each other + haskell-mode ; A Haskell editing mode + jedi ; Python auto-completion for Emacs + magit ; control Git from Emacs + markdown-mode ; Emacs Major mode for Markdown-formatted files. + monokai-theme ; A fruity color theme for Emacs. + move-text ; Move current line or region with M-up or M-down + multiple-cursors ; Multiple cursors for Emacs. + org ; Outline-based notes management and organizer + paredit ; minor mode for editing parentheses + pretty-lambdada ; the word `lambda' as the Greek letter. + smex ; M-x interface with Ido-style fuzzy matching. + )) + (upgrade-or-install-package package)) #+END_SRC ** Require @@ -164,6 +160,17 @@ ) #+END_SRC + The =load-path= specifies where Emacs should look for =.el=-files (or + Emacs lisp files). I have a directory called =site-lisp= where I keep all + extensions that have been installed manually (these are mostly my own + projects). + + #+BEGIN_SRC emacs-lisp :tangle yes + (let ((default-directory (concat user-emacs-directory "site-lisp/"))) + (normal-top-level-add-to-load-path '(".")) + (normal-top-level-add-subdirs-to-load-path)) + #+END_SRC + Answering /yes/ and /no/ to each question from Emacs can be tedious, a single /y/ or /n/ will suffice. @@ -310,14 +317,6 @@ (global-set-key (kbd "M-x") 'smex) #+END_SRC -** Mail - #+BEGIN_SRC emacs-lisp :tangle yes - (setq user-full-name "Lars Tveito" - user-mail-address "larstvei@ifi.uio.no" - smtpmail-smtp-server "smtp.uio.no" - smtpmail-smtp-service 587) - #+END_SRC - ** Calendar Define a function to display week numbers in =calender-mode=. The snippet @@ -477,6 +476,12 @@ (global-set-key (kbd "C-c n") 'mc/mark-next-like-this) #+END_SRC + Bindings for [[http://magit.github.io][Magit]]. + + #+BEGIN_SRC emacs-lisp :tangle yes + (global-set-key (kbd "C-c m") 'magit-status) + #+END_SRC + Bindings for [[https://github.com/winterTTr/ace-jump-mode][ace-jump-mode]]. #+BEGIN_SRC emacs-lisp :tangle yes diff --git a/init.pdf b/init.pdf index a4d83ca..ee0fcc7 100644 Binary files a/init.pdf and b/init.pdf differ