one variable and go over that in a loop.
#+BEGIN_SRC emacs-lisp :tangle yes
(defvar jj-elisp-subdirs '(local gnus icicle org/contrib tiny mo-git-blame cedet
-- cedet/eieio ecb jdee/lisp sunrise multiple-cursors
-- auto-complete yasnippet magit mmm emms/lisp
-- elpy find-file-in-project fuzzy idomenu nose
-- popup pyvenv git-rebase-mode git-commit-mode)
+ cedet/eieio ecb jdee/lisp sunrise multiple-cursors
+ auto-complete yasnippet magit mmm emms/lisp
+ elpy find-file-in-project fuzzy idomenu nose
+ popup pyvenv git-rebase-mode git-commit-mode)
"List of subdirectories in jj-elisp-dir to add to load-path")
(let (dirval)
* Extra modes and their configuration
+** abbrev
+A defined abbrev is a word which expands, if you insert it, into some
+different text. Abbrevs are defined by the user to expand in specific
+ways.
+#+BEGIN_SRC emacs-lisp :tangle yes
+(use-package abbrev
+ :commands abbrev-mode
+ :diminish abbrev-mode
+ :init
+ (hook-into-modes #'abbrev-mode '(text-mode-hook))
+
+ :config
+ (progn
+ (setq save-abbrevs 'silently)
+ (setq abbrev-file-name (expand-file-name "abbrev_defs" jj-cache-dir))
+ (if (file-exists-p abbrev-file-name)
+ (quietly-read-abbrev-file))
+
+ (add-hook 'expand-load-hook
+ (lambda ()
+ (add-hook 'expand-expand-hook 'indent-according-to-mode)
+ (add-hook 'expand-jump-hook 'indent-according-to-mode)))))
+#+END_SRC
+
** ace-jump-mode
[2013-04-28 So 11:26]
Quickly move around in buffers.
:command ace-jump-mode
:bind ("H-SPC" . ace-jump-mode))
#+END_SRC
+** ace-window
+[2013-04-21 So 20:27]
+Use H-w to switch windows
+#+BEGIN_SRC emacs-lisp :tangle yes
+(use-package ace-window
+ :ensure ace-window
+ :commands ace-window
+ :bind ("H-w" . ace-window))
+#+END_SRC
** ascii
[2014-05-21 Wed 00:33]
#+BEGIN_SRC emacs-lisp :tangle yes
(bind-key "C-c e A" 'ascii-toggle)))
#+END_SRC
+** auctex
+#+BEGIN_SRC emacs-lisp :tangle yes
+(setq auto-mode-alist (cons '("\\.tex\\'" . latex-mode) auto-mode-alist))
+(setq TeX-auto-save t)
+(setq TeX-parse-self t)
+(setq TeX-PDF-mode t)
+#+END_SRC
+
+** auto-complete mode
+[2013-04-27 Sa 16:33]
+And aren't we all lazy? I definitely am, and I like my emacs doing as
+much possible work for me as it can.
+So here, auto-complete-mode, which lets emacs do this, based on what I
+already had typed.
+#+BEGIN_SRC emacs-lisp :tangle yes
+(use-package auto-complete
+ :ensure auto-complete
+ :init
+ (progn
+ (global-auto-complete-mode t)
+ )
+ :config
+ (progn
+ (setq ac-comphist-file (expand-file-name "ac-comphist.dat" jj-cache-dir))
+
+ (setq ac-expand-on-auto-complete nil)
+ (setq ac-dwim t)
+ (setq ac-auto-start t)
+
+ ;;----------------------------------------------------------------------------
+ ;; Use Emacs' built-in TAB completion hooks to trigger AC (Emacs >= 23.2)
+ ;;----------------------------------------------------------------------------
+ (setq tab-always-indent 'complete) ;; use 't when auto-complete is disabled
+ (add-to-list 'completion-styles 'initials t)
+
+ ;; hook AC into completion-at-point
+ (defun sanityinc/auto-complete-at-point ()
+ (when (and (not (minibufferp))
+ (fboundp 'auto-complete-mode)
+ auto-complete-mode)
+ (auto-complete)))
+
+ (defun set-auto-complete-as-completion-at-point-function ()
+ (add-to-list 'completion-at-point-functions 'sanityinc/auto-complete-at-point))
+
+ (add-hook 'auto-complete-mode-hook 'set-auto-complete-as-completion-at-point-function)
+
+ ;(require 'ac-dabbrev)
+ (set-default 'ac-sources
+ '(ac-source-imenu
+ ac-source-dictionary
+ ac-source-words-in-buffer
+ ac-source-words-in-same-mode-buffers
+ ac-source-words-in-all-buffer))
+; ac-source-dabbrev))
+
+ (dolist (mode '(magit-log-edit-mode log-edit-mode org-mode text-mode haml-mode
+ sass-mode yaml-mode csv-mode espresso-mode haskell-mode
+ html-mode nxml-mode sh-mode smarty-mode clojure-mode
+ lisp-mode textile-mode markdown-mode tuareg-mode python-mode
+ js3-mode css-mode less-css-mode sql-mode ielm-mode))
+ (add-to-list 'ac-modes mode))
+
+;; Exclude very large buffers from dabbrev
+ (defun sanityinc/dabbrev-friend-buffer (other-buffer)
+ (< (buffer-size other-buffer) (* 1 1024 1024)))
+
+ (setq dabbrev-friend-buffer-function 'sanityinc/dabbrev-friend-buffer)
+
+
+;; custom keybindings to use tab, enter and up and down arrows
+(bind-key "\t" 'ac-expand ac-complete-mode-map)
+(bind-key "\r" 'ac-complete ac-complete-mode-map)
+(bind-key "M-n" 'ac-next ac-complete-mode-map)
+(bind-key "M-p" 'ac-previous ac-complete-mode-map)
+(bind-key "M-TAB" 'auto-complete ac-mode-map)
+
+(setq auto-completion-syntax-alist (quote (global accept . word))) ;; Use space and punctuation to accept the current the most likely completion.
+(setq auto-completion-min-chars (quote (global . 3))) ;; Avoid completion for short trivial words.
+(setq completion-use-dynamic t)
+
+(add-hook 'latex-mode-hook 'auto-complete-mode)
+(add-hook 'LaTeX-mode-hook 'auto-complete-mode)
+(add-hook 'prog-mode-hook 'auto-complete-mode)
+(add-hook 'org-mode-hook 'auto-complete-mode)))
+#+END_SRC
+
+** auto-revert
+When files change outside emacs for whatever reason I want emacs to deal
+with it. Not to have to revert buffers myself
+#+BEGIN_SRC emacs-lisp :tangle yes
+(use-package autorevert
+ :commands auto-revert-mode
+ :diminish auto-revert-mode
+ :init
+ (progn
+ (setq global-auto-revert-mode t)
+ (global-auto-revert-mode)))
+#+END_SRC
+
** backups
Emacs should keep backup copies of files I edit, but I do not want them
to clutter up the filesystem everywhere. So I put them into one defined
(member method '("su" "sudo"))))))))))
#+END_SRC
-** markdown-mode
-[2014-05-20 Tue 23:04]
+** crontab-mode
+[2013-05-21 Tue 23:18]
#+BEGIN_SRC emacs-lisp :tangle yes
-(use-package markdown-mode
- :mode (("\\.md\\'" . markdown-mode)
- ("\\.mdwn\\'" . markdown-mode))
- :defer t)
+(use-package crontab-mode
+ :ensure crontab-mode
+ :commands crontab-mode
+ :mode ("\\.?cron\\(tab\\)?\\'" . crontab-mode))
#+END_SRC
-** diff-mode
+
+** css
#+BEGIN_SRC emacs-lisp :tangle yes
-(use-package diff-mode
- :commands diff-mode
- :mode ("COMMIT_EDITMSG$" . diff-mode)
+(use-package css-mode
+ :mode ("\\.css\\'" . css-mode)
+ :defer t
:config
- (use-package diff-mode-))
+ (progn
+ ;;; CSS flymake
+ (use-package flymake-css
+ :ensure flymake-css
+ :config
+ (progn
+ (defun maybe-flymake-css-load ()
+ "Activate flymake-css as necessary, but not in derived modes."
+ (when (eq major-mode 'css-mode)
+ (flymake-css-load)))
+ (add-hook 'css-mode-hook 'maybe-flymake-css-load)))
+ ;;; Auto-complete CSS keywords
+ (eval-after-load 'auto-complete
+ '(progn
+ (dolist (hook '(css-mode-hook sass-mode-hook scss-mode-hook))
+ (add-hook hook 'ac-css-mode-setup))))))
#+END_SRC
-For some file endings we need to tell emacs what mode we want for them.
-I only list modes here where I don't have any other special
-configuration.
-** Region bindings mode
-[2013-05-01 Wed 22:51]
-This mode allows to have keybindings that are only alive when the
-region is active. Helpful for things that only do any useful action
-then, like for example the [[*multiple%20cursors][multiple cursors]] mode I load later.
+** cua
+I know that this lets it look "more like windows", but I don't much care
+about its paste/copy/cut keybindings, the really nice part is the great
+support for rectangular regions, which I started to use a lot since I
+know this mode. The normal keybindings for those are just to useless.
#+BEGIN_SRC emacs-lisp :tangle yes
-(use-package region-bindings-mode
- :ensure region-bindings-mode
- :init
- (region-bindings-mode-enable))
+(cua-mode t)
+(setq cua-enable-cua-keys (quote shift))
#+END_SRC
-** tramp
-Transparent Remote (file) Access, Multiple Protocol, remote file editing.
+
+Luckily cua-mode easily supports this, with the following line I just
+get the CUA selection and rectangle stuff, not the keybindings. Yes,
+even though the above =cua-enable-cua-keys= setting would only enable
+them if the selection is done when the region was marked with a shifted
+movement keys.
#+BEGIN_SRC emacs-lisp :tangle yes
-(use-package tramp
- :defer t
- :config
- (progn
- (setq tramp-persistency-file-name (expand-file-name "tramp" jj-cache-dir))
- (setq shell-prompt-pattern "^[^a-zA-Z].*[#$%>] *")
- (add-to-list 'tramp-default-method-alist '("\\`localhost\\'" "\\`root\\'" "su")
- )
- (setq tramp-debug-buffer nil)
- (setq tramp-default-method "sshx")
- (tramp-set-completion-function "ssh"
- '((tramp-parse-sconfig "/etc/ssh_config")
- (tramp-parse-sconfig "~/.ssh/config")))
- (setq tramp-verbose 5)
- ))
+(cua-selection-mode t)
#+END_SRC
-** tiny-tools
-We configure only a bit of the tiny-tools to load when I should need
-them. I don't need much actually, but these things are nice to have.
-
+** Debian related
#+BEGIN_SRC emacs-lisp :tangle yes
-(autoload 'turn-on-tinyperl-mode "tinyperl" "" t)
-(add-hook 'perl-mode-hook 'turn-on-tinyperl-mode)
-(add-hook 'cperl-mode-hook 'turn-on-tinyperl-mode)
+(require 'dpkg-dev-el-loaddefs nil 'noerror)
+(require 'debian-el-loaddefs nil 'noerror)
-(autoload 'tinycomment-indent-for-comment "tinycomment" "" t)
-(autoload 'tinyeat-forward-preserve "tinyeat" "" t)
-(autoload 'tinyeat-backward-preserve "tinyeat" "" t)
-(autoload 'tinyeat-delete-paragraph "tinyeat" "" t)
-(autoload 'tinyeat-kill-line "tinyeat" "" t)
-(autoload 'tinyeat-zap-line "tinyeat" "" t)
-(autoload 'tinyeat-kill-line-backward "tinyeat" "" t)
-(autoload 'tinyeat-kill-buffer-lines-point-max "tinyeat" "" t)
-(autoload 'tinyeat-kill-buffer-lines-point-min "tinyeat" "" t)
+(setq debian-changelog-full-name "Joerg Jaspert")
+(setq debian-changelog-mailing-address "joerg@debian.org")
#+END_SRC
-*** Keyboard changes for tiny-tools
+
+** diff-mode
#+BEGIN_SRC emacs-lisp :tangle yes
-(bind-key "\M-;" 'tinycomment-indent-for-comment)
-(bind-key "ESC C-k" 'tinyeat-kill-line-backward)
-(bind-key "ESC d" 'tinyeat-forward-preserve)
-(bind-key "<M-backspace>" 'tinyeat-backward-preserve)
-(bind-key "<S-backspace>" 'tinyeat-delete-whole-word)
+(use-package diff-mode
+ :commands diff-mode
+ :mode ("COMMIT_EDITMSG$" . diff-mode)
+ :config
+ (use-package diff-mode-))
#+END_SRC
+For some file endings we need to tell emacs what mode we want for them.
+I only list modes here where I don't have any other special
+configuration.
** dired & co
I like dired and work a lot with it, but it tends to leave lots of
#+END_SRC
-** filladapt
-[2013-05-02 Thu 00:04]
+** easypg
+EasyPG is a GnuPG interface for Emacs.
#+BEGIN_SRC emacs-lisp :tangle yes
-(use-package filladapt
- :diminish filladapt-mode
- :init
- (setq-default filladapt-mode t))
+(require 'epa-file)
+(epa-file-enable)
#+END_SRC
-** icicles
-[[http://article.gmane.org/gmane.emacs.orgmode/4574/match%3Dicicles]["In case you never heard of it, Icicles is to ‘TAB’ completion what
-‘TAB’ completion is to typing things manually every time.”]]
+
+I took the following from [[http://www.emacswiki.org/emacs/EasyPG][EmacsWiki: Easy PG]]
#+BEGIN_SRC emacs-lisp :tangle yes
-(use-package icicles
- :load-path "elisp/icicle/"
- :init
- (icy-mode 1))
+(defadvice epg--start (around advice-epg-disable-agent disable)
+ "Don't allow epg--start to use gpg-agent in plain text
+ terminals."
+ (if (display-graphic-p)
+ ad-do-it
+ (let ((agent (getenv "GPG_AGENT_INFO")))
+ (setenv "GPG_AGENT_INFO" nil) ; give us a usable text password prompt
+ ad-do-it
+ (setenv "GPG_AGENT_INFO" agent))))
+(ad-enable-advice 'epg--start 'around 'advice-epg-disable-agent)
+(ad-activate 'epg--start)
#+END_SRC
-** uniquify
-Always have unique buffernames. See [[http://www.gnu.org/software/emacs/manual/html_node/emacs/Uniquify.html][Uniquify - GNU Emacs Manual]]
-#+BEGIN_SRC emacs-lisp :tangle yes
-(use-package uniquify
- :init
+** ediff
+[2013-04-21 So 20:36]
+ediff - don't start another frame
+#+BEGIN_SRC elisp
+(use-package ediff
+ :pre-init
(progn
- (setq uniquify-buffer-name-style 'post-forward)
- (setq uniquify-after-kill-buffer-p t)
- (setq uniquify-ignore-buffers-re "^\\*")))
+ (defvar ctl-period-equals-map)
+ (define-prefix-command 'ctl-period-equals-map)
+ (bind-key "C-. =" 'ctl-period-equals-map)
+
+ (bind-key "C-. = c" 'compare-windows)) ; not an ediff command, but it fits
+
+ :bind (("C-. = b" . ediff-buffers)
+ ("C-. = B" . ediff-buffers3)
+ ("C-. = =" . ediff-files)
+ ("C-. = f" . ediff-files)
+ ("C-. = F" . ediff-files3)
+ ("C-. = r" . ediff-revision)
+ ("C-. = p" . ediff-patch-file)
+ ("C-. = P" . ediff-patch-buffer)
+ ("C-. = l" . ediff-regions-linewise)
+ ("C-. = w" . ediff-regions-wordwise)))
#+END_SRC
+** emms
+EMMS is the Emacs Multimedia System.
+#+BEGIN_SRC emacs-lisp :tangle no
+(require 'emms-source-file)
+(require 'emms-source-playlist)
+(require 'emms-info)
+(require 'emms-cache)
+(require 'emms-playlist-mode)
+(require 'emms-playing-time)
+(require 'emms-player-mpd)
+(require 'emms-playlist-sort)
+(require 'emms-mark)
+(require 'emms-browser)
+(require 'emms-lyrics)
+(require 'emms-last-played)
+(require 'emms-score)
+(require 'emms-tag-editor)
+(require 'emms-history)
+(require 'emms-i18n)
-** abbrev
-A defined abbrev is a word which expands, if you insert it, into some
-different text. Abbrevs are defined by the user to expand in specific
-ways.
-#+BEGIN_SRC emacs-lisp :tangle yes
-(use-package abbrev
- :commands abbrev-mode
- :diminish abbrev-mode
- :init
- (hook-into-modes #'abbrev-mode '(text-mode-hook))
+(setq emms-playlist-default-major-mode 'emms-playlist-mode)
+(add-to-list 'emms-track-initialize-functions 'emms-info-initialize-track)
+(emms-playing-time 1)
+(emms-lyrics 1)
+(add-hook 'emms-player-started-hook 'emms-last-played-update-current)
+;(add-hook 'emms-player-started-hook 'emms-player-mpd-sync-from-emms)
+(emms-score 1)
+(when (fboundp 'emms-cache) ; work around compiler warning
+ (emms-cache 1))
+(setq emms-score-default-score 3)
- :config
- (progn
- (setq save-abbrevs 'silently)
- (setq abbrev-file-name (expand-file-name "abbrev_defs" jj-cache-dir))
- (if (file-exists-p abbrev-file-name)
- (quietly-read-abbrev-file))
+(defun emms-mpd-init ()
+ "Connect Emms to mpd."
+ (interactive)
+ (emms-player-mpd-connect))
- (add-hook 'expand-load-hook
- (lambda ()
- (add-hook 'expand-expand-hook 'indent-according-to-mode)
- (add-hook 'expand-jump-hook 'indent-according-to-mode)))))
-#+END_SRC
+;; players
+(require 'emms-player-mpd)
+(setq emms-player-mpd-server-name "localhost")
+(setq emms-player-mpd-server-port "6600")
+(add-to-list 'emms-info-functions 'emms-info-mpd)
+(add-to-list 'emms-player-list 'emms-player-mpd)
+(setq emms-volume-change-function 'emms-volume-mpd-change)
+(setq emms-player-mpd-sync-playlist t)
+
+(setq emms-source-file-default-directory "/var/lib/mpd/music")
+(setq emms-player-mpd-music-directory "/var/lib/mpd/music")
+(setq emms-info-auto-update t)
+(setq emms-lyrics-scroll-p t)
+(setq emms-lyrics-display-on-minibuffer t)
+(setq emms-lyrics-display-on-modeline nil)
+(setq emms-lyrics-dir "~/.emacs.d/var/lyrics")
+
+(setq emms-last-played-format-alist
+ '(((emms-last-played-seconds-today) . "%H:%M")
+ (604800 . "%a %H:%M") ; this week
+ ((emms-last-played-seconds-month) . "%d.%m.%Y")
+ ((emms-last-played-seconds-year) . "%d.%m.%Y")
+ (t . "Never played")))
+
+;; Playlist format
+(defun my-describe (track)
+ (let* ((empty "...")
+ (name (emms-track-name track))
+ (type (emms-track-type track))
+ (short-name (file-name-nondirectory name))
+ (play-count (or (emms-track-get track 'play-count) 0))
+ (last-played (or (emms-track-get track 'last-played) '(0 0 0)))
+ (artist (or (emms-track-get track 'info-artist) empty))
+ (year (emms-track-get track 'info-year))
+ (playing-time (or (emms-track-get track 'info-playing-time) 0))
+ (min (/ playing-time 60))
+ (sec (% playing-time 60))
+ (album (or (emms-track-get track 'info-album) empty))
+ (tracknumber (emms-track-get track 'info-tracknumber))
+ (short-name (file-name-sans-extension
+ (file-name-nondirectory name)))
+ (title (or (emms-track-get track 'info-title) short-name))
+ (rating (emms-score-get-score name))
+ (rate-char ?☭)
+ )
+ (format "%12s %20s (%.4s) [%-20s] - %2s. %-30s | %2d %s"
+ (emms-last-played-format-date last-played)
+ artist
+ year
+ album
+ (if (and tracknumber ; tracknumber
+ (not (zerop (string-to-number tracknumber))))
+ (format "%02d" (string-to-number tracknumber))
+ "")
+ title
+ play-count
+ (make-string rating rate-char)))
+)
+
+(setq emms-track-description-function 'my-describe)
+
+;; (global-set-key (kbd "C-<f9> t") 'emms-play-directory-tree)
+;; (global-set-key (kbd "H-<f9> e") 'emms-play-file)
+(global-set-key (kbd "H-<f9> <f9>") 'emms-mpd-init)
+(global-set-key (kbd "H-<f9> d") 'emms-play-dired)
+(global-set-key (kbd "H-<f9> x") 'emms-start)
+(global-set-key (kbd "H-<f9> v") 'emms-stop)
+(global-set-key (kbd "H-<f9> n") 'emms-next)
+(global-set-key (kbd "H-<f9> p") 'emms-previous)
+(global-set-key (kbd "H-<f9> o") 'emms-show)
+(global-set-key (kbd "H-<f9> h") 'emms-shuffle)
+(global-set-key (kbd "H-<f9> SPC") 'emms-pause)
+(global-set-key (kbd "H-<f9> a") 'emms-add-directory-tree)
+(global-set-key (kbd "H-<f9> b") 'emms-smart-browse)
+(global-set-key (kbd "H-<f9> l") 'emms-playlist-mode-go)
+
+(global-set-key (kbd "H-<f9> r") 'emms-toggle-repeat-track)
+(global-set-key (kbd "H-<f9> R") 'emms-toggle-repeat-playlist)
+(global-set-key (kbd "H-<f9> m") 'emms-lyrics-toggle-display-on-minibuffer)
+(global-set-key (kbd "H-<f9> M") 'emms-lyrics-toggle-display-on-modeline)
+
+(global-set-key (kbd "H-<f9> <left>") (lambda () (interactive) (emms-seek -10)))
+(global-set-key (kbd "H-<f9> <right>") (lambda () (interactive) (emms-seek +10)))
+(global-set-key (kbd "H-<f9> <down>") (lambda () (interactive) (emms-seek -60)))
+(global-set-key (kbd "H-<f9> <up>") (lambda () (interactive) (emms-seek +60)))
+
+(global-set-key (kbd "H-<f9> s u") 'emms-score-up-playing)
+(global-set-key (kbd "H-<f9> s d") 'emms-score-down-playing)
+(global-set-key (kbd "H-<f9> s o") 'emms-score-show-playing)
+(global-set-key (kbd "H-<f9> s s") 'emms-score-set-playing)
+
+(define-key emms-playlist-mode-map "u" 'emms-score-up-playing)
+(define-key emms-playlist-mode-map "d" 'emms-score-down-playing)
+(define-key emms-playlist-mode-map "o" 'emms-score-show-playing)
+(define-key emms-playlist-mode-map "s" 'emms-score-set-playing)
+(define-key emms-playlist-mode-map "r" 'emms-mpd-init)
+(define-key emms-playlist-mode-map "N" 'emms-playlist-new)
+
+(define-key emms-playlist-mode-map "x" 'emms-start)
+(define-key emms-playlist-mode-map "v" 'emms-stop)
+(define-key emms-playlist-mode-map "n" 'emms-next)
+(define-key emms-playlist-mode-map "p" 'emms-previous)
+
+(setq emms-playlist-buffer-name "*EMMS Playlist*"
+ emms-playlist-mode-open-playlists t)
+
+;; Faces
+(if (window-system)
+ ((lambda ()
+ (set-face-attribute
+ 'emms-browser-artist-face nil
+ :family "Arno Pro")
+ )
+))
+
+(setq emms-player-mpd-supported-regexp
+ (or (emms-player-mpd-get-supported-regexp)
+ (concat "\\`http://\\|"
+ (emms-player-simple-regexp
+ "m3u" "ogg" "flac" "mp3" "wav" "mod" "au" "aiff"))))
+(emms-player-set emms-player-mpd 'regex emms-player-mpd-supported-regexp)
+#+END_SRC
+** filladapt
+[2013-05-02 Thu 00:04]
+#+BEGIN_SRC emacs-lisp :tangle yes
+(use-package filladapt
+ :diminish filladapt-mode
+ :init
+ (setq-default filladapt-mode t))
+#+END_SRC
+** flycheck
+[2013-04-28 So 22:21]
+Flycheck is a on-the-fly syntax checking tool, supposedly better than Flymake.
+As the one time I tried Flymake i wasn't happy, thats easy to
+understand for me.
+#+BEGIN_SRC emacs-lisp :tangle yes
+(use-package flycheck
+ :ensure flycheck
+ :init
+ (add-hook 'after-init-hook #'global-flycheck-mode))
+#+END_SRC
** font-lock
Obviously emacs can do syntax hilighting. For more things than you ever
heard about.
(global-font-lock-mode 1)
(setq font-lock-maximum-decoration t)))
#+END_SRC
-** miniedit
-Edit minibuffer in a full (text-mode) buffer by pressing *M-C-e*.
+** git commit mode
#+BEGIN_SRC emacs-lisp :tangle yes
-(use-package miniedit
- :ensure miniedit
- :config
- (progn
- (bind-key "M-C-e" 'miniedit minibuffer-local-map)
- (bind-key "M-C-e" 'miniedit minibuffer-local-ns-map)
- (bind-key "M-C-e" 'miniedit minibuffer-local-completion-map)
- (bind-key "M-C-e" 'miniedit minibuffer-local-must-match-map)
- ))
+(use-package git-commit-mode
+ :ensure git-commit-mode
+ :commands git-commit-mode
+ :mode ("COMMIT_EDITMSG" . git-commit-mode))
#+END_SRC
-** timestamp
-By default, Emacs can update the time stamp for the following two
-formats if one exists in the first 8 lines of the file.
-- Time-stamp: <>
-- Time-stamp: " "
+** git rebase mode
#+BEGIN_SRC emacs-lisp :tangle yes
-(use-package time-stamp
- :commands time-stamp
+(use-package git-rebase-mode
+ :ensure git-rebase-mode
+ :commands git-rebase-mode
+ :mode ("git-rebase-todo" . git-rebase-mode))
+#+END_SRC
+** git-gutter+
+[2014-05-21 Wed 22:56]
+#+BEGIN_SRC emacs-lisp :tangle yes
+(use-package git-gutter+
+ :ensure git-gutter+
+ :diminish git-gutter+-mode
+ :bind (("C-x n" . git-gutter+-next-hunk)
+ ("C-x p" . git-gutter+-previous-hunk)
+ ("C-x v =" . git-gutter+-show-hunk)
+ ("C-x r" . git-gutter+-revert-hunks)
+ ("C-x s" . git-gutter+-stage-hunks)
+ ("C-x c" . git-gutter+-commit)
+ )
:init
(progn
- (add-hook 'write-file-hooks 'time-stamp)
- (setq time-stamp-active t))
+ (setq git-gutter+-disabled-modes '(org-mode)))
:config
(progn
- (setq time-stamp-format "%02H:%02M:%02S (%z) - %02d.%02m.%:y from %u (%U) on %s")
- (setq time-stamp-old-format-warn nil)
- (setq time-stamp-time-zone nil)))
+ (use-package git-gutter-fringe+
+ :ensure git-gutter-fringe+
+ :config
+ (progn
+ (setq git-gutter-fr+-side 'right-fringe)
+ ;(git-gutter-fr+-minimal)
+ ))
+ (global-git-gutter+-mode 1)))
+
+#+END_SRC
+** gnus
+Most of my gnus config is in an own file, [[file:gnus.org][gnus.org]], here I only have
+what I want every emacs to know.
+#+BEGIN_SRC emacs-lisp :tangle yes
+(bind-key* "\M-n" 'gnus) ; Start gnus with M-n
+(after 'gnus
+ (jj-init-theme)
+)
#+END_SRC
-** perl / cperl
-I like /cperl-mode/ a bit more than the default /perl-mode/, so set it
-up here to be used.
+** highlight mode
+[2014-05-21 Wed 23:51]
#+BEGIN_SRC emacs-lisp :tangle yes
-(use-package perl-mode
- :commands cperl-mode
+(use-package hi-lock
+ :bind (("M-o l" . highlight-lines-matching-regexp)
+ ("M-o r" . highlight-regexp)
+ ("M-o w" . highlight-phrase)))
+
+;;;_ , hilit-chg
+
+(use-package hilit-chg
+ :bind ("M-o C" . highlight-changes-mode))
+
+#+END_SRC
+** hippie-exp
+Crazy way of completion. It looks at the word before point and then
+tries to expand it in various ways.
+#+BEGIN_SRC emacs-lisp :tangle yes
+(use-package hippie-exp
+ :defer t
+ :bind ("M-/" . hippie-expand)
:init
(progn
- (defalias 'perl-mode 'cperl-mode)
- (add-auto-mode 'cperl-mode "\\.\\([pP][Llm]\\|al\\)\\'")
- (add-auto-mode 'pod-mode "\\.pod$")
- (add-auto-mode 'tt-mode "\\.tt$")
- (add-to-list 'interpreter-mode-alist '("perl" . cperl-mode))
- (add-to-list 'interpreter-mode-alist '("perl5" . cperl-mode))
- (add-to-list 'interpreter-mode-alist '("miniperl" . cperl-mode))
- )
- :config
- (progn
- (setq cperl-invalid-face nil
- cperl-close-paren-offset -4
- cperl-continued-statement-offset 0
- cperl-indent-level 4
- cperl-indent-parens-as-block t
- cperl-hairy t
- cperl-electric-keywords t
- cperl-electric-lbrace-space t
- cperl-electric-parens nil
- cperl-highlight-variables-indiscriminately t
- cperl-imenu-addback t
- cperl-invalid-face (quote underline)
- cperl-lazy-help-time 5
- cperl-scan-files-regexp "\\.\\([pP][Llm]\\|xs\\|cgi\\)$"
- cperl-syntaxify-by-font-lock t
- cperl-use-syntax-table-text-property-for-tags t)
+ (setq hippie-expand-try-functions-list '(try-expand-dabbrev
+ try-expand-dabbrev-all-buffers
+ try-expand-dabbrev-from-kill
+ try-complete-file-name-partially
+ try-complete-file-name
+ try-expand-all-abbrevs try-expand-list
+ try-expand-line
+ try-complete-lisp-symbol-partially
+ try-complete-lisp-symbol))))
+#+END_SRC
+** html-helper
+Instead of default /html-mode/ I use /html-helper-mode/.
+#+BEGIN_SRC emacs-lisp :tangle yes
+(autoload 'html-helper-mode "html-helper-mode" "Yay HTML" t)
+(add-auto-mode 'html-helper-mode "\\.html$")
+(add-auto-mode 'html-helper-mode "\\.asp$")
+(add-auto-mode 'html-helper-mode "\\.phtml$")
+(add-auto-mode 'html-helper-mode "\\.(jsp|tmpl)\\'")
+(defalias 'html-mode 'html-helper-mode)
+#+END_SRC
- ;; And have cperl mode give ElDoc a useful string
- (defun my-cperl-eldoc-documentation-function ()
- "Return meaningful doc string for `eldoc-mode'."
- (car
- (let ((cperl-message-on-help-error nil))
- (cperl-get-help))))
- (add-hook 'cperl-mode-hook
- (lambda ()
- (set (make-local-variable 'eldoc-documentation-function)
- 'my-cperl-eldoc-documentation-function)
- (eldoc-mode))))
- )
+** ibuffer
+[2014-05-21 Wed 23:54]
+#+BEGIN_SRC emacs-lisp :tangle yes
+(use-package ibuffer
+ :bind ("C-x C-b" . ibuffer))
+#+END_SRC
+** icicles
+[[http://article.gmane.org/gmane.emacs.orgmode/4574/match%3Dicicles]["In case you never heard of it, Icicles is to ‘TAB’ completion what
+‘TAB’ completion is to typing things manually every time.”]]
+#+BEGIN_SRC emacs-lisp :tangle yes
+(use-package icicles
+ :load-path "elisp/icicle/"
+ :init
+ (icy-mode 1))
+#+END_SRC
+** icomplete
+Incremental mini-buffer completion preview: Type in the minibuffer,
+list of matching commands is echoed
+#+BEGIN_SRC emacs-lisp :tangle yes
+(icomplete-mode 99)
#+END_SRC
+
** info stuff
[2014-05-20 Tue 23:35]
#+BEGIN_SRC emacs-lisp :tangle yes
(use-package info
:bind ("C-h C-i" . info-lookup-symbol)
-
+
:config
(progn
;; (defadvice info-setup (after load-info+ activate)
(use-package info-look
:commands info-lookup-add-help)
#+END_SRC
-** sh
-Settings for shell scripts
-#+BEGIN_SRC emacs-lisp :tangle yes
-(use-package sh-script
- :defer t
- :config
- (progn
- (defvar sh-script-initialized nil)
- (defun initialize-sh-script ()
- (unless sh-script-initialized
- (setq sh-script-initialized t)
- (setq sh-indent-comment t)
- (info-lookup-add-help :mode 'shell-script-mode
- :regexp ".*"
- :doc-spec
- '(("(bash)Index")))))
-
- (add-hook 'shell-mode-hook 'initialize-sh-script)))
-#+END_SRC
-** sh-toggle
-#+BEGIN_SRC emacs-lisp :tangle yes
-(use-package sh-toggle
- :bind ("C-. C-z" . shell-toggle))
-#+END_SRC
-** auto-revert
-When files change outside emacs for whatever reason I want emacs to deal
-with it. Not to have to revert buffers myself
-#+BEGIN_SRC emacs-lisp :tangle yes
-(use-package autorevert
- :commands auto-revert-mode
- :diminish auto-revert-mode
- :init
- (progn
- (setq global-auto-revert-mode t)
- (global-auto-revert-mode)))
-#+END_SRC
-
** linum (line number)
Various modes should have line numbers in front of each line.
(global-linum-mode 1))
#+END_SRC
-** css
+** lisp editing stuff
+[2013-04-21 So 21:00]
+I'm not doing much of it, except for my emacs and gnus configs, but
+then I like it nice too...
#+BEGIN_SRC emacs-lisp :tangle yes
-(use-package css-mode
- :mode ("\\.css\\'" . css-mode)
- :defer t
- :config
- (progn
- ;;; CSS flymake
- (use-package flymake-css
- :ensure flymake-css
- :config
- (progn
- (defun maybe-flymake-css-load ()
- "Activate flymake-css as necessary, but not in derived modes."
- (when (eq major-mode 'css-mode)
- (flymake-css-load)))
- (add-hook 'css-mode-hook 'maybe-flymake-css-load)))
- ;;; Auto-complete CSS keywords
- (eval-after-load 'auto-complete
- '(progn
- (dolist (hook '(css-mode-hook sass-mode-hook scss-mode-hook))
- (add-hook hook 'ac-css-mode-setup))))))
+(bind-key "TAB" 'lisp-complete-symbol read-expression-map)
+
+(use-package paredit
+ :ensure paredit
+ :diminish paredit-mode " π")
+
+(setq lisp-coding-hook 'lisp-coding-defaults)
+(setq interactive-lisp-coding-hook 'interactive-lisp-coding-defaults)
+
+(setq prelude-emacs-lisp-mode-hook 'prelude-emacs-lisp-mode-defaults)
+(add-hook 'emacs-lisp-mode-hook (lambda ()
+ (run-hooks 'prelude-emacs-lisp-mode-hook)))
+
+(bind-key "M-." 'find-function-at-point emacs-lisp-mode-map)
+
+(after "elisp-slime-nav"
+ '(diminish 'elisp-slime-nav-mode))
+(after "rainbow-mode"
+ '(diminish 'rainbow-mode))
+(after "eldoc"
+ '(diminish 'eldoc-mode))
#+END_SRC
-** mmm-mode
-[2013-05-21 Tue 23:39]
-MMM Mode is a minor mode for Emacs that allows Multiple Major Modes to
-coexist in one buffer.
+** magit
+[2013-04-21 So 20:48]
+magit is a mode for interacting with git.
#+BEGIN_SRC emacs-lisp :tangle yes
-(use-package mmm-auto
- :ensure mmm-mode
- :init
- (progn
- (setq mmm-global-mode 'buffers-with-submode-classes)
- (setq mmm-submode-decoration-level 2)
- (eval-after-load 'mmm-vars
+(use-package magit
+ :ensure magit
+ :commands (magit-log magit-run-gitk magit-run-git-gui magit-status
+ magit-git-repo-p magit-list-repos)
+ :defer t
+ :bind (("C-x g" . magit-status)
+ ("C-x G" . magit-status-with-prefix))
+ :init
+ (progn
+ (setq magit-commit-signoff t
+ magit-repo-dirs '("~/git"
+ "/develop/vcs/"
+ )
+ magit-repo-dirs-depth 4
+ magit-log-auto-more t)
+ (use-package magit-blame
+ :commands magit-blame-mode)
+
+ (use-package magit-filenotify
+ :ensure magit-filenotify)
+
+ (use-package magit-svn
+ :ensure magit-svn
+ :commands (magit-svn-mode
+ turn-on-magit-svn))
+
+ (add-hook 'magit-mode-hook 'hl-line-mode)
+ (defun magit-status-with-prefix ()
+ (interactive)
+ (let ((current-prefix-arg '(4)))
+ (call-interactively 'magit-status)))
+ )
+ :config
+ (progn
+ (setenv "GIT_PAGER" "")
+
+ (unbind-key "M-h" magit-mode-map)
+ (unbind-key "M-s" magit-mode-map)
+
+ (add-hook 'magit-log-edit-mode-hook
+ #'(lambda ()
+ (set-fill-column 72)
+ (flyspell-mode)))
+ ))
+#+END_SRC
+** markdown-mode
+[2014-05-20 Tue 23:04]
+#+BEGIN_SRC emacs-lisp :tangle yes
+(use-package markdown-mode
+ :mode (("\\.md\\'" . markdown-mode)
+ ("\\.mdwn\\'" . markdown-mode))
+ :defer t)
+#+END_SRC
+** message
+#+BEGIN_SRC emacs-lisp :tangle yes
+(require 'message)
+(setq message-kill-buffer-on-exit t)
+#+END_SRC
+** mingus
+[[https://github.com/pft/mingus][Mingus]] is a nice interface to mpd, the Music Player Daemon.
+
+I want to access it from anywhere using =F6=.
+#+BEGIN_SRC emacs-lisp :tangle yes
+(use-package mingus-stays-home
+ :bind ( "<f6>" . mingus)
+ :defer t
+ :config
+ (progn
+ (setq mingus-dired-add-keys t)
+ (setq mingus-mode-always-modeline nil)
+ (setq mingus-mode-line-show-elapsed-percentage nil)
+ (setq mingus-mode-line-show-volume nil)
+ (setq mingus-mpd-config-file "/etc/mpd.conf")
+ (setq mingus-mpd-playlist-dir "/var/lib/mpd/playlists")
+ (setq mingus-mpd-root "/share/music/")))
+#+END_SRC
+
+** miniedit
+Edit minibuffer in a full (text-mode) buffer by pressing *M-C-e*.
+#+BEGIN_SRC emacs-lisp :tangle yes
+(use-package miniedit
+ :ensure miniedit
+ :config
+ (progn
+ (bind-key "M-C-e" 'miniedit minibuffer-local-map)
+ (bind-key "M-C-e" 'miniedit minibuffer-local-ns-map)
+ (bind-key "M-C-e" 'miniedit minibuffer-local-completion-map)
+ (bind-key "M-C-e" 'miniedit minibuffer-local-must-match-map)
+ ))
+#+END_SRC
+
+** mmm-mode
+[2013-05-21 Tue 23:39]
+MMM Mode is a minor mode for Emacs that allows Multiple Major Modes to
+coexist in one buffer.
+#+BEGIN_SRC emacs-lisp :tangle yes
+(use-package mmm-auto
+ :ensure mmm-mode
+ :init
+ (progn
+ (setq mmm-global-mode 'buffers-with-submode-classes)
+ (setq mmm-submode-decoration-level 2)
+ (eval-after-load 'mmm-vars
'(progn
(mmm-add-group
'html-css
))))
#+END_SRC
-** html-helper
-Instead of default /html-mode/ I use /html-helper-mode/.
+** mo-git-blame
+This is [[https://github.com/mbunkus/mo-git-blame][mo-git-blame -- An interactive, iterative 'git blame' mode for
+Emacs]].
+
#+BEGIN_SRC emacs-lisp :tangle yes
-(autoload 'html-helper-mode "html-helper-mode" "Yay HTML" t)
-(add-auto-mode 'html-helper-mode "\\.html$")
-(add-auto-mode 'html-helper-mode "\\.asp$")
-(add-auto-mode 'html-helper-mode "\\.phtml$")
-(add-auto-mode 'html-helper-mode "\\.(jsp|tmpl)\\'")
-(defalias 'html-mode 'html-helper-mode)
+(use-package mo-git-blame
+ :ensure mo-git-blame
+ :commands (mo-git-blame-current
+ mo-git-blame-file)
+ :config
+ (progn
+ (setq mo-git-blame-blame-window-width 25)))
#+END_SRC
-** auctex
+** multiple cursors
+[2013-04-08 Mon 23:57]
+Use multiple cursors mode. See [[http://emacsrocks.com/e13.html][Emacs Rocks! multiple cursors]] and
+[[https://github.com/emacsmirror/multiple-cursors][emacsmirror/multiple-cursors · GitHub]]
#+BEGIN_SRC emacs-lisp :tangle yes
-(setq auto-mode-alist (cons '("\\.tex\\'" . latex-mode) auto-mode-alist))
-(setq TeX-auto-save t)
-(setq TeX-parse-self t)
-(setq TeX-PDF-mode t)
+(use-package multiple-cursors
+ :ensure multiple-cursors
+ :defer t
+ :bind (("C-S-c C-S-c" . mc/edit-lines)
+ ("C->" . mc/mark-next-like-this)
+ ("C-<" . mc/mark-previous-like-this)
+ ("C-c C-<" . mc/mark-all-like-this))
+ :config
+ (progn
+ (bind-key "a" 'mc/mark-all-like-this region-bindings-mode-map)
+ (bind-key "p" 'mc/mark-previous-like-this region-bindings-mode-map)
+ (bind-key "n" 'mc/mark-next-like-this region-bindings-mode-map)
+ (bind-key "l" 'mc/edit-lines region-bindings-mode-map)
+ (bind-key "m" 'mc/mark-more-like-this-extended region-bindings-mode-map)
+ (setq mc/list-file (expand-file-name "mc-cache.el" jj-cache-dir))))
#+END_SRC
-
-** Debian related
+** nxml
+[2013-05-22 Wed 22:02]
+nxml-mode is a major mode for editing XML.
#+BEGIN_SRC emacs-lisp :tangle yes
-(require 'dpkg-dev-el-loaddefs nil 'noerror)
-(require 'debian-el-loaddefs nil 'noerror)
+(add-auto-mode
+ 'nxml-mode
+ (concat "\\."
+ (regexp-opt
+ '("xml" "xsd" "sch" "rng" "xslt" "svg" "rss"
+ "gpx" "tcx"))
+ "\\'"))
+(setq magic-mode-alist (cons '("<\\?xml " . nxml-mode) magic-mode-alist))
+(fset 'xml-mode 'nxml-mode)
+(setq nxml-slash-auto-complete-flag t)
-(setq debian-changelog-full-name "Joerg Jaspert")
-(setq debian-changelog-mailing-address "joerg@debian.org")
-#+END_SRC
+;; See: http://sinewalker.wordpress.com/2008/06/26/pretty-printing-xml-with-emacs-nxml-mode/
+(defun pp-xml-region (begin end)
+ "Pretty format XML markup in region. The function inserts
+linebreaks to separate tags that have nothing but whitespace
+between them. It then indents the markup by using nxml's
+indentation rules."
+ (interactive "r")
+ (save-excursion
+ (nxml-mode)
+ (goto-char begin)
+ (while (search-forward-regexp "\>[ \\t]*\<" nil t)
+ (backward-char) (insert "\n"))
+ (indent-region begin end)))
+
+;;----------------------------------------------------------------------------
+;; Integration with tidy for html + xml
+;;----------------------------------------------------------------------------
+;; tidy is autoloaded
+(eval-after-load 'tidy
+ '(progn
+ (add-hook 'nxml-mode-hook (lambda () (tidy-build-menu nxml-mode-map)))
+ (add-hook 'html-mode-hook (lambda () (tidy-build-menu html-mode-map)))
+ ))
+#+END_SRC
** org :FIXME:
*** General settings
[2013-04-28 So 17:06]
And now a largish set of keybindings...
#+BEGIN_SRC emacs-lisp :tangle yes :tangle yes
-(global-set-key "\C-cl" 'org-store-link)
-(global-set-key "\C-ca" 'org-agenda)
-(global-set-key "\C-cb" 'org-iswitchb)
-(define-key mode-specific-map [?a] 'org-agenda)
-
-(global-set-key (kbd "<f12>") 'org-agenda)
-(global-set-key (kbd "<f5>") 'bh/org-todo)
-(global-set-key (kbd "<S-f5>") 'bh/widen)
-(global-set-key (kbd "<f7>") 'bh/set-truncate-lines)
-(global-set-key (kbd "<f8>") 'org-cycle-agenda-files)
-
-(global-set-key (kbd "<f9> <f9>") 'bh/show-org-agenda)
-(global-set-key (kbd "<f9> b") 'bbdb)
-(global-set-key (kbd "<f9> c") 'calendar)
-(global-set-key (kbd "<f9> f") 'boxquote-insert-file)
-(global-set-key (kbd "<f9> h") 'bh/hide-other)
-(global-set-key (kbd "<f9> n") 'org-narrow-to-subtree)
-(global-set-key (kbd "<f9> w") 'widen)
-(global-set-key (kbd "<f9> u") 'bh/narrow-up-one-level)
-(global-set-key (kbd "<f9> I") 'bh/punch-in)
-(global-set-key (kbd "<f9> O") 'bh/punch-out)
-(global-set-key (kbd "<f9> H") 'jj/punch-in-hw)
-(global-set-key (kbd "<f9> W") 'jj/punch-out-hw)
-(global-set-key (kbd "<f9> o") 'bh/make-org-scratch)
-(global-set-key (kbd "<f9> p") 'bh/phone-call)
-(global-set-key (kbd "<f9> r") 'boxquote-region)
-(global-set-key (kbd "<f9> s") 'bh/switch-to-scratch)
-(global-set-key (kbd "<f9> t") 'bh/insert-inactive-timestamp)
-(global-set-key (kbd "<f9> T") 'tabify)
-(global-set-key (kbd "<f9> U") 'untabify)
-(global-set-key (kbd "<f9> v") 'visible-mode)
-(global-set-key (kbd "<f9> SPC") 'bh/clock-in-last-task)
-(global-set-key (kbd "C-<f9>") 'previous-buffer)
-(global-set-key (kbd "C-<f10>") 'next-buffer)
-(global-set-key (kbd "M-<f9>") 'org-toggle-inline-images)
-(global-set-key (kbd "C-x n r") 'narrow-to-region)
-(global-set-key (kbd "<f11>") 'org-clock-goto)
-(global-set-key (kbd "C-<f11>") 'org-clock-in)
-(global-set-key (kbd "C-M-r") 'org-capture)
-(global-set-key (kbd "C-c r") 'org-capture)
-(global-set-key (kbd "C-S-<f12>") 'bh/save-then-publish)
-
-(define-key org-mode-map [(control k)] 'jj-org-kill-line)
+ (global-set-key "\C-cl" 'org-store-link)
+ (global-set-key "\C-ca" 'org-agenda)
+ (global-set-key "\C-cb" 'org-iswitchb)
+ (define-key mode-specific-map [?a] 'org-agenda)
+
+ (global-set-key (kbd "<f12>") 'org-agenda)
+ (global-set-key (kbd "<f5>") 'bh/org-todo)
+ (global-set-key (kbd "<S-f5>") 'bh/widen)
+ (global-set-key (kbd "<f7>") 'bh/set-truncate-lines)
+ (global-set-key (kbd "<f8>") 'org-cycle-agenda-files)
+
+ (global-set-key (kbd "<f9> <f9>") 'bh/show-org-agenda)
+ (global-set-key (kbd "<f9> b") 'bbdb)
+ (global-set-key (kbd "<f9> c") 'calendar)
+ (global-set-key (kbd "<f9> f") 'boxquote-insert-file)
+ (global-set-key (kbd "<f9> h") 'bh/hide-other)
+ (global-set-key (kbd "<f9> n") 'org-narrow-to-subtree)
+ (global-set-key (kbd "<f9> w") 'widen)
+ (global-set-key (kbd "<f9> u") 'bh/narrow-up-one-level)
+ (global-set-key (kbd "<f9> I") 'bh/punch-in)
+ (global-set-key (kbd "<f9> O") 'bh/punch-out)
+ (global-set-key (kbd "<f9> H") 'jj/punch-in-hw)
+ (global-set-key (kbd "<f9> W") 'jj/punch-out-hw)
+ (global-set-key (kbd "<f9> o") 'bh/make-org-scratch)
+ (global-set-key (kbd "<f9> p") 'bh/phone-call)
+ (global-set-key (kbd "<f9> r") 'boxquote-region)
+ (global-set-key (kbd "<f9> s") 'bh/switch-to-scratch)
+ (global-set-key (kbd "<f9> t") 'bh/insert-inactive-timestamp)
+ (global-set-key (kbd "<f9> T") 'tabify)
+ (global-set-key (kbd "<f9> U") 'untabify)
+ (global-set-key (kbd "<f9> v") 'visible-mode)
+ (global-set-key (kbd "<f9> SPC") 'bh/clock-in-last-task)
+ (global-set-key (kbd "C-<f9>") 'previous-buffer)
+ (global-set-key (kbd "C-<f10>") 'next-buffer)
+ (global-set-key (kbd "M-<f9>") 'org-toggle-inline-images)
+ ;(global-set-key (kbd "C-x n r") 'narrow-to-region)
+ (global-set-key (kbd "<f11>") 'org-clock-goto)
+ (global-set-key (kbd "C-<f11>") 'org-clock-in)
+ (global-set-key (kbd "C-M-r") 'org-capture)
+ (global-set-key (kbd "C-c r") 'org-capture)
+ (global-set-key (kbd "C-S-<f12>") 'bh/save-then-publish)
+
+ (define-key org-mode-map [(control k)] 'jj-org-kill-line)
#+END_SRC
*** Tasks, States, Todo fun
(require 'org-checklist)
#+END_SRC
-** transient mark
-For some reason I prefer this mode more than the way without. I want to
-see the marked region.
-#+BEGIN_SRC emacs-lisp :tangle yes
-(transient-mark-mode 1)
-#+END_SRC
-** cua
-I know that this lets it look "more like windows", but I don't much care
-about its paste/copy/cut keybindings, the really nice part is the great
-support for rectangular regions, which I started to use a lot since I
-know this mode. The normal keybindings for those are just to useless.
-#+BEGIN_SRC emacs-lisp :tangle yes
-(cua-mode t)
-(setq cua-enable-cua-keys (quote shift))
-#+END_SRC
-
-Luckily cua-mode easily supports this, with the following line I just
-get the CUA selection and rectangle stuff, not the keybindings. Yes,
-even though the above =cua-enable-cua-keys= setting would only enable
-them if the selection is done when the region was marked with a shifted
-movement keys.
-#+BEGIN_SRC emacs-lisp :tangle yes
-(cua-selection-mode t)
-#+END_SRC
-
-** mo-git-blame
-This is [[https://github.com/mbunkus/mo-git-blame][mo-git-blame -- An interactive, iterative 'git blame' mode for
-Emacs]].
-
+** perl / cperl
+I like /cperl-mode/ a bit more than the default /perl-mode/, so set it
+up here to be used.
#+BEGIN_SRC emacs-lisp :tangle yes
-(use-package mo-git-blame
- :ensure mo-git-blame
- :commands (mo-git-blame-current
- mo-git-blame-file)
- :config
+(use-package perl-mode
+ :commands cperl-mode
+ :init
(progn
- (setq mo-git-blame-blame-window-width 25)))
-#+END_SRC
-
-** mingus
-[[https://github.com/pft/mingus][Mingus]] is a nice interface to mpd, the Music Player Daemon.
-
-I want to access it from anywhere using =F6=.
-#+BEGIN_SRC emacs-lisp :tangle yes
-(use-package mingus-stays-home
- :bind ( "<f6>" . mingus)
- :defer t
+ (defalias 'perl-mode 'cperl-mode)
+ (add-auto-mode 'cperl-mode "\\.\\([pP][Llm]\\|al\\)\\'")
+ (add-auto-mode 'pod-mode "\\.pod$")
+ (add-auto-mode 'tt-mode "\\.tt$")
+ (add-to-list 'interpreter-mode-alist '("perl" . cperl-mode))
+ (add-to-list 'interpreter-mode-alist '("perl5" . cperl-mode))
+ (add-to-list 'interpreter-mode-alist '("miniperl" . cperl-mode))
+ )
:config
(progn
- (setq mingus-dired-add-keys t)
- (setq mingus-mode-always-modeline nil)
- (setq mingus-mode-line-show-elapsed-percentage nil)
- (setq mingus-mode-line-show-volume nil)
- (setq mingus-mpd-config-file "/etc/mpd.conf")
- (setq mingus-mpd-playlist-dir "/var/lib/mpd/playlists")
- (setq mingus-mpd-root "/share/music/")))
+ (setq cperl-invalid-face nil
+ cperl-close-paren-offset -4
+ cperl-continued-statement-offset 0
+ cperl-indent-level 4
+ cperl-indent-parens-as-block t
+ cperl-hairy t
+ cperl-electric-keywords t
+ cperl-electric-lbrace-space t
+ cperl-electric-parens nil
+ cperl-highlight-variables-indiscriminately t
+ cperl-imenu-addback t
+ cperl-invalid-face (quote underline)
+ cperl-lazy-help-time 5
+ cperl-scan-files-regexp "\\.\\([pP][Llm]\\|xs\\|cgi\\)$"
+ cperl-syntaxify-by-font-lock t
+ cperl-use-syntax-table-text-property-for-tags t)
+
+ ;; And have cperl mode give ElDoc a useful string
+ (defun my-cperl-eldoc-documentation-function ()
+ "Return meaningful doc string for `eldoc-mode'."
+ (car
+ (let ((cperl-message-on-help-error nil))
+ (cperl-get-help))))
+ (add-hook 'cperl-mode-hook
+ (lambda ()
+ (set (make-local-variable 'eldoc-documentation-function)
+ 'my-cperl-eldoc-documentation-function)
+ (eldoc-mode))))
+ )
+#+END_SRC
+** puppet
+[2014-05-22 Thu 00:05]
+#+BEGIN_SRC emacs-lisp :tangle yes
+(use-package puppet-mode
+ :mode ("\\.pp\\'" . puppet-mode)
+ :config
+ (use-package puppet-ext
+ :init
+ (progn
+ (bind-key "C-x ?" 'puppet-set-anchor puppet-mode-map)
+ (bind-key "C-c C-r" 'puppet-create-require puppet-mode-map))))
+#+END_SRC
+
+** python
+Use elpy for the emacs python fun, but dont let it initialize all the
+various variables. Elpy author may like them, but I'm not him...
+#+BEGIN_SRC emacs-lisp :tangle yes
+(safe-load (concat jj-elisp-dir "/elpy/elpy-autoloads.el"))
+(defalias 'elpy-initialize-variables 'jj-init-elpy)
+(defun jj-init-elpy ()
+ "Initialize elpy in a way i like"
+ ;; Local variables in `python-mode'. This is not removed when Elpy
+ ;; is disabled, which can cause some confusion.
+ (add-hook 'python-mode-hook 'elpy-initialize-local-variables)
+
+ ;; `flymake-no-changes-timeout': The original value of 0.5 is too
+ ;; short for Python code, as that will result in the current line to
+ ;; be highlighted most of the time, and that's annoying. This value
+ ;; might be on the long side, but at least it does not, in general,
+ ;; interfere with normal interaction.
+ (setq flymake-no-changes-timeout 60)
+
+ ;; `flymake-start-syntax-check-on-newline': This should be nil for
+ ;; Python, as;; most lines with a colon at the end will mean the next
+ ;; line is always highlighted as error, which is not helpful and
+ ;; mostly annoying.
+ (setq flymake-start-syntax-check-on-newline nil)
+
+ ;; `ac-auto-show-menu': Short timeout because the menu is great.
+ (setq ac-auto-show-menu 0.4)
+
+ ;; `ac-quick-help-delay': I'd like to show the menu right with the
+ ;; completions, but this value should be greater than
+ ;; `ac-auto-show-menu' to show help for the first entry as well.
+ (setq ac-quick-help-delay 0.5)
+
+ ;; `yas-trigger-key': TAB, as is the default, conflicts with the
+ ;; autocompletion. We also need to tell yasnippet about the new
+ ;; binding. This is a bad interface to set the trigger key. Stop
+ ;; doing this.
+ (let ((old (when (boundp 'yas-trigger-key)
+ yas-trigger-key)))
+ (setq yas-trigger-key "C-c C-i")
+ (when (fboundp 'yas--trigger-key-reload)
+ (yas--trigger-key-reload old)))
+
+ ;; yas-snippet-dirs can be a string for a single directory. Make
+ ;; sure it's a list in that case so we can add our own entry.
+ (when (not (listp yas-snippet-dirs))
+ (setq yas-snippet-dirs (list yas-snippet-dirs)))
+ (add-to-list 'yas-snippet-dirs
+ (concat (file-name-directory (locate-library "elpy"))
+ "snippets/")
+ t)
+
+ ;; Now load yasnippets.
+ (yas-reload-all))
+(elpy-enable)
+(elpy-use-ipython)
+#+END_SRC
+
+Below is old setup
+#+BEGIN_SRC emacs-lisp :tangle no
+(autoload 'python-mode "python-mode" "Python Mode." t)
+(add-auto-mode 'python-mode "\\.py\\'")
+(add-auto-mode 'python-mode "\\.py$")
+(add-auto-mode 'python-mode "SConstruct\\'")
+(add-auto-mode 'python-mode "SConscript\\'")
+(add-to-list 'interpreter-mode-alist '("python" . python-mode))
+
+(after 'python-mode
+ (set-variable 'py-indent-offset 4)
+ (set-variable 'py-smart-indentation nil)
+ (set-variable 'indent-tabs-mode nil)
+ (define-key python-mode-map "\C-m" 'newline-and-indent)
+ (turn-on-eldoc-mode)
+ (defun python-auto-fill-comments-only ()
+ (auto-fill-mode 1)
+ (set (make-local-variable 'fill-nobreak-predicate)
+ (lambda ()
+ (not (python-in-string/comment)))))
+ (add-hook 'python-mode-hook
+ (lambda ()
+ (python-auto-fill-comments-only)))
+ ;; pymacs
+ (autoload 'pymacs-apply "pymacs")
+ (autoload 'pymacs-call "pymacs")
+ (autoload 'pymacs-eval "pymacs" nil t)
+ (autoload 'pymacs-exec "pymacs" nil t)
+ (autoload 'pymacs-load "pymacs" nil t))
+#+END_SRC
+
+If an =ipython= executable is on the path, then assume that IPython is
+the preferred method python evaluation.
+#+BEGIN_SRC emacs-lisp :tangle no
+(when (executable-find "ipython")
+ (require 'ipython)
+ (setq org-babel-python-mode 'python-mode))
+
+(setq python-shell-interpreter "ipython")
+(setq python-shell-interpreter-args "")
+(setq python-shell-prompt-regexp "In \\[[0-9]+\\]: ")
+(setq python-shell-prompt-output-regexp "Out\\[[0-9]+\\]: ")
+(setq python-shell-completion-setup-code
+ "from IPython.core.completerlib import module_completion")
+(setq python-shell-completion-module-string-code
+ "';'.join(module_completion('''%s'''))\n")
+(setq python-shell-completion-string-code
+ "';'.join(get_ipython().Completer.all_completions('''%s'''))\n")
+#+END_SRC
+** rainbow-delimiters
+[2013-04-09 Di 23:38]
+[[http://www.emacswiki.org/emacs/RainbowDelimiters][EmacsWiki: Rainbow Delimiters]] is a “rainbow parentheses”-like mode
+which highlights parens, brackets, and braces according to their
+depth. Each successive level is highlighted a different color. This
+makes it easy to spot matching delimiters, orient yourself in the code,
+and tell which statements are at the same depth.
+#+BEGIN_SRC emacs-lisp :tangle yes
+(use-package rainbow-delimiters
+ :ensure rainbow-delimiters
+ :init
+ (global-rainbow-delimiters-mode))
+#+END_SRC
+** rainbow-mode
+#+BEGIN_SRC emacs-lisp :tangle yes
+(use-package rainbow-mode
+ :ensure rainbow-mode
+ :diminish rainbow-mode)
#+END_SRC
+** re-builder
+Saner regex syntax
+#+BEGIN_SRC emacs-lisp :tangle yes
+(use-package re-builder
+ :command re-builder
+ :defer t
+ :config
+ (setq reb-re-syntax 'string))
+#+END_SRC
** recentf
[2014-05-19 Mo 22:56]
Recentf is a minor mode that builds a list of recently opened
(recentf-mode 1)
(setq recentf-max-menu-items 25)
(setq recentf-save-file (expand-file-name ".recentf" jj-cache-dir))
-
+
(defun recentf-add-dired-directory ()
(if (and dired-directory
(file-directory-p dired-directory)
(add-hook 'dired-mode-hook 'recentf-add-dired-directory)))
#+END_SRC
+** Region bindings mode
+[2013-05-01 Wed 22:51]
+This mode allows to have keybindings that are only alive when the
+region is active. Helpful for things that only do any useful action
+then, like for example the [[*multiple%20cursors][multiple cursors]] mode I load later.
+#+BEGIN_SRC emacs-lisp :tangle yes
+(use-package region-bindings-mode
+ :ensure region-bindings-mode
+ :init
+ (region-bindings-mode-enable))
+#+END_SRC
+** ruby
+[2013-05-22 Wed 22:33]
+Programming in ruby...
+
+*** Auto-modes
+#+BEGIN_SRC emacs-lisp :tangle yes
+(add-auto-mode 'ruby-mode
+ "Rakefile\\'" "\\.rake\\'" "\.rxml\\'"
+ "\\.rjs\\'" ".irbrc\\'" "\.builder\\'" "\\.ru\\'"
+ "\\.gemspec\\'" "Gemfile\\'" "Kirkfile\\'")
+#+END_SRC
+
+*** Config
+#+BEGIN_SRC emacs-lisp :tangle yes
+(use-package ruby-mode
+ :mode ("\\.rb\\'" . ruby-mode)
+ :interpreter ("ruby" . ruby-mode)
+ :defer t
+ :config
+ (progn
+ (use-package yari
+ :init
+ (progn
+ (defvar yari-helm-source-ri-pages
+ '((name . "RI documentation")
+ (candidates . (lambda () (yari-ruby-obarray)))
+ (action ("Show with Yari" . yari))
+ (candidate-number-limit . 300)
+ (requires-pattern . 2)
+ "Source for completing RI documentation."))
+
+ (defun helm-yari (&optional rehash)
+ (interactive (list current-prefix-arg))
+ (when current-prefix-arg (yari-ruby-obarray rehash))
+ (helm 'yari-helm-source-ri-pages (yari-symbol-at-point)))))
+
+ (defun my-ruby-smart-return ()
+ (interactive)
+ (when (memq (char-after) '(?\| ?\" ?\'))
+ (forward-char))
+ (call-interactively 'newline-and-indent))
+
+ (use-package ruby-hash-syntax
+ :ensure ruby-hash-syntax)
+
+ (defun my-ruby-mode-hook ()
+ (require 'inf-ruby)
+ (inf-ruby-keys)
+
+ (bind-key "<return>" 'my-ruby-smart-return ruby-mode-map)
+ ;(bind-key "<tab>" 'indent-for-tab-command ruby-mode-map)
+
+
+ (set (make-local-variable 'yas-fallback-behavior)
+ '(apply ruby-indent-command . nil))
+ (bind-key "<tab>" 'yas-expand-from-trigger-key ruby-mode-map))
+
+ (add-hook 'ruby-mode-hook 'my-ruby-mode-hook)
+
+ ;; Stupidly the non-bundled ruby-mode isn't a derived mode of
+ ;; prog-mode: we run the latter's hooks anyway in that case.
+ (add-hook 'ruby-mode-hook
+ (lambda ()
+ (unless (derived-mode-p 'prog-mode)
+ (run-hooks 'prog-mode-hook))))
+ ))
+#+END_SRC
** sessions :FIXME:
[2013-05-22 Wed 22:40]
Save and restore the desktop
(setq save-place-file (expand-file-name "saved-places" jj-cache-dir))
#+END_SRC
-** easypg
-EasyPG is a GnuPG interface for Emacs.
-#+BEGIN_SRC emacs-lisp :tangle yes
-(require 'epa-file)
-(epa-file-enable)
-#+END_SRC
-
-I took the following from [[http://www.emacswiki.org/emacs/EasyPG][EmacsWiki: Easy PG]]
-#+BEGIN_SRC emacs-lisp :tangle yes
-(defadvice epg--start (around advice-epg-disable-agent disable)
- "Don't allow epg--start to use gpg-agent in plain text
- terminals."
- (if (display-graphic-p)
- ad-do-it
- (let ((agent (getenv "GPG_AGENT_INFO")))
- (setenv "GPG_AGENT_INFO" nil) ; give us a usable text password prompt
- ad-do-it
- (setenv "GPG_AGENT_INFO" agent))))
-(ad-enable-advice 'epg--start 'around 'advice-epg-disable-agent)
-(ad-activate 'epg--start)
-#+END_SRC
-** message
-#+BEGIN_SRC emacs-lisp :tangle yes
-(require 'message)
-(setq message-kill-buffer-on-exit t)
-#+END_SRC
-** gnus
-Most of my gnus config is in an own file, [[file:gnus.org][gnus.org]], here I only have
-what I want every emacs to know.
-#+BEGIN_SRC emacs-lisp :tangle yes
-(bind-key* "\M-n" 'gnus) ; Start gnus with M-n
-(after 'gnus
- (jj-init-theme)
-)
-#+END_SRC
-
-** url
-url contains code to parse and handle URLs - who would have thought? I
-set it to send Accept-language header and tell it to not send email,
-operating system or location info.
-#+BEGIN_SRC emacs-lisp :tangle yes
-(setq url-mime-language-string "de,en")
-(setq url-privacy-level (quote (email os lastloc)))
-#+END_SRC
-** hippie-exp
-Crazy way of completion. It looks at the word before point and then
-tries to expand it in various ways.
+** sh
+Settings for shell scripts
#+BEGIN_SRC emacs-lisp :tangle yes
-(use-package hippie-exp
+(use-package sh-script
:defer t
- :bind ("M-/" . hippie-expand)
- :init
+ :config
(progn
- (setq hippie-expand-try-functions-list '(try-expand-dabbrev
- try-expand-dabbrev-all-buffers
- try-expand-dabbrev-from-kill
- try-complete-file-name-partially
- try-complete-file-name
- try-expand-all-abbrevs try-expand-list
- try-expand-line
- try-complete-lisp-symbol-partially
- try-complete-lisp-symbol))))
+ (defvar sh-script-initialized nil)
+ (defun initialize-sh-script ()
+ (unless sh-script-initialized
+ (setq sh-script-initialized t)
+ (setq sh-indent-comment t)
+ (info-lookup-add-help :mode 'shell-script-mode
+ :regexp ".*"
+ :doc-spec
+ '(("(bash)Index")))))
+
+ (add-hook 'shell-mode-hook 'initialize-sh-script)))
#+END_SRC
-** yasnippet
-[2013-04-27 Sa 23:16]
-Yasnippet is a template system. Type an abbreviation, expand it into
-whatever the snippet holds.
+** sh-toggle
#+BEGIN_SRC emacs-lisp :tangle yes
-(setq yas-snippet-dirs (expand-file-name "yasnippet/snippets" jj-elisp-dir))
-(use-package yasnippet
- :ensure yasnippet
- :init
- (progn
- (yas-global-mode 1)
- ;; Integrate hippie-expand with ya-snippet
- (add-to-list 'hippie-expand-try-functions-list
- 'yas-hippie-try-expand)
- ))
+(use-package sh-toggle
+ :bind ("C-. C-z" . shell-toggle))
#+END_SRC
-** multiple cursors
-[2013-04-08 Mon 23:57]
-Use multiple cursors mode. See [[http://emacsrocks.com/e13.html][Emacs Rocks! multiple cursors]] and
-[[https://github.com/emacsmirror/multiple-cursors][emacsmirror/multiple-cursors · GitHub]]
+** timestamp
+By default, Emacs can update the time stamp for the following two
+formats if one exists in the first 8 lines of the file.
+- Time-stamp: <>
+- Time-stamp: " "
#+BEGIN_SRC emacs-lisp :tangle yes
-(use-package multiple-cursors
- :ensure multiple-cursors
- :defer t
- :bind (("C-S-c C-S-c" . mc/edit-lines)
- ("C->" . mc/mark-next-like-this)
- ("C-<" . mc/mark-previous-like-this)
- ("C-c C-<" . mc/mark-all-like-this))
+(use-package time-stamp
+ :commands time-stamp
:init
(progn
- (bind-key "a" 'mc/mark-all-like-this region-bindings-mode-map)
- (bind-key "p" 'mc/mark-previous-like-this region-bindings-mode-map)
- (bind-key "n" 'mc/mark-next-like-this region-bindings-mode-map)
- (bind-key "l" 'mc/edit-lines region-bindings-mode-map)
- (bind-key "m" 'mc/mark-more-like-this-extended region-bindings-mode-map)
- (setq mc/list-file (expand-file-name "mc-cache.el" jj-cache-dir))))
-#+END_SRC
-** rainbow-mode
-#+BEGIN_SRC emacs-lisp :tangle yes
-(use-package rainbow-mode
- :ensure rainbow-mode
- :diminish rainbow-mode)
-#+END_SRC
-
-** rainbow-delimiters
-[2013-04-09 Di 23:38]
-[[http://www.emacswiki.org/emacs/RainbowDelimiters][EmacsWiki: Rainbow Delimiters]] is a “rainbow parentheses”-like mode
-which highlights parens, brackets, and braces according to their
-depth. Each successive level is highlighted a different color. This
-makes it easy to spot matching delimiters, orient yourself in the code,
-and tell which statements are at the same depth.
-#+BEGIN_SRC emacs-lisp :tangle yes
-(use-package rainbow-delimiters
- :ensure rainbow-delimiters
- :init
- (global-rainbow-delimiters-mode))
-#+END_SRC
-** undo-tree
-[2013-04-21 So 11:07]
-Emacs undo is pretty powerful - but can also be confusing. There are
-tons of modes available to change it, even downgrade it to the very
-crappy ways one usually knows from other systems which lose
-information. undo-tree is different - it helps keeping you sane while
-keeping the full power of emacs undo/redo.
-#+BEGIN_SRC emacs-lisp :tangle yes
-(use-package undo-tree
- :ensure undo-tree
- :init
- (global-undo-tree-mode)
- :diminish undo-tree-mode)
+ (add-hook 'write-file-hooks 'time-stamp)
+ (setq time-stamp-active t))
+ :config
+ (progn
+ (setq time-stamp-format "%02H:%02M:%02S (%z) - %02d.%02m.%:y from %u (%U) on %s")
+ (setq time-stamp-old-format-warn nil)
+ (setq time-stamp-time-zone nil)))
#+END_SRC
-Additionally I would like to keep the region active should I undo
-while I have one.
+** tiny-tools
+We configure only a bit of the tiny-tools to load when I should need
+them. I don't need much actually, but these things are nice to have.
#+BEGIN_SRC emacs-lisp :tangle yes
-;; Keep region when undoing in region
-(defadvice undo-tree-undo (around keep-region activate)
- (if (use-region-p)
- (let ((m (set-marker (make-marker) (mark)))
- (p (set-marker (make-marker) (point))))
- ad-do-it
- (goto-char p)
- (set-mark m)
- (set-marker p nil)
- (set-marker m nil))
- ad-do-it))
-#+END_SRC
-** windmove
-[2013-04-21 So 20:27]
-Use hyper + arrow keys to switch between visible buffers
-#+BEGIN_SRC emacs-lisp :tangle yes
-(use-package windmove
- :init
- (progn
- (windmove-default-keybindings 'hyper)
- (setq windmove-wrap-around t)))
+(autoload 'turn-on-tinyperl-mode "tinyperl" "" t)
+(add-hook 'perl-mode-hook 'turn-on-tinyperl-mode)
+(add-hook 'cperl-mode-hook 'turn-on-tinyperl-mode)
+
+(autoload 'tinycomment-indent-for-comment "tinycomment" "" t)
+(autoload 'tinyeat-forward-preserve "tinyeat" "" t)
+(autoload 'tinyeat-backward-preserve "tinyeat" "" t)
+(autoload 'tinyeat-delete-paragraph "tinyeat" "" t)
+(autoload 'tinyeat-kill-line "tinyeat" "" t)
+(autoload 'tinyeat-zap-line "tinyeat" "" t)
+(autoload 'tinyeat-kill-line-backward "tinyeat" "" t)
+(autoload 'tinyeat-kill-buffer-lines-point-max "tinyeat" "" t)
+(autoload 'tinyeat-kill-buffer-lines-point-min "tinyeat" "" t)
#+END_SRC
-** volatile highlights
-[2013-04-21 So 20:31]
-VolatileHighlights highlights changes to the buffer caused by commands
-such as ‘undo’, ‘yank’/’yank-pop’, etc. The highlight disappears at the
-next command. The highlighting gives useful visual feedback for what
-your operation actually changed in the buffer.
+*** Keyboard changes for tiny-tools
#+BEGIN_SRC emacs-lisp :tangle yes
-(use-package volatile-highlights
- :ensure volatile-highlights
- :init
- (volatile-highlights-mode t)
- :diminish volatile-highlights-mode)
+(bind-key "\M-;" 'tinycomment-indent-for-comment)
+(bind-key "ESC C-k" 'tinyeat-kill-line-backward)
+(bind-key "ESC d" 'tinyeat-forward-preserve)
+(bind-key "<M-backspace>" 'tinyeat-backward-preserve)
+(bind-key "<S-backspace>" 'tinyeat-delete-whole-word)
#+END_SRC
-** ediff
-[2013-04-21 So 20:36]
-ediff - don't start another frame
-#+BEGIN_SRC elisp
-(use-package ediff
- :pre-init
- (progn
- (defvar ctl-period-equals-map)
- (define-prefix-command 'ctl-period-equals-map)
- (bind-key "C-. =" 'ctl-period-equals-map)
-
- (bind-key "C-. = c" 'compare-windows)) ; not an ediff command, but it fits
- :bind (("C-. = b" . ediff-buffers)
- ("C-. = B" . ediff-buffers3)
- ("C-. = =" . ediff-files)
- ("C-. = f" . ediff-files)
- ("C-. = F" . ediff-files3)
- ("C-. = r" . ediff-revision)
- ("C-. = p" . ediff-patch-file)
- ("C-. = P" . ediff-patch-buffer)
- ("C-. = l" . ediff-regions-linewise)
- ("C-. = w" . ediff-regions-wordwise)))
-#+END_SRC
-** re-builder
-Saner regex syntax
+** tramp
+Transparent Remote (file) Access, Multiple Protocol, remote file editing.
#+BEGIN_SRC emacs-lisp :tangle yes
-(use-package re-builder
- :command re-builder
+(use-package tramp
:defer t
:config
- (setq reb-re-syntax 'string))
-#+END_SRC
-** magit
-[2013-04-21 So 20:48]
-magit is a mode for interacting with git.
-#+BEGIN_SRC emacs-lisp :tangle yes
-(use-package magit
- :ensure magit
- :commands (magit-log magit-run-gitk magit-run-git-gui magit-status
- magit-git-repo-p magit-list-repos)
- :defer t
- :bind (("C-x g" . magit-status)
- ("C-x G" . magit-status-with-prefix))
- :init
(progn
- (setq magit-commit-signoff t
- magit-repo-dirs '("~/git"
- "/develop/vcs/"
- )
- magit-repo-dirs-depth 4
- magit-log-auto-more t)
- (use-package magit-blame
- :commands magit-blame-mode)
-
- (use-package magit-filenotify
- :ensure magit-filenotify)
-
- (use-package magit-svn
- :ensure magit-svn
- :commands (magit-svn-mode
- turn-on-magit-svn))
-
- (add-hook 'magit-mode-hook 'hl-line-mode)
- (defun magit-status-with-prefix ()
- (interactive)
- (let ((current-prefix-arg '(4)))
- (call-interactively 'magit-status)))
- )
- :config
- (progn
- (setenv "GIT_PAGER" "")
-
- (unbind-key "M-h" magit-mode-map)
- (unbind-key "M-s" magit-mode-map)
-
- (add-hook 'magit-log-edit-mode-hook
- #'(lambda ()
- (set-fill-column 72)
- (flyspell-mode)))
- ))
-#+END_SRC
-** git-gutter+
-[2014-05-21 Wed 22:56]
-#+BEGIN_SRC emacs-lisp :tangle yes
-(use-package git-gutter+
- :ensure git-gutter+
- :diminish git-gutter+-mode
- :bind (("C-x n" . git-gutter+-next-hunk)
- ("C-x p" . git-gutter+-previous-hunk)
- ("C-x v =" . git-gutter+-show-hunk)
- ("C-x r" . git-gutter+-revert-hunks)
- ("C-x s" . git-gutter+-stage-hunks)
- ("C-x c" . git-gutter+-commit)
- )
- :init
- (progn
- (setq git-gutter+-disabled-modes '(org-mode)))
- :config
- (progn
- (use-package git-gutter-fringe+
- :ensure git-gutter-fringe+
- :config
- (progn
- (setq git-gutter-fr+-side 'right-fringe)
- ;(git-gutter-fr+-minimal)
- ))
- (global-git-gutter+-mode 1)))
-
-#+END_SRC
-** git rebase mode
-#+BEGIN_SRC emacs-lisp :tangle yes
-(use-package git-rebase-mode
- :ensure git-rebase-mode
- :commands git-rebase-mode
- :mode ("git-rebase-todo" . git-rebase-mode))
-#+END_SRC
-** git commit mode
-#+BEGIN_SRC emacs-lisp :tangle yes
-(use-package git-commit-mode
- :ensure git-commit-mode
- :commands git-commit-mode
- :mode ("COMMIT_EDITMSG" . git-commit-mode))
-#+END_SRC
-
-** lisp editing stuff
-[2013-04-21 So 21:00]
-I'm not doing much of it, except for my emacs and gnus configs, but
-then I like it nice too...
-#+BEGIN_SRC emacs-lisp :tangle yes
-(bind-key "TAB" 'lisp-complete-symbol read-expression-map)
-
-(use-package paredit
- :ensure paredit
- :diminish paredit-mode " π")
-
-(setq lisp-coding-hook 'lisp-coding-defaults)
-(setq interactive-lisp-coding-hook 'interactive-lisp-coding-defaults)
-
-(setq prelude-emacs-lisp-mode-hook 'prelude-emacs-lisp-mode-defaults)
-(add-hook 'emacs-lisp-mode-hook (lambda ()
- (run-hooks 'prelude-emacs-lisp-mode-hook)))
-
-(bind-key "M-." 'find-function-at-point emacs-lisp-mode-map)
-
-(after "elisp-slime-nav"
- '(diminish 'elisp-slime-nav-mode))
-(after "rainbow-mode"
- '(diminish 'rainbow-mode))
-(after "eldoc"
- '(diminish 'eldoc-mode))
-#+END_SRC
-
-** writegood
-This highlights some /weaselwords/, a mode to /aid in finding common
-writing problems/...
-[2013-04-27 Sa 23:29]
-#+BEGIN_SRC emacs-lisp :tangle yes
-(use-package writegood-mode
- :ensure writegood-mode
- :defer t
- :init
- (bind-key "C-c g" 'writegood-mode))
-#+END_SRC
-** auto-complete mode
-[2013-04-27 Sa 16:33]
-And aren't we all lazy? I definitely am, and I like my emacs doing as
-much possible work for me as it can.
-So here, auto-complete-mode, which lets emacs do this, based on what I
-already had typed.
-#+BEGIN_SRC emacs-lisp :tangle yes
-(use-package auto-complete
- :ensure auto-complete
- :init
- (progn
- (global-auto-complete-mode t)
- )
- :config
- (progn
- (setq ac-comphist-file (expand-file-name "ac-comphist.dat" jj-cache-dir))
-
- (setq ac-expand-on-auto-complete nil)
- (setq ac-dwim t)
- (setq ac-auto-start t)
-
- ;;----------------------------------------------------------------------------
- ;; Use Emacs' built-in TAB completion hooks to trigger AC (Emacs >= 23.2)
- ;;----------------------------------------------------------------------------
- (setq tab-always-indent 'complete) ;; use 't when auto-complete is disabled
- (add-to-list 'completion-styles 'initials t)
-
- ;; hook AC into completion-at-point
- (defun sanityinc/auto-complete-at-point ()
- (when (and (not (minibufferp))
- (fboundp 'auto-complete-mode)
- auto-complete-mode)
- (auto-complete)))
-
- (defun set-auto-complete-as-completion-at-point-function ()
- (add-to-list 'completion-at-point-functions 'sanityinc/auto-complete-at-point))
-
- (add-hook 'auto-complete-mode-hook 'set-auto-complete-as-completion-at-point-function)
-
- ;(require 'ac-dabbrev)
- (set-default 'ac-sources
- '(ac-source-imenu
- ac-source-dictionary
- ac-source-words-in-buffer
- ac-source-words-in-same-mode-buffers
- ac-source-words-in-all-buffer))
-; ac-source-dabbrev))
-
- (dolist (mode '(magit-log-edit-mode log-edit-mode org-mode text-mode haml-mode
- sass-mode yaml-mode csv-mode espresso-mode haskell-mode
- html-mode nxml-mode sh-mode smarty-mode clojure-mode
- lisp-mode textile-mode markdown-mode tuareg-mode python-mode
- js3-mode css-mode less-css-mode sql-mode ielm-mode))
- (add-to-list 'ac-modes mode))
-
-;; Exclude very large buffers from dabbrev
- (defun sanityinc/dabbrev-friend-buffer (other-buffer)
- (< (buffer-size other-buffer) (* 1 1024 1024)))
-
- (setq dabbrev-friend-buffer-function 'sanityinc/dabbrev-friend-buffer)
-
-
-;; custom keybindings to use tab, enter and up and down arrows
-(bind-key "\t" 'ac-expand ac-complete-mode-map)
-(bind-key "\r" 'ac-complete ac-complete-mode-map)
-(bind-key "M-n" 'ac-next ac-complete-mode-map)
-(bind-key "M-p" 'ac-previous ac-complete-mode-map)
-(bind-key "M-TAB" 'auto-complete ac-mode-map)
-
-(setq auto-completion-syntax-alist (quote (global accept . word))) ;; Use space and punctuation to accept the current the most likely completion.
-(setq auto-completion-min-chars (quote (global . 3))) ;; Avoid completion for short trivial words.
-(setq completion-use-dynamic t)
-
-(add-hook 'latex-mode-hook 'auto-complete-mode)
-(add-hook 'LaTeX-mode-hook 'auto-complete-mode)
-(add-hook 'prog-mode-hook 'auto-complete-mode)
-(add-hook 'org-mode-hook 'auto-complete-mode)))
-#+END_SRC
-
-** yaml-mode
-[2013-04-28 So 01:13]
-YAML is a nice format for data, which is both, human and machine
-readable/editable without getting a big headache.
-#+BEGIN_SRC emacs-lisp :tangle yes
-(use-package yaml-mode
- :ensure yaml-mode
-
- :mode ("\\.ya?ml\\'" . yaml-mode)
- :config
- (bind-key "C-m" 'newline-and-indent yaml-mode-map ))
-#+END_SRC
-
-** flycheck
-[2013-04-28 So 22:21]
-Flycheck is a on-the-fly syntax checking tool, supposedly better than Flymake.
-As the one time I tried Flymake i wasn't happy, thats easy to
-understand for me.
-#+BEGIN_SRC emacs-lisp :tangle yes
-(use-package flycheck
- :ensure flycheck
- :init
- (add-hook 'after-init-hook #'global-flycheck-mode))
-#+END_SRC
-** crontab-mode
-[2013-05-21 Tue 23:18]
-#+BEGIN_SRC emacs-lisp :tangle yes
-(use-package crontab-mode
- :ensure crontab-mode
- :commands crontab-mode
- :mode ("\\.?cron\\(tab\\)?\\'" . crontab-mode))
-#+END_SRC
-
-** nxml
-[2013-05-22 Wed 22:02]
-nxml-mode is a major mode for editing XML.
-#+BEGIN_SRC emacs-lisp :tangle yes
-(add-auto-mode
- 'nxml-mode
- (concat "\\."
- (regexp-opt
- '("xml" "xsd" "sch" "rng" "xslt" "svg" "rss"
- "gpx" "tcx"))
- "\\'"))
-(setq magic-mode-alist (cons '("<\\?xml " . nxml-mode) magic-mode-alist))
-(fset 'xml-mode 'nxml-mode)
-(setq nxml-slash-auto-complete-flag t)
-
-;; See: http://sinewalker.wordpress.com/2008/06/26/pretty-printing-xml-with-emacs-nxml-mode/
-(defun pp-xml-region (begin end)
- "Pretty format XML markup in region. The function inserts
-linebreaks to separate tags that have nothing but whitespace
-between them. It then indents the markup by using nxml's
-indentation rules."
- (interactive "r")
- (save-excursion
- (nxml-mode)
- (goto-char begin)
- (while (search-forward-regexp "\>[ \\t]*\<" nil t)
- (backward-char) (insert "\n"))
- (indent-region begin end)))
-
-;;----------------------------------------------------------------------------
-;; Integration with tidy for html + xml
-;;----------------------------------------------------------------------------
-;; tidy is autoloaded
-(eval-after-load 'tidy
- '(progn
- (add-hook 'nxml-mode-hook (lambda () (tidy-build-menu nxml-mode-map)))
- (add-hook 'html-mode-hook (lambda () (tidy-build-menu html-mode-map)))
- ))
-
-#+END_SRC
-** ruby
-[2013-05-22 Wed 22:33]
-Programming in ruby...
-
-*** Auto-modes
-#+BEGIN_SRC emacs-lisp :tangle yes
-(add-auto-mode 'ruby-mode
- "Rakefile\\'" "\\.rake\\'" "\.rxml\\'"
- "\\.rjs\\'" ".irbrc\\'" "\.builder\\'" "\\.ru\\'"
- "\\.gemspec\\'" "Gemfile\\'" "Kirkfile\\'")
-#+END_SRC
-
-*** Config
-#+BEGIN_SRC emacs-lisp :tangle yes
-(use-package ruby-mode
- :mode ("\\.rb\\'" . ruby-mode)
- :interpreter ("ruby" . ruby-mode)
- :defer t
- :config
- (progn
- (use-package yari
- :init
- (progn
- (defvar yari-helm-source-ri-pages
- '((name . "RI documentation")
- (candidates . (lambda () (yari-ruby-obarray)))
- (action ("Show with Yari" . yari))
- (candidate-number-limit . 300)
- (requires-pattern . 2)
- "Source for completing RI documentation."))
-
- (defun helm-yari (&optional rehash)
- (interactive (list current-prefix-arg))
- (when current-prefix-arg (yari-ruby-obarray rehash))
- (helm 'yari-helm-source-ri-pages (yari-symbol-at-point)))))
-
- (defun my-ruby-smart-return ()
- (interactive)
- (when (memq (char-after) '(?\| ?\" ?\'))
- (forward-char))
- (call-interactively 'newline-and-indent))
-
- (use-package ruby-hash-syntax
- :ensure ruby-hash-syntax)
-
- (defun my-ruby-mode-hook ()
- (require 'inf-ruby)
- (inf-ruby-keys)
-
- (bind-key "<return>" 'my-ruby-smart-return ruby-mode-map)
- ;(bind-key "<tab>" 'indent-for-tab-command ruby-mode-map)
-
-
- (set (make-local-variable 'yas-fallback-behavior)
- '(apply ruby-indent-command . nil))
- (bind-key "<tab>" 'yas-expand-from-trigger-key ruby-mode-map))
-
- (add-hook 'ruby-mode-hook 'my-ruby-mode-hook)
-
- ;; Stupidly the non-bundled ruby-mode isn't a derived mode of
- ;; prog-mode: we run the latter's hooks anyway in that case.
- (add-hook 'ruby-mode-hook
- (lambda ()
- (unless (derived-mode-p 'prog-mode)
- (run-hooks 'prog-mode-hook))))
- ))
-#+END_SRC
-** emms
-EMMS is the Emacs Multimedia System.
-#+BEGIN_SRC emacs-lisp :tangle no
-(require 'emms-source-file)
-(require 'emms-source-playlist)
-(require 'emms-info)
-(require 'emms-cache)
-(require 'emms-playlist-mode)
-(require 'emms-playing-time)
-(require 'emms-player-mpd)
-(require 'emms-playlist-sort)
-(require 'emms-mark)
-(require 'emms-browser)
-(require 'emms-lyrics)
-(require 'emms-last-played)
-(require 'emms-score)
-(require 'emms-tag-editor)
-(require 'emms-history)
-(require 'emms-i18n)
-
-(setq emms-playlist-default-major-mode 'emms-playlist-mode)
-(add-to-list 'emms-track-initialize-functions 'emms-info-initialize-track)
-(emms-playing-time 1)
-(emms-lyrics 1)
-(add-hook 'emms-player-started-hook 'emms-last-played-update-current)
-;(add-hook 'emms-player-started-hook 'emms-player-mpd-sync-from-emms)
-(emms-score 1)
-(when (fboundp 'emms-cache) ; work around compiler warning
- (emms-cache 1))
-(setq emms-score-default-score 3)
-
-(defun emms-mpd-init ()
- "Connect Emms to mpd."
- (interactive)
- (emms-player-mpd-connect))
-
-;; players
-(require 'emms-player-mpd)
-(setq emms-player-mpd-server-name "localhost")
-(setq emms-player-mpd-server-port "6600")
-(add-to-list 'emms-info-functions 'emms-info-mpd)
-(add-to-list 'emms-player-list 'emms-player-mpd)
-(setq emms-volume-change-function 'emms-volume-mpd-change)
-(setq emms-player-mpd-sync-playlist t)
-
-(setq emms-source-file-default-directory "/var/lib/mpd/music")
-(setq emms-player-mpd-music-directory "/var/lib/mpd/music")
-(setq emms-info-auto-update t)
-(setq emms-lyrics-scroll-p t)
-(setq emms-lyrics-display-on-minibuffer t)
-(setq emms-lyrics-display-on-modeline nil)
-(setq emms-lyrics-dir "~/.emacs.d/var/lyrics")
-
-(setq emms-last-played-format-alist
- '(((emms-last-played-seconds-today) . "%H:%M")
- (604800 . "%a %H:%M") ; this week
- ((emms-last-played-seconds-month) . "%d.%m.%Y")
- ((emms-last-played-seconds-year) . "%d.%m.%Y")
- (t . "Never played")))
-
-;; Playlist format
-(defun my-describe (track)
- (let* ((empty "...")
- (name (emms-track-name track))
- (type (emms-track-type track))
- (short-name (file-name-nondirectory name))
- (play-count (or (emms-track-get track 'play-count) 0))
- (last-played (or (emms-track-get track 'last-played) '(0 0 0)))
- (artist (or (emms-track-get track 'info-artist) empty))
- (year (emms-track-get track 'info-year))
- (playing-time (or (emms-track-get track 'info-playing-time) 0))
- (min (/ playing-time 60))
- (sec (% playing-time 60))
- (album (or (emms-track-get track 'info-album) empty))
- (tracknumber (emms-track-get track 'info-tracknumber))
- (short-name (file-name-sans-extension
- (file-name-nondirectory name)))
- (title (or (emms-track-get track 'info-title) short-name))
- (rating (emms-score-get-score name))
- (rate-char ?☭)
- )
- (format "%12s %20s (%.4s) [%-20s] - %2s. %-30s | %2d %s"
- (emms-last-played-format-date last-played)
- artist
- year
- album
- (if (and tracknumber ; tracknumber
- (not (zerop (string-to-number tracknumber))))
- (format "%02d" (string-to-number tracknumber))
- "")
- title
- play-count
- (make-string rating rate-char)))
-)
-
-(setq emms-track-description-function 'my-describe)
-
-;; (global-set-key (kbd "C-<f9> t") 'emms-play-directory-tree)
-;; (global-set-key (kbd "H-<f9> e") 'emms-play-file)
-(global-set-key (kbd "H-<f9> <f9>") 'emms-mpd-init)
-(global-set-key (kbd "H-<f9> d") 'emms-play-dired)
-(global-set-key (kbd "H-<f9> x") 'emms-start)
-(global-set-key (kbd "H-<f9> v") 'emms-stop)
-(global-set-key (kbd "H-<f9> n") 'emms-next)
-(global-set-key (kbd "H-<f9> p") 'emms-previous)
-(global-set-key (kbd "H-<f9> o") 'emms-show)
-(global-set-key (kbd "H-<f9> h") 'emms-shuffle)
-(global-set-key (kbd "H-<f9> SPC") 'emms-pause)
-(global-set-key (kbd "H-<f9> a") 'emms-add-directory-tree)
-(global-set-key (kbd "H-<f9> b") 'emms-smart-browse)
-(global-set-key (kbd "H-<f9> l") 'emms-playlist-mode-go)
-
-(global-set-key (kbd "H-<f9> r") 'emms-toggle-repeat-track)
-(global-set-key (kbd "H-<f9> R") 'emms-toggle-repeat-playlist)
-(global-set-key (kbd "H-<f9> m") 'emms-lyrics-toggle-display-on-minibuffer)
-(global-set-key (kbd "H-<f9> M") 'emms-lyrics-toggle-display-on-modeline)
-
-(global-set-key (kbd "H-<f9> <left>") (lambda () (interactive) (emms-seek -10)))
-(global-set-key (kbd "H-<f9> <right>") (lambda () (interactive) (emms-seek +10)))
-(global-set-key (kbd "H-<f9> <down>") (lambda () (interactive) (emms-seek -60)))
-(global-set-key (kbd "H-<f9> <up>") (lambda () (interactive) (emms-seek +60)))
-
-(global-set-key (kbd "H-<f9> s u") 'emms-score-up-playing)
-(global-set-key (kbd "H-<f9> s d") 'emms-score-down-playing)
-(global-set-key (kbd "H-<f9> s o") 'emms-score-show-playing)
-(global-set-key (kbd "H-<f9> s s") 'emms-score-set-playing)
-
-(define-key emms-playlist-mode-map "u" 'emms-score-up-playing)
-(define-key emms-playlist-mode-map "d" 'emms-score-down-playing)
-(define-key emms-playlist-mode-map "o" 'emms-score-show-playing)
-(define-key emms-playlist-mode-map "s" 'emms-score-set-playing)
-(define-key emms-playlist-mode-map "r" 'emms-mpd-init)
-(define-key emms-playlist-mode-map "N" 'emms-playlist-new)
+ (setq tramp-persistency-file-name (expand-file-name "tramp" jj-cache-dir))
+ (setq shell-prompt-pattern "^[^a-zA-Z].*[#$%>] *")
+ (add-to-list 'tramp-default-method-alist '("\\`localhost\\'" "\\`root\\'" "su")
+ )
+ (setq tramp-debug-buffer nil)
+ (setq tramp-default-method "sshx")
+ (tramp-set-completion-function "ssh"
+ '((tramp-parse-sconfig "/etc/ssh_config")
+ (tramp-parse-sconfig "~/.ssh/config")))
+ (setq tramp-verbose 5)
+ ))
+#+END_SRC
-(define-key emms-playlist-mode-map "x" 'emms-start)
-(define-key emms-playlist-mode-map "v" 'emms-stop)
-(define-key emms-playlist-mode-map "n" 'emms-next)
-(define-key emms-playlist-mode-map "p" 'emms-previous)
+** transient mark
+For some reason I prefer this mode more than the way without. I want to
+see the marked region.
+#+BEGIN_SRC emacs-lisp :tangle yes
+(transient-mark-mode 1)
+#+END_SRC
+** undo-tree
+[2013-04-21 So 11:07]
+Emacs undo is pretty powerful - but can also be confusing. There are
+tons of modes available to change it, even downgrade it to the very
+crappy ways one usually knows from other systems which lose
+information. undo-tree is different - it helps keeping you sane while
+keeping the full power of emacs undo/redo.
+#+BEGIN_SRC emacs-lisp :tangle yes
+(use-package undo-tree
+ :ensure undo-tree
+ :init
+ (global-undo-tree-mode)
+ :diminish undo-tree-mode)
+#+END_SRC
-(setq emms-playlist-buffer-name "*EMMS Playlist*"
- emms-playlist-mode-open-playlists t)
+Additionally I would like to keep the region active should I undo
+while I have one.
-;; Faces
-(if (window-system)
- ((lambda ()
- (set-face-attribute
- 'emms-browser-artist-face nil
- :family "Arno Pro")
- )
-))
+#+BEGIN_SRC emacs-lisp :tangle yes
+;; Keep region when undoing in region
+(defadvice undo-tree-undo (around keep-region activate)
+ (if (use-region-p)
+ (let ((m (set-marker (make-marker) (mark)))
+ (p (set-marker (make-marker) (point))))
+ ad-do-it
+ (goto-char p)
+ (set-mark m)
+ (set-marker p nil)
+ (set-marker m nil))
+ ad-do-it))
+#+END_SRC
+** uniquify
+Always have unique buffernames. See [[http://www.gnu.org/software/emacs/manual/html_node/emacs/Uniquify.html][Uniquify - GNU Emacs Manual]]
+#+BEGIN_SRC emacs-lisp :tangle yes
+(use-package uniquify
+ :init
+ (progn
+ (setq uniquify-buffer-name-style 'post-forward)
+ (setq uniquify-after-kill-buffer-p t)
+ (setq uniquify-ignore-buffers-re "^\\*")))
+#+END_SRC
-(setq emms-player-mpd-supported-regexp
- (or (emms-player-mpd-get-supported-regexp)
- (concat "\\`http://\\|"
- (emms-player-simple-regexp
- "m3u" "ogg" "flac" "mp3" "wav" "mod" "au" "aiff"))))
-(emms-player-set emms-player-mpd 'regex emms-player-mpd-supported-regexp)
-
+** url
+url contains code to parse and handle URLs - who would have thought? I
+set it to send Accept-language header and tell it to not send email,
+operating system or location info.
+#+BEGIN_SRC emacs-lisp :tangle yes
+(setq url-mime-language-string "de,en")
+(setq url-privacy-level (quote (email os lastloc)))
+#+END_SRC
+** volatile highlights
+[2013-04-21 So 20:31]
+VolatileHighlights highlights changes to the buffer caused by commands
+such as ‘undo’, ‘yank’/’yank-pop’, etc. The highlight disappears at the
+next command. The highlighting gives useful visual feedback for what
+your operation actually changed in the buffer.
+#+BEGIN_SRC emacs-lisp :tangle yes
+(use-package volatile-highlights
+ :ensure volatile-highlights
+ :init
+ (volatile-highlights-mode t)
+ :diminish volatile-highlights-mode)
+#+END_SRC
+** writegood
+This highlights some /weaselwords/, a mode to /aid in finding common
+writing problems/...
+[2013-04-27 Sa 23:29]
+#+BEGIN_SRC emacs-lisp :tangle yes
+(use-package writegood-mode
+ :ensure writegood-mode
+ :defer t
+ :init
+ (bind-key "C-c g" 'writegood-mode))
#+END_SRC
** yafolding
Yet another folding extension for the Emacs editor. Unlike many
;;(define-key global-map (kbd "C-c C-f") 'yafolding-toggle-all)
(bind-key "C-c C-f" 'yafolding-toggle-all-by-current-level)
#+END_SRC
-** icomplete
-Incremental mini-buffer completion preview: Type in the minibuffer,
-list of matching commands is echoed
-#+BEGIN_SRC emacs-lisp :tangle yes
-(icomplete-mode 99)
-#+END_SRC
-
-** python
-Use elpy for the emacs python fun, but dont let it initialize all the
-various variables. Elpy author may like them, but I'm not him...
+** yaml-mode
+[2013-04-28 So 01:13]
+YAML is a nice format for data, which is both, human and machine
+readable/editable without getting a big headache.
#+BEGIN_SRC emacs-lisp :tangle yes
-(safe-load (concat jj-elisp-dir "/elpy/elpy-autoloads.el"))
-(defalias 'elpy-initialize-variables 'jj-init-elpy)
-(defun jj-init-elpy ()
- "Initialize elpy in a way i like"
- ;; Local variables in `python-mode'. This is not removed when Elpy
- ;; is disabled, which can cause some confusion.
- (add-hook 'python-mode-hook 'elpy-initialize-local-variables)
-
- ;; `flymake-no-changes-timeout': The original value of 0.5 is too
- ;; short for Python code, as that will result in the current line to
- ;; be highlighted most of the time, and that's annoying. This value
- ;; might be on the long side, but at least it does not, in general,
- ;; interfere with normal interaction.
- (setq flymake-no-changes-timeout 60)
-
- ;; `flymake-start-syntax-check-on-newline': This should be nil for
- ;; Python, as;; most lines with a colon at the end will mean the next
- ;; line is always highlighted as error, which is not helpful and
- ;; mostly annoying.
- (setq flymake-start-syntax-check-on-newline nil)
-
- ;; `ac-auto-show-menu': Short timeout because the menu is great.
- (setq ac-auto-show-menu 0.4)
-
- ;; `ac-quick-help-delay': I'd like to show the menu right with the
- ;; completions, but this value should be greater than
- ;; `ac-auto-show-menu' to show help for the first entry as well.
- (setq ac-quick-help-delay 0.5)
-
- ;; `yas-trigger-key': TAB, as is the default, conflicts with the
- ;; autocompletion. We also need to tell yasnippet about the new
- ;; binding. This is a bad interface to set the trigger key. Stop
- ;; doing this.
- (let ((old (when (boundp 'yas-trigger-key)
- yas-trigger-key)))
- (setq yas-trigger-key "C-c C-i")
- (when (fboundp 'yas--trigger-key-reload)
- (yas--trigger-key-reload old)))
-
- ;; yas-snippet-dirs can be a string for a single directory. Make
- ;; sure it's a list in that case so we can add our own entry.
- (when (not (listp yas-snippet-dirs))
- (setq yas-snippet-dirs (list yas-snippet-dirs)))
- (add-to-list 'yas-snippet-dirs
- (concat (file-name-directory (locate-library "elpy"))
- "snippets/")
- t)
-
- ;; Now load yasnippets.
- (yas-reload-all))
-(elpy-enable)
-(elpy-use-ipython)
-#+END_SRC
-
-Below is old setup
-#+BEGIN_SRC emacs-lisp :tangle no
-(autoload 'python-mode "python-mode" "Python Mode." t)
-(add-auto-mode 'python-mode "\\.py\\'")
-(add-auto-mode 'python-mode "\\.py$")
-(add-auto-mode 'python-mode "SConstruct\\'")
-(add-auto-mode 'python-mode "SConscript\\'")
-(add-to-list 'interpreter-mode-alist '("python" . python-mode))
-
-(after 'python-mode
- (set-variable 'py-indent-offset 4)
- (set-variable 'py-smart-indentation nil)
- (set-variable 'indent-tabs-mode nil)
- (define-key python-mode-map "\C-m" 'newline-and-indent)
- (turn-on-eldoc-mode)
- (defun python-auto-fill-comments-only ()
- (auto-fill-mode 1)
- (set (make-local-variable 'fill-nobreak-predicate)
- (lambda ()
- (not (python-in-string/comment)))))
- (add-hook 'python-mode-hook
- (lambda ()
- (python-auto-fill-comments-only)))
- ;; pymacs
- (autoload 'pymacs-apply "pymacs")
- (autoload 'pymacs-call "pymacs")
- (autoload 'pymacs-eval "pymacs" nil t)
- (autoload 'pymacs-exec "pymacs" nil t)
- (autoload 'pymacs-load "pymacs" nil t))
-#+END_SRC
-
-If an =ipython= executable is on the path, then assume that IPython is
-the preferred method python evaluation.
-#+BEGIN_SRC emacs-lisp :tangle no
-(when (executable-find "ipython")
- (require 'ipython)
- (setq org-babel-python-mode 'python-mode))
+(use-package yaml-mode
+ :ensure yaml-mode
-(setq python-shell-interpreter "ipython")
-(setq python-shell-interpreter-args "")
-(setq python-shell-prompt-regexp "In \\[[0-9]+\\]: ")
-(setq python-shell-prompt-output-regexp "Out\\[[0-9]+\\]: ")
-(setq python-shell-completion-setup-code
- "from IPython.core.completerlib import module_completion")
-(setq python-shell-completion-module-string-code
- "';'.join(module_completion('''%s'''))\n")
-(setq python-shell-completion-string-code
- "';'.join(get_ipython().Completer.all_completions('''%s'''))\n")
+ :mode ("\\.ya?ml\\'" . yaml-mode)
+ :config
+ (bind-key "C-m" 'newline-and-indent yaml-mode-map ))
#+END_SRC
-** highlight mode
-[2014-05-21 Wed 23:51]
-#+BEGIN_SRC emacs-lisp :tangle yes
-(use-package hi-lock
- :bind (("M-o l" . highlight-lines-matching-regexp)
- ("M-o r" . highlight-regexp)
- ("M-o w" . highlight-phrase)))
-;;;_ , hilit-chg
-
-(use-package hilit-chg
- :bind ("M-o C" . highlight-changes-mode))
-
-#+END_SRC
-** ibuffer
-[2014-05-21 Wed 23:54]
-#+BEGIN_SRC emacs-lisp :tangle yes
-(use-package ibuffer
- :bind ("C-x C-b" . ibuffer))
-#+END_SRC
-** puppet
-[2014-05-22 Thu 00:05]
+** yasnippet
+[2013-04-27 Sa 23:16]
+Yasnippet is a template system. Type an abbreviation, expand it into
+whatever the snippet holds.
#+BEGIN_SRC emacs-lisp :tangle yes
-(use-package puppet-mode
- :mode ("\\.pp\\'" . puppet-mode)
- :config
- (use-package puppet-ext
+(setq yas-snippet-dirs (expand-file-name "yasnippet/snippets" jj-elisp-dir))
+(use-package yasnippet
+ :ensure yasnippet
:init
(progn
- (bind-key "C-x ?" 'puppet-set-anchor puppet-mode-map)
- (bind-key "C-c C-r" 'puppet-create-require puppet-mode-map))))
+ (yas-global-mode 1)
+ ;; Integrate hippie-expand with ya-snippet
+ (add-to-list 'hippie-expand-try-functions-list
+ 'yas-hippie-try-expand)
+ ))
#+END_SRC
* Thats it
And thats it for this file, control passes "back" to [[file:../initjj.org][initjj.org/el]]