wip
[dot-emacs] / my-init.org
1 #+TITLE: My Personal Init Customization
2 #+OPTIONS: toc:nil num:nil ^:nil
3 * copyright
4 # Copyright (C) 2016 Ian Kelling
5
6 # This program is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
10
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
19 * things that should be at the beginning
20 #+begin_src emacs-lisp
21 ;; todo, evaluating this manually disables debug on error instead of toggling it
22 ;(toggle-debug-on-error) ;uncomment to help debug and catch errors
23
24
25 #+end_src
26
27
28 packages installed from package manager: i pretty much prioritize repos this way: gnu, then melpa, then marmalade.
29
30 package-activated-list:
31 ac-dabbrev ac-haskell-process ack-and-a-half alect-themes auctex bash-completion bbdb csv-mode cyberpunk-theme dot-mode expand-region f find-file-in-project flycheck foreign-regexp ggtags ghc gnuplot-mode goto-chg haskell-mode heroku-theme highlight-indentation highlight-symbol htmlize inf-ruby info+ inkpot-theme jedi auto-complete jedi-core epc ctable concurrent key-chord leuven-theme logstash-conf magit git-commit magit-popup misc-fns mouse+ naquadah-theme nginx-mode occidental-theme org paredit pcsv php-mode pkg-info epl popup py-autopep8 python-environment deferred python-info python-mode rainbow-mode rust-mode rw-hunspell s smartparens smex smooth-scroll sr-speedbar strings swiper ivy tabulated-list tangotango-theme thingatpt+ undo-tree vimrc-mode volatile-highlights web-mode with-editor dash async ws-butler yasnippet
32
33 alternate keyboards
34 #+begin_src emacs-lisp
35 ;; todo, figure out an easy way to disable this when using external keyboard
36 (if (display-graphic-p)
37 (setq
38 enter-key (kbd "<return>")
39 s-enter-key (kbd "<S-return>")
40 c-m-enter-key (kbd "<C-M-return>")
41 m-enter (kbd "<M-return>")
42 c-enter (kbd "<C-return>"))
43 (setq
44 enter-key (kbd "C-m")
45 s-enter-key (kbd "C-8")
46 c-m-enter-key (kbd "C-M-8")
47 m-enter (kbd "M-m")
48 c-enter (kbd "C-8")))
49
50 (setq tp (string= (system-name) "tp"))
51 (setq x200 (string= (system-name) "x2"))
52 (setq laptop-keyboard (or tp x200))
53 #+end_src
54
55 - Ubiquitous Packages which should be loaded on startup rather than
56 autoloaded on demand since they are likely to be used in every
57 session.
58 #+name: starter-kit-load-on-startup
59 #+begin_src emacs-lisp
60 (require 'saveplace)
61 (require 'ffap)
62 (require 'uniquify)
63 (require 'ansi-color)
64 (require 'recentf)
65
66 #+end_src
67
68
69 - Better to have a list of packages in here vs installed manually.
70 However, I install manually because sometimes there are two
71 versions and it is not necessarily easy to reconcile that.
72 #+begin_src emacs-lisp
73 ;; based on marmalage website front page.
74 (require 'package)
75
76 ;; little kit to help remove a down server
77 ;; (setq package-archives nil)
78
79 (add-to-list 'package-archives
80 '("marmalade" .
81 "http://marmalade-repo.org/packages/"))
82
83 (add-to-list 'package-archives
84 '("melpa" . "http://melpa.milkbox.net/packages/") t)
85 (add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/") t)
86
87 ;; if this is a new machine/config, get package list
88 ;; not sure why we need it, but it is recommended in starter kit,
89 ;; and doesn't seem like a bad thing
90 (unless package-archive-contents (package-refresh-contents))
91
92 #+end_src
93
94
95 keep our init.el clean, by moving customization elisp to it's own file
96 #+name: m-x-customize-customizations
97 #+begin_src emacs-lisp
98 (setq custom-file "~/.emacs.d/custom.el")
99 (load custom-file 'noerror)
100 #+end_src
101
102 undo tree stuff
103 #+begin_src emacs-lisp
104 ;; more resilient undo-tree-history if we have their locations set up front.
105 (setq undo-tree-history-directory-alist '(("." . "~/.undo-tree-history")))
106 ;; Undo in region just happens accidentally, and throws me off, and it's been buggy in the past
107 (setq undo-tree-enable-undo-in-region nil)
108 #+end_src
109
110 * Stuff that I do not recommend that others use without reading,
111 understanding, and customizing themselves are
112
113 all mouse stuff disabled till i have time to figure it out again.
114 #+begin_src emacs-lisp :tangle no
115 (defun xterm-mouse-translate-1 (&optional extension)
116 (save-excursion
117 (let* ((event (xterm-mouse-event extension))
118 (ev-command (nth 0 event))
119 (ev-data (nth 1 event))
120 (ev-where (nth 1 ev-data))
121 (vec (vector event))
122 (is-down (string-match "down-" (symbol-name ev-command))))
123
124 (cond
125 ((null event) nil) ;Unknown/bogus byte sequence!
126 (is-down
127 (setf (terminal-parameter nil 'xterm-mouse-last-down) event)
128 vec)
129 (t
130 (let* ((down (terminal-parameter nil 'xterm-mouse-last-down))
131 (down-data (nth 1 down))
132 (down-where (nth 1 down-data)))
133 (setf (terminal-parameter nil 'xterm-mouse-last-down) nil)
134 (cond
135 ((null down)
136 ;; This is an "up-only" event. Pretend there was an up-event
137 ;; right before and keep the up-event for later.
138 (push event unread-command-events)
139 (vector (cons (intern (replace-regexp-in-string
140 "\\`\\([ACMHSs]-\\)*" "\\&down-"
141 (symbol-name ev-command) t))
142 (cdr event))))
143 ((equal ev-where down-where) vec)
144 (t
145 (let ((drag (if (symbolp ev-where)
146 0 ;FIXME: Why?!?
147 (list (intern (replace-regexp-in-string
148 "\\`\\([ACMHSs]-\\)*" "\\&drag-"
149 (symbol-name ev-command) t))
150 down-data ev-data))))
151 (if (null track-mouse)
152 (vector drag)
153 (push drag unread-command-events)
154 (vector (list 'mouse-movement ev-data))))))))))))
155
156 #+end_src
157 * how to find auto-saved files that need recovering
158 find a recently dated file in ~/.emacs.d/auto-save-list/, and see the files listed in it.
159 #file# is an auto-save file. It may or may not be different than the file is corresponds to.
160 If it is different, emacs will give a message about recovering it when you open it.
161
162
163
164 * TODO learn some more ivy mode stuff
165 * TODO declarative package installations,
166 with documentation.
167 * TODO shell mode reverse search hides 2nd+ line of multi-line result
168 * TODO report bug in latest emacs,
169 c-c ', does't exit org-mode src editing mode.
170 * TODO button for switching to scratch buffer
171 * TODO figure out browsing files with broken nfs mount
172 causes emacs to freeze until I kill -9 it.
173 * TODO make a keybind to print var under cursor
174 and actually, putting the start of it in th emodeline might be cool
175 * TODO fix undo tree files literering filesystem
176 * TODO c-<delete> in shell mode should send over
177 previous line if current line is empty
178 * TODO make c-m-s be just a control key for easier use
179 * TODO try out avy mode for laptop
180 i used to have ace jump mode, but google says avy is better.
181 * TODO bind a in group mode of gnus to c-u a,
182 also, make a default for number of articles
183 * TODO make auto-complete be on by default in sql-mode
184 * TODO make an easy bind for open previous buffer
185 * TODO i think my autosave for sudo-edit might be too fast
186 it sometimes leaves #_asdfjasdf files littered
187 * TODO readline-compleste doesn't work when you cat a file without a newline,
188 and so the prompt is messed up. not sure exactly what needs to be in end, or if its anything
189 * TODO figure out how to paste a path into find file
190 probably have to use the old kind of find file
191 * TODO readline-complete doesn't escape special chars in filenames
192 * TODO readline-complete dev
193
194
195
196 ** misc fixes
197
198 bad code, the comment this relates to was removed, but not the comment
199 /* If waiting for this channel, arrange to return as
200 soon as no more input to be processed. No more
201 waiting. */
202
203
204 (status_notify): New arg WAIT_PROC. this is unused, this is a bug.
205 The change in status_notify's return is just passing more information
206 from what it did already. No changes at all inside this function.
207
208 * TODO consider whether to bind indent-for-tab-command
209 I removed it from m-tab for terminal compatibility.
210 It's the default tab command, which yasnippet replaces.
211 * TODO readline-complete: remove the hardcoded rlc-no-readline-hook
212 * TODO isearch doesn't automatically wrap in info
213 * TODO look into fixing shell mode reverse search
214 and why auto-complete dies
215 caveat is that it doesn't work well with certain unusual prompts, for example if $/# is not used at the end
216 see if we can load history, or reverse search with history commands
217 * TODO keybinds for s-delete/tab etc
218 * TODO fix bbdb info packaging in melpa
219 * TODO figure out why my emacs startup script doesn't work from dmenu
220 * TODO post idea to make customize group show function var names so we can read doc strings
221 * TODO report/fix bug that kill-whole-line doesn't work right with append kill
222 * TODO make bash keybind for copy paste interoperate with x windows
223 * TODO fix org stderr redirection
224 make this produce output of "ok"
225 #+begin_src sh
226 echo ok >&2
227
228 #+end_src
229 * TODO make ido keybinds better
230 * TODO fix indenting in org
231
232 (defun my-org-indent-region (start end)
233 "Indent region."
234 (interactive "r")
235 (save-excursion
236 (let ((line-end (org-current-line end)))
237 (goto-char start)
238 (while (< (org-current-line) line-end)
239 (cond ((org-in-src-block-p) (org-babel-do-in-edit-buffer (indent-according-to-mode)))
240 (t (call-interactively 'org-indent-line)))
241 (move-beginning-of-line 2)))))
242
243
244
245 org-indent-region is broken for source blocks
246 the above function works, but has several problems.
247 first: it should not have separate logic from org-indent-line
248 second: it runs way too slow, mainly the command
249 (org-babel-do-in-edit-buffer (indent-according-to-mode)))
250
251
252 * TODO figure out newline in prompt shell issue
253 setting this before readline-complete is loaded allows completion to work,
254 but auto-completion still fails. Need to debug readline-complete to figure this out.
255 (setq shell-prompt-pattern "^[^#$%>]*[#$]\n")
256 * TODO setup bind for find tag / lisp function at point
257
258 * TODO org-delete-char should also work for the delete/backspace keys!
259 fix and send patch
260
261 * TODO checkout projectile / graphene's project settings
262
263 * TODO check up on recent changes to 3rd party default configs
264 - last checked apr 24
265 https://github.com/eschulte/emacs24-starter-kit/commits/master
266
267 last checked mayish
268 https://github.com/bbatsov/prelude
269 - redefined mouse functions from this file
270
271 * TODO figure out how to setup emacs to format text nicely like thunderbird
272 * TODO it appears impossible make C-[ not be the same as escape
273 * TODO movement within info buffer after opening a link doesn't cancel isearch
274 leads to many frustrations
275 * TODO fix org resolve clock message. it is innacurate
276 i is not the same, becuase it does not make org realize there is an active clock
277
278 * TODO add apropos commands to help prefix, from
279 http://stackoverflow.com/questions/3124844/what-are-your-favorite-global-key-bindings-in-emacs
280 * TODO my autosave goes into an endless prompting loop
281 when running save buffer, and the buffer has been changed
282 outside of emacs
283 * TODO smart peren does not see ?\\) as a valid paren
284
285 * TODO why does org-end-of-line not go all the way to the end on a closed headline?
286 * TODO org makes random ... things, and delete right before them does ctrl-i
287 * TODO try mark word, which might be a useful keybind
288 * TODO fix org-cycle: it assumes which key it is bound to for its last alternative
289 * TODO checkout lisp-complete-symbol to augment auto-complete
290 * TODO learn dired.
291 * TODO emacs keylogger to optimize key binds
292 * TODO remap/investigate find tag, find tag at point
293 * TODO set key to cycle buffers by mode, example below
294
295 (defun cycle-buffer-by-mode (p-mode)
296 "Cycle buffers by mode name"
297 (interactive)
298 (dolist (buffer (buffer-list))
299 (with-current-buffer buffer
300 (when (buffer-live-p buffer)
301 (if (string-match p-mode mode-name) ;(regexp-quote p-mode)
302 (setq switch2buffer buffer)))))
303 (when (boundp 'switch2buffer)
304 (switch-to-buffer switch2buffer)))
305
306 And I have bound this to my F9 key
307
308 (global-set-key [f9] '(lambda () (interactive) (cycle-buffer-by-mode "Shell$")))
309
310 * TODO test out usefulness of forward/back sexp in different languages
311
312 * TODO major mode settings to check out in future
313 ** emacs24 starter kit
314 - Nxhtml -- utilities for web development
315 [[http://ourcomments.org/Emacs/nXhtml/doc/nxhtml.html][Nxhtml]] is a large package of utilities for web development and for
316 embedding multiple major modes in a single buffer.
317
318 Nxhtml is not installed in this version of the starter-kit by default,
319 for information on installing nxhtml see [[http://www.emacswiki.org/emacs/NxhtmlMode][EmacsWiki-Nxhtml]].
320
321 web-mode is competing package and actively developed, so i'm using that instead
322
323
324 (dolist (package '(yaml-mode js2-mode))
325 (unless (package-installed-p package)
326
327 - Associate modes with file extensions
328
329 (add-to-list 'auto-mode-alist '("COMMIT_EDITMSG$" . diff-mode))
330 (add-to-list 'auto-mode-alist '("\\.css$" . css-mode))
331 (require 'yaml-mode)
332 (add-to-list 'auto-mode-alist '("\\.ya?ml$" . yaml-mode))
333 (add-to-list 'auto-mode-alist '("\\.rb$" . ruby-mode))
334 (add-to-list 'auto-mode-alist '("Rakefile$" . ruby-mode))
335 (add-to-list 'auto-mode-alist '("\\.js\\(on\\)?$" . js2-mode))
336 ;; (add-to-list 'auto-mode-alist '("\\.xml$" . nxml-mode))
337
338 - clojure in starter-kit-lisp.org
339
340 - others = gnus, js, publish, perl, python, perl, ruby
341 they each have their own starter kit file.
342
343 - snippets for various modes other than org-mode
344
345 * TODO update yasnippet documentation
346 yas expand key customization is rediculously hard to figure out
347 and completely undocumented
348 * TODO fix org source indenting, send patch
349 * TODO check out bundling aka compiling yasnippet
350 * TODO try xml/html mode url func
351
352 (defun view-url ()
353 "Open a new buffer containing the contents of URL."
354 (interactive)
355 (let* ((default (thing-at-point-url-at-point))
356 (url (read-from-minibfer "URL: " default)))
357 (switch-to-buffer (url-retrieve-synchronously url))
358 (rename-buffer url t)
359 ;; TODO: switch to nxml/nxhtml mode
360 (cond ((search-forward "<?xml" nil t) (xml-mode))
361 ((search-forward "<html" nil t) (html-mode)))))
362
363 * TODO flyspell-buffer automatically
364
365 * TODO respond to ediff thread
366 * TODO fix horizontal mouse resizing
367 resizing a window horizontally with the mouse should be allowed in more places
368
369 * TODO try using / making abbreviations
370
371 * abbreviations
372 #+begin_src emacs-lisp
373
374 ;; turn on abbrev mode globally
375 (setq-default abbrev-mode t)
376
377 #+end_src
378 default abbreviation mode file is .emacs.d/abbrev_defs.
379 add-global-abbrev, add-mode-abbrev for expansion at point
380 if all else fails, edit the abbrev file
381
382 * auto-complete
383
384 #+begin_src emacs-lisp
385 ;; auto-completion in minibuffer
386 ;; disabled while I look for another alternative
387 ;;(icomplete-mode)
388
389 (require 'auto-complete-config)
390 (ac-config-default)
391
392
393 ;; complete after 1 char instead of default 2
394 (setq ac-auto-start 1)
395 (setq ac-delay 0.001)
396
397 (add-to-list 'ac-modes 'org-mode 'sql-mode)
398
399 (defun ac-common-setup ()
400 (add-to-list 'ac-sources 'ac-source-yasnippet))
401
402 ;; for org mode completion source taken from wiki.
403 ;; it did not work. no idea why. todo, investigate
404 ;; the ac-sources code is at http://www.emacswiki.org/emacs/AutoCompleteSources
405 ;; i've deleted it here so as to save space and not spam this file
406 ;;(defun my-ac-org-mode ()
407 ;; (setq ac-sources (append ac-sources '(ac-source-org))))
408
409
410 ;; this makes the org-self-insert command not do a flyspell spell check.
411 ;; low priority thing to look into sometime
412 (ac-flyspell-workaround)
413
414
415 (define-key ac-completing-map (kbd "<up>") nil)
416 (define-key ac-completing-map (kbd "<down>") nil)
417 (define-key ac-completing-map (kbd "<S-return>") 'ac-expand)
418 (define-key ac-completing-map "\t" 'ac-complete)
419 (define-key ac-completing-map (kbd "<tab>") 'ac-complete)
420
421
422
423 #+end_src
424 * auto-complete readline-complete
425 #+begin_src emacs-lisp
426
427 (add-to-list 'load-path "~/.emacs.d/src/readline-complete")
428 (require 'readline-complete)
429 ;; not sure how I made these, but I deleted, and
430 ;; it would be nice to make them again sometime
431 ;;(require 'src-loaddefs)
432
433 ;; disabled cuz broken
434 ;; redefining function in readline-complete so ac-complete only uses readline as a source
435 (defun ac-rlc-setup-sources ()
436 "Add me to shell-mode-hook!"
437 (setq ac-sources '(ac-source-shell)))
438 (add-hook 'shell-mode-hook 'ac-rlc-setup-sources)
439
440 ;; generally unnecessary, but why not
441 (setq explicit-shell-file-name "bash")
442
443 ;; readline-complete says to add this line.
444 ;; however, it messes up my procfs directory tracking hook
445 ;; because get-process doesn't notice the child shell.
446 ;; instead, I've removed export EMACS=t from
447 ;; comint-exec-1 (the function which initially sets it)
448 ;; by finding it in emacs sources and redefinind it here
449 ;; and done stty echo in my bashrc
450 ;;(setq explicit-bash-args '("-c" "export EMACS=; stty echo; bash"))
451
452 (setenv "EMACS" "")
453 (setq explicit-bash-args nil)
454 (setq comint-process-echoes t)
455 ;; default of 30 is way too slow. todo, consider pushing this upstream
456 (setq rlc-attempts 5)
457
458 (add-to-list 'ac-modes 'shell-mode)
459
460 ;; readline-complete recommends this (i assume this format),
461 ;; but greping finds no reference in emacs or my .emacs.d
462 ;; so I'm assuming it is for an older emacs
463 ;;(setq explicit-ssh-args '("-t"))
464
465 (add-hook 'shell-mode-hook
466 (lambda ()
467 (define-key shell-mode-map (kbd "<tab>") 'auto-complete)))
468
469
470 #+end_src
471 #+RESULTS:
472 : comint-exec-1
473
474 ** readline complete fix
475
476 I need this function here, where INSIDE_EMACS is replaced with RLC_INSIDE_EMACS.
477 #+begin_src emacs-lisp
478 ;; ian: last update 2017-1-7. update this periodically from upstream
479 ;; like when we do a major emacs update
480 (defun comint-exec-1 (name buffer command switches)
481 (let ((process-environment
482 (nconc
483 ;; If using termcap, we specify `emacs' as the terminal type
484 ;; because that lets us specify a width.
485 ;; If using terminfo, we specify `dumb' because that is
486 ;; a defined terminal type. `emacs' is not a defined terminal type
487 ;; and there is no way for us to define it here.
488 ;; Some programs that use terminfo get very confused
489 ;; if TERM is not a valid terminal type.
490 ;; ;; There is similar code in compile.el.
491 (if (and (boundp 'system-uses-terminfo) system-uses-terminfo)
492 (list "TERM=dumb" "TERMCAP="
493 (format "COLUMNS=%d" (window-width)))
494 (list "TERM=emacs"
495 (format "TERMCAP=emacs:co#%d:tc=unknown:" (window-width))))
496 (list (format "RLC_INSIDE_EMACS=%s,comint" emacs-version))
497 process-environment))
498 (default-directory
499 (if (file-accessible-directory-p default-directory)
500 default-directory
501 "/"))
502 proc decoding encoding changed)
503 (let ((exec-path (if (and command (file-name-directory command))
504 ;; If the command has slashes, make sure we
505 ;; first look relative to the current directory.
506 (cons default-directory exec-path) exec-path)))
507 (setq proc (apply 'start-file-process name buffer command switches)))
508 ;; Some file name handler cannot start a process, fe ange-ftp.
509 (unless (processp proc) (error "No process started"))
510 (let ((coding-systems (process-coding-system proc)))
511 (setq decoding (car coding-systems)
512 encoding (cdr coding-systems)))
513 ;; Even if start-file-process left the coding system for encoding data
514 ;; sent from the process undecided, we had better use the same one
515 ;; as what we use for decoding. But, we should suppress EOL
516 ;; conversion.
517 (if (and decoding (not encoding))
518 (setq encoding (coding-system-change-eol-conversion decoding 'unix)
519 changed t))
520 (if changed
521 (set-process-coding-system proc decoding encoding))
522 proc))
523
524 #+end_src
525
526 * auto save & backup
527
528 there is a bug that when emacs has been running for a long time,
529 auto-save-timeout never happens simply by waiting.
530 doing something like an M-x function will trigger it.
531 Todo: report this bug.
532
533 #+begin_src emacs-lisp
534
535 ;; enable auto-save hook
536 (setq auto-save-timeout 1) ; idle time before auto-save.
537
538
539 ;; main hook for my auto save
540 (add-hook 'auto-save-hook 'my-auto-save)
541 ;; additional hook to try to deal with emacs not auto-saving when a buffer isn't active
542 (add-hook 'window-configuration-change-hook 'my-auto-save)
543
544
545 (defun my-auto-save ()
546 (if (and my-as (buffer-file-name) (buffer-modified-p))
547 (let (message-log-max)
548 ;; a bit of a hack to partially suppress the constant saving in the echo area
549 (with-temp-message ""
550 (basic-save-buffer)))))
551
552 (defun my-as-off ()
553 (interactive)
554 (setq my-as nil))
555
556 (defun my-as-on ()
557 (interactive)
558 (setq my-as t))
559
560 ;; based on suggestion in the emacs docs, redefine these 2 functions
561 ;; to avoid prompt spamming the user when we do auto-save
562 (defun ask-user-about-supersession-threat (fn)
563 (discard-input)
564 (message
565 "File for %s has changed on disk outside of emacs. Auto-save is overwriting it, however
566 a backup is being created in case that is not what you intended." buffer-file-name)
567 (setq buffer-backed-up nil))
568
569 (defadvice ask-user-about-lock (before lock-deactivate-as activate)
570 (make-local-variable 'my-as)
571 (setq my-as nil)
572 (message "proper autosave has been turned off for this buffer because of lock file problem.
573 In this buffer, do M-x my-as-on to reenable"))
574
575 ;; todo, this doesn't work consistently to override the auto-save message
576 (defalias 'do-auto-save-original (symbol-function 'do-auto-save))
577 (defun do-auto-save (&optional no-message current-only)
578 "This function has been modified to wrap the original so that NO-MESSAGE
579 is always set to t, since we auto-save a lot, it spams otherwise.
580 The original doc string is as follows:
581
582 Auto-save all buffers that need it.
583 This is all buffers that have auto-saving enabled
584 and are changed since last auto-saved.
585 Auto-saving writes the buffer into a file
586 so that your editing is not lost if the system crashes.
587 This file is not the file you visited; that changes only when you save.
588 Normally we run the normal hook `auto-save-hook' before saving.
589
590
591 A non-nil NO-MESSAGE argument means do not print any message if successful.
592 A non-nil CURRENT-ONLY argument means save only current buffer."
593 (interactive)
594 (do-auto-save-original t current-only))
595
596 ;; enable MY auto-save
597 (my-as-on)
598
599 #+end_src
600
601
602 backups, separate from auto-save
603
604 #+begin_src emacs-lisp
605
606 ;; set backup file location
607 (setq backup-directory-alist '(("." . "~/.editor-backups")))
608 (setq auto-save-file-name-transforms
609 '((".*" "~/.editor-backups/" t)))
610
611 (setq version-control t ;; Use version numbers for backups
612 kept-new-versions 100
613 kept-old-versions 2
614 delete-old-versions t ;; delete old versions silently
615 ;; assume hard linked files are done on purpose, don't screw them up
616 backup-by-copying-when-linked t)
617
618 ;; todo, the time needs to be an integer, not a vector type thing
619 (defun constant-backup ()
620 "Backup conditioned on some time passing since last one.
621 Hooked into 'before-save-hook."
622 (cl-flet ((b-time (minutes)
623 (< last-backup-time
624 (- (current-time) (* 60 minutes)))))
625 (when (or (not (boundp 'last-backup-time)) (and (< (buffer-size) 10000000) (b-time 5)) (b-time 30))
626 (setq buffer-backed-up nil)
627 (setq-local last-backup-time (current-time)))))
628
629 ;; make a backup on auto-save, because the backup feature is not
630 ;; utilized with my-auto-save, only normal interactive save.
631 ;; todo, enable when fixed
632 ;;(add-hook 'before-save-hook 'constant-backup)
633
634 (add-hook 'auto-save-hook 'auto-save-size-limit)
635
636 (defun auto-save-size-limit ()
637 (when (and (not backup-inhibited) (> (buffer-size) 2000000))
638 (message "Backups disabled for this buffer due to size > 2 megs")
639 (make-local-variable 'backup-inhibited)
640 (setq backup-inhibited t)))
641
642 #+end_src
643
644
645
646 background:
647 the faq suggests to auto-save using
648 (setq auto-save-visited-file-name t)
649 and to toggle auto-saving in the current buffer, type `M-x auto-save-mode'
650
651 however, this is buggy.
652 it leaves around lock files, which can be disabled with
653 (setq create-lockfiles nil)
654 but it is also buggy on other things that appear to hook onto file saving
655 so i created my own function, which originally had bugs,
656 but new emacs version fixed all that, yay!.
657
658
659 ; not using, but here for documentation,
660 ; alternate way to enable and specify how long between autosaves.
661 ; number of input events between autosave.
662 ; lowest bound of functionality is actually about 15 input events
663 ;(setq auto-save-interval
664 ** todo keep an eye out for why/when and fix the fact that normal auto-save files are being made soemtimes
665 they are #filename#
666 seems they are created
667
668 * bbdb
669 #+begin_src emacs-lisp
670 ;; based on bbdb manual
671 ;; also has instructions to initialize upon launching gnus, etc
672 ;; but I figure try this to make sure everything works all the time first
673 (require 'bbdb)
674 (bbdb-initialize 'message)
675
676 ;; recommended by gnus,
677 ;; but seems like it could be good to have set for other stuff
678 (setq user-full-name "Ian Kelling"
679 user-mail-address "ian@iankelling.org")
680 ;; general email setting? recommended by mu4e
681 (setq message-kill-buffer-on-exit t)
682
683
684 ;; based on emacs24-starter-kit
685 (setq bbdb-offer-save 'auto
686 bbdb-notice-auto-save-file t
687 bbdb-expand-mail-aliases t
688 bbdb-canonicalize-redundant-nets-p t
689 bbdb-complete-name-allow-cycling t)
690
691 ;; use d instead
692 (add-hook 'bbdb-mode-hook
693 (lambda () (define-key bbdb-mode-map (kbd "C-k") nil)))
694
695 (add-to-list 'load-path "~/.emacs.d/src/bbdb-csv-import")
696 (require 'bbdb-csv-import)
697 #+end_src
698
699 * bookmark settings
700 #+begin_src emacs-lisp
701 ; save bookmarks whenever they are changed instead of just when emacs quits
702 (setq bookmark-save-flag 1)
703 ; increase bookmark context size for better functionality
704 (setq bookmark-search-size 2000)
705 #+end_src
706 * c-like settings
707 #+begin_src emacs-lisp
708 ;; change last thing from gnu.
709 ;; notably this avoids brace indent after if, and 4 space indent
710 (setq c-default-style '((java-mode . "java")
711 (awk-mode . "awk")
712 (other . "stroustrup")))
713 ;; for emacs itself, use
714 ;; (setq c-default-style '((java-mode . "java")
715 ;; (awk-mode . "awk")
716 ;; (other . "gnu")))
717 ;; (setq-default c-basic-offset 2)
718 #+end_src
719 * color theme
720
721 A Theme builder is available at http://elpa.gnu.org/themes/ along with
722 a list of pre-built themes at http://elpa.gnu.org/themes/view.html and
723 themes are available through ELPA.
724
725
726 interesting light themes
727
728
729 #+begin_src emacs-lisp
730 (defun override-theme (arg)
731 (interactive)
732 (while custom-enabled-themes
733 (disable-theme (car custom-enabled-themes)))
734 (load-theme arg t))
735 (setq color-theme-is-global t)
736
737 (defun toggle-night ()
738 (interactive)
739 (if (equal (car custom-enabled-themes) 'naquadah)
740 (override-theme 'leuven)
741 (override-theme 'naquadah)))
742
743
744 (override-theme 'leuven) ;; org mode features, with monitor darkened. part of org-mode i think
745
746
747
748 ;; disable color thing with this:
749 ;;(disable-theme (car custom-enabled-themes))
750
751 ;; decent dark themes
752
753 ;;(override-theme 'tangotango)
754 ;;(override-theme 'deeper-blue)
755 ;;(override-theme 'tango-dark)
756 ;;(override-theme 'tsdh-dark)
757
758 ;;(override-theme 'heroku)
759 ;;(override-theme 'inkpot) ;; part of inkpot-theme package
760 ;;(override-theme 'naquadah) ; org mode features, part of naquadah-theme package
761 ;;(override-theme 'spolsky) ;; part of sublime-themes package
762 ;;(override-theme 'twilight-anti-bright) ;; from twilight-anti-bright-theme package
763
764 ;; interesting but not usable colors
765 ;;(override-theme 'cyberpunk) ; cool org mode features, from cyberpunk-theme package
766 ;;(override-theme 'wombat) ; cursor not visible enough. from a wombat package, not sure which
767 ;;(override-theme 'misterioso) ; cursor not visible enough
768
769
770
771 ;;decent light themes
772 ;;(override-theme 'alect-light) ; theres a -alt version, don't see a dif. could use this without dimming. from alect-something package
773 ;;(override-theme 'occidental) ; from occidental-theme package
774
775
776 ;;color-theme is deprecated in emacs 24.
777
778 ;; theme packages i tried then removed:
779 ;; ignored ones that didn't use the new theme engine
780
781 ;;66 packages (zenburn-theme-2.1, zen-and-art-theme-1.0.1, waher-theme-20130917.7, ujelly-theme-1.0.35, twilight-theme-1.0.0, twilight-bright-theme-20130605.143, twilight-anti-bright-theme-20120713.316, tronesque-theme-1.3, tron-theme-12, toxi-theme-0.1.0, tommyh-theme-1.2, tango-2-theme-1.0.0, sunny-day-theme-20131203.1250, sublime-themes-20140117.323, subatomic-theme-20131011.1048, soothe-theme-0.3.16, soft-morning-theme-20131211.1342, soft-charcoal-theme-20130924.1206, sea-before-storm-theme-0.3, purple-haze-theme-20130929.1751, phoenix-dark-pink-theme-20130905.941, phoenix-dark-mono-theme-20130306.1215, pastels-on-dark-theme-0.3, obsidian-theme-20130920.937, nzenburn-theme-20130513, noctilux-theme-20131019.31, mustang-theme-20130920.939, monokai-theme-0.0.10, molokai-theme-20130828.0, late-night-theme-0.0, jujube-theme-0.1, ir-black-theme-20130302.2355, gruvbox-theme-20131229.1458, gruber-darker-theme-0.6, grandshell-theme-20140118.1003, github-theme-0.0.3, gandalf-theme-0.1, flatland-theme-20131204.858, django-theme-20131022.202, deep-thought-theme-0.1.1, dakrone-theme-20131212.1159, colorsarenice-theme-20131128.1106, color-theme-wombat+-0.0.2, color-theme-wombat-0.0.1, color-theme-twilight-0.1, color-theme-tango-0.0.2, color-theme-solarized-20120301, color-theme-sanityinc-solarized-2.25, color-theme-railscasts-0.0.2, color-theme-monokai-0.0.5, color-theme-molokai-0.1, color-theme-ir-black-1.0.1, color-theme-heroku-1.0.0, color-theme-github-0.0.3, color-theme-eclipse-0.0.2, color-theme-dpaste-0.0.1, color-theme-dawn-night-1.0, color-theme-colorful-obsolescence-0.0.1, color-theme-cobalt-0.0.2, color-theme-20080305.34, clues-theme-20130908.801, busybee-theme-20130920.942, bubbleberry-theme-0.1.2, assemblage-theme-20130715.621, anti-zenburn-theme-20140104.1542, ample-zen-theme-0.2)
782
783
784
785 #+end_src
786
787 * yasnippet
788 cd ~/.emacs.d/src
789 git clone --recursive https://github.com/capitaomorte/yasnippet
790 touch snippets/.yas-make-groups
791
792 This all makes it so I can look through the default snippets
793 in the menu bar, but they don't show up elsewhere, because they are
794 mostly things I don't want.
795
796 #+begin_src emacs-lisp
797
798 (require 'yasnippet)
799 ;; this needs to be before yas-global-mode
800 (setq yas-snippet-dirs (list "~/.emacs.d/snippets"))
801 (yas-global-mode 1)
802
803 (setq
804 yas-also-auto-indent-first-line t
805 yas-choose-tables-first t
806 yas-use-menu (quote full)
807 ;; this sets ido-prompt as first function
808 yas-prompt-functions
809 '(yas-ido-prompt yas-dropdown-prompt yas-x-prompt yas-completing-prompt yas-no-prompt))
810
811 ;; todo, explore this option for wrapping region
812 ;; '(yas/wrap-around-region t))
813
814 #+end_src
815
816 #+RESULTS:
817 | yas-ido-prompt | yas-dropdown-prompt | yas-x-prompt | yas-completing-prompt | yas-no-prompt |
818
819 * cross session settings
820 #+begin_src emacs-lisp
821
822 ;; Save a list of recent files visited.
823 (recentf-mode 1)
824 (setq recentf-max-saved-items 200
825 recentf-max-menu-items 15)
826
827
828 (setq save-place t
829 save-place-version-control 'nospecial
830 save-place-limit 40000
831 save-place-file "~/.emacs.d/places")
832
833
834
835 ;; savehist keeps track of some history
836 ;; search entries
837 (setq savehist-additional-variables '(kill-ring search-ring regexp-search-ring)
838 ;; save every minute
839 savehist-autosave-interval 60
840 ;; keep the home clean
841 savehist-file "~/.emacs.d/.savehist")
842 (savehist-mode 1)
843
844 #+end_src
845
846 * ediff
847 #+begin_src emacs-lisp
848 ;; ediff-buffers is the main command to use
849
850 ;; ediff - don't start another frame for the control panel
851 ;; unfortunately, this doesn't allow me to use 2 frames for the diff buffers
852 ;; so disable this temporarily with the next line if you want that
853 ;; sometime I should setup 2 functions to explicitly do each type
854 (setq ediff-window-setup-function 'ediff-setup-windows-plain)
855 ;;(setq ediff-window-setup-function 'ediff-setup-windows-default)
856
857 ;; do side by side diffs
858 (setq ediff-split-window-function 'split-window-horizontally)
859
860
861 #+end_src
862
863
864
865 Things I tried which didn't work, which intuitively I think should work better: I can open the second diff buffer in a new frame, and close it's window in the first frame after starting ediff, but when I hit n to go to the next diff, it restores the window in the first frame. Another thing I tried is to open 2 new frames and set them up as I want. However, if I try to open the *Ediff Control Panel* buffer in a different window from its original one, my mouse jumps to one of the diff frames, or if that isn't visible, the buffer just hangs until I select the original ediff control panel window. This seems like a bug to me. I am using a very recent development version of emacs.
866
867 * dired
868 #+begin_src emacs-lisp
869
870 ;; dired - reuse current buffer by pressing 'a'
871 (put 'dired-find-alternate-file 'disabled nil)
872 #+end_src
873
874 * disabled but saved for documentation purposes
875 :PROPERTIES:
876 :header-args: :tangle no
877 :END:
878 ** indent settings for git's perl code
879 don't have a way to set this automatically or a good place to put this
880 #+begin_src emacs-lisp
881 (setq
882 perl-indent-level 8
883 perl-continued-statement-offset 8
884 perl-continued-brace-offset -8
885 perl-brace-offset 0
886 perl-brace-imaginary-offset 0
887 indent-tabs-mode t
888 )
889 #+end_src
890 ** org mode website
891
892 #+begin_src emacs-lisp
893 ;; use org-publish-current-project with a project file open
894 (setq org-publish-project-alist
895 '(("org"
896 :base-directory "/a/h/src"
897 :publishing-directory "/a/h/output"
898 :base-extension "org"
899 ;;:publishing-function org-org-publish-to-org
900 :publishing-function org-html-publish-to-html
901 :preserve-breaks t
902 :html-postamble "Everything here is <a rel=\"license\"
903 href=\"http://creativecommons.org/licenses/by-sa/4.0/\"><img
904 alt=\"Creative Commons License\" style=\"border-width:0\"
905 src=\"http://i.creativecommons.org/l/by-sa/4.0/80x15.png\" /></a>"
906 :html-head "<link rel=\"stylesheet\"
907 href=\"style.css\"
908 type=\"text/css\"/>"
909 :htmlized-source t)
910 ("othersrc"
911 :base-directory "/a/h/src"
912 :base-extension "css\\|el\\|"
913 :publishing-directory "/a/h/output"
914 :publishing-function org-publish-attachment)
915 ("other"
916 :base-directory "/a/h/other"
917 :base-extension ".*"
918 :publishing-directory "/a/h/output"
919 :publishing-function org-publish-attachment)))
920 ;; default is xhtml-strict. don't really care, but this is more common
921 (setq org-html-doctype "html4-strict")
922
923 ;; this is needed for worg
924 ;; todo: for my own site, I need to define the css in a separate file
925 ;; in order to use this setting. see the variable help for info
926 (setq org-export-htmlize-output-type t)
927
928
929 #+end_src
930
931 ** bash-completion
932 #+begin_src emacs-lisp
933 ;; this eventually gets set in
934 ;; comint-dynamic-complete-functions
935 ;; (car comint-dynamic-complete-functions)
936 (autoload 'bash-completion-dynamic-complete "bash-completion"
937 "BASH completion hook")
938 (add-hook 'shell-dynamic-complete-functions
939 'bash-completion-dynamic-complete)
940
941 ;; this appears useless, but was in the recommended init code
942 (add-hook 'shell-command-complete-functions
943 'bash-completion-dynamic-complete)
944
945 (defun ac-rlc-setup-sources ()
946 "Add me to shell-mode-hook!"
947 (setq ac-sources '(ac-source-shell)))
948 (add-hook 'shell-mode-hook 'ac-rlc-setup-sources)
949
950 #+end_src
951
952 ** misc stuff
953 It is an awesome mode for keyboard navigation.
954 However, using the mouse takes less thought and works as well
955
956 #+begin_src emacs-lisp
957
958
959 ;; whitespace-mode config. minimal for bad whitespace
960 ;(setq whitespace-line-column 80) ; for style of lines-tail, but I have it disabled
961 (setq whitespace-style '(face tabs empty trailing))
962 ;to enable whitespace mode
963 (whitespace-mode +1)
964
965
966
967 (defun org-set-mark-command (arg)
968 "Do set-mark-command and then org-show-context if the point
969 moves to invisible text."
970 (interactive "P")
971 (let ((initial-point (point)))
972 (setq this-command 'set-mark-command)
973 (set-mark-command (arg))
974 (if (and (not (= (point) initial-point))
975 (or (outline-invisible-p) (org-invisible-p2)))
976 (org-show-context 'mark-goto))))
977
978 (defun org-exchange-point-and-mark (&optional arg)
979 (interactive "P")
980 (let ((initial-point (point)))
981 (exchange-point-and-mark)
982 (if (and (not (= (point) initial-point))
983 (or (outline-invisible-p) (org-invisible-p2)))
984 (org-show-context 'mark-goto))))
985
986
987 (defun toggle-mode-line ()
988 "Toggle mode line on and off."
989 (interactive)
990 (if mode-line-format
991 (progn (setq my-saved-mode-line-format mode-line-format)
992 (setq mode-line-format nil))
993 (setq mode-line-format my-saved-mode-line-format))
994 (force-mode-line-update))
995 (toggle-mode-line)
996 (global-set-key (kbd "M-m") 'toggle-mode-line)
997 (add-hook 'after-change-major-mode-hook
998 (lambda () (setq my-saved-mode-line-format mode-line-format)
999 (setq mode-line-format nil)))
1000
1001
1002 #+end_src
1003
1004 ** Copy mode-line to the top
1005 #+begin_src emacs-lisp
1006 ;; Copy mode-line to the top
1007 (setq-default header-line-format mode-line-format
1008 mode-line-format nil)
1009 ;; copied the mode-line theme into the header theme, else it is unreadable
1010 ;; this goes after loading the theme
1011 (let ((class '((class color) (min-colors 89))))
1012 (custom-theme-set-faces
1013 'leuven
1014 `(header-line ((,class (:box (:line-width 1 :color "#1A2F54") :foreground "#85CEEB" :background "#335EA8"))))))
1015
1016 #+end_src
1017
1018 ** tab bindings for when I wanted to make tab be for search
1019 #+begin_src emacs-lisp
1020
1021 (define-key emacs-lisp-mode-map (kbd "<tab>") nil)
1022 (define-key button-buffer-map "\t" nil)
1023 (define-key button-buffer-map (kbd "f") 'forward-button)
1024 (define-key Info-mode-map "\t" nil)
1025 (define-key widget-keymap "\t" nil)
1026 (define-key widget-keymap (kbd "<tab>") nil)
1027
1028 (add-hook 'compilation-mode-hook (lambda ()
1029 (define-key compilation-mode-map (kbd "<tab>") nil)
1030 (define-key compilation-mode-map "\t" nil)))
1031
1032 ;; unbind c-i for yas. it already separately binds <tab>
1033 (add-hook 'yas-minor-mode-hook (lambda ()
1034 (define-key yas-minor-mode-map "\t" nil)))
1035
1036 (add-hook 'haskell-interactive-mode-hook
1037 (lambda ()
1038 (define-key haskell-interactive-mode-map "\t" nil)
1039 (define-key haskell-interactive-mode-map (kbd "<tab>") 'haskell-interactive-mode-tab)))
1040
1041 (define-key minibuffer-local-must-match-map "\t" nil)
1042 (define-key minibuffer-local-must-match-map (kbd "<tab>") 'minibuffer-complete)
1043 (define-key minibuffer-local-completion-map (kbd "<tab>") 'minibuffer-complete)
1044 (define-key minibuffer-local-completion-map "\t" 'minibuffer-complete)
1045
1046 (add-hook 'ido-setup-hook
1047 (lambda()
1048 (define-key ido-completion-map (kbd "<tab>") 'ido-complete)
1049 (define-key ido-completion-map "\t" nil)))
1050
1051 #+end_src
1052
1053 ** kill buffer and window
1054 #+begin_src emacs-lisp
1055 (defun kill-buffer-and-window ()
1056 "Close the current window and kill the buffer it's visiting."
1057 (interactive)
1058 (progn
1059 (kill-buffer)
1060 (delete-window)))
1061 #+end_src
1062 ** sending multiple commands to a comint buffer
1063 without waiting for commands to finish is unreliable.
1064 seems like 1 in 100 times, an invisible command to restore prompt didn't work
1065 #+begin_src emacs-lisp
1066 (setq shell-unset-prompt "unset PROMPT_COMMAND; unset PS1")
1067 (setq shell-set-prompt "PROMPT_COMMAND=prompt_command")
1068
1069 (if (boundp 'shell-unset-prompt)
1070 (send-invisible-string proc shell-unset-prompt))
1071 (if (boundp 'shell-set-prompt)
1072 (send-invisible-string proc shell-set-prompt))
1073
1074
1075 (defun send-invisible-string (proc string)
1076 "Like send-invisible, but non-interactive"
1077 (comint-snapshot-last-prompt)
1078 (funcall comint-input-sender proc string))
1079
1080 #+end_src
1081
1082
1083
1084 ** mu4e
1085
1086 alsot tried notmuch, it had some glitches, and it's config
1087 has a list of folders which i'd rather not publish, so it's config is archived.
1088
1089 #+begin_src emacs-lisp
1090 (add-to-list 'load-path "/usr/local/share/emacs/site-lisp/mu4e")
1091 (require 'mu4e)
1092 (setq send-mail-function (quote sendmail-send-it) ;; common to gnus also
1093 mu4e-sent-folder "/Sent Items"
1094 mu4e-drafts-folder "/Drafts"
1095 mu4e-trash-folder "/Trash"
1096 mu4e-refile-folder "/Archive"
1097 mu4e-get-mail-command "offlineimap"
1098 mu4e-update-interval 60
1099 mu4e-sent-messages-behavior 'delete
1100 mu4e-use-fancy-chars t
1101 mu4e-confirm-quit nil
1102 mu4e-headers-leave-behavior 'apply ;; dont ask
1103 mu4e-headers-fields (delq (assoc :mailing-list mu4e-headers-fields) mu4e-headers-fields)
1104 ;; a bit faster than the default 500
1105 mu4e-headers-results-limit 80)
1106
1107 (define-key mu4e-headers-mode-map (kbd "<return>") 'mu4e-headers-view-message)
1108
1109 (defun my-mu4e-to ()
1110 "inspired by mu4e info manual"
1111 (--reduce-from (if (mu4e-message-contact-field-matches
1112 mu4e-compose-parent-message :to (cadr it))
1113 (concat (car it) (cadr it))
1114 acc)
1115 '("Ian Kelling <ian@iankelling.org")
1116 ;;'(("Ian Kelling " "<alternate1@example.com>")
1117 ;; ("Ian Kelling " "<alternate2@example.com>"))
1118 ))
1119
1120 (add-hook 'mu4e-compose-pre-hook 'my-mu4e-to)
1121
1122 (add-to-list 'mu4e-view-actions
1123 '("ViewInBrowser" . mu4e-action-view-in-browser) t)
1124 (setq mu4e-maildir-shortcuts
1125 '( ("/INBOX" . ?i)
1126 ("/bog" . ?b)
1127 ("/Drafts" . ?d)))
1128
1129 #+end_src
1130
1131
1132
1133
1134 ** org-mode auto-complete source
1135
1136 todo, someday take a look at this. it is broken.
1137
1138 ;(defvar ac-source-eshell-pcomplete
1139 ; '((candidates . (pcomplete-completions))))
1140 ;(defun ac-complete-eshell-pcomplete ()
1141 ; (interactive)
1142 ; (auto-complete '(ac-source-eshell-pcomplete)))
1143
1144 ;(add-hook 'org-mode-hook (lambda () (setq ac-sources (cons 'ac-source-eshell-pcomplete ac-sources))))
1145 ;(add-to-list 'ac-modes 'eshell-mode)
1146
1147
1148 ** gnus nice unicode
1149
1150
1151 this looks nice, but it lags gnus just a bit
1152 #+begin_src emacs-lisp
1153
1154 (defun gnus-pretty-chars-setup ()
1155 (when window-system
1156 (setq gnus-sum-thread-tree-indent " "
1157 gnus-sum-thread-tree-root "● "
1158 gnus-sum-thread-tree-false-root "◯ "
1159 gnus-sum-thread-tree-single-indent "◎ "
1160 gnus-sum-thread-tree-leaf-with-other "├─► "
1161 gnus-sum-thread-tree-vertical "│"
1162 gnus-sum-thread-tree-single-leaf "╰─► ")))
1163 ;; dunno why, but this didn't work just setting on startup
1164 (add-hook 'gnus-startup-hook 'gnus-pretty-chars-setup)
1165
1166 #+end_src
1167
1168 ** misc
1169 #+begin_src emacs-lisp
1170
1171 ; todo, is this require things necessary?
1172 ; (require 'flyspell)
1173
1174
1175
1176 ; whenever M-tab is completion, swap it with tab
1177 ;(define-key emacs-lisp-mode-map (kbd "<tab>") 'completion-at-point)
1178 ;(define-key emacs-lisp-mode-map (kbd "C-M-i") 'indent-for-tab-command)
1179 ;(define-key lisp-interaction-mode-map (kbd "<tab>") 'completion-at-point)
1180 ;(define-key lisp-interaction-mode-map (kbd "C-M-i") 'indent-for-tab-command)
1181 ;the global tab keyind. for some reason this totally screws up mini-buffer tab.
1182 ; disabled until I actually find myself using this, and find a fix for the above problem
1183 ;(global-set-key (kbd "<tab>") 'complete-symbol)
1184
1185
1186 ; todo, make my custom overlays have an underline if they are
1187 ; overriding a paren matching overlay
1188 ; make right click set the mark
1189 ; make search tab do completion instead of meta-tab
1190 ; in isearch, move C-y to C-v
1191 ; in isearch, move c-s to c-f
1192
1193 ; some testing to figure out the underlining when paren highlight conflicts
1194 ; (let ((extra-overlays (overlays-at (1+ end-point))))
1195 ; (when extra-overlays (print extra-overlays)))
1196
1197
1198
1199
1200 ; commented out because it messes up yank-pop.
1201 ; todo, fix it someday
1202 ; make yank linewise if it ends in a newline
1203 ;(defadvice yank (before linewise-yank-advice activate)
1204 ; (let ((arg (ad-get-arg 0)))
1205 ; (when (string-match "\n[ \t]*$" (current-kill (cond
1206 ;; ((listp arg) 0)
1207 ;; ((eq arg '-) -2)
1208 ;; (t (1- arg))) t))
1209 ;; (move-beginning-of-line nil))))
1210
1211
1212
1213 ; todo, look into augmenting auto-complete with hippie expand.
1214 ; starter kit has some hippie expand settings to look into:
1215 ; (when (boundp 'hippie-expand-try-functions-list)
1216 ; (delete 'try-expand-line hippie-expand-try-functions-list)
1217 ; (delete 'try-expand-list hippie-expand-try-functions-list))
1218
1219
1220 ;; hippie expand is dabbrev expand on steroids
1221 ;(setq hippie-expand-try-functions-list '(try-expand-dabbrev
1222 ; try-expand-dabbrev-all-buffers
1223 ; try-expand-dabbrev-from-kill
1224 ; try-complete-file-name-partially
1225 ; try-complete-file-name
1226 ; try-expand-all-abbrevs
1227 ; try-expand-list
1228 ; try-expand-line
1229 ; try-complete-lisp-symbol-partially
1230 ; try-complete-lisp-symbol))
1231 ;; use hippie-expand instead of dabbrev
1232 ;(global-set-key (kbd "M-/") 'hippie-expand)
1233
1234
1235 ; commented because i haven't had time to check it out yet
1236 ;; shorter aliases for ack-and-a-half commands
1237 ;(defalias 'ack 'ack-and-a-half)
1238 ;(defalias 'ack-same 'ack-and-a-half-same)
1239 ;(defalias 'ack-find-file 'ack-and-a-half-find-file)
1240 ;(defalias 'ack-find-file-same 'ack-and-a-half-find-file-same)
1241
1242
1243
1244
1245 ; todo. take a look at fixing this
1246 ;delete-old-versions t ; fix description in http://www.emacswiki.org/emacs/ForceBackups
1247
1248
1249
1250
1251 ;; prelude uses paredit mode.
1252 ;; paredit has some useful stuff but also annoying stuff.
1253 ;; if I ever do a ton of lisp coding, I should look into it
1254
1255
1256
1257
1258
1259
1260 ; random notes and example code
1261
1262
1263 ; usefull thing
1264 ;(map 'list #'list tabSwapKeys (reverse (getBinds tabSwapKeys)))
1265
1266 ; example of getting keymap info
1267 ;(car (car (minor-mode-key-binding (kbd "C-/") t)))
1268 ;(cdr (car (minor-mode-key-binding (kbd "C-/") t)))
1269 ;(global-key-binding (kbd "C-M-i") t)
1270 ;(minor-mode-key-binding (kbd "<tab>") t)
1271 ;(local-key-binding (kbd "C-M-i") t)
1272 ;(current-minor-mode-maps)
1273 ;(cdr (assq 'undo-tree-mode minor-mode-map-alist))
1274
1275
1276 ; center on incremental search, instead of being at top or bottom of screen.
1277 ; i'm hoping that setting Isearch Allow Scroll is good enough to fix this annoyance
1278 ;from http://stackoverflow.com/questions/11052678/emacs-combine-iseach-forward-and-recenter-top-bottom
1279
1280 ;example of constant definition of an overlay and propreries
1281 ;(defface mouse-flash-position '((t (:background "Yellow")))
1282 ; "*Face used to highlight mouse position temporarily."
1283 ; :group 'mouse)
1284 ;(defface mouse-flash-position '((t (:background "Yellow")))
1285 ; "*Face used to highlight mouse position temporarily."
1286 ; :group 'mouse)
1287 ;(defconst mouse-flash-posn-overlay
1288 ; ;; Create and immediately delete, to get "overlay in no buffer".
1289 ; (let ((ol (make-overlay (point-min) (point-max))))
1290 ; ;(delete-overlay ol)
1291 ; ;(overlay-put ol 'face 'mouse-flash-position)
1292 ; (overlay-put ol 'mouse-face 'mouse-flash-position)
1293 ; (overlay-put ol 'priority 1000000)
1294 ; ol)
1295 ; "Overlay to highlight current mouse position.")
1296
1297
1298 ;tip, put the last interactive command as elisp on the kill ring:
1299 ;C-x <ESC> <ESC> C-a C-k C-g
1300
1301 ; example of overlay testing
1302 ;(setq foo (make-overlay 2 3 nil t nil))
1303 ;(setq foo2 (make-overlay 3 4 nil t nil))
1304 ;(overlay-put foo 'face '(:background "red3" :foreground "black"))
1305 ;(overlay-put foo2 'face '(:background "red1" :foreground "black"))
1306 ;(overlay-put foo 'face 'visible-mark-face)
1307 ;(overlay-put foo 'face visible-mark-face2)
1308
1309
1310 #+end_src
1311
1312
1313 ** SQL
1314
1315 disabled, as I haven't used it in a long time. I think it was good for learning some sql stuff.
1316 #+begin_src emacs-lisp :tangle no
1317 (require 'sqlup-mode)
1318 (add-hook 'sql-mode-hook 'sqlup-mode)
1319 (add-hook 'sql-interactive-mode-hook 'sqlup-mode)
1320
1321 (setq sql-product 'postgres)
1322 #+end_src
1323
1324
1325 ** icomplete
1326 #+begin_src emacs-lisp
1327 ;; without this, on partial completion return would exit the minibuffer, and i had to
1328 ;; keep typing out letters do a full completion before pressing enter.
1329 ;; super annoying. So I picked ctrl-j as a free key to put exit,
1330 ;; but in practice, I would just use ctrl-g to quit. Anyways,
1331 ;; ivy is doing all the minibuffer stuff, so removed this as it's
1332 ;; unused, so it can't cause any problems in future
1333 (when (boundp 'icomplete-minibuffer-map)
1334 (define-key icomplete-minibuffer-map (kbd "C-j") 'exit-minibuffer)
1335 (define-key icomplete-minibuffer-map (kbd "<return>")
1336 'minibuffer-force-complete-and-exit))
1337
1338
1339 #+end_src
1340 * elisp settings
1341 #+begin_src emacs-lisp
1342 ; when manually evaluating lisp, go into debugger on error
1343 (setq eval-expression-debug-on-error t)
1344 ;reminder of useful var: debug-on-error
1345 #+end_src
1346
1347
1348
1349
1350
1351 * gnus
1352
1353 good info http://www.emacswiki.org/emacs/GnusTutorial
1354 good info http://www.emacs.uniyar.ac.ru/doc/em24h/emacs183.htm
1355
1356 searching / accessing old mailing list messages:
1357 http://wiki.list.org/display/DOC/How+do+I+make+the+archives+searchable
1358 3 options suggested. nabble is very good, and you can even reply directly from their web interface with your own email
1359 address.
1360 google with site:example.com/archive works
1361 However, it has the downside of relying on a 3rd party running unreleased software.
1362 mail-archive.com and gmane.org search do not work.
1363
1364 Some lists mirror to a newsgroup via gmane, and then mirror the newsgroup via a google group, which has good search
1365 ability, and you can post via the newsgroup.
1366
1367 Downsides of nabble/google. Doesn't integrate with normal email programs, and lock in. They store and show you what you
1368 have and haven't read, what messages you've sent, etc. migrating that data to a normal mail program is undocumented and
1369 unsupported.
1370
1371 mailmans normal public archives are a bit obfuscated, but there is also a "private" archive, available to subscribers,
1372 which is not obfuscated, and can be easily imported to your local email program.
1373 you have to sub and log in to the web interfact to access it, and then the url is unpublished, but follows a format,
1374 which is documented in a few places around the web like
1375 https://mail.python.org/pipermail/mailman-users/2005-September/046757.html
1376 its form is:
1377 https://lists.fedorahosted.org/mailman/private/hyperkitty-devel.mbox/hyperkitty-devel.mbox
1378 http://www.example.com/mailman/private/<listname>.mbox/<listname>.mbox
1379 if you copy the url after logging in, and pass it to this function, it will print the transformed url
1380 lurl() { local x="${1#*/options/}"; x="${x%%/*}.mbox"; echo "${1%/mailman/*}/mailman/private/$x/$x"; }
1381
1382 Then you can download that url. Actually downloading the url is something firefox doesn't make the easiest out of the box.
1383 Here are some options:
1384 - paste in the url bar, the save the page
1385 as a file after it loads.
1386 - use downthemall extension or similar and paste the url in it.
1387 - put it in an html page as
1388 a link (or a small javascript program which will display input as a link), then right click and save as.
1389 wget won't work because you need to have (i assume) the authorization cookie mailman gives your browser
1390
1391 people have written various tools to de-obfuscate the normal public archives and sometimes import them to a mail
1392 program. It seems they were not aware of the private archive. However, these tools are probably still useful to automate
1393 things. None of them has a lot of usage, so I decided it was not worth the risk of hitting bugs vs doing a few extra clicks.
1394
1395 this was the most interesting one I found within a few minutes of googling.
1396 https://github.com/wcdolphin/mailman-downloader
1397
1398 Once you have an mbox file, there are rather straightforward ways to get it into any mail program, but I will cover
1399 gnus, which I use and is a bit tricky.
1400
1401 gnus has a native search (limited, too slow for body text searches), and external search engine integration.
1402 gnus manual recommends converting to maildir for searching local mail, but importing lots of maildir messages to gnus
1403 takes 10+ minutes, so scratch that option. it suggests 2 alternate options
1404 mairix. for mbox, it doesn't integrate 100% with gnus, it copies the search results to a mbox
1405 and tells gnus to make a group of that mbox and display it. This means the read state won't be persistent, but otherwise
1406 works great.
1407
1408 local imap server which will use the mbox and provide search.
1409 dovecot is modular, theres a dovecot-common which uses recommends to install i guess it's most used modules. Its
1410 description is completely not useful. Anyways, I'm not sure if there is any benefit to installing this over just the
1411 module we need.
1412 pi dovecot-imapd
1413
1414 dovecot by default also makes a an inbox folder based on the normal local mail location /var/mail/<username>
1415 those locations are adjustable and well documented via the var mail_location in
1416 /etc/dovecot/conf.d/10-mail.conf
1417 I forward my local mail, didn't see immediately how to turn off the inbox, but it will always be empty, so I left as
1418 is. you could make the var be empty, which apparently has the same effect.
1419
1420 Originally just linked the default location ~/.mail, but I changed to altering the config since ~/.mail since it seems
1421 other things like postfix use that location
1422
1423 based on http://roland.entierement.nu/blog/2010/09/08/gnus-dovecot-offlineimap-search-a-howto.html
1424 other links that poped up contained outdated, innacurate information
1425 http://sachachua.com/blog/2008/05/geek-how-to-use-offlineimap-and-the-dovecot-mail-server-to-read-your-gmail-in-emacs-efficiently/
1426 http://www.emacswiki.org/emacs/JamesFerguson
1427 http://www.sanityinc.com/articles/read-mailing-lists-in-emacs-over-imap/
1428
1429 Within emacs you can move messages between mbox and maildir etc, which is a nice flexibility.
1430
1431
1432
1433 doc group for mbox:
1434 in gnus, do gnus-group-make-doc-group (G f in groups buffer) and point to the file
1435
1436 info about groups created within gnus is stored in ~/.newsrc.eld
1437 also stored is a duplication of what email messages are read/unread,
1438 what newsgroups are subsribed to and read/unread,
1439 probably more stuff, everything that gnus saves.
1440
1441
1442 searching the body of the messages, i cut off after a few minutes.
1443 i can grep the file in just a couple seconds
1444
1445
1446 random side note
1447 we can also get mbox from gmane
1448 http://notmuchmail.org/howto/#index7h2
1449
1450
1451 gnus can't search mboxes except with its builtin search which is extremely slow. mairix can do mbox files from the command
1452 line, but not from within gnus, but from mairix.el, which can then open the results in gnus
1453
1454 mbox can be converted to maildir easily, but gnus loads lots of maildir messages extremely slow. it parses all the
1455 headers and generates a nov file for each.
1456
1457 nnfolder-generate-active-file
1458
1459 to reset things, when changing mail group. I duno all the proper way, but it works to delete
1460 ~/Mail ~/.newsrc.eld ~/.dribble (or something)
1461
1462
1463 ** mail sources vs select methods background
1464 I found this very confusing when first reading through the manual. "mail sources" is a term that does not simply mean
1465 sources of mail, it is much narrower for gnus. sources of mail can be either "mail sources" or select methods. Mail
1466 sources will move mail to ~/Mail (not sure what format), and split it into groups according to variables. You can use
1467 "mail sources" for maildir / imap, but those can also be read via select methods, which do not move the mail from their
1468 location, but use them in their native format. This is what I want to do, and I can simply ignore mail
1469 sources. Confusing terminology is that "fetching mail" "scanning mail", lots of things mail doesn't mean all mail, it
1470 means specifically from "mail sources". The words "articles" and "news" is used in connection with select methods, aka my actual mail.
1471
1472
1473
1474 ** caching background
1475
1476 caching:
1477 there is also ~/News/cache, filled with a bunch of articles, like 300 megs. can't figure out why.
1478 Grepped for caching in the manual, found 2 main things.
1479 cache is for 2 purposes. to cache locally, and to keep articles from expiring, called persistence
1480 gnus-use-cache, which puts things if they are
1481 gnus-cache-enter-articles
1482 things go in cache when they are marked certain ways by default, ticked and dormant
1483 and read articles are moved out of the cache
1484 still no idea why i have a bunch in the cache, but I set a var so that my mail won't get cached
1485 I'm gonna delete the cache, and check on it later see what exactly is going in there
1486 And of course, I moved ~/News to my encrypted drive and symlinked it
1487
1488
1489 * haskell
1490 :LOGBOOK:
1491 :END:
1492
1493 useful comint-shell mode commands. If not prefaced with *, it means it is not in the haskell custom repl
1494 *todo: setup haskell c-t toggle arrow keys
1495 tab completion
1496 C-q insert prev arg
1497 C-( history search
1498 c-m-left/right move to next/prev prompts
1499 *c-enter, multi-line input
1500 *s-delete, send input across windows. (i can implement this)
1501 *c-m-l clear screen
1502 *haskell-process-interrupt, c-cc terminate job (i can implement this maybe)
1503
1504 nice bash/readline functions missing in comint:
1505 yank-nth-arg
1506 operate-get-next
1507 menu-complete
1508
1509 usefull comint commands:
1510 c-cl : list historic command in temp buffer
1511 C-c C-o comint-delete-output
1512 comint-restore-input, todo: put this on a randomish c-c key
1513
1514
1515
1516 todo:
1517 checkout haskell repl functions:
1518 c-cv haskell-check, hlint
1519 C-M-q prog-indent-sexp
1520 c-c. haskell-mode-format-imports
1521 C-c M-/ haskell-doc-check-active
1522 haskell-process-generate-tags
1523 haskell-process-cabal-build
1524 haskell-cabal-command.. or something
1525 haskell-process-restart
1526 C-h v haskell-process-log
1527 C-h v haskell-process-show-debug-tips
1528
1529 various not immediately useful functions:
1530 haskell-process-add-dependency
1531 haskell-process-touch-buffer
1532 haskell-process-cd
1533 haskell-process-unignore
1534 haskell-process-reload-devel-main
1535
1536
1537 rebind
1538 home: C-a haskell-interactive-mode-beginning
1539 c-return: C-j haskell-interactive-mode-newline-indent
1540 up/down: <C-down> haskell-interactive-mode-history-next
1541
1542 todo haskell mode better binds for:
1543 'haskell-process-load-file
1544 'haskell-process-do-type
1545 'haskell-process-do-info
1546 'inferior-haskell-send-decl
1547
1548
1549 commands which don't work in haskell-interactive-mode(hi) vs inferior-haskell-mode(ih, default)
1550 functions not in hi:
1551 inferior-haskell-find-definition, use tags instead
1552 inferior-haskell-find-haddock, todo, test if this works
1553
1554 redefined ih to hi
1555 switch-to-haskell -> 'haskell-interactive-switch
1556 haskell-process-load-file -> inferior-haskell-load-file
1557 haskell-process-do-type -> inferior-haskell-type
1558 switch-to-haskell -> haskell-interactive-switch
1559 inferior-haskell-load-file -> 'haskell-process-load-file
1560
1561
1562 haskell-mode installation from source, based on its readme
1563 in the git directory,
1564 make all
1565
1566 #+begin_src emacs-lisp
1567
1568
1569
1570 ;; remove default option to not link the file
1571 (setq haskell-compile-command "ghc -Wall -ferror-spans -fforce-recomp %s")
1572 (add-hook 'haskell-indentation-mode-hook
1573 (lambda ()
1574 (define-key haskell-indentation-mode-map [?\C-d] nil)
1575 (define-key haskell-indentation-mode-map
1576 (kbd "<deletechar>")
1577 'haskell-indentation-delete-char)))
1578
1579 ;;copied from haskell-mode docs in order to use the new, better, nondefault
1580 ;;interactive mode.
1581 (eval-after-load "haskell-mode"
1582 '(progn
1583 (define-key haskell-mode-map (kbd "C-x C-d") nil)
1584 (define-key haskell-mode-map (kbd "C-c C-z") 'haskell-interactive-switch)
1585 (define-key haskell-mode-map (kbd "C-c C-l") 'haskell-process-load-file)
1586 (define-key haskell-mode-map (kbd "C-c C-b") 'haskell-interactive-switch)
1587 (define-key haskell-mode-map (kbd "C-c C-t") 'haskell-process-do-type)
1588 (define-key haskell-mode-map (kbd "C-c C-i") 'haskell-process-do-info)
1589 (define-key haskell-mode-map (kbd "C-c M-.") nil)
1590 (define-key haskell-mode-map (kbd "C-c C-d") nil)))
1591
1592 ;; ghc-mod install http://www.mew.org/~kazu/proj/ghc-mod/en/emacs.html
1593 ;; todo, try this out
1594 ;; (autoload 'ghc-init "ghc" nil t)
1595 ;;(add-hook 'haskell-mode-hook (lambda () (ghc-init) (flymake-mode)))
1596
1597
1598
1599 (add-to-list 'load-path "~/.emacs.d/src/ghci-completion")
1600 ;; from the package readme for ghci-completion
1601 (require 'ghci-completion)
1602 (add-hook 'inferior-haskell-mode-hook 'turn-on-ghci-completion)
1603
1604
1605 ;; disable some rebinds. they are set to appropriate keys in the keybinds section
1606 (eval-after-load "haskell-mode"
1607 '(progn
1608 (define-key haskell-mode-map (kbd "C-a") 'nil)
1609 (define-key haskell-mode-map (kbd "C-j") 'nil)))
1610
1611 (defun pretty-lambdas-haskell ()
1612 (font-lock-add-keywords
1613 nil `((,(concat "(?\\(" (regexp-quote "\\") "\\)")
1614 (0 (progn (compose-region (match-beginning 1) (match-end 1)
1615 ,(make-char 'greek-iso8859-7 107))
1616 nil))))))
1617 ;; from haskell-mode manual
1618 (add-hook 'haskell-mode-hook 'turn-on-haskell-decl-scan)
1619 (when (window-system)
1620 (add-hook 'haskell-mode-hook 'pretty-lambdas-haskell))
1621
1622 ;; added from haskell-mode website install instructions
1623 ;(load "/usr/share/emacs/site-lisp/haskell-mode/haskell-site-file")
1624 (add-hook 'haskell-mode-hook 'turn-on-haskell-doc-mode)
1625 ;;the three indentation modules are mutually exclusive - add at most one. Trying out the "most advanced"
1626 (add-hook 'haskell-mode-hook 'turn-on-haskell-indentation)
1627 ;;(add-hook 'haskell-mode-hook 'turn-on-haskell-indent)
1628 ;;(add-hook 'haskell-mode-hook 'turn-on-haskell-simple-indent)
1629
1630
1631 ;; todo, set this to some other key
1632 ;; (local-set-key (kbd "C-e") 'my-haskell-load-and-run)
1633
1634 (defun my-haskell-load-and-run ()
1635 "Loads and runs the current Haskell file."
1636 (interactive)
1637 (let ((start-buffer (current-buffer)))
1638 (inferior-haskell-load-and-run inferior-haskell-run-command)
1639 (sleep-for 0 100)
1640 (end-of-buffer)
1641 (pop-to-buffer start-buffer)))
1642
1643 ;; show haskell function in mode line
1644 ;; todo, this broke after updating emacs
1645 ;;(eval-after-load "which-func"
1646 ;; '(add-to-list 'which-func-modes 'haskell-mode))
1647
1648
1649
1650 (add-hook 'interactive-haskell-mode-hook 'ac-haskell-process-setup)
1651 (add-hook 'haskell-interactive-mode-hook 'ac-haskell-process-setup)
1652 (eval-after-load "auto-complete"
1653 '(add-to-list 'ac-modes 'haskell-interactive-mode))
1654
1655 (add-hook 'haskell-mode-hook
1656 (lambda () (define-key haskell-mode-map (kbd "C-(")
1657 (lambda () (interactive)
1658 (basic-save-buffer)
1659 (haskell-compile)
1660 (run-with-timer .3 nil 'repeat-shell)))))
1661 (add-hook 'haskell-cabal-mode-hook
1662 (lambda () (define-key haskell-cabal-mode-map (kbd "C-(") 'haskell-compile)))
1663
1664
1665
1666 (add-hook 'haskell-interactive-mode-hook
1667 (lambda ()
1668 (define-key haskell-interactive-mode-map "\r" nil)
1669 (define-key haskell-interactive-mode-map (kbd "<return>") 'haskell-interactive-mode-return)))
1670 (add-hook 'haskell-indentation-mode-hook (lambda () (define-key haskell-indentation-mode-map "\r" nil)))
1671
1672
1673
1674 (add-hook 'haskell-interactive-mode-hook
1675 (lambda ()
1676 (define-key haskell-interactive-mode-map (kbd "<C-M-return>") 'haskell-interactive-mode-newline-indent)))
1677
1678 #+end_src
1679
1680 #+RESULTS:
1681 | (lambda nil (define-key haskell-interactive-mode-map (kbd <C-M-return>) (quote haskell-interactive-mode-newline-indent))) | (lambda nil (define-key haskell-interactive-mode-map \n nil) (define-key haskell-interactive-mode-map (kbd <return>) (quote haskell-interactive-mode-return))) | ac-haskell-process-setup |
1682
1683 * isearch
1684 #+begin_src emacs-lisp
1685 (setq
1686 isearch-allow-scroll t
1687 search-ring-update t) ;; dont start an edit when going to previous search
1688
1689 (defun isearch-yank-regexp (regexp)
1690 "Pull REGEXP into search regexp."
1691 (let ((isearch-regexp nil)) ;; Dynamic binding of global.
1692 (isearch-yank-string regexp))
1693 (isearch-search-and-update))
1694
1695 (defun isearch-yank-symbol (&optional partialp backward)
1696 "Put symbol at current point into search string.
1697
1698 If PARTIALP is non-nil, find all partial matches."
1699 (interactive "P")
1700
1701 (let (from to bound sym)
1702 (setq sym
1703 ; this block taken directly from find-tag-default
1704 ; we couldn't use the function because we need the internal from and to values
1705 (when (or (progn
1706 ;; Look at text around `point'.
1707 (save-excursion
1708 (skip-syntax-backward "w_") (setq from (point)))
1709 (save-excursion
1710 (skip-syntax-forward "w_") (setq to (point)))
1711 (> to from))
1712 ;; Look between `line-beginning-position' and `point'.
1713 (save-excursion
1714 (and (setq bound (line-beginning-position))
1715 (skip-syntax-backward "^w_" bound)
1716 (> (setq to (point)) bound)
1717 (skip-syntax-backward "w_")
1718 (setq from (point))))
1719 ;; Look between `point' and `line-end-position'.
1720 (save-excursion
1721 (and (setq bound (line-end-position))
1722 (skip-syntax-forward "^w_" bound)
1723 (< (setq from (point)) bound)
1724 (skip-syntax-forward "w_")
1725 (setq to (point)))))
1726 (buffer-substring-no-properties from to)))
1727 (cond ((null sym)
1728 (message "No symbol at point"))
1729 ((null backward)
1730 (goto-char (1+ from)))
1731 (t
1732 (goto-char (1- to))))
1733 (isearch-search)
1734 (if partialp
1735 (isearch-yank-string sym)
1736 (isearch-yank-regexp
1737 (concat "\\_<" (regexp-quote sym) "\\_>")))))
1738
1739 (defun isearch-current-symbol (&optional partialp)
1740 "Incremental search forward with symbol under point.
1741
1742 Prefixed with \\[universal-argument] will find all partial
1743 matches."
1744 (interactive "P")
1745 (let ((start (point)))
1746 (isearch-forward-regexp nil 1)
1747 (isearch-yank-symbol partialp)))
1748 ;; todo, make this
1749
1750 (defun isearch-backward-current-symbol (&optional partialp)
1751 "Incremental search backward with symbol under point.
1752
1753 Prefixed with \\[universal-argument] will find all partial
1754 matches."
1755 (interactive "P")
1756 (let ((start (point)))
1757 (isearch-backward-regexp nil 1)
1758 (isearch-yank-symbol partialp)))
1759
1760
1761
1762 ; lets look through emacs starter kit before we throw this out.
1763
1764
1765 ; automatically wrap to the top of the buffer when isearch fails
1766 (defadvice isearch-search (after isearch-no-fail activate)
1767 (unless isearch-success
1768 (ad-disable-advice 'isearch-search 'after 'isearch-no-fail)
1769 (ad-activate 'isearch-search)
1770 (isearch-repeat (if isearch-forward 'forward))
1771 (ad-enable-advice 'isearch-search 'after 'isearch-no-fail)
1772 (ad-activate 'isearch-search)))
1773
1774 ;; Activate occur easily inside isearch
1775 (define-key isearch-mode-map (kbd "C-o")
1776 (lambda () (interactive)
1777 (let ((case-fold-search isearch-case-fold-search))
1778 (occur (if isearch-regexp
1779 isearch-string
1780 (regexp-quote isearch-string))))))
1781
1782
1783 #+end_src
1784
1785 * lisp / elisp mode setings
1786 #+begin_src emacs-lisp
1787
1788 (add-hook 'emacs-lisp-mode-hook 'starter-kit-remove-elc-on-save)
1789 (defun starter-kit-remove-elc-on-save ()
1790 "If you're saving an elisp file, likely the .elc is no longer valid."
1791 (make-local-variable 'after-save-hook)
1792 (add-hook 'after-save-hook
1793 (lambda ()
1794 (if (file-exists-p (concat buffer-file-name "c"))
1795 (delete-file (concat buffer-file-name "c"))))))
1796
1797
1798 (defun emacs-lisp-mode-defaults ()
1799 ;; checkdoc has an annoying feature that wants a header and footer
1800 ;; in every elisp buffer as if they all were packages
1801 ;; todo, see if there is a way
1802 ;; to make checkdoc usable instead of just disabling it as I do here
1803 (if (boundp 'flycheck-checkers)
1804 (setq flycheck-checkers (remove 'emacs-lisp-checkdoc flycheck-checkers)))
1805 (eldoc-mode 1))
1806 (add-hook 'emacs-lisp-mode-hook 'emacs-lisp-mode-defaults)
1807
1808 (define-key lisp-mode-map (kbd "<M-up>") 'backward-up-list)
1809 (define-key lisp-mode-map (kbd "<M-down>") 'down-list)
1810 (define-key emacs-lisp-mode-map (kbd "<M-up>") 'backward-up-list)
1811 (define-key emacs-lisp-mode-map (kbd "<M-down>") 'down-list)
1812 (define-key emacs-lisp-mode-map (kbd "<M-escape>") 'find-function-at-point)
1813
1814 ;; interactive modes don't need whitespace checks
1815 (defun interactive-lisp-coding-defaults ()
1816 (whitespace-mode -1))
1817 (setq prelude-interactive-lisp-coding-hook 'prelude-interactive-lisp-coding-defaults)
1818
1819
1820 ;; ielm is an interactive Emacs Lisp shell
1821 (defun ielm-mode-defaults ()
1822 (run-hooks 'prelude-interactive-lisp-coding-hook)
1823 (turn-on-eldoc-mode))
1824 (add-hook 'ielm-mode-hook 'ielm-mode-defaults)
1825
1826 #+end_src
1827
1828
1829 * java eclim
1830
1831 based on https://github.com/senny/emacs-eclim
1832
1833
1834 eclim: eclipse completion, searching, validation, etc inside emacs
1835 install
1836 #+begin_src sh :tangle no
1837 cd ~/opt
1838 git clone git://github.com/ervandew/eclim.git
1839 cd eclim
1840 pi ant
1841 ant -Declipse.home=/a/opt/eclipse
1842 #+end_src
1843
1844
1845 currently makes emacs hang a bunch. dunno why. just using eclipse instead
1846 #+begin_src emacs-lisp :tangle no
1847 (require 'eclim)
1848 (global-eclim-mode)
1849
1850 ;; just do java
1851 (setq eclim-accepted-file-regexps
1852 '("\\.java"))
1853
1854 (custom-set-variables
1855 '(eclim-eclipse-dirs '("/a/opt/eclipse"))
1856 '(eclim-executable "/a/opt/eclipse/eclim"))
1857
1858 (setq help-at-pt-display-when-idle t)
1859 (setq help-at-pt-timer-delay 0.1)
1860 (help-at-pt-set-timer)
1861
1862 ;; dunno if this line is needed
1863 (require 'eclimd)
1864 (setq eclimd-default-workspace "/a/bin/eclipse-workspace")
1865
1866 ;;add the emacs-eclim source
1867 (require 'ac-emacs-eclim-source)
1868 (add-hook 'java-mode-hook 'ac-emacs-eclim-java-setup)
1869
1870 #+end_src
1871
1872 #+RESULTS:
1873 | ac-emacs-eclim-java-setup |
1874
1875 * mediawiki
1876 #+begin_src emacs-lisp
1877
1878 (add-to-list 'load-path "~/.emacs.d/src/mediawiki-el")
1879 (eval-after-load "mediawiki"
1880 '(progn
1881 (remove-hook 'outline-minor-mode-hook 'mediawiki-outline-magic-keys)
1882 (add-hook 'mediawiki-mode-hook
1883 (lambda () (define-key mediawiki-mode-map (kbd "C-(") 'mediawiki-save-reload)))
1884
1885 ;; mediawiki mode has a bug that it will claim an edit conflict unless you reload after saving.
1886 ;; I also like to save with no edit summary for previewing on my local mw instance
1887 (defun mediawiki-save-reload ()
1888 (interactive)
1889 (and (mediawiki-save "") (mediawiki-reload)))))
1890 #+end_src
1891 * modes with little configuration needed
1892 #+begin_src emacs-lisp
1893
1894 ;;(require 'dtrt-indent)
1895 ;;(setq dtrt-indent-mode t)
1896
1897 (setq css-indent-offset 2)
1898
1899 (load-file "/a/h/iank-mod.el")
1900
1901 (require 'ws-butler)
1902 (ws-butler-global-mode)
1903
1904
1905 (defun ws-butler-clean-region (beg end)
1906 "Delete trailing blanks in region BEG END."
1907 (interactive "*r")
1908 (ws-butler-with-save
1909 (narrow-to-region beg end)
1910 ;; _much slower would be: (replace-regexp "[ \t]+$" "")
1911 (goto-char (point-min))
1912 (while (not (eobp))
1913 (end-of-line)
1914 (delete-horizontal-space)
1915 (forward-line 1)))
1916 ;; clean return code for hooks
1917 nil)
1918
1919
1920 (require 'nginx-mode)
1921 ;;The mode should automatically activate for files called nginx.conf and files under /etc/nginx - if not, you can add something like this to your init file:
1922 ;;(add-to-list 'auto-mode-alist '("/etc/nginx/sites-available/.*" . nginx-mode))
1923
1924 ;; todo, put this on a hook with prog mode
1925 ;;(highlight-indentation-mode 1)
1926
1927 (add-hook 'auto-revert-tail-mode-hook
1928 (lambda ()
1929 (when (string=
1930 buffer-file-name
1931 "/var/log/cloudman/development/cm-service.log")
1932 (setq-local prev-auto-revert-max 0)
1933 ;; set buffer-local hook
1934 (add-hook 'after-revert-hook 'tail-colorize nil t))))
1935 (defun tail-colorize ()
1936 (ansi-color-apply-on-region prev-auto-revert-max (point-max))
1937 (setq-local prev-auto-revert-max (point-max)))
1938
1939
1940 ;; gnu global
1941 (require 'ggtags)
1942 (add-hook 'c-mode-common-hook
1943 (lambda () (ggtags-mode 1)
1944 (setq c-label-minimum-indentation 0)))
1945
1946 ;; specific to my unusual keybind setup, you may want to
1947 ;; pick different keys
1948 (define-key ggtags-mode-map (kbd "C-M-o") 'ggtags-find-tag-dwim)
1949 (define-key ggtags-mode-map (kbd "C-M-m") 'ggtags-grep)
1950
1951 (defun gtags-update-single(filename)
1952 "Update Gtags database for changes in a single file"
1953 (interactive)
1954 (start-process "update-gtags" "update-gtags" "bash" "-c" (concat "cd " ggtags-project-root " ; gtags --single-update " filename )))
1955
1956 (defun gtags-update-current-file()
1957 (interactive)
1958 (let ((rel-filename (replace-regexp-in-string
1959 ggtags-project-root "."
1960 (buffer-file-name (current-buffer)))))
1961 (gtags-update-single rel-filename)))
1962
1963 (defun gtags-update-hook()
1964 "Update GTAGS file incrementally upon saving a file"
1965 (when (and ggtags-mode ggtags-project-root)
1966 (gtags-update-current-file)))
1967
1968 (add-hook 'after-save-hook 'gtags-update-hook)
1969
1970 ;; i'd like to make some elisp which modifies a keymap to remove
1971 ;; all binds which don't match a predicate.
1972 ;; I tried setting a keymap to a new keymap,
1973 ;; but that didn't register as functional.
1974 ;; so I'd need to modify the list in place.
1975
1976 (require 'magit)
1977
1978
1979 ;; colorize hex colors: use rainbow mode
1980
1981
1982 ;; message mode prompted me on first message.
1983 ;; a function which describes options then sets this
1984 ;; the other options were to use smtp directly or pass to another mail client
1985 ;; here we use the standard sendmail interface, which I use postfix for
1986 (setq send-mail-function (quote sendmail-send-it))
1987
1988 (add-to-list 'load-path "~/.emacs.d/src/spray")
1989 (require 'spray)
1990 (global-set-key (kbd "C-M-w") 'spray-mode)
1991 ;; remember, h/l = move. f/s = faster/slower, space = pause, all others quit
1992
1993 ;; delete active selection with self-insert commands
1994 (delete-selection-mode t)
1995
1996 ;; Transparently open compressed files
1997 (auto-compression-mode t)
1998
1999 ;; Highlight matching parenthesesq when the pointq is on them.
2000 ;; not needed since smart paren mode?
2001 ;; (show-paren-mode 1)
2002
2003
2004 ;; not documented, but looking at the source, I find this
2005 ;; stops me from being asked what command on every C-c-c
2006 ;; when doing a latex document.
2007 (setq TeX-command-force "LaTeX")
2008
2009 ;; dot mode, repeats last action
2010 (require 'dot-mode)
2011 (add-hook 'find-file-hooks 'dot-mode-on)
2012
2013
2014 ;; clean up obsolete buffers automatically at midnight
2015 (require 'midnight)
2016
2017
2018 ;; disabled because it takes 400ms on startup
2019 ;; ;; emacs regexes are too limited.
2020 ;; (require 'foreign-regexp)
2021 ;; ;; perl is most powerful, but javascript is pretty close and
2022 ;; ;; I'd rather know javascript stuff than perl
2023 ;; (custom-set-variables
2024 ;; '(foreign-regexp/regexp-type 'javascript) ;; Choose by your preference.
2025 ;; '(reb-re-syntax 'foreign-regexp)) ;; Tell re-builder to use foreign regexp.
2026 ;; ;; it would be nice to add documentation to do this for more commands to that package
2027 ;; ;; disabled because it's too slow. but I'd still m-x it for advanced replacements
2028 ;; ;;(define-key global-map [remap isearch-forward-regexp] 'foreign-regexp/isearch-forward)
2029
2030
2031 ;; saner regex syntax
2032 (require 're-builder)
2033 (setq reb-re-syntax 'string)
2034
2035
2036 ;; use shift + arrow keys to switch between visible buffers
2037 ;; todo, set these keys to something else
2038 (require 'windmove)
2039 (windmove-default-keybindings)
2040
2041
2042 ;; show the name of the current function definition in the modeline
2043 (require 'which-func)
2044 (setq which-func-modes t)
2045 (which-function-mode 1)
2046
2047
2048 ;; enable winner-mode to manage window configurations
2049 (winner-mode +1)
2050
2051 ;; meaningful names for buffers with the same name
2052 (require 'uniquify)
2053 (setq uniquify-buffer-name-style 'forward
2054 uniquify-separator "/"
2055 ;; for sdx work. until I figure out a better way.
2056 ;; maybe something like projectile can do it,
2057 ;; or hacking around the status bar
2058 uniquify-min-dir-content 2
2059 uniquify-after-kill-buffer-p t ; rename after killing uniquified
2060 uniquify-ignore-buffers-re "^\\*") ; don't muck with special buffers
2061
2062
2063 ;; makefiles require tabs
2064 ;; todo: find a makefile indent function that works,
2065 ;; best I could find is this one which means don't indent at all
2066 ;;
2067 (add-hook 'makefile-mode-hook
2068 (lambda ()
2069 (setq indent-tabs-mode t)
2070 (setq indent-line-function (lambda () 'no-indent))))
2071
2072
2073 ;; todo, turn on auto-fill just for txt files
2074 ;;(add-hook 'text-mode-hook 'turn-on-auto-fill)
2075 (add-hook 'text-mode-hook 'turn-on-flyspell)
2076
2077
2078 ;; auto indent shell script comments
2079 (setq sh-indent-comment t)
2080
2081 ;; random extra highlights
2082 (require 'volatile-highlights)
2083 (volatile-highlights-mode t)
2084
2085
2086 ;; make help buffers smaller when it makes sense
2087 (temp-buffer-resize-mode 1)
2088
2089
2090 (require 'info+)
2091 ;; based on suggestions in info+.el, I also installed misc-fns, strings, and thingatpt+
2092 ;; remove some bad keybinds from info+
2093 (define-key Info-mode-map [mouse-4] nil)
2094 (define-key Info-mode-map [mouse-5] nil)
2095
2096
2097 (require 'smooth-scroll)
2098 ;; long gnus summary buffers lags too much with this,
2099 ;; but I like it enough to leave it enabled by default
2100 ;; and crank up the step size to be faster
2101 ;; and it doesn't have a way to enable it only for certain modes etc.
2102 ;; todo sometime, make it work for certain modes only
2103 (smooth-scroll-mode t)
2104 ;; its too slow with the default of 2
2105 (setq smooth-scroll/vscroll-step-size 7)
2106 ;; sublimity doesn't work as good going fast by default
2107 ;; smooth-scrolling.el, does not do smooth scrolling. its about cursor location
2108
2109
2110 (setq sh-here-document-word "'EOF'")
2111
2112 (setq tramp-default-method "ssh")
2113 #+end_src
2114 * misc general settings
2115
2116 #+begin_src emacs-lisp
2117
2118 (setq vc-follow-symlinks t)
2119
2120 ;; give us a shell to start instead of scratch
2121 ;;(setq initial-buffer-choice (lambda () (new-shell)))
2122
2123 ;; disable this nasty function, as I always use a gui
2124 (defun suspend-frame() (interactive))
2125
2126 ;; Seed the random-number generator
2127 (random t)
2128
2129 ;; easier to remember than keybinds
2130 (defalias 'scrypt 'mml-secure-message-encrypt-pgpmime)
2131 (defalias 'sign 'mml-secure-message-sign-pgpmime)
2132 (defun encrypt ()
2133 (interactive)
2134 (mml-secure-message-encrypt-pgpmime 'dontsign))
2135
2136 ;; don't highlight the region.
2137 (set-face-background 'region nil)
2138
2139 ;; this fixes save error for python example code
2140 (define-coding-system-alias 'UTF-8 'utf-8)
2141
2142 ;; i don't use frame titles, but if I ever do
2143 ;; this starter kit setting is probably good
2144 (if window-system (setq frame-title-format '(buffer-file-name "%f" ("%b"))))
2145
2146 (set-terminal-coding-system 'utf-8)
2147 (set-keyboard-coding-system 'utf-8)
2148 (prefer-coding-system 'utf-8)
2149
2150 ;; remove ugly 3d box feature
2151 (set-face-attribute 'mode-line nil :box nil)
2152
2153 (add-to-list 'default-frame-alist
2154 '(font . "DejaVu Sans Mono-11"))
2155 ; the default will jump 2 sizes.
2156 (setq text-scale-mode-step 1.1)
2157 (setq font-lock-maximum-decoration t
2158 inhibit-startup-message t
2159 transient-mark-mode t
2160 delete-by-moving-to-trash t
2161 shift-select-mode nil
2162 truncate-partial-width-windows nil
2163 uniquify-buffer-name-style 'forward
2164 oddmuse-directory "~/.emacs.d/oddmuse"
2165 echo-keystrokes 0.1
2166 mark-ring-max 160
2167 sort-fold-case t ; case insensitive line sorting
2168 global-mark-ring-max 1000
2169 ;; the visible bell seems to lag the ui
2170 ;;visible-bell t
2171 ;; turn off audible bell
2172 ;; https://www.emacswiki.org/emacs/AlarmBell
2173 ring-bell-function 'ignore
2174 case-replace nil
2175 revert-without-query '(".*")
2176 ;; don't pause display code on input.
2177 ;; smoother display performance at slight cost of input performance
2178 redisplay-dont-pause t
2179 font-lock-maximum-decoration t) ; probably default and not necesary
2180
2181
2182 (setq-default indent-tabs-mode nil ;; don't use tabs to indent
2183 cursor-type 'box
2184 fill-column 72
2185
2186 ;; wrap at word boundaries instead of mid-word
2187 word-wrap t
2188 imenu-auto-rescan t
2189 indicate-empty-lines t) ; mark end of buffer
2190
2191
2192 (blink-cursor-mode '(-4))
2193 (menu-bar-mode -1)
2194 (tool-bar-mode -1)
2195 (set-scroll-bar-mode 'left)
2196
2197
2198 ;; enable various commands
2199 (put 'narrow-to-region 'disabled nil)
2200 (put 'narrow-to-page 'disabled nil)
2201 (put 'narrow-to-defun 'disabled nil)
2202 (put 'upcase-region 'disabled nil)
2203 (put 'downcase-region 'disabled nil)
2204 (put 'scroll-left 'disabled nil)
2205 ;; these from graphene, haven't read about them yet
2206 (put 'ido-complete 'disabled nil)
2207 (put 'ido-exit-minibuffer 'disabled nil)
2208 (put 'dired-find-alternate-file 'disabled nil)
2209 (put 'autopair-newline 'disabled nil)
2210
2211
2212
2213 ;;disable and minimize various prompts/messages
2214 (fset 'yes-or-no-p 'y-or-n-p)
2215 (setq confirm-nonexistent-file-or-buffer nil
2216 inhibit-startup-message t
2217 inhibit-startup-echo-area-message t
2218 inhibit-startup-screen t
2219 compilation-read-command nil ;; just don't compile with unsafe file local vars
2220 kill-buffer-query-functions (remq 'process-kill-buffer-query-function
2221 kill-buffer-query-functions))
2222
2223
2224 ;; exit without bothering me
2225 ;; http://stackoverflow.com/questions/2706527/make-emacs-stop-asking-active-processes-exist-kill-them-and-exit-anyway/2708042#2708042
2226 (add-hook 'comint-exec-hook
2227 (lambda () (set-process-query-on-exit-flag (get-buffer-process (current-buffer)) nil)))
2228 ;; based on save-buffers-kill-emacs help string, don't ask about clients when exiting
2229 ;; apparently this would need to be in some later hook. dunno where is best, but this works
2230 (defadvice save-buffers-kill-emacs (before no-client-prompt-advice activate)
2231 (setq kill-emacs-query-functions (delq 'server-kill-emacs-query-function kill-emacs-query-functions)))
2232
2233
2234
2235 ;; (custom-set-faces
2236 ;; ;; setting header-line-format to " " as a hack for a top margin the oly thning I could find to do a top margin
2237 ;; '(header-line ((t (:background "default" :foreground "default" :overline nil :underline nil))))
2238 ;; ;; don't highlight the region
2239 ;; '(region ((t nil))))
2240 (setq-default header-line-format " ")
2241
2242
2243 (setq initial-scratch-message nil)
2244 #+end_src
2245
2246
2247 vertical margin background.
2248 google turned up: http://lists.gnu.org/archive/html/help-gnu-emacs/2014-03/msg00544.html
2249 the xresource doesn't work for me, probably an xmonad thing.
2250
2251 figured out I needed to customize the header line face. To find the face, M-x list-faces-display or just google / search
2252 info,
2253 then M-x customize-face
2254 header-line
2255 unchecked some stuff so that it inherits from default.
2256
2257 * misc function definitions
2258 #+begin_src emacs-lisp
2259
2260
2261
2262
2263
2264 (defun next-backup-dir ()
2265 "In a directory listing from rsync -n,
2266 Go to the next directory based on where the cursor is."
2267 (interactive)
2268 (let* ((start-col (current-column))
2269 (end-col (progn (skip-chars-forward "^/\n") (current-column)))
2270 (dir (progn
2271 (beginning-of-line 1)
2272 (buffer-substring-no-properties (point) (+ (point) end-col)))))
2273 (message dir)
2274 (forward-line 1)
2275 (while (and (not (eobp))
2276 (string= dir (buffer-substring-no-properties (point) (+ (point) end-col))))
2277 (forward-line 1))
2278 (forward-char-same-line start-col)))
2279 ;; copy paste this for fast keybind
2280 ;;(local-set-key (kbd "<kp-enter>"))
2281
2282
2283 (defun goto-buffer-or-find-file (file-name)
2284 "If buffer is with FILE-NAME exists, go to it, else open the file using full path."
2285 (interactive)
2286 (let ((b (get-buffer (file-name-nondirectory file-name))))
2287 (if b
2288 (switch-to-buffer b)
2289 (find-file file-name))))
2290
2291
2292
2293
2294 ;; todo, i think this is broken. perhaps the last goto-char is not accounting for buffer or something
2295 (defun unpop-global-mark ()
2296 "Unpop off global mark ring. Does nothing if mark ring is empty."
2297 (interactive)
2298 (when global-mark-ring
2299 (setq global-mark-ring (cons (copy-marker (mark-marker)) global-mark-ring))
2300 (let ((lm (car (last global-mark-ring))))
2301 (set-marker (mark-marker) (marker-position lm) (marker-buffer lm)))
2302 (when (null (mark t)) (ding))
2303 (setq global-mark-ring (nbutlast global-mark-ring))
2304 (goto-char (marker-position (mark-marker)))))
2305
2306 (defun indent-buffer ()
2307 "Indents the entire buffer."
2308 (interactive)
2309 (cond ((derived-mode-p 'org-mode)
2310 (org-indent-region (point-min) (point-max)))
2311 ((derived-mode-p 'python-mode)
2312 (py-autopep8))
2313 (t
2314 (indent-region (point-min) (point-max)))))
2315
2316
2317 ;; TODO doesn't work with uniquify
2318 (defun rename-file-and-buffer ()
2319 "Renames current buffer and file it is visiting."
2320 (interactive)
2321 (let ((name (buffer-name))
2322 (filename (buffer-file-name)))
2323 (if (not (and filename (file-exists-p filename)))
2324 (message "Buffer '%s' is not visiting a file!" name)
2325 (let ((new-name (read-file-name "New name: " filename)))
2326 (cond ((get-buffer new-name)
2327 (message "A buffer named '%s' already exists!" new-name))
2328 (t
2329 (rename-file name new-name 1)
2330 (rename-buffer new-name)
2331 (set-visited-file-name new-name)
2332 (set-buffer-modified-p nil)))))))
2333
2334
2335
2336 (defun sudo-edit (&optional arg)
2337 (interactive "P")
2338 (if (or arg (not buffer-file-name))
2339 (find-file (concat "/sudo:root@localhost:" (ido-read-file-name "File: ")))
2340 (find-alternate-file (concat "/sudo:root@localhost:" buffer-file-name))))
2341
2342
2343
2344 (defun backward-symbol (arg)
2345 (interactive "p")
2346 (forward-symbol (- arg)))
2347
2348 #+end_src
2349
2350 * mode line
2351 #+begin_src emacs-lisp
2352
2353 ; -----------------------------
2354 ; fixing up the mode line
2355 ; modified from mastering emacs blog
2356 ; ----------------------------
2357
2358 (defvar mode-line-cleaner-alist
2359 `((auto-complete-mode . "")
2360 (yas/minor-mode . "")
2361 (paredit-mode . "")
2362 (auto-fill-function . "")
2363 (eldoc-mode . "")
2364 (abbrev-mode . "")
2365 (flyspell-mode . "")
2366 (glasses-mode . "")
2367 (dot-mode . "")
2368 (yas-global-mode . "")
2369 (yas-minor-mode . "")
2370 (undo-tree-mode . "")
2371 (volatile-highlights-mode . "")
2372 (highlight-symbol-mode . "")
2373 ;; Major modes
2374 (lisp-interaction-mode . "λ")
2375 (hi-lock-mode . "")
2376 (python-mode . "Py")
2377 (emacs-lisp-mode . "EL")
2378 (nxhtml-mode . "nx"))
2379 "Alist for `clean-mode-line'.
2380
2381 When you add a new element to the alist, keep in mind that you
2382 must pass the correct minor/major mode symbol and a string you
2383 want to use in the modeline *in lieu of* the original.")
2384
2385
2386 (defun clean-mode-line ()
2387 (interactive)
2388 (loop for cleaner in mode-line-cleaner-alist
2389 do (let* ((mode (car cleaner))
2390 (mode-str (cdr cleaner))
2391 (old-mode-str (cdr (assq mode minor-mode-alist))))
2392 (when old-mode-str
2393 (setcar old-mode-str mode-str))
2394 ;; major mode
2395 (when (eq mode major-mode)
2396 (setq mode-name mode-str)))))
2397
2398 ; disabled
2399 ; (add-hook 'after-change-major-mode-hook 'clean-mode-line)
2400
2401
2402 ;;; alias the new `flymake-report-status-slim' to
2403 ;;; `flymake-report-status'
2404 (defalias 'flymake-report-status 'flymake-report-status-slim)
2405 (defun flymake-report-status-slim (e-w &optional status)
2406 "Show \"slim\" flymake status in mode line."
2407 (when e-w
2408 (setq flymake-mode-line-e-w e-w))
2409 (when status
2410 (setq flymake-mode-line-status status))
2411 (let* ((mode-line " Φ"))
2412 (when (> (length flymake-mode-line-e-w) 0)
2413 (setq mode-line (concat mode-line ":" flymake-mode-line-e-w)))
2414 (setq mode-line (concat mode-line flymake-mode-line-status))
2415 (setq flymake-mode-line mode-line)
2416 (force-mode-line-update)))
2417
2418
2419 (add-hook 'after-change-major-mode-hook (lambda ()
2420
2421 (setq mode-line-mule-info nil
2422 mode-line-position nil
2423 mode-line-modes nil))) ; todo, make only flymake status show up
2424
2425 #+end_src
2426
2427 * mouse related
2428 ** settings
2429 #+begin_src emacs-lisp
2430 (setq focus-follows-mouse t
2431 mouse-autoselect-window t
2432 xterm-mouse-mode t)
2433 #+end_src
2434 ** move-mouse-to-point
2435 todo, this is buggy with multiple windows open.
2436 #+begin_src emacs-lisp
2437 (defun move-mouse-to-point ()
2438 (interactive)
2439 (let* ((pos (posn-col-row (posn-at-point)))
2440 (x (+ (car pos) 2)) ; no idea why this is off by 1-2
2441 (y (cdr pos)))
2442 (set-mouse-position (selected-frame) x y)))
2443 #+end_src
2444 ** cursor highlight
2445 disabled until fixed
2446 #+begin_src emacs-lisp :tangle no
2447 (defun mouse-follow-cursor ()
2448 ;(if (not (equal this-command last-command)) (print this-command))
2449 ;debug
2450 ; (print this-command)
2451 (when (and this-command (not (string= this-command "show-pointer")))
2452 (let* ((pos (posn-col-row (posn-at-point)))
2453 (x (1+ (car pos))) ; no idea why this is off by 1
2454 (y (cdr pos)))
2455 (setq ignore-mouse-visibility t)
2456 (set-mouse-position (selected-frame) x y))
2457 ;(sleep-for 0 100)
2458 (frame-make-pointer-invisible)))
2459
2460 ; (when this-command
2461 ; (if (string= this-command "show-pointer")
2462 ; (frame-make-pointer-visible)
2463 ;))
2464
2465
2466
2467 (defun show-pointer ()
2468 (interactive)
2469 (if ignore-mouse-visibility
2470 (setq ignore-mouse-visibility nil)
2471 ; (print "visible")
2472 (frame-make-pointer-visible)))
2473
2474 (setq ignore-mouse-visibility t)
2475 ; disabled
2476 ; (global-set-key (kbd "<mouse-movement>") 'show-pointer)
2477
2478 ; (add-hook 'post-command-hook 'mouse-follow-cursor t)
2479
2480
2481 ; status. working, except that all scroll wheel actions send a mouse-movement command before doing their actual command, which makes the pointer flicker.
2482 ; this is just an artifact of xbindkeys. when i do my own mouse chip, it will fix this.
2483
2484 ; we could set track-mouse to nil, then do the command, then set it back. i like that idea a bit better.
2485 ; we could do the same thing in the other case of ignore-mouse-visibility.
2486
2487 ; there are also other issues, it doesn't work with changing buffers on a split screen.
2488 ; i think a good idea along with this would be for the cursor to follow the mouse all the time.
2489 ; i have done code for that in my mouse 1 function,
2490 ; i just need to read it again and try it out.
2491
2492
2493
2494
2495 ; this does not take care of scrolling,
2496 ; a post-command hook function below does,
2497 ; but it breaks when the frame is split.
2498 ; the bug is specifically in mouse-pixel-position
2499 ; todo, fix this eventually
2500 (defun mouse-highlight-event (event)
2501 (interactive "e")
2502 (when (or (not event) (mouse-movement-p event)
2503 (memq (car-safe event) '(switch-frame select-window)))
2504 (let ((pos (posn-point (event-end event))))
2505 (if (eq (overlay-buffer mouse-hi-ov) (current-buffer))
2506 (move-overlay mouse-hi-ov pos (1+ pos))
2507 (delete-overlay mouse-hi-ov)
2508 (setq mouse-hi-ov
2509 (make-overlay pos (1+ pos)))
2510 (overlay-put mouse-hi-ov
2511 'insert-in-front-hooks (list 'mouse-hi-modification))
2512 (overlay-put mouse-hi-ov 'priority 1001))
2513 (cond ((save-excursion (goto-char pos) (eolp))
2514 (overlay-put mouse-hi-ov 'face nil)
2515 (overlay-put mouse-hi-ov 'before-string
2516 (propertize
2517 " "
2518 'cursor t
2519 'face 'mouse-cursor-face)))
2520 (t
2521 (overlay-put mouse-hi-ov 'face 'mouse-cursor-face)
2522 (overlay-put mouse-hi-ov 'before-string nil))))))
2523
2524
2525 ; overlay changed hook function
2526 (defun mouse-hi-modification (ov timing beginning end &optional length)
2527 "Make an overlay of length 1 not expand when text is inserted at the front."
2528 (when timing
2529 (let ((start (overlay-start ov)))
2530 (move-overlay ov start (1+ start)))))
2531
2532
2533
2534
2535 (defun mouse-hi-command-hook ()
2536 ; not sure if I need to deal with case of a nil mouse position in some unforseen situation.
2537 (let ((x-y (cdr (mouse-pixel-position))))
2538 (when (wholenump (car x-y))
2539 (let ((pos (posn-point (posn-at-x-y (car x-y) (cdr x-y) nil t))))
2540 (when pos
2541 (if (eq (overlay-buffer mouse-hi-ov) (current-buffer))
2542 (move-overlay mouse-hi-ov pos (1+ pos))
2543 (delete-overlay mouse-hi-ov)
2544 (setq mouse-hi-ov
2545 (make-overlay pos (1+ pos)))
2546
2547 (overlay-put mouse-hi-ov 'priority 1001))
2548 (cond ((save-excursion (goto-char pos) (eolp))
2549
2550 (overlay-put mouse-hi-ov 'face nil)
2551 (overlay-put mouse-hi-ov 'before-string
2552 (propertize
2553 " "
2554 'cursor t
2555 'face 'mouse-cursor-face)))
2556 (t
2557 (overlay-put mouse-hi-ov 'face 'mouse-cursor-face)
2558 (overlay-put mouse-hi-ov 'before-string nil))))))))
2559 ; (pcase-let ((`(,_ ,x . ,y) (mouse-pixel-position)))
2560 ; (posn-point (posn-at-x-y x y)))))
2561 ; equivalent of above to find pos. todo, learn about the above syntax
2562
2563 (setq mouse-hi-ov (make-overlay 1 1))
2564 (delete-overlay mouse-hi-ov)
2565 ; initialized overlay
2566 ; temporarily set to nil instead of t because it is broken and
2567 ; also has a bug that makes emacs not remember the column when
2568 ; doing up and down movements.
2569 ; it also messes up yas/insert-snippet, dunno why.
2570 ; i should test out whether it is something in the post-command hook
2571 ; (setq track-mouse t)
2572 ;(add-hook 'post-command-hook 'mouse-hi-command-hook)
2573
2574 ;(mouse-hi-command-hook)
2575 ;(setq debug-on-error nil)
2576
2577 #+end_src
2578 ** mouse 1 drag func
2579 :PROPERTIES:
2580
2581 disabled as it breaks in newer emacs versions with this error, when
2582 clicking on info links
2583
2584 "and: Symbol's function definition is void: mouse--remap-link-click-p"
2585
2586 #+begin_src emacs-lisp :tangle no
2587
2588 ; Copied from mouse.el and modified.
2589 ; my modifications have comments prefaced by "ian"
2590 (defun mouse-drag-track (start-event &optional
2591 do-mouse-drag-region-post-process)
2592 "Track mouse drags by highlighting area between point and cursor.
2593 The region will be defined with mark and point.
2594 DO-MOUSE-DRAG-REGION-POST-PROCESS should only be used by
2595 `mouse-drag-region'."
2596 (mouse-minibuffer-check start-event)
2597 (setq mouse-selection-click-count-buffer (current-buffer))
2598 ; ian. removed as unneeded since I don't use TMM
2599 ;(deactivate-mark)
2600 (let* ((scroll-margin 0) ; Avoid margin scrolling (Bug#9541).
2601 (original-window (selected-window))
2602 ;; We've recorded what we needed from the current buffer and
2603 ;; window, now let's jump to the place of the event, where things
2604 ;; are happening.
2605 (_ (mouse-set-point start-event))
2606 (echo-keystrokes 0)
2607 (start-posn (event-start start-event))
2608 (start-point (posn-point start-posn))
2609 (start-window (posn-window start-posn))
2610 (start-window-start (window-start start-window))
2611 (start-hscroll (window-hscroll start-window))
2612 (bounds (window-edges start-window))
2613 (make-cursor-line-fully-visible nil)
2614 (top (nth 1 bounds))
2615 (bottom (if (window-minibuffer-p start-window)
2616 (nth 3 bounds)
2617 ;; Don't count the mode line.
2618 (1- (nth 3 bounds))))
2619 (on-link (and mouse-1-click-follows-link
2620 ;; Use start-point before the intangibility
2621 ;; treatment, in case we click on a link inside
2622 ;; intangible text.
2623 (mouse-on-link-p start-posn)))
2624 (click-count (1- (event-click-count start-event)))
2625 (remap-double-click (and on-link
2626 (eq mouse-1-click-follows-link 'double)
2627 (= click-count 1)))
2628 ;; Suppress automatic hscrolling, because that is a nuisance
2629 ;; when setting point near the right fringe (but see below).
2630 (auto-hscroll-mode-saved auto-hscroll-mode)
2631 (auto-hscroll-mode nil)
2632 moved-off-start event end end-point)
2633
2634 (setq mouse-selection-click-count click-count)
2635 ;; In case the down click is in the middle of some intangible text,
2636 ;; use the end of that text, and put it in START-POINT.
2637 (if (< (point) start-point)
2638 (goto-char start-point))
2639 (setq start-point (point))
2640 (if remap-double-click
2641 (setq click-count 0))
2642
2643 ;; Activate the region, using `mouse-start-end' to determine where
2644 ;; to put point and mark (e.g., double-click will select a word).
2645 (setq transient-mark-mode
2646 (if (eq transient-mark-mode 'lambda)
2647 '(only)
2648 (cons 'only transient-mark-mode)))
2649 (delete-overlay mouse-hi-ov) ; ian, added this.
2650
2651 (let ((range (mouse-start-end start-point start-point click-count)))
2652 (push-mark (nth 0 range) t t)
2653 (goto-char (nth 1 range)))
2654
2655 ;; Track the mouse until we get a non-movement event.
2656 (track-mouse
2657 (while (progn
2658 (setq event (read-event))
2659 (or (mouse-movement-p event)
2660 (memq (car-safe event) '(switch-frame select-window))))
2661 (unless (memq (car-safe event) '(switch-frame select-window))
2662 ;; Automatic hscrolling did not occur during the call to
2663 ;; `read-event'; but if the user subsequently drags the
2664 ;; mouse, go ahead and hscroll.
2665 (let ((auto-hscroll-mode auto-hscroll-mode-saved))
2666 (redisplay))
2667 (setq end (event-end event)
2668 end-point (posn-point end))
2669 ;; Note whether the mouse has left the starting position.
2670 (unless (eq end-point start-point)
2671 (setq moved-off-start t))
2672 (if (and (eq (posn-window end) start-window)
2673 (integer-or-marker-p end-point))
2674 (mouse--drag-set-mark-and-point start-point
2675 end-point click-count)
2676 (let ((mouse-row (cdr (cdr (mouse-position)))))
2677 (cond
2678 ((null mouse-row))
2679 ((< mouse-row top)
2680 (mouse-scroll-subr start-window (- mouse-row top)
2681 nil start-point))
2682 ((>= mouse-row bottom)
2683 (mouse-scroll-subr start-window (1+ (- mouse-row bottom))
2684 nil start-point))))))
2685 (visible-mark-move-overlays))) ; ian, added this
2686
2687
2688 ;; Handle the terminating event if possible.
2689 (when (consp event)
2690 ;; Ensure that point is on the end of the last event.
2691 (when (and (setq end-point (posn-point (event-end event)))
2692 (eq (posn-window end) start-window)
2693 (integer-or-marker-p end-point)
2694 (/= start-point end-point))
2695 (mouse--drag-set-mark-and-point start-point
2696 end-point click-count))
2697
2698 ;; Find its binding.
2699 (let* ((fun (key-binding (vector (car event))))
2700 (do-multi-click (and (> (event-click-count event) 0)
2701 (functionp fun)
2702 (not (memq fun '(mouse-set-point
2703 mouse-set-region))))))
2704 (if (and (/= (mark) (point))
2705 (not do-multi-click))
2706
2707 ;; If point has moved, finish the drag.
2708 (let* (last-command this-command)
2709 (and mouse-drag-copy-region
2710 do-mouse-drag-region-post-process
2711 (let (deactivate-mark)
2712 (copy-region-as-kill (mark) (point)))))
2713
2714 ;; Otherwise, run binding of terminating up-event.
2715 (if do-multi-click
2716 (goto-char start-point)
2717 (deactivate-mark)
2718 (unless moved-off-start
2719 ;; ian: poping the mark is a poor choice of behavior.
2720 ;; we should delete the mark instead.
2721 ;; The first way I found to delete it is to pop it first
2722 (pop-mark)
2723 (setq mark-ring (nbutlast mark-ring))))
2724
2725 (when (and (functionp fun)
2726 (= start-hscroll (window-hscroll start-window))
2727 ;; Don't run the up-event handler if the window
2728 ;; start changed in a redisplay after the
2729 ;; mouse-set-point for the down-mouse event at
2730 ;; the beginning of this function. When the
2731 ;; window start has changed, the up-mouse event
2732 ;; contains a different position due to the new
2733 ;; window contents, and point is set again.
2734 (or end-point
2735 (= (window-start start-window)
2736 start-window-start)))
2737
2738 (when (and on-link
2739 (= start-point (point))
2740 (mouse--remap-link-click-p start-event event))
2741
2742 ;; If we rebind to mouse-2, reselect previous selected
2743 ;; window, so that the mouse-2 event runs in the same
2744 ;; situation as if user had clicked it directly. Fixes
2745 ;; the bug reported by juri@jurta.org on 2005-12-27.
2746 (if (or (vectorp on-link) (stringp on-link))
2747 (setq event (aref on-link 0))
2748 (select-window original-window)
2749 (setcar event 'mouse-2)
2750 ;; If this mouse click has never been done by the
2751 ;; user, it doesn't have the necessary property to be
2752 ;; interpreted correctly.
2753 (put 'mouse-2 'event-kind 'mouse-click)))
2754 (push event unread-command-events)))))))
2755 #+end_src
2756
2757 ** mouse 3
2758 #+begin_src emacs-lisp :tangle no
2759
2760
2761 (defun mouse3-range-mark (start click click-count)
2762 (let* ((range (mouse-start-end start click click-count))
2763 (beg (nth 0 range))
2764 (end (nth 1 range)))
2765 (cond ((<= click start)
2766 (set-mark beg))
2767 (t
2768 (set-mark end))))
2769 (visible-mark-move-overlays))
2770
2771
2772 (defun mouse3-set-mark (event)
2773 "in development"
2774 (interactive "e")
2775 (mouse-minibuffer-check event)
2776 ;; Use event-end in case called from mouse-drag-region.
2777 ;; If EVENT is a click, event-end and event-start give same value.
2778 (set-mark (posn-point (event-end event)))
2779 (visible-mark-move-overlays))
2780
2781
2782 (defun mouse3-func (start-event)
2783 "in development"
2784 (interactive "e")
2785
2786 (run-hooks 'mouse-leave-buffer-hook)
2787
2788 (mouse-minibuffer-check start-event)
2789 (setq mouse-selection-click-count-buffer (current-buffer))
2790 (push-mark (posn-point (event-end start-event)))
2791
2792 (let* ((scroll-margin 0) ; Avoid margin scrolling (Bug#9541).
2793 (original-window (selected-window))
2794 ;; We've recorded what we needed from the current buffer and
2795 ;; window, now let's jump to the place of the event, where things
2796 ;; are happening.
2797 ;(_ (mouse-set-point start-event)) ; ian: commented, replaced
2798 (echo-keystrokes 0)
2799 (start-posn (event-start start-event))
2800 (start-point (posn-point start-posn))
2801 (start-window (posn-window start-posn))
2802 (start-window-start (window-start start-window))
2803 (start-hscroll (window-hscroll start-window))
2804 (bounds (window-edges start-window))
2805 (make-cursor-line-fully-visible nil)
2806 (top (nth 1 bounds))
2807 (bottom (if (window-minibuffer-p start-window)
2808 (nth 3 bounds)
2809 ;; Don't count the mode line.
2810 (1- (nth 3 bounds))))
2811 (click-count (1- (event-click-count start-event)))
2812 ;; Suppress automatic hscrolling, because that is a nuisance
2813 ;; when setting point near the right fringe (but see below).
2814 (auto-hscroll-mode-saved auto-hscroll-mode)
2815 (auto-hscroll-mode nil)
2816 moved-off-start event end end-point)
2817
2818 (setq mouse-selection-click-count click-count)
2819 ;; In case the down click is in the middle of some intangible text,
2820 ;; use the end of that text, and put it in START-POINT.
2821 (if (< (mark) start-point) ; ian: change point to the mark
2822 (set-mark start-point)
2823 (visible-mark-move-overlays))
2824 (setq start-point (mark))
2825
2826 (delete-overlay mouse-hi-ov) ; ian, added this.
2827
2828 ;; Activate the region, using `mouse-start-end' to determine where
2829 ;; to put point and mark (e.g., double-click will select a word).
2830 (let ((range (mouse-start-end start-point start-point click-count)))
2831 (set-mark (nth 1 range)))
2832 (visible-mark-move-overlays)
2833
2834
2835 ;; Track the mouse until we get a non-movement event.
2836 (track-mouse
2837
2838 (while (progn
2839 (setq event (read-event))
2840 (or (mouse-movement-p event)
2841 (memq (car-safe event) '(switch-frame select-window))))
2842 (unless (memq (car-safe event) '(switch-frame select-window))
2843
2844 ;; Automatic hscrolling did not occur during the call to
2845 ;; `read-event'; but if the user subsequently drags the
2846 ;; mouse, go ahead and hscroll.
2847 (let ((auto-hscroll-mode auto-hscroll-mode-saved))
2848 (redisplay))
2849 (setq end (event-end event)
2850 end-point (posn-point end))
2851 ;; Note whether the mouse has left the starting position.
2852
2853 (unless (eq end-point start-point)
2854 (setq moved-off-start t))
2855 (if (and (eq (posn-window end) start-window)
2856 (integer-or-marker-p end-point))
2857 (mouse3-range-mark start-point end-point click-count); ian, set mark
2858
2859 ; do scrolling if needed
2860 (let ((mouse-row (cdr (cdr (mouse-position)))))
2861 (cond
2862 ((null mouse-row))
2863 ((< mouse-row top)
2864 (mouse-scroll-subr start-window (- mouse-row top)
2865 nil start-point))
2866 ((>= mouse-row bottom)
2867 (mouse-scroll-subr start-window (1+ (- mouse-row bottom))
2868 nil start-point))))))))
2869
2870 ;; Handle the terminating event if possible.
2871 (when (consp event)
2872 ;; Ensure that point is on the end of the last event.
2873 (when (and (setq end-point (posn-point (event-end event)))
2874 (eq (posn-window end) start-window)
2875 (integer-or-marker-p end-point)
2876 (/= start-point end-point))
2877 ;(mouse--drag-set-mark-and-point start-point ; ian, set mark
2878 ;end-point click-count))
2879 (mouse3-range-mark start-point end-point click-count)); ian, set mark
2880
2881 ;; Find its binding.
2882 (let* ((fun (key-binding (vector (car event))))
2883 (do-multi-click (and (> (event-click-count event) 0)
2884 (functionp fun)
2885 (not (memq fun '(mouse3-set-mark))))))
2886 (if (and (/= end-point start-point)
2887 (not do-multi-click))
2888
2889 ;; If point has moved, finish the drag.
2890 (let* (last-command this-command)
2891 (and mouse-drag-copy-region
2892 do-mouse-drag-region-post-process
2893 (let (deactivate-mark)
2894 (copy-region-as-kill (mark) (point)))))
2895
2896 ;; Otherwise, run binding of terminating up-event.
2897 (when do-multi-click
2898 (set-mark start-point)) ; ian, change this. why?
2899 (visible-mark-move-overlays)
2900
2901
2902 (when (and (functionp fun)
2903 (= start-hscroll (window-hscroll start-window))
2904 ;; Don't run the up-event handler if the window
2905 ;; start changed in a redisplay after the
2906 ;; mouse-set-point for the down-mouse event at
2907 ;; the beginning of this function. When the
2908 ;; window start has changed, the up-mouse event
2909 ;; contains a different position due to the new
2910 ;; window contents, and point is set again.
2911 (or end-point
2912 (= (window-start start-window)
2913 start-window-start)))
2914
2915 (push event unread-command-events)))))))
2916
2917 #+end_src
2918
2919
2920
2921
2922
2923 * org mode
2924
2925 #+begin_src emacs-lisp
2926
2927 ;; todo work on org-cycle-emulate-tab
2928
2929 ;; todo, this doesn't work for a non-standard keybind
2930 ;;(setq org-special-ctrl-k t)
2931
2932 ;; todo, generally fix org mode keys
2933 ;; todo, org-mark-element, unbdind from M-h, bind to mark defun key
2934
2935 (org-babel-do-load-languages
2936 'org-babel-load-languages
2937 '((emacs-lisp . t)
2938 (sh . t)))
2939
2940 ;; make shell work like interactive bash shell
2941 (setq org-babel-default-header-args:sh
2942 '((:results . "output") (:shebang . "#!/bin/bash -l")))
2943
2944 ;; my patch to output stderr
2945 (setq org-babel-use-error-buffer nil)
2946
2947 ;
2948 ;; org-mode manual suggests these, but I haven't used them.
2949 ;;(global-set-key "\C-cl" 'org-store-link)
2950 ;;(global-set-key "\C-ca" 'org-agenda)
2951 ;; this got in the way of a haskell mode command
2952 ;;(global-set-key "\C-cb" 'org-iswitchb)
2953
2954
2955
2956 ;; org-src-tab-acts-natively t ; broken option. using next instead, todo fix
2957
2958 (setq org-src-fontify-natively t ; make babel blocks nice
2959 org-adapt-indentation nil
2960 org-src-preserve-indentation t
2961 ;; The most basic logging is to keep track of when a TODO item was finished.
2962 org-log-done 'time
2963 ;; use a drawer to keep the logs tidy
2964 org-log-into-drawer t
2965 org-extend-today-until 0
2966 org-startup-truncated nil
2967 org-clock-persist t
2968 org-clock-mode-line-total 'today
2969 ;; global STYLE property values for completion
2970 org-global-properties (quote (("STYLE_ALL" . "habit")))
2971 org-special-ctrl-a/e t ;; home and end work special in headlines
2972 org-completion-use-ido t
2973 org-catch-invisible-edits 'smart)
2974
2975 ;; non universally recommended settings
2976 (setq
2977 org-default-notes-file (concat org-directory "/a/t.org")
2978 org-agenda-files (quote ("/a/t.org"))
2979 org-mobile-directory "/p/org-mobile"
2980 org-mobile-inbox-for-pull "/p/from-mobile.org"
2981 org-directory "/p")
2982
2983 ;; modeilne populated from (org-clock-get-clocked-time)
2984 ;; which is populated from the var org-clock-total-time
2985 ;; which is populated by a function which starts from (org-clock-get-sum-start)
2986 ;;
2987
2988 (org-clock-persistence-insinuate)
2989
2990
2991 (defun time-to-org-day (time)
2992 (round (time-to-number-of-days
2993 (time-subtract time (list 0 (* 3600 org-extend-today-until) 0)))))
2994
2995
2996 (defun my-org-confirm-babel-evaluate (lang body)
2997 (not (or (string= (buffer-file-name) "/a/t.org")
2998 (string= (buffer-file-name) "/home/ian/.emacs.d/my-init.org")
2999 )))
3000 (setq org-confirm-babel-evaluate 'my-org-confirm-babel-evaluate)
3001
3002
3003 (defun org-time-stamp-with-time (arg)
3004 (interactive "P")
3005 ;; '(4) is the argument passed by universal prefix
3006 (org-time-stamp (if arg arg '(4)) t))
3007
3008 (defun ian-org-work-time ()
3009 (interactive)
3010 (save-excursion
3011 (set-buffer "t.org")
3012 (goto-char (org-find-entry-with-id "ian-identifier-1"))
3013 (org-clock-in)))
3014
3015 (defun ian-org-idle-time ()
3016 (interactive)
3017 (save-excursion
3018 (goto-char (org-find-entry-with-id "ian-identifier-2"))
3019 (set-buffer "t.org")
3020 (org-clock-in)))
3021
3022
3023
3024 ;; based on http://stackoverflow.com/questions/3758139/variable-pitch-for-org-mode-fixed-pitch-for-tables
3025 ;; keywords: proportional font, monospace
3026
3027 (defun variable-pitch-on ()
3028 (variable-pitch-mode 1))
3029 (add-hook 'fundamental-mode-hook 'variable-pitch-on)
3030 (add-hook 'org-mode-hook 'variable-pitch-on)
3031 (add-hook 'text-mode-hook 'variable-pitch-on)
3032
3033 (set-face-attribute 'org-table nil :family (face-attribute 'fixed-pitch :family))
3034 (set-face-attribute 'org-code nil :family (face-attribute 'fixed-pitch :family))
3035 (set-face-attribute 'org-formula nil :family (face-attribute 'fixed-pitch :family))
3036 (set-face-attribute 'org-link nil :family (face-attribute 'fixed-pitch :family))
3037 (set-face-attribute 'org-block nil :family (face-attribute 'fixed-pitch :family))
3038 (set-face-attribute 'org-date nil :family (face-attribute 'fixed-pitch :family))
3039
3040
3041 (defun remove-org-binds ()
3042 (define-key org-mode-map (kbd "<M-return>") nil)
3043 (define-key org-mode-map (kbd "C-'") nil)
3044 (define-key org-mode-map (kbd "C-y") nil)
3045 (define-key org-mode-map (kbd "<C-return>") nil)
3046 (define-key org-mode-map (kbd "<C-M-kp-enter>") nil)
3047 (define-key org-mode-map (kbd "C-,") nil)
3048 (define-key org-mode-map (kbd "C-M-m") nil)
3049 (define-key org-mode-map (kbd "C-k") nil)
3050 (define-key org-mode-map (kbd "C-j") nil)
3051 (define-key org-mode-map (kbd "C-M-i") nil)
3052 (define-key org-mode-map (kbd "C-M-t") nil)
3053 (define-key org-mode-map (kbd "M-a") 'nil)
3054 (define-key org-mode-map (kbd "C-a") nil)
3055 (define-key org-mode-map (kbd "M-e") nil)
3056 (define-key org-mode-map (kbd "C-e") nil)
3057 (define-key org-mode-map (kbd "C-3") nil)
3058 (define-key org-mode-map (kbd "<M-left>") nil)
3059 (define-key org-mode-map (kbd "<M-right>") nil)
3060 (define-key org-mode-map (kbd "<S-return>") nil)
3061 (define-key org-mode-map (kbd "<tab>") nil)
3062 (define-key org-mode-map (kbd "<C-S-down>") nil)
3063 (define-key org-mode-map (kbd "<C-S-up>") nil)
3064 (define-key org-mode-map (kbd "<S-down>") nil)
3065 (define-key org-mode-map (kbd "<S-up>") nil)
3066 (define-key org-mode-map "\t" nil))
3067 (add-hook 'org-mode-hook 'remove-org-binds)
3068
3069 #+end_src
3070
3071
3072 * org drill
3073
3074
3075 #+begin_src emacs-lisp :tangle no
3076
3077 (setq
3078 ;; account actual time, not just scheduled time
3079 org-drill-adjust-intervals-for-early-and-late-repetitions-p t
3080
3081 ;; still show leeches, but warn
3082 org-drill-leech-method (quote warn)
3083 ;; increased from default 20
3084 org-drill-maximum-duration 60
3085 ;; especially when starting, I want to drill hard
3086 org-drill-maximum-items-per-session nil
3087 ;; don't prompt to save buffer, auto-save will do that
3088 org-drill-save-buffers-after-drill-sessions-p nil
3089 ;; this one deals with varying difficulty items better
3090 ;; sm2 is similar, but more simplistic
3091 org-drill-spaced-repetition-algorithm (quote simple8)
3092 )
3093 #+end_src
3094 ;; todo, make the prompting text reflect this number.
3095 ;; org-drill-failure-quality
3096
3097 * os specific settings
3098
3099 disabled cuz I have none yet
3100 #+begin_src emacs-lisp :tangle no
3101 (cond ((eq system-type 'darwin))
3102 ((eq system-type 'gnu/linux))
3103 ((eq system-type 'windows-nt))
3104 (t ))
3105 #+end_src
3106
3107
3108 * prog-mode-defaults
3109
3110 #+begin_src emacs-lisp
3111
3112
3113 (defun prog-mode-defaults ()
3114 "Default coding hook, useful with any programming language."
3115 ;; so that I can do completion before the dialog pops up
3116 (local-set-key (kbd "<tab>") 'auto-complete)
3117 ;; todo, this is causing error message on loading file, prolly not working
3118 ;;(flycheck-mode +1)
3119 (setq ac-sources (delq 'ac-source-dictionary ac-sources))
3120 (highlight-symbol-mode)
3121 (make-local-variable 'column-number-mode)
3122 ;; this says do autofilling using newcomment.el. The "only" is a misnomer.
3123 (set (make-local-variable 'comment-auto-fill-only-comments) t)
3124 (column-number-mode t)
3125 (turn-on-smartparens-mode)
3126
3127 ;; prettify lambdas
3128 (font-lock-add-keywords
3129 nil `(("(\\(lambda\\>\\)"
3130 (0 (progn (compose-region (match-beginning 1) (match-end 1)
3131 ,(make-char 'greek-iso8859-7 107))
3132 nil))))))
3133 (add-hook 'prog-mode-hook 'prog-mode-defaults)
3134
3135 ;; enable flyspell in prog mode. text mode is handled
3136 (add-hook 'prog-mode-hook 'flyspell-prog-mode)
3137
3138
3139
3140 #+end_src
3141
3142 ** yank auto-indent
3143 #+begin_src emacs-lisp
3144 ;; automatically indenting yanked text if in programming-modes
3145 (defvar yank-indent-modes
3146 '(LaTeX-mode TeX-mode)
3147 "Modes in which to indent regions that are yanked (or yank-popped).
3148 Only modes that don't derive from `prog-mode' should be listed here.")
3149
3150 (defvar yank-indent-blacklisted-modes
3151 '(python-mode slim-mode haml-mode)
3152 "Modes for which auto-indenting is suppressed.")
3153
3154 (defvar yank-advised-indent-threshold 2000
3155 "Threshold (# chars) over which indentation does not automatically occur.")
3156
3157 (defun yank-advised-indent-function (beg end)
3158 "Do indentation, as long as the region isn't too large."
3159 (if (<= (- end beg) yank-advised-indent-threshold)
3160 (indent-region beg end nil)))
3161
3162 (defadvice yank (after yank-indent activate)
3163 "If current mode is one of 'yank-indent-modes,
3164 indent yanked text (with prefix arg don't indent)."
3165 (if (and (not (ad-get-arg 0))
3166 (not (member major-mode yank-indent-blacklisted-modes))
3167 (or (derived-mode-p 'prog-mode)
3168 (member major-mode yank-indent-modes)))
3169 (let ((transient-mark-mode nil))
3170 (yank-advised-indent-function (region-beginning) (region-end)))))
3171
3172 (defadvice yank-pop (after yank-pop-indent activate)
3173 "If current mode is one of 'yank-indent-modes,
3174 indent yanked text (with prefix arg don't indent)."
3175 (if (and (not (ad-get-arg 0))
3176 (not (member major-mode yank-indent-blacklisted-modes))
3177 (or (derived-mode-p 'prog-mode)
3178 (member major-mode yank-indent-modes)))
3179 (let ((transient-mark-mode nil))
3180 (yank-advised-indent-function (region-beginning) (region-end)))))
3181
3182 #+end_src
3183
3184
3185 * shell mode
3186 #+begin_src emacs-lisp
3187 ;; avoid stupid git crap like "warning, terminal not fully functional"
3188 (setenv "PAGER" "cat")
3189 ;; don't store successive duplicates in comint command history
3190 (setq comint-input-ignoredups t)
3191
3192 (defun add-mode-line-dirtrack ()
3193 (add-to-list 'mode-line-buffer-identification
3194 '(:propertize (" " default-directory " ") face dired-directory)))
3195 (add-hook 'shell-mode-hook 'add-mode-line-dirtrack)
3196
3197
3198 ;; don't fully understand it, but it works.
3199 ;; http://www.emacswiki.org/emacs/ShellDirtrackByProcfs
3200 (defun track-shell-directory/procfs ()
3201 (shell-dirtrack-mode 0)
3202 (add-hook 'comint-preoutput-filter-functions
3203 (lambda (str)
3204 (prog1 str
3205 (when (string-match comint-prompt-regexp str)
3206 (cd (file-symlink-p
3207 (format "/proc/%s/cwd" (process-id
3208 (get-buffer-process
3209 (current-buffer)))))))))
3210 nil t))
3211 (setq comint-buffer-maximum-size 100000)
3212 (add-to-list 'comint-output-filter-functions 'comint-truncate-buffer)
3213 (defun new-shell ()
3214 (interactive)
3215 (shell (generate-new-buffer-name "*shell*")))
3216 ;;
3217 (defun shell-wrap (prefix)
3218 "wrap the shell function, automatically generate a new name for a prefix arg"
3219 (interactive "P")
3220 (if prefix
3221 (new-shell)
3222 (shell)))
3223
3224 (add-hook 'shell-mode-hook 'track-shell-directory/procfs)
3225 #+end_src
3226 * smartparens
3227 the melpa git version had a catastrophic bug I reported.
3228 downgraded to marmalade version and everything is working fine.
3229 #+begin_src emacs-lisp
3230 (require 'smartparens-config)
3231 (show-smartparens-global-mode t)
3232
3233
3234 (defun gp/sp/pair-on-newline-and-indent (id action context)
3235 "Open a new brace or bracket expression, with relevant newlines and indent. "
3236 (save-excursion
3237 (newline)
3238 (indent-according-to-mode))
3239 (indent-according-to-mode))
3240
3241 ;; when opening a pair, and then inserting a newline, push the closing pair to another newline
3242 (sp-pair "{" nil :post-handlers
3243 '(:add ((lambda (id action context)
3244 (gp/sp/pair-on-newline-and-indent id action context)) (kbd "<return>"))))
3245 (sp-pair "[" nil :post-handlers
3246 '(:add ((lambda (id action context)
3247 (gp/sp/pair-on-newline-and-indent id action context)) (kbd "<return>"))))
3248
3249
3250 ;; in my version, this is not a pairing.
3251 ;; not sure if it is in a future version since I reverted to marmalade
3252 ;; Don't need c-comments in strings -- they frustrate filename globs
3253 ;; (sp-pair "/*" nil :unless '(sp-in-string-p))
3254
3255 ;; Don't need quotes to pair next to words
3256 (sp-pair "\"" nil :unless '(sp-point-before-word-p sp-point-after-word-p))
3257 (sp-pair "'" nil :unless '(sp-point-before-word-p sp-point-after-word-p))
3258
3259
3260 ;; todo, testout these mode specific settings from graphene.
3261 ;; Ruby-specific pairs and handlers
3262 (require 'smartparens-ruby)
3263
3264 ;; Markdown
3265 (sp-local-pair '(markdown-mode gfm-mode) "*" "*"
3266 :unless '(sp-in-string-p)
3267 :actions '(insert wrap))
3268
3269 ;; Except in HTML
3270 (sp-local-pair 'html-mode "\"" nil :unless '(:rem sp-point-after-word-p))
3271
3272
3273 #+end_src
3274 * smex
3275 todo; check out smex-show-unbound-commands shows frequently used commands that have no key bindings.
3276 #+begin_src emacs-lisp
3277 ; these must be before smex-initialize
3278 (setq
3279 smex-save-file "~/.emacs.d/.smex-items")
3280
3281 (smex-initialize)
3282 #+end_src
3283 * speedbar
3284 (sr-speedbar-close)
3285 (sr-speedbar-open)
3286
3287 ** todo, disabled cuz of broken package
3288 #+begin_src emacs-lisp :tangle no
3289 (require 'sr-speedbar)
3290 (setq speedbar-hide-button-brackets-flag t ;; didn't notice a diff
3291 speedbar-file-unshown-regexp "flycheck-.*"
3292 sr-speedbar-width 40
3293 sr-speedbar-width-x 40
3294 sr-speedbar-auto-refresh nil
3295 sr-speedbar-skip-other-window-p t
3296 sr-speedbar-right-side nil
3297 speedbar-hide-button-brackets-flag nil)
3298 #+end_src
3299 * spell correction
3300 #+begin_src emacs-lisp
3301 (setq
3302 ispell-program-name "hunspell"
3303 ispell-silently-savep t) ; don't prompt to save personal dictionary
3304
3305 (require 'rw-hunspell)
3306 #+end_src
3307 rw-hunspell sets up hunspell dictionary automagically.
3308
3309
3310 Rant: Hunspell SHOULD be standard. its used by firefox and openoffice and
3311 osx. In contrast, the first few words I added to aspell dictionary were
3312 "emacs" "customizable" and "timestamp". Hunspell already has those,
3313 thank god.
3314
3315 ispell-personal-dictionary does not document where the hunspell
3316 dictionary goes by default, but it is ~/.hunspell_en_US for me
3317
3318
3319 * tex
3320 #+begin_src emacs-lisp
3321 (setq-default TeX-PDF-mode t) ; use pdf
3322
3323 ; more sensible defaults based on info manual quickstart
3324 (setq TeX-auto-save t)
3325 (setq TeX-parse-self t)
3326
3327
3328 #+end_src
3329 * undo tree
3330 #+begin_src emacs-lisp
3331
3332 ;; undo-tree checks for minor modes which override
3333 ;; its minor mode keymap, and sets global keybinds if
3334 ;; that happens. this will prevent that, but I have no
3335 ;; reason to do that, so it is commented.
3336 ;; (defun undo-tree-overridden-undo-bindings-p () nil)
3337
3338 ;; todo, send patch undo-tree-visualize should scroll with the scroll key, instead of just pgup pgdn (aka next/prior)
3339 (global-undo-tree-mode)
3340 ;; disabled due to bug, something like unknown entry in undo tree canary
3341 ;; (setq undo-tree-auto-save-history t)
3342 (setq undo-outer-limit 100000000 ; per undo command
3343 undo-limit 500000000 ; undo history limit
3344 undo-strong-limit 600000000) ; undo history limit plus some extra
3345
3346
3347 #+end_src
3348
3349 * visible mark mode
3350
3351 these colors were better for dark theme
3352 #+begin_src emacs-lisp :tangle no
3353
3354
3355
3356 (defface visible-mark-face1
3357 '((((type tty) (class mono)))
3358 (t (:background "LimeGreen"))) "")
3359 (defface visible-mark-face2
3360 '((((type tty) (class mono)))
3361 (t (:background "red4"))) "")
3362 (defface visible-mark-forward-face1
3363 '((((type tty) (class mono)))
3364 (t (:background "dark magenta"))) "")
3365 (defface visible-mark-active
3366 '((((type tty) (class mono)))
3367 (t (:background "gold"))) "")
3368 (defface mouse-cursor-face
3369 '((((type tty) (class mono)))
3370 (t (:background "DeepPink1"))) "")
3371
3372 #+end_src
3373
3374
3375 #+begin_src emacs-lisp
3376
3377 (add-to-list 'load-path "~/.emacs.d/src/visible-mark")
3378
3379 ;; since it is not easy to change the mark overlay priority, I change this one.
3380 (setq show-paren-priority 999)
3381
3382
3383 (defface visible-mark-active
3384 '((((type tty) (class mono)))
3385 (t (:background "magenta"))) "")
3386
3387
3388
3389 (defface mouse-cursor-face
3390 '((((type tty) (class mono)))
3391 (t (:background "DeepPink1"))) "")
3392
3393
3394 (require 'visible-mark)
3395
3396 (setq visible-mark-faces '(visible-mark-face1 visible-mark-face2))
3397 (setq visible-mark-forward-faces '(visible-mark-forward-face1))
3398
3399
3400 ; highlight the last 2 marks
3401 (setq visible-mark-max 2)
3402 ; highlight 1 forward mark
3403 (setq visible-mark-forward-max 1)
3404 ; globally activate visible-mark-mode
3405 (global-visible-mark-mode +1)
3406
3407
3408 ;; todo, it doesn't seem to be exposed in elisp, but it would be nice
3409 ;; if I could define overlay faces to use inverse foreground color
3410
3411
3412 #+end_src
3413
3414 #+RESULTS:
3415 : t
3416
3417
3418 * key binds. keep at end of file
3419 this should come at the end because it depends on key maps being
3420 created in earlier sections.
3421
3422 ** emacs keys notes
3423 commands not needed in ido mode and their replacement in ido mode
3424 spell check fix -> use current pattern and start new one
3425 narrow -> create subdirectory
3426 org-cycle -> M-s search recently used directory
3427 vert split Window -> create file instead of select match
3428 delete-other-windows -> open dired buffer
3429 delete current window -> delete buffer/file
3430 find file -> search within all subdirectories
3431
3432 forward/back error
3433
3434 buffer select -> toggle find file / buffer
3435 up/down -> next/previous history
3436 forward/back -> ido-forward/back
3437
3438
3439 right keyboard attributes: movement, involve typing words
3440 left keyboard attributes: non-typing universal non-movement
3441
3442
3443
3444
3445 todo
3446 fix global unpop mark ring
3447 setup helm
3448 learn cedet and projectile and helm
3449 setup key for pop-global-mark
3450 try out C-M-\ indent region
3451 set quoted insert to some obscure keybind
3452 make currently overrided M-u uppercase word into something obscure
3453 remember mode
3454 bind shell-command to something better
3455 investigate tags
3456 investigate keys in isearch mode and find file mode
3457 try out occur. M-s o
3458 investigate programming modes. M-g n/b next/previous error. gdb?
3459 investigate org mode keys
3460 learn version control
3461 learn mail
3462 check out imenu
3463 bind capitalize-word to something obscure
3464 sentance/paragraph movement/marking should be swapped with sexp/paren movement based on mode
3465 bind fill-paragraph to something obscure
3466 setup linewise paste
3467 install magit (git control)
3468 magpie expansion provides a completion key for acronym expansion based on buffer text
3469 learn ediff
3470 universal google
3471 figure out auto-indent
3472 learn eshell and prelude settings for it
3473 combine register prefix and c-x prefix
3474 note: remember to think of mouse & foot pedals
3475 commands to change: select other window: C-x o.
3476 ** prefix keybind changes
3477 #+begin_src emacs-lisp
3478
3479
3480 ; prefix key binds.
3481 ; good info http://www.masteringemacs.org/articles/2011/02/08/mastering-key-bindings-emacs/
3482 ; rebinding the prefix keys are tricky. apparently, some modes ignore any redefinition of a prefix key and use it explicitly,
3483 ; so you have to dig into their key maps and redo things.
3484 ; There are 2 simpler alternatives which have their own downsides.
3485 ; One is cua mode, which I do not like because it smashes 2 keybinds onto 1 and limits what you can do.
3486 ; The other is keyboard-translate, which translates the key presses before anything else.
3487 ; The downside is that it translates them when you aren't using them as a prefix.
3488 ; Since the swaps I'm using are all very accessible, the only downside is some mental jugling when reading docs etc about these keybinds.
3489
3490 ; I've seen this as an another suggestion, it was a total fail. The prefix command took over both keys.
3491 ; (define-key key-translation-map [f12] "\C-c")
3492 ; (define-key key-translation-map "\C-c" [left])
3493
3494
3495 ;idea to remove the hook later since it is only needed at startup.
3496 ; did not work however, and there is not a real need to fix it, so I did not investigate
3497 ;(defun removeSwapHook ()
3498 ; (remove-hook 'buffer-list-update-hook 'myKeySwap)
3499 ; (remove-hook 'change-major-mode-hook 'removeSwapHook))
3500 ;(add-hook 'change-major-mode-hook 'removeSwapHook)
3501
3502
3503 ; went through almost all the relevant standard hooks,
3504 ; this overcomes a known bug that (keyboard-translate) does not get applied when running emacs daemon
3505 (add-hook 'buffer-list-update-hook (lambda () (interactive)
3506 (keyboard-translate ?\C-x ?\C-s)
3507 (keyboard-translate ?\C-s ?\C-x)
3508 (keyboard-translate ?\C-c ?\C-d)
3509 (keyboard-translate ?\C-d ?\C-c)))
3510
3511
3512
3513 ; these all don't work
3514 ; don't know why this doesn't error but reversing the keys does
3515 ;(keyboard-translate ?\t ?\M-\t)
3516 ;(keyboard-translate [M-tab] [tab])
3517 ; from what i can tell, it wants to use a keyboard-translate-table,
3518 ; which is a char table, which is a vector indexed by chars,
3519 ; and mod+tab is not a char (it has too many bits), it is an integer
3520 ; it actually says it can hold vectors or strings, but that it is obsolete to do so
3521 ;(characterp ?\M-a)
3522 ;(characterp ?\C-a)
3523
3524
3525
3526 #+end_src
3527
3528 ** named commands
3529 *** tramp sudo
3530 /ssh:host|sudo:host:
3531 when in the same session, you can then do:
3532 /sudo:root@host:
3533
3534 *** org insert table row
3535 [org-shiftmetadown/up]
3536 *** toggle line continuation / truncation / wrap :drill:
3537 SCHEDULED: <2014-04-07 Mon>
3538 :PROPERTIES:
3539 :ID: 5f3f567a-0926-4d92-81f3-4e4cd6070af2
3540 :DRILL_LAST_INTERVAL: 28.6736
3541 :DRILL_REPEATS_SINCE_FAIL: 5
3542 :DRILL_TOTAL_REPEATS: 5
3543 :DRILL_FAILURE_COUNT: 1
3544 :DRILL_AVERAGE_QUALITY: 3.4
3545 :DRILL_EASE: 2.666
3546 :DRILL_LAST_QUALITY: 4
3547 :DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:37>
3548 :END:
3549 [toggle-truncate-lines]
3550 *** auto-save on/off :drill:
3551 SCHEDULED: <2014-05-13 Tue>
3552 :PROPERTIES:
3553 :ID: 462f859d-1a06-46a3-ac72-6ffe5b4417c9
3554 :DRILL_LAST_INTERVAL: 71.5839
3555 :DRILL_REPEATS_SINCE_FAIL: 4
3556 :DRILL_TOTAL_REPEATS: 4
3557 :DRILL_FAILURE_COUNT: 0
3558 :DRILL_AVERAGE_QUALITY: 4.75
3559 :DRILL_EASE: 4.85
3560 :DRILL_LAST_QUALITY: 5
3561 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:11>
3562 :END:
3563 [my-as-on/my-as-off]
3564 *** toggle menu bar
3565 [menu-bar-mode]
3566 *** show abbreviations :drill:
3567 SCHEDULED: <2014-03-24 Mon>
3568 :PROPERTIES:
3569 :ID: 479a2ced-b952-4088-a6e3-862cd37693a9
3570 :DRILL_LAST_INTERVAL: 32.7466
3571 :DRILL_REPEATS_SINCE_FAIL: 4
3572 :DRILL_TOTAL_REPEATS: 4
3573 :DRILL_FAILURE_COUNT: 0
3574 :DRILL_AVERAGE_QUALITY: 4.0
3575 :DRILL_EASE: 3.204
3576 :DRILL_LAST_QUALITY: 4
3577 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 18:03>
3578 :END:
3579 [list-abbrevs]
3580
3581 *** rename-file-and-buffer
3582 *** ediff-buffers
3583 *** refill-mode
3584 automatically balance a paragraph with newlines
3585 *** executable-make-buffer-file-executable-if-script-p
3586 make a script executable
3587 *** (setq lazy-highlight-cleanup nil)
3588 *** auto-revert-tail-mode
3589 tail a file
3590 *** trash-file-and-buffer
3591 #+begin_src emacs-lisp
3592 (defun trash-file-and-buffer ()
3593 "Removes file connected to current buffer and kills buffer."
3594 (interactive)
3595 (let ((filename (buffer-file-name))
3596 (buffer (current-buffer))
3597 (name (buffer-name)))
3598 (if (not (and filename (file-exists-p filename)))
3599 (error "Buffer '%s' is not visiting a file!" name)
3600 (delete-file filename)
3601 (kill-buffer buffer)
3602 (message "File '%s' successfully removed" filename))))
3603
3604 #+end_src
3605 *** what-line
3606 *** linum-mode
3607 line numbers
3608
3609 *** sgml-pretty-print
3610 format xml in nxml-mode
3611 *** visual-line-mode
3612 toggle word wrap.
3613 ** compound commands
3614 *** C-xc
3615 :PROPERTIES:
3616 :ID: d0802daa-9281-4a9f-ab4a-47d9f7ef7cfd
3617 :END:
3618 exit
3619 *** [C-x x] :drill:
3620 SCHEDULED: <2014-03-24 Mon>
3621 :PROPERTIES:
3622 :ID: 2f7d1353-3c20-4e00-95ea-1f84c4d87fc1
3623 :DRILL_LAST_INTERVAL: 32.7466
3624 :DRILL_REPEATS_SINCE_FAIL: 4
3625 :DRILL_TOTAL_REPEATS: 4
3626 :DRILL_FAILURE_COUNT: 0
3627 :DRILL_AVERAGE_QUALITY: 4.0
3628 :DRILL_EASE: 3.204
3629 :DRILL_LAST_QUALITY: 4
3630 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 18:03>
3631 :END:
3632 save file
3633 *** [C-x e] :drill:
3634 SCHEDULED: <2014-03-27 Thu>
3635 :PROPERTIES:
3636 :ID: b802eeb8-ddcd-4778-844a-b6e737b54d7d
3637 :DRILL_LAST_INTERVAL: 50.6823
3638 :DRILL_REPEATS_SINCE_FAIL: 3
3639 :DRILL_TOTAL_REPEATS: 3
3640 :DRILL_FAILURE_COUNT: 0
3641 :DRILL_AVERAGE_QUALITY: 5.0
3642 :DRILL_EASE: 5.815
3643 :DRILL_LAST_QUALITY: 5
3644 :DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:41>
3645 :END:
3646 eval last sexp
3647 *** C-x u
3648 [undo-tree-visualize]
3649 *** C-j u/U
3650 [undo-tree save/restore state via register]
3651 *** C-c -
3652 [org insert table horizontal line or create list]
3653 *** [C-x tab] :drill:
3654 SCHEDULED: <2014-03-24 Mon>
3655 :PROPERTIES:
3656 :ID: ceb701d7-3d44-4781-ae23-7309ca887a01
3657 :DRILL_LAST_INTERVAL: 32.7466
3658 :DRILL_REPEATS_SINCE_FAIL: 4
3659 :DRILL_TOTAL_REPEATS: 4
3660 :DRILL_FAILURE_COUNT: 0
3661 :DRILL_AVERAGE_QUALITY: 4.0
3662 :DRILL_EASE: 3.204
3663 :DRILL_LAST_QUALITY: 4
3664 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:50>
3665 :END:
3666 dumb indent
3667
3668 [shift-left and shift-right are default for indenting by tab stop,
3669 and they are only defined as lambdas so I copy them here
3670 to use with up and down.
3671 #+begin_src emacs-lisp
3672 ;; condition cuz emacs24 release doesn't have this yet
3673 (when (boundp 'indent-rigidly-map)
3674 (define-key indent-rigidly-map (kbd "<C-left>")
3675 (lambda (beg end) (interactive "r")
3676 (let* ((current (indent-rigidly--current-indentation beg end))
3677 (next (indent--next-tab-stop current)))
3678 (indent-rigidly beg end (- next current)))))
3679
3680 (define-key indent-rigidly-map (kbd "<C-right>")
3681 (lambda (beg end) (interactive "r")
3682 (let* ((current (indent-rigidly--current-indentation beg end))
3683 (next (indent--next-tab-stop current 'prev)))
3684 (indent-rigidly beg end (- next current))))))
3685 #+end_src
3686 ]
3687 *** C-x *
3688 [calc-dispatch]
3689 *** C-x =
3690 [point information]
3691 *** C-x d
3692 [dired]
3693 *** C-xb
3694 [ibuffer]
3695 #+begin_src emacs-lisp
3696 (global-set-key (kbd "C-x C-b") 'ibuffer)
3697 #+end_src
3698 ** gnus
3699 searching overview.
3700 3 types:
3701 ingroup searching
3702 nnir searching with notmuch, specific group (not sure if it can do multiple)
3703 search all groups with mairix
3704 *** [a]
3705 compose new message
3706 *** [C-c C-c]
3707 send message
3708 *** [s]
3709 save newsrc file, alterations to groups.
3710 *** [g]
3711 gnus refresh / get new
3712 *** [m]
3713 gnus new message
3714 *** [F]
3715 gnus quoted reply all
3716 *** [e]
3717 gnus draft edit message
3718 *** [delete]
3719 gnus delete draft
3720 #+begin_src emacs-lisp
3721 (add-hook 'gnus-startup-hook
3722 (lambda ()
3723 (define-key gnus-summary-mode-map (kbd "<delete>") 'gnus-summary-delete-article)))
3724 #+end_src
3725
3726 *** [b]
3727 mairix search
3728 #+begin_src emacs-lisp
3729 (add-hook 'gnus-startup-hook
3730 (lambda ()
3731 (define-key gnus-group-mode-map "b" 'nnmairix-search)
3732 (define-key gnus-summary-mode-map "b" 'nnmairix-search)))
3733 #+end_src
3734 *** [B m]
3735 move message, or messages in region
3736 *** [#]
3737 mark article, move with B m
3738 *** [B delete]
3739 gnus delete draft
3740 *** [/ plus x a / b]
3741 search current group (or see info manual for more groups),
3742 using the gnus native search (its slow, do a notmuch or mairix search instead)
3743 x= extra (ie. to)
3744 todo; send in patch to make author search to in sent folder
3745 a = author
3746 / = subject
3747 b = body
3748 see C-h m for a full list
3749 *** [ G G ]
3750 do a nnir notmuch search, for the group on the current line
3751 *** [ A T ]
3752 jump to thread from nnir group
3753
3754 *** [marks]
3755 ! = saved for later
3756 E = expired
3757 M-& apply process mark to a non-process mark command
3758 *** [S D e]
3759 edit as new
3760 ** message mode
3761 *** [C-ck]
3762 discard message
3763 ** notmuch
3764 *** [space]
3765 notmuch advance to next message/thread
3766
3767 ** readline / bash / .inputrc
3768 *** [M-0-9]
3769 SCHEDULED: <2014-05-13 Tue>
3770 :PROPERTIES:
3771 :ID: dac68f2e-37c2-448e-861d-0554e51f1414
3772 :DRILL_LAST_INTERVAL: 71.5839
3773 :DRILL_REPEATS_SINCE_FAIL: 4
3774 :DRILL_TOTAL_REPEATS: 4
3775 :DRILL_FAILURE_COUNT: 0
3776 :DRILL_AVERAGE_QUALITY: 4.75
3777 :DRILL_EASE: 4.85
3778 :DRILL_LAST_QUALITY: 5
3779 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:10>
3780 :END:
3781 bash digit-argument
3782
3783 removed drill from all these because I'm using emacs for shell now
3784 *** [C-2]
3785 SCHEDULED: <2014-03-15 Sat>
3786 :PROPERTIES:
3787 :ID: d2e87812-6ab7-432f-ad7c-4281c0e3b86b
3788 :DRILL_LAST_INTERVAL: 12.979
3789 :DRILL_REPEATS_SINCE_FAIL: 3
3790 :DRILL_TOTAL_REPEATS: 3
3791 :DRILL_FAILURE_COUNT: 0
3792 :DRILL_AVERAGE_QUALITY: 3.333
3793 :DRILL_EASE: 2.626
3794 :DRILL_LAST_QUALITY: 3
3795 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:00>
3796 :END:
3797 terminal X paste
3798 *** [C-3]
3799 SCHEDULED: <2014-03-15 Sat>
3800 :PROPERTIES:
3801 :ID: 3b156730-eb92-4149-b4ce-f93a9098d2b4
3802 :DRILL_LAST_INTERVAL: 12.979
3803 :DRILL_REPEATS_SINCE_FAIL: 3
3804 :DRILL_TOTAL_REPEATS: 3
3805 :DRILL_FAILURE_COUNT: 0
3806 :DRILL_AVERAGE_QUALITY: 3.333
3807 :DRILL_EASE: 2.626
3808 :DRILL_LAST_QUALITY: 3
3809 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:00>
3810 :END:
3811 terminal open file manager
3812 *** [C-q]
3813 SCHEDULED: <2014-03-12 Wed>
3814 :PROPERTIES:
3815 :ID: ed6a19de-d000-4469-9dd9-7b9e35f6c751
3816 :DRILL_LAST_INTERVAL: 2.8975
3817 :DRILL_REPEATS_SINCE_FAIL: 2
3818 :DRILL_TOTAL_REPEATS: 10
3819 :DRILL_FAILURE_COUNT: 12
3820 :DRILL_AVERAGE_QUALITY: 2.692
3821 :DRILL_EASE: 2.311
3822 :DRILL_LAST_QUALITY: 3
3823 :DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:33>
3824 :END:
3825 bash exchange-point-and-mark
3826
3827 *** [C-M-q]
3828 SCHEDULED: <2014-03-14 Fri>
3829 :PROPERTIES:
3830 :ID: 9827eb7e-532e-41fb-8d91-8c95c23553f5
3831 :DRILL_LAST_INTERVAL: 11.6739
3832 :DRILL_REPEATS_SINCE_FAIL: 3
3833 :DRILL_TOTAL_REPEATS: 3
3834 :DRILL_FAILURE_COUNT: 0
3835 :DRILL_AVERAGE_QUALITY: 3.333
3836 :DRILL_EASE: 2.626
3837 :DRILL_LAST_QUALITY: 4
3838 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:09>
3839 :END:
3840 quoted insert
3841 *** [C-w]
3842 SCHEDULED: <2014-04-07 Mon>
3843 :PROPERTIES:
3844 :ID: 58fea89a-def9-4aac-95d4-fdd63fde8097
3845 :DRILL_LAST_INTERVAL: 28.6736
3846 :DRILL_REPEATS_SINCE_FAIL: 5
3847 :DRILL_TOTAL_REPEATS: 5
3848 :DRILL_FAILURE_COUNT: 1
3849 :DRILL_AVERAGE_QUALITY: 3.4
3850 :DRILL_EASE: 2.666
3851 :DRILL_LAST_QUALITY: 4
3852 :DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:36>
3853 :END:
3854 bash kill-region
3855 *** [C-e]
3856 SCHEDULED: <2014-03-27 Thu>
3857 :PROPERTIES:
3858 :ID: 3ee7662f-3ac7-46ff-afe7-73244656d48b
3859 :DRILL_LAST_INTERVAL: 50.6823
3860 :DRILL_REPEATS_SINCE_FAIL: 3
3861 :DRILL_TOTAL_REPEATS: 3
3862 :DRILL_FAILURE_COUNT: 0
3863 :DRILL_AVERAGE_QUALITY: 5.0
3864 :DRILL_EASE: 5.815
3865 :DRILL_LAST_QUALITY: 5
3866 :DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:40>
3867 :END:
3868 bash yank-last-arg
3869 *** C-r
3870 :PROPERTIES:
3871 :ID: 579a9008-0758-4ba9-a52f-175f264fe96a
3872 :END:
3873 bash history-search-backward
3874 *** [C-t]
3875 SCHEDULED: <2014-04-04 Fri>
3876 :PROPERTIES:
3877 :ID: 25e737fe-52c4-452b-ab93-037575375579
3878 :DRILL_LAST_INTERVAL: 26.2331
3879 :DRILL_REPEATS_SINCE_FAIL: 5
3880 :DRILL_TOTAL_REPEATS: 5
3881 :DRILL_FAILURE_COUNT: 1
3882 :DRILL_AVERAGE_QUALITY: 3.2
3883 :DRILL_EASE: 2.554
3884 :DRILL_LAST_QUALITY: 4
3885 :DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:36>
3886 :END:
3887 shell-expand-line, expand like bash does u hit enter
3888 *** [C-a]
3889 SCHEDULED: <2014-04-06 Sun>
3890 :PROPERTIES:
3891 :ID: 384b3337-3cb0-4b3b-8a1a-8ae299ae212b
3892 :DRILL_LAST_INTERVAL: 27.9921
3893 :DRILL_REPEATS_SINCE_FAIL: 5
3894 :DRILL_TOTAL_REPEATS: 5
3895 :DRILL_FAILURE_COUNT: 1
3896 :DRILL_AVERAGE_QUALITY: 3.6
3897 :DRILL_EASE: 2.802
3898 :DRILL_LAST_QUALITY: 5
3899 :DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:37>
3900 :END:
3901 bash comment-line
3902 *** [C-s]
3903 SCHEDULED: <2014-03-10 Mon>
3904 :PROPERTIES:
3905 :ID: 4b5c71f9-6035-4b92-bcad-e400e5e25d66
3906 :DRILL_LAST_INTERVAL: 8.225
3907 :DRILL_REPEATS_SINCE_FAIL: 3
3908 :DRILL_TOTAL_REPEATS: 7
3909 :DRILL_FAILURE_COUNT: 4
3910 :DRILL_AVERAGE_QUALITY: 2.879
3911 :DRILL_EASE: 2.399
3912 :DRILL_LAST_QUALITY: 4
3913 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 20:57>
3914 :END:
3915 bash yank-nth-arg
3916 yank $1 of last argument, or nth if prefixed with a digit argument
3917 *** [C-d]
3918 SCHEDULED: <2014-03-12 Wed>
3919 :PROPERTIES:
3920 :ID: f5da97c1-6e3c-44dd-a2f1-7dacd7f523da
3921 :DRILL_LAST_INTERVAL: 9.8132
3922 :DRILL_REPEATS_SINCE_FAIL: 3
3923 :DRILL_TOTAL_REPEATS: 7
3924 :DRILL_FAILURE_COUNT: 3
3925 :DRILL_AVERAGE_QUALITY: 3.21
3926 :DRILL_EASE: 2.559
3927 :DRILL_LAST_QUALITY: 4
3928 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:04>
3929 :END:
3930 bash undo
3931 *** [C-f]
3932 SCHEDULED: <2014-05-13 Tue>
3933 :PROPERTIES:
3934 :ID: 0f1def18-0d94-45e7-b258-f621e67cefd7
3935 :DRILL_LAST_INTERVAL: 71.5839
3936 :DRILL_REPEATS_SINCE_FAIL: 4
3937 :DRILL_TOTAL_REPEATS: 4
3938 :DRILL_FAILURE_COUNT: 0
3939 :DRILL_AVERAGE_QUALITY: 4.75
3940 :DRILL_EASE: 4.85
3941 :DRILL_LAST_QUALITY: 5
3942 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:11>
3943 :END:
3944 bash menu-complete
3945 *** [C-g]
3946 SCHEDULED: <2014-03-10 Mon>
3947 :PROPERTIES:
3948 :ID: 263e9479-de1d-4e78-8600-5a0f3a8e2dd9
3949 :DRILL_LAST_INTERVAL: 8.0608
3950 :DRILL_REPEATS_SINCE_FAIL: 3
3951 :DRILL_TOTAL_REPEATS: 8
3952 :DRILL_FAILURE_COUNT: 5
3953 :DRILL_AVERAGE_QUALITY: 2.966
3954 :DRILL_EASE: 2.439
3955 :DRILL_LAST_QUALITY: 4
3956 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:04>
3957 :END:
3958 bash edit-and-execute-command
3959 *** C-z
3960 *** C-x
3961 emacs hard to rebind
3962 looks like it actually wouldn't be that hard.
3963 possibly take the output from bind -p, make all those keys undefined.
3964 *** C-c
3965 quit/cancel
3966 *** C-v
3967 yank, aka paste
3968 *** C-M-v
3969 yank-pop
3970 *** [C-b]
3971 SCHEDULED: <2014-03-14 Fri>
3972 :PROPERTIES:
3973 :ID: 1a688c40-4bba-4053-a28b-0e1e8d3f4985
3974 :DRILL_LAST_INTERVAL: 4.9208
3975 :DRILL_REPEATS_SINCE_FAIL: 2
3976 :DRILL_TOTAL_REPEATS: 8
3977 :DRILL_FAILURE_COUNT: 4
3978 :DRILL_AVERAGE_QUALITY: 3.066
3979 :DRILL_EASE: 2.487
3980 :DRILL_LAST_QUALITY: 3
3981 :DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:33>
3982 :END:
3983 bash menu-complete-backward
3984 *** tab
3985 completion
3986 *** [C-tab]
3987 SCHEDULED: <2014-03-14 Fri>
3988 :PROPERTIES:
3989 :ID: 75d57537-8a32-4a18-982e-6d6f756a9ba6
3990 :DRILL_LAST_INTERVAL: 12.2744
3991 :DRILL_REPEATS_SINCE_FAIL: 3
3992 :DRILL_TOTAL_REPEATS: 3
3993 :DRILL_FAILURE_COUNT: 2
3994 :DRILL_AVERAGE_QUALITY: 3.667
3995 :DRILL_EASE: 2.855
3996 :DRILL_LAST_QUALITY: 4
3997 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:09>
3998 :END:
3999 terminal find
4000 *** [C-left/right]
4001 SCHEDULED: <2014-03-27 Thu>
4002 :PROPERTIES:
4003 :ID: 5587c07b-c003-470f-bef4-fa55f00524ff
4004 :DRILL_LAST_INTERVAL: 50.6823
4005 :DRILL_REPEATS_SINCE_FAIL: 3
4006 :DRILL_TOTAL_REPEATS: 3
4007 :DRILL_FAILURE_COUNT: 0
4008 :DRILL_AVERAGE_QUALITY: 5.0
4009 :DRILL_EASE: 5.815
4010 :DRILL_LAST_QUALITY: 5
4011 :DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:41>
4012 :END:
4013 forward/backward-word
4014
4015 *** [C-u]
4016 SCHEDULED: <2014-03-19 Wed>
4017 :PROPERTIES:
4018 :ID: b5342b6b-f14f-4a6b-99d8-110fdef243f2
4019 :DRILL_LAST_INTERVAL: 24.3844
4020 :DRILL_REPEATS_SINCE_FAIL: 5
4021 :DRILL_TOTAL_REPEATS: 5
4022 :DRILL_FAILURE_COUNT: 2
4023 :DRILL_AVERAGE_QUALITY: 3.0
4024 :DRILL_EASE: 2.456
4025 :DRILL_LAST_QUALITY: 3
4026 :DRILL_LAST_REVIEWED: <2014-02-23 Sun 01:51>
4027 :END:
4028 bash backward-kill-word
4029 *** [C-i]
4030 SCHEDULED: <2014-03-14 Fri>
4031 :PROPERTIES:
4032 :ID: 6e306a04-8f21-4142-8c00-8a87a3544d6e
4033 :DRILL_LAST_INTERVAL: 11.6739
4034 :DRILL_REPEATS_SINCE_FAIL: 3
4035 :DRILL_TOTAL_REPEATS: 3
4036 :DRILL_FAILURE_COUNT: 0
4037 :DRILL_AVERAGE_QUALITY: 3.333
4038 :DRILL_EASE: 2.626
4039 :DRILL_LAST_QUALITY: 4
4040 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 20:58>
4041 :END:
4042 terminal find up
4043 [ terminal crap, duplicate of tab ]
4044 *** [C-o]
4045 SCHEDULED: <2014-03-15 Sat>
4046 :PROPERTIES:
4047 :ID: 40b6d9ce-2427-4905-b444-d6d90c5a4da4
4048 :DRILL_LAST_INTERVAL: 23.5247
4049 :DRILL_REPEATS_SINCE_FAIL: 4
4050 :DRILL_TOTAL_REPEATS: 4
4051 :DRILL_FAILURE_COUNT: 0
4052 :DRILL_AVERAGE_QUALITY: 3.5
4053 :DRILL_EASE: 2.73
4054 :DRILL_LAST_QUALITY: 3
4055 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:25>
4056 :END:
4057 bash operate-and-get-next, submit and bring up next item in history
4058 *** [C-p]
4059 SCHEDULED: <2014-03-11 Tue>
4060 :PROPERTIES:
4061 :ID: 4956027e-c5da-48de-8925-6f6b6dd98cec
4062 :DRILL_LAST_INTERVAL: 1.575
4063 :DRILL_REPEATS_SINCE_FAIL: 1
4064 :DRILL_TOTAL_REPEATS: 9
4065 :DRILL_FAILURE_COUNT: 8
4066 :DRILL_AVERAGE_QUALITY: 2.597
4067 :DRILL_EASE: 2.265
4068 :DRILL_LAST_QUALITY: 3
4069 :DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:38>
4070 :END:
4071 bash dabbrev-expand,
4072 complete historical command names
4073 *** C-h
4074 terminal incompatible junk
4075 *** [C-k]
4076 SCHEDULED: <2014-05-09 Fri>
4077 :PROPERTIES:
4078 :ID: f91ff161-8d8c-4f47-beb5-09f86bf774d5
4079 :DRILL_LAST_INTERVAL: 67.6174
4080 :DRILL_REPEATS_SINCE_FAIL: 4
4081 :DRILL_TOTAL_REPEATS: 4
4082 :DRILL_FAILURE_COUNT: 1
4083 :DRILL_AVERAGE_QUALITY: 4.75
4084 :DRILL_EASE: 4.85
4085 :DRILL_LAST_QUALITY: 5
4086 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:10>
4087 :END:
4088 bash kill-line, to end of line
4089 *** [C-l]
4090 SCHEDULED: <2014-05-13 Tue>
4091 :PROPERTIES:
4092 :ID: 4798acc1-4fc8-406e-bc95-8131cfa255a5
4093 :DRILL_LAST_INTERVAL: 71.5839
4094 :DRILL_REPEATS_SINCE_FAIL: 4
4095 :DRILL_TOTAL_REPEATS: 4
4096 :DRILL_FAILURE_COUNT: 0
4097 :DRILL_AVERAGE_QUALITY: 4.75
4098 :DRILL_EASE: 4.85
4099 :DRILL_LAST_QUALITY: 5
4100 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:12>
4101 :END:
4102 bash clear screen
4103 *** [C-m]
4104 SCHEDULED: <2014-03-14 Fri>
4105 :PROPERTIES:
4106 :ID: 119a0a90-9253-4131-b0c8-5aa7d8cf2259
4107 :DRILL_LAST_INTERVAL: 11.6739
4108 :DRILL_REPEATS_SINCE_FAIL: 3
4109 :DRILL_TOTAL_REPEATS: 3
4110 :DRILL_FAILURE_COUNT: 0
4111 :DRILL_AVERAGE_QUALITY: 3.333
4112 :DRILL_EASE: 2.626
4113 :DRILL_LAST_QUALITY: 4
4114 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 20:58>
4115 :END:
4116 [--------]
4117 #+begin_src emacs-lisp
4118 (add-hook 'comint-mode-hook
4119 (lambda ()
4120 (define-key comint-mode-map "\C-m" nil)))
4121
4122 #+end_src
4123 *** [C-space]
4124 SCHEDULED: <2014-03-12 Wed>
4125 :PROPERTIES:
4126 :ID: 803e2480-4e11-41d0-a261-4f5930a7f9a9
4127 :DRILL_LAST_INTERVAL: 10.0687
4128 :DRILL_REPEATS_SINCE_FAIL: 3
4129 :DRILL_TOTAL_REPEATS: 6
4130 :DRILL_FAILURE_COUNT: 1
4131 :DRILL_AVERAGE_QUALITY: 2.875
4132 :DRILL_EASE: 2.397
4133 :DRILL_LAST_QUALITY: 3
4134 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:06>
4135 :END:
4136 bash set mark
4137 *** [C-delete]
4138 SCHEDULED: <2014-03-15 Sat>
4139 :PROPERTIES:
4140 :ID: 3d0c188b-3cf0-4f0a-83c8-78f6e4040ee5
4141 :DRILL_LAST_INTERVAL: 24.4352
4142 :DRILL_REPEATS_SINCE_FAIL: 4
4143 :DRILL_TOTAL_REPEATS: 4
4144 :DRILL_FAILURE_COUNT: 0
4145 :DRILL_AVERAGE_QUALITY: 3.75
4146 :DRILL_EASE: 2.929
4147 :DRILL_LAST_QUALITY: 4
4148 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:44>
4149 :END:
4150 bash delete word
4151 ** isearch
4152 *** [C-w] :drill:
4153 SCHEDULED: <2014-03-27 Thu>
4154 :PROPERTIES:
4155 :ID: f0e2b6e2-809b-40c2-8d72-0f7e35eda9b3
4156 :DRILL_LAST_INTERVAL: 50.6823
4157 :DRILL_REPEATS_SINCE_FAIL: 3
4158 :DRILL_TOTAL_REPEATS: 3
4159 :DRILL_FAILURE_COUNT: 0
4160 :DRILL_AVERAGE_QUALITY: 5.0
4161 :DRILL_EASE: 5.815
4162 :DRILL_LAST_QUALITY: 5
4163 :DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:40>
4164 :END:
4165 paste word/char under cursor into isearch
4166 *** [M-n/p] :drill:
4167 SCHEDULED: <2014-03-27 Thu>
4168 :PROPERTIES:
4169 :ID: b3692e47-458e-41a0-b2be-c5f61b4eadbd
4170 :DRILL_LAST_INTERVAL: 50.6823
4171 :DRILL_REPEATS_SINCE_FAIL: 3
4172 :DRILL_TOTAL_REPEATS: 3
4173 :DRILL_FAILURE_COUNT: 0
4174 :DRILL_AVERAGE_QUALITY: 5.0
4175 :DRILL_EASE: 5.815
4176 :DRILL_LAST_QUALITY: 5
4177 :DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:41>
4178 :END:
4179 next/previous isearch history
4180 *** [C-o] :drill:
4181 SCHEDULED: <2014-03-11 Tue>
4182 :PROPERTIES:
4183 :ID: 8e36b562-7e0c-45e6-a41b-3cd96c134b33
4184 :DRILL_LAST_INTERVAL: 19.9622
4185 :DRILL_REPEATS_SINCE_FAIL: 4
4186 :DRILL_TOTAL_REPEATS: 4
4187 :DRILL_FAILURE_COUNT: 0
4188 :DRILL_AVERAGE_QUALITY: 3.5
4189 :DRILL_EASE: 2.73
4190 :DRILL_LAST_QUALITY: 4
4191 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 16:30>
4192 :END:
4193 isearch-occur
4194 Activate occur easily inside isearch
4195 [
4196 from starter-kit
4197 #+begin_src emacs-lisp
4198 (define-key isearch-mode-map (kbd "C-o")
4199 (lambda () (interactive)
4200 (let ((case-fold-search isearch-case-fold-search))
4201 (occur (if isearch-regexp
4202 isearch-string
4203 (regexp-quote isearch-string))))))
4204 #+end_src
4205 ]
4206 *** [m-r]
4207 #+begin_src emacs-lisp
4208 (defun my-isearch-toggle-regexp ()
4209 (interactive)
4210 (isearch-toggle-regexp)
4211 (cond (isearch-regexp
4212 (global-set-key (kbd "C-r") 'isearch-backward-regexp)
4213 (define-key global-map (kbd "<kp-add>") 'isearch-forward-regexp))
4214 (t
4215 (global-set-key (kbd "C-r") 'isearch-backward)
4216 (define-key global-map (kbd "<kp-add>") 'isearch-forward))))
4217 (define-key isearch-mode-map (kbd "M-r") 'my-isearch-toggle-regexp)
4218 #+end_src
4219
4220 ** icomplete
4221 *** C-. C-,
4222 icomplete-forward/backward-completions
4223
4224 ** ido
4225 *** [C-j] :drill:
4226 SCHEDULED: <2014-04-01 Tue>
4227 :PROPERTIES:
4228 :ID: 9cc3392d-00a1-4564-8c57-b418a20d9235
4229 :DRILL_LAST_INTERVAL: 22.6411
4230 :DRILL_REPEATS_SINCE_FAIL: 5
4231 :DRILL_TOTAL_REPEATS: 6
4232 :DRILL_FAILURE_COUNT: 1
4233 :DRILL_AVERAGE_QUALITY: 2.833
4234 :DRILL_EASE: 2.378
4235 :DRILL_LAST_QUALITY: 3
4236 :DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:34>
4237 :END:
4238 ido-find-file create file
4239 *** [//] :drill:
4240 SCHEDULED: <2014-03-27 Thu>
4241 :PROPERTIES:
4242 :ID: 18ce7d51-93ca-4d41-8e8d-1958cff9c726
4243 :DRILL_LAST_INTERVAL: 50.6823
4244 :DRILL_REPEATS_SINCE_FAIL: 3
4245 :DRILL_TOTAL_REPEATS: 3
4246 :DRILL_FAILURE_COUNT: 0
4247 :DRILL_AVERAGE_QUALITY: 5.0
4248 :DRILL_EASE: 5.815
4249 :DRILL_LAST_QUALITY: 5
4250 :DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:40>
4251 :END:
4252 ido goto root
4253 *** [C-k] :drill:
4254 :PROPERTIES:
4255 :ID: af4cc865-fe0c-424b-aa5b-2097320d6fb6
4256 :DRILL_LAST_INTERVAL: 0.0
4257 :DRILL_REPEATS_SINCE_FAIL: 0
4258 :DRILL_TOTAL_REPEATS: 5
4259 :DRILL_FAILURE_COUNT: 2
4260 :DRILL_AVERAGE_QUALITY: 3.083
4261 :DRILL_EASE: 2.496
4262 :DRILL_LAST_QUALITY: 2
4263 :DRILL_LAST_REVIEWED: <2014-04-14 Mon 11:31>
4264 :END:
4265 ido kill buffer/file
4266 *** [C-d] :drill:
4267 SCHEDULED: <2014-04-04 Fri>
4268 :PROPERTIES:
4269 :ID: c93d6e0c-ae33-45aa-9610-ce33cfc406a0
4270 :DRILL_LAST_INTERVAL: 25.8141
4271 :DRILL_REPEATS_SINCE_FAIL: 5
4272 :DRILL_TOTAL_REPEATS: 5
4273 :DRILL_FAILURE_COUNT: 1
4274 :DRILL_AVERAGE_QUALITY: 3.0
4275 :DRILL_EASE: 2.456
4276 :DRILL_LAST_QUALITY: 3
4277 :DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:37>
4278 :END:
4279 ido open dired buffer
4280 *** [M-d] :drill:
4281 SCHEDULED: <2014-03-11 Tue>
4282 :PROPERTIES:
4283 :ID: 8eab4299-207f-4a4a-a698-38f31cb5ff1b
4284 :DRILL_LAST_INTERVAL: 1.7651
4285 :DRILL_REPEATS_SINCE_FAIL: 1
4286 :DRILL_TOTAL_REPEATS: 6
4287 :DRILL_FAILURE_COUNT: 6
4288 :DRILL_AVERAGE_QUALITY: 2.583
4289 :DRILL_EASE: 2.258
4290 :DRILL_LAST_QUALITY: 3
4291 :DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:38>
4292 :END:
4293 ido search within all subdirectories
4294 *** [M-m] :drill:
4295 SCHEDULED: <2014-03-10 Mon>
4296 :PROPERTIES:
4297 :ID: cb7f6420-1f70-4ddb-ad73-83c3b22ef0e2
4298 :DRILL_LAST_INTERVAL: 7.6174
4299 :DRILL_REPEATS_SINCE_FAIL: 3
4300 :DRILL_TOTAL_REPEATS: 8
4301 :DRILL_FAILURE_COUNT: 4
4302 :DRILL_AVERAGE_QUALITY: 2.583
4303 :DRILL_EASE: 2.257
4304 :DRILL_LAST_QUALITY: 3
4305 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:01>
4306 :END:
4307 ido create subdirectory
4308 *** [M-s] :drill:
4309 SCHEDULED: <2014-04-01 Tue>
4310 :PROPERTIES:
4311 :ID: eb798918-4dd2-40e1-9d08-82ade145869d
4312 :DRILL_LAST_INTERVAL: 23.2268
4313 :DRILL_REPEATS_SINCE_FAIL: 5
4314 :DRILL_TOTAL_REPEATS: 6
4315 :DRILL_FAILURE_COUNT: 4
4316 :DRILL_AVERAGE_QUALITY: 3.083
4317 :DRILL_EASE: 2.496
4318 :DRILL_LAST_QUALITY: 3
4319 :DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:34>
4320 :END:
4321 ido search recently used directories
4322 *** [M-n/p] :drill:
4323 SCHEDULED: <2014-03-14 Fri>
4324 :PROPERTIES:
4325 :ID: db965c9e-feb0-4213-b631-7cfa0208cfdb
4326 :DRILL_LAST_INTERVAL: 23.0811
4327 :DRILL_REPEATS_SINCE_FAIL: 4
4328 :DRILL_TOTAL_REPEATS: 4
4329 :DRILL_FAILURE_COUNT: 1
4330 :DRILL_AVERAGE_QUALITY: 3.75
4331 :DRILL_EASE: 2.929
4332 :DRILL_LAST_QUALITY: 4
4333 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 16:36>
4334 :END:
4335 ido next/previous recently used directory
4336 *** [C-s]
4337 **** TODO implement this keybind, normally ctrl-space
4338 ido use current pattern and start a new one
4339 ** info
4340 *** [[]]
4341 goto next-prev node regardless of structure
4342 *** [f]
4343 goto cross reference
4344 *** [x]
4345 Info-follow-nearest-node
4346 #+begin_src emacs-lisp
4347 (define-key Info-mode-map "x" 'Info-follow-nearest-node)
4348 #+end_src
4349 m, f, n, p or ^ command, depending on where you click.
4350 ** auto-complete
4351 *** [S-return] :drill:
4352 SCHEDULED: <2014-03-11 Tue>
4353 :PROPERTIES:
4354 :ID: b9e47939-8033-4adc-8bf4-734b25f4fc47
4355 :DRILL_LAST_INTERVAL: 2.0943
4356 :DRILL_REPEATS_SINCE_FAIL: 1
4357 :DRILL_TOTAL_REPEATS: 7
4358 :DRILL_FAILURE_COUNT: 3
4359 :DRILL_AVERAGE_QUALITY: 2.633
4360 :DRILL_EASE: 2.282
4361 :DRILL_LAST_QUALITY: 3
4362 :DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:38>
4363 :END:
4364 ac-expand, then select next candidates
4365 *** [C-s] :drill:
4366 SCHEDULED: <2014-03-14 Fri>
4367 :PROPERTIES:
4368 :ID: 828416d4-7ce4-4817-aede-068b80f3041f
4369 :DRILL_LAST_INTERVAL: 23.0811
4370 :DRILL_REPEATS_SINCE_FAIL: 4
4371 :DRILL_TOTAL_REPEATS: 4
4372 :DRILL_FAILURE_COUNT: 1
4373 :DRILL_AVERAGE_QUALITY: 3.75
4374 :DRILL_EASE: 2.929
4375 :DRILL_LAST_QUALITY: 4
4376 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 16:38>
4377 :END:
4378 ac filter completions
4379 ** agenda
4380 *** [t] :drill:
4381 SCHEDULED: <2014-03-22 Sat>
4382 :PROPERTIES:
4383 :ID: 173e9cec-e401-4f03-90cc-72cba462b2f2
4384 :DRILL_LAST_INTERVAL: 31.1381
4385 :DRILL_REPEATS_SINCE_FAIL: 4
4386 :DRILL_TOTAL_REPEATS: 4
4387 :DRILL_FAILURE_COUNT: 0
4388 :DRILL_AVERAGE_QUALITY: 3.75
4389 :DRILL_EASE: 2.929
4390 :DRILL_LAST_QUALITY: 3
4391 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:50>
4392 :END:
4393 agenda cycle todo state
4394 ** org
4395 *** [C-c / t] :drill:
4396 SCHEDULED: <2014-03-13 Thu>
4397 :PROPERTIES:
4398 :ID: a5775c4f-c5d3-4024-a280-6628c5e7ab39
4399 :DRILL_LAST_INTERVAL: 10.7692
4400 :DRILL_REPEATS_SINCE_FAIL: 3
4401 :DRILL_TOTAL_REPEATS: 6
4402 :DRILL_FAILURE_COUNT: 1
4403 :DRILL_AVERAGE_QUALITY: 3.167
4404 :DRILL_EASE: 2.537
4405 :DRILL_LAST_QUALITY: 4
4406 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:09>
4407 :END:
4408 show todo items
4409 *** [S-<tab>] :drill:
4410 SCHEDULED: <2014-03-27 Thu>
4411 :PROPERTIES:
4412 :ID: 1c1a4061-5cff-4826-aec2-8f677aab33a9
4413 :DRILL_LAST_INTERVAL: 50.6823
4414 :DRILL_REPEATS_SINCE_FAIL: 3
4415 :DRILL_TOTAL_REPEATS: 3
4416 :DRILL_FAILURE_COUNT: 0
4417 :DRILL_AVERAGE_QUALITY: 5.0
4418 :DRILL_EASE: 5.815
4419 :DRILL_LAST_QUALITY: 5
4420 :DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:44>
4421 :END:
4422 org-shifttab global visibility cycle / move table cell
4423 *** [C-cs] :drill:
4424 SCHEDULED: <2014-03-14 Fri>
4425 :PROPERTIES:
4426 :ID: 9ba74a38-655c-4f96-8443-b574ee25c544
4427 :DRILL_LAST_INTERVAL: 5.238
4428 :DRILL_REPEATS_SINCE_FAIL: 2
4429 :DRILL_TOTAL_REPEATS: 7
4430 :DRILL_FAILURE_COUNT: 2
4431 :DRILL_AVERAGE_QUALITY: 2.801
4432 :DRILL_EASE: 2.362
4433 :DRILL_LAST_QUALITY: 3
4434 :DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:33>
4435 :END:
4436 schedule todo item
4437 *** [C-cx p] :drill:
4438 SCHEDULED: <2014-03-15 Sat>
4439 :PROPERTIES:
4440 :ID: 4b486f48-219d-4517-96c2-83ef839abda5
4441 :DRILL_LAST_INTERVAL: 24.4352
4442 :DRILL_REPEATS_SINCE_FAIL: 4
4443 :DRILL_TOTAL_REPEATS: 4
4444 :DRILL_FAILURE_COUNT: 0
4445 :DRILL_AVERAGE_QUALITY: 3.75
4446 :DRILL_EASE: 2.929
4447 :DRILL_LAST_QUALITY: 4
4448 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:39>
4449 :END:
4450 org set property
4451 *** [C-c -] :drill:
4452 SCHEDULED: <2014-03-24 Mon>
4453 :PROPERTIES:
4454 :ID: 60e57e56-d815-4d9b-ba78-2a56164db209
4455 :DRILL_LAST_INTERVAL: 32.7466
4456 :DRILL_REPEATS_SINCE_FAIL: 4
4457 :DRILL_TOTAL_REPEATS: 4
4458 :DRILL_FAILURE_COUNT: 0
4459 :DRILL_AVERAGE_QUALITY: 4.0
4460 :DRILL_EASE: 3.204
4461 :DRILL_LAST_QUALITY: 4
4462 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:52>
4463 :END:
4464 org insert horizontal line
4465 *** [C-cq] :drill:
4466 SCHEDULED: <2014-03-24 Mon>
4467 :PROPERTIES:
4468 :ID: 6987ba15-fbc0-459b-bc27-cf9016baebc3
4469 :DRILL_LAST_INTERVAL: 32.7466
4470 :DRILL_REPEATS_SINCE_FAIL: 4
4471 :DRILL_TOTAL_REPEATS: 4
4472 :DRILL_FAILURE_COUNT: 0
4473 :DRILL_AVERAGE_QUALITY: 4.0
4474 :DRILL_EASE: 3.204
4475 :DRILL_LAST_QUALITY: 4
4476 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:50>
4477 :END:
4478 org tag
4479 ** calc
4480 i'd like to drill these sometime when I have space in my head, or I
4481 plan to use calc.
4482 *** space
4483 [enter input to the stack, or duplicate top stack item]
4484 *** C-M-i
4485 [cycle 3 elements on stack]
4486 *** tab
4487 [cycle 2 elements on stack]
4488 *** n
4489 [negate]
4490 *** _
4491 [begin negative number]
4492 *** /
4493 [reciprocal]
4494 *** x
4495 [calc named command]
4496 *** M-delete
4497 [delete 2nd from top of stack]
4498 *** C-u [-]0-9
4499 [0=whole stack, 1-9=that many, -1-9=that element]
4500 *** delete
4501 [remove from the top of the stack]
4502 *** '
4503 [algebraic mode. infix expressions are calculated when input to the stack]
4504 *** m a
4505 [auto algebraic mode]
4506 *** $,$$,$$$
4507 [top x of stack reference]
4508 *** s s/t/r/u
4509 [store to variable: store, top, retrieve, unstore. the quick variables 0-9 don't need s prefix]
4510 *** U/D
4511 [undo/redo]
4512 *** t p/n/]/y
4513 [trail prev/next/end/yankh]
4514 *** `
4515 [calc edit mode, to edit the top of stack]
4516
4517 ** single/special keys
4518 :PROPERTIES:
4519 :ID: beginning-of-keybind-table-data
4520 :END:
4521 *** [tab key]
4522 :PROPERTIES:
4523 :CUSTOM_ID: 6c10a716-1d8e-4ce4-8e26-64468f19c17a
4524 :END:
4525 isearch
4526 #+begin_src emacs-lisp
4527 (define-key isearch-mode-map (kbd "<tab>") 'isearch-query-replace)
4528 #+end_src
4529 *** tab
4530 :PROPERTIES:
4531 :ID: d93321a4-6732-421f-9c03-0073c4cbfdcb
4532 :CUSTOM_ID: 51ece189-1840-41a1-8ca0-19f9a0481895
4533 :END:
4534 isearch-forward
4535 #+begin_src emacs-lisp
4536 ;; explained in http://stackoverflow.com/questions/7411920/how-to-bind-search-and-search-repeat-to-c-f-in-emacs
4537 (global-set-key (kbd "<kp-add>") 'isearch-forward)
4538 (define-key isearch-mode-map "\t" nil)
4539 (define-key isearch-mode-map (kbd "<kp-add>") 'isearch-repeat-forward)
4540 ;; get rid of the standard completion binding, always use auto-complete
4541 ;; this didn't work very well
4542 ;;(global-set-key (kbd "TAB") 'auto-complete)
4543 (define-key global-map [remap completion-at-point] 'auto-complete)
4544
4545 #+end_src
4546
4547 *** end
4548 :PROPERTIES:
4549 :ID: 7e71b6fe-dcef-4f91-87d9-d996ddf7db5d
4550 :CUSTOM_ID: 00d589b7-2b8e-494c-b761-3afefebe6ec6
4551 :END:
4552 move-end-of-line
4553 #+begin_src emacs-lisp
4554 ;; taken from emacs wiki, along with home function
4555 ;; http://www.emacswiki.org/emacs/BackToIndentationOrBeginning
4556 (defun point-in-comment ()
4557 "Determine if the point is inside a comment"
4558 (interactive)
4559 (let ((syn (syntax-ppss)))
4560 (and (nth 8 syn)
4561 (not (nth 3 syn)))))
4562 (defun end-of-code-or-line (arg)
4563 "Move to end of line, or before start of comments depending on situation.
4564 Toggle back and forth positions if we are already at one.
4565 Comments are recognized in any mode that sets syntax-ppss
4566 properly."
4567 (interactive "P")
4568 (when (catch 'bol
4569 (let ((start (point))
4570 (bol (save-excursion
4571 (beginning-of-line)
4572 (point)))
4573 (eol (progn (move-end-of-line arg) (point))))
4574 (while (point-in-comment)
4575 (backward-char)
4576 (when (= (point) bol)
4577 (throw 'bol t)))
4578 (throw 'bol (and (not (= eol start)) (>= start (point))))))
4579 (move-end-of-line arg)))
4580
4581 (global-set-key (kbd "<end>") 'end-of-code-or-line)(add-hook 'org-mode-hook (lambda () (define-key org-mode-map (kbd "<end>") 'org-end-of-line)))
4582 #+end_src
4583
4584 *** home
4585 :PROPERTIES:
4586 :ID: f52de4a4-212c-4133-9038-2b652c739ad2
4587 :CUSTOM_ID: 7800e455-c3f6-4a8f-8907-b2292449ab67
4588 :END:
4589 back-to-indentation
4590 #+begin_src emacs-lisp
4591 (defun back-to-indentation-or-beginning ()
4592 (interactive)
4593 (if (= (point) (progn (back-to-indentation) (point)))
4594 (if (derived-mode-p 'org-mode)
4595 (org-beginning-of-line)
4596 (beginning-of-line))))
4597 (global-set-key (kbd "<home>") 'back-to-indentation-or-beginning)
4598
4599 #+end_src
4600
4601 *** [s-tab]
4602 :PROPERTIES:
4603 :CUSTOM_ID: 3072901e-5cf3-4d6e-9ac8-3ef64a5f6ad2
4604 :END:
4605 indent-buffer
4606 [
4607 #+begin_src emacs-lisp
4608 (global-set-key (kbd "<S-iso-lefttab>") 'indent-buffer)
4609 #+end_src
4610 ]
4611 *** [s-delete]
4612 :PROPERTIES:
4613 :CUSTOM_ID: e53728b6-054d-4443-a03e-6cf02d13724d
4614 :END:
4615 send-shell
4616 #+begin_src emacs-lisp
4617
4618 (global-set-key (kbd "<S-delete>") 'send-shell)
4619
4620 ;; optional variables used by send-shell
4621 (setq shell-send-yank-key nil)
4622
4623 (defun repeat-shell ()
4624 (interactive)
4625 "Repeat the last command in shell-mode, displaying the window if needed."
4626 (let ((shell-buffer (get-buffer "*shell*")))
4627 (if shell-buffer
4628 (buffer-window-show shell-buffer)
4629 (let ((original-buffer (current-buffer)))
4630 (funcall 'shell)
4631 (setq shell-buffer (current-buffer))
4632 (switch-to-buffer original-buffer)))
4633 (with-current-buffer shell-buffer
4634 (goto-char (point-max))
4635 (call-interactively 'comint-previous-input)
4636 ;; the t flag makes the buffer advance
4637 (comint-send-input nil t))))
4638
4639 (setq compilation-filenames '("Makefile" "makefile"))
4640
4641 (defun get-nearest-compilation-file ()
4642 "Search for the compilation file traversing up the directory tree."
4643 (interactive)
4644 (let ((dir default-directory)
4645 (parent-dir (file-name-directory (directory-file-name default-directory)))
4646 (nearest-compilation-file 'nil))
4647 (while (and (not (string= dir parent-dir))
4648 (not nearest-compilation-file))
4649 (dolist (filename compilation-filenames)
4650 (setq file-path (concat dir filename))
4651 (when (file-readable-p file-path)
4652 (setq nearest-compilation-file file-path)))
4653 (setq dir parent-dir
4654 parent-dir (file-name-directory (directory-file-name parent-dir))))
4655 nearest-compilation-file))
4656 (defun run ()
4657 (interactive)
4658 "call run-fun if it is set, else run make if there is a makefile,
4659 else save and repeat last shell command.
4660 run-fun is meant to store file local variables, which show how to
4661 do the main thing we want on this file, generally compile and
4662 run.
4663
4664 example of setting it in a file:
4665 ;; Local Variables:
4666 ;; run-fun: merge-test
4667 ;; End: "
4668 (basic-save-buffer)
4669 (if (and (boundp 'run-fun) run-fun)
4670 (funcall run-fun)
4671 (let ((makefile (get-nearest-compilation-file)))
4672 (if (and makefile (stringp mode-name) (string= mode-name "C/l"))
4673 (compile (format
4674 "make -f %s" (get-nearest-compilation-file)))
4675 (repeat-shell)))))
4676
4677
4678 (defun send-shell ()
4679 (interactive)
4680 (send-shell-buffer "*shell*" 'shell (kbd "C-v")))
4681
4682 (defun send-python ()
4683 (interactive)
4684 (send-shell-buffer "*Python*" 'py-shell (kbd "C-v")))
4685
4686
4687 (defun send-shell-buffer (buffer-name &optional init shell-send-yank-key)
4688 "Send current line or region to shell-mode buffer.
4689 When in shell-mode, copy the current line to the
4690 most recently visited visible window.
4691
4692 SHELL-SEND-YANK-KEY: key to use instead
4693 of yank to paste into recent window. This allows compatibility with
4694 modes like org-mode which have their own yank function."
4695 (if (string= (buffer-name) buffer-name)
4696 ;; this section is copied out of comint-send-input
4697 (progn
4698 (let ((proc (get-buffer-process (current-buffer))))
4699 (if (not proc) (user-error "Current buffer has no process")
4700 (widen)
4701
4702 (let* ((pmark (process-mark proc))
4703 (intxt (if (>= (point) (marker-position pmark))
4704 (progn (if comint-eol-on-send (end-of-line))
4705 (buffer-substring pmark (point)))
4706 (let ((copy (funcall comint-get-old-input)))
4707 (goto-char pmark)
4708 (insert copy)
4709 copy))))
4710
4711 (if (= (length intxt) 0)
4712 (kill-new (comint-previous-matching-input-string "." 1))
4713 (kill-new intxt)))))
4714 (kill-append "\n" nil)
4715 (select-window (previous-window nil nil 'visible))
4716 (if (and (boundp 'shell-send-yank-key) shell-send-yank-key)
4717 (call-interactively (global-key-binding shell-send-yank-key))
4718 (yank))
4719 (select-window (next-window nil nil 'visible)))
4720 (let (start end)
4721 (if mark-active
4722 (setq start (mark)
4723 end (point))
4724 (setq start (save-excursion (beginning-of-line) (point))
4725 end (save-excursion (end-of-line) (point)))
4726 (let (line-move-visual)
4727 (call-interactively 'next-line)))
4728 (send-comint-input buffer-name start end init))))
4729
4730 ;; supporting functions
4731
4732
4733 (defun send-comint-input (buffer-name start end &optional init)
4734 "Input the region to BUFFER-NAME, assuming it is a comint-derived buffer.
4735 Show BUFFER-NAME if it is not show.
4736 Call INIT if BUFFER-NAME does not exist."
4737 (let ((input (filter-buffer-substring start end))
4738 (buffer (get-buffer buffer-name)))
4739 (unless buffer
4740 (message "nobuffer")
4741 ;; save-excursion etc. don't work for (shell), so I do this instead
4742 (if init (let ((original-buffer (current-buffer)))
4743 (funcall init (and (boundp 'send-shell-buffer-name) send-shell-buffer-name))
4744 (switch-to-buffer original-buffer)
4745 (setq buffer (get-buffer buffer-name)))
4746 (error "No existing buffer found and no init function argument. ")))
4747 (buffer-window-show buffer)
4748 (with-current-buffer buffer
4749 (let ((proc (get-buffer-process buffer)))
4750 (goto-char (process-mark proc))
4751 (insert input)
4752 (comint-send-input nil t)))))
4753
4754 (defun buffer-window-show (&optional buffer action)
4755 "Like temp-buffer-window-show, but removed stuff
4756 relevant to it being temp or help."
4757 (let (window frame)
4758 (with-current-buffer buffer
4759 (when (let ((window-combination-limit
4760 ;; When `window-combination-limit' equals
4761 ;; `temp-buffer' or `temp-buffer-resize' and
4762 ;; `temp-buffer-resize-mode' is enabled in this
4763 ;; buffer bind it to t so resizing steals space
4764 ;; preferably from the window that was split.
4765 (if (or (eq window-combination-limit 'temp-buffer)
4766 (and (eq window-combination-limit
4767 'temp-buffer-resize)
4768 temp-buffer-resize-mode))
4769 t
4770 window-combination-limit)))
4771 ;; debug
4772 ;;(message "window-combination-limit")
4773 ;;(print window-combination-limit)
4774 (setq window (display-buffer buffer action)))
4775 (setq frame (window-frame window))
4776 (unless (eq frame (selected-frame))
4777 (raise-frame frame))
4778 (setq minibuffer-scroll-window window)
4779 (set-window-hscroll window 0)
4780 ;; Return the window.
4781 window))))
4782
4783
4784 ;; when poping help, etc, allow reusing a window in a different frame if it is visible
4785 ;; figured this out after spending quite a while reading doc string for display-buffer
4786 ;; which is the main function which uses this.
4787 ;; it will use other vars or its arg to override this,
4788 ;; but those things are often nil.
4789 ;; aha moments in reading it: ACTION = (FUNCTION-or-FUNCTIONLIST ALIST)
4790 ;; FRAME adds an association to ACTION's alist, but it's not used if ACTION arg is nil.
4791 (setq display-buffer-fallback-action `(,(car display-buffer-fallback-action) . '(reusable-frames . visible)))
4792 ;; stop splitting windows verticallly when I open a buffer or shell
4793 (setq split-height-threshold nil)
4794 #+end_src
4795
4796 *** s-left arrow
4797 :PROPERTIES:
4798 :CUSTOM_ID: d8c473ac-5507-4a6b-9e5a-46558c17b09f
4799 :END:
4800 shell
4801 #+begin_src emacs-lisp
4802 (global-set-key (kbd "<S-kp-equal>") 'shell-wrap)
4803 #+end_src
4804 *** s-right arrow
4805 :LOGBOOK:
4806 CLOCK: [2016-11-28 Mon 11:03]--[2016-11-28 Mon 11:03] => 0:00
4807 :END:
4808 :PROPERTIES:
4809 :CUSTOM_ID: 2365f5a7-b89a-4a97-b272-ac8ae9c2cc66
4810 :END:
4811 previous-buffer
4812 #+begin_src emacs-lisp
4813 (global-set-key (kbd "<S-kp-divide>") 'previous-buffer)
4814 #+end_src
4815 *** esc
4816 :PROPERTIES:
4817 :CUSTOM_ID: 60a56803-f38d-4d0a-8ed5-1c94ba97b6f6
4818 :END:
4819 *** return
4820 :PROPERTIES:
4821 :CUSTOM_ID: fab6adea-ed20-45ab-a0a3-776c68d5c3a5
4822 :END:
4823 new line
4824
4825 #+begin_src emacs-lisp
4826 ;; todo, this doesn't set the keybind for the help minibuffer
4827
4828
4829 ;;(global-set-key (kbd "<return>") 'indent-new-comment-line)
4830
4831 ;; don't use enter for autocomplete, we use tab or something
4832 (define-key ac-completing-map (kbd "<return>") nil)
4833 (define-key ac-completing-map "\r" nil)
4834
4835 (add-hook 'org-mode-hook
4836 (lambda ()
4837 ;; copied from org-mode, replace org-enter with org-enter-indent
4838 (org-defkey org-mode-map "\C-m" 'org-return-indent)))
4839
4840
4841 (add-hook 'comint-mode-hook
4842 (lambda ()
4843 (define-key comint-mode-map "\r" nil)
4844 (define-key comint-mode-map (kbd "<return>") 'comint-send-input)))
4845
4846 (add-hook 'comint-mode-hook
4847 (lambda ()
4848 (define-key comint-mode-map "\C-m" nil)
4849 (define-key comint-mode-map "\C-d" nil)))
4850
4851 #+end_src
4852
4853 *** [s-return] :drill:
4854 SCHEDULED: <2014-03-10 Mon>
4855 :PROPERTIES:
4856 auto-correct-prev-word
4857 :ID: db46193b-f202-4927-bc76-2ad74d9f0ed7
4858 :CUSTOM_ID: 819cfb55-3a2f-4f20-8591-f819d1a6869a
4859 :DRILL_LAST_INTERVAL: 7.9493
4860 :DRILL_REPEATS_SINCE_FAIL: 3
4861 :DRILL_TOTAL_REPEATS: 7
4862 :DRILL_FAILURE_COUNT: 4
4863 :DRILL_AVERAGE_QUALITY: 2.696
4864 :DRILL_EASE: 2.312
4865 :DRILL_LAST_QUALITY: 3
4866 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:05>
4867 :END:
4868 auto-correct-prev-word
4869 [
4870 #+begin_src emacs-lisp
4871 (global-set-key (kbd "<S-return>") 'flyspell-auto-correct-previous-word)
4872 #+end_src
4873 ]
4874
4875 *** down arrow
4876 :PROPERTIES:
4877 :CUSTOM_ID: 7a868484-9c63-4a73-abda-7751cb2c02be
4878 :END:
4879 mark
4880 #+begin_src emacs-lisp
4881 (global-set-key (kbd "<kp-enter>") 'set-mark-command)
4882 #+end_src
4883 *** s-down arrow
4884 :PROPERTIES:
4885 :CUSTOM_ID: 097b97e0-8ad8-40f7-8388-c4ace1706b38
4886 :END:
4887 extended command
4888 #+begin_src emacs-lisp
4889 (global-set-key (kbd "<S-kp-enter>") 'smex)
4890 #+end_src
4891 *** s-up arrow
4892
4893 ** mouse
4894 *** [mouse-2 mode line] :drill:
4895 SCHEDULED: <2014-03-17 Mon>
4896 :PROPERTIES:
4897 :ID: d79167ad-9782-40b3-8e40-55aaa8428dec
4898 :CUSTOM_ID: 69aaa631-6fb5-4beb-b2d8-c0f3d92c0a98
4899 :DRILL_LAST_INTERVAL: 15.2345
4900 :DRILL_REPEATS_SINCE_FAIL: 4
4901 :DRILL_TOTAL_REPEATS: 7
4902 :DRILL_FAILURE_COUNT: 2
4903 :DRILL_AVERAGE_QUALITY: 2.893
4904 :DRILL_EASE: 2.405
4905 :DRILL_LAST_QUALITY: 3
4906 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:06>
4907 :END:
4908 mouse-delete-other-windows
4909 *** C-mouse-2 mode line
4910 :PROPERTIES:
4911 :CUSTOM_ID: 501479ab-e1e2-497e-bd86-071f8afa3378
4912 :END:
4913 mouse-split-window-horizontally
4914 *** M-mouse-2 mode line
4915 :PROPERTIES:
4916 :CUSTOM_ID: 8de14d73-499e-406a-b5c4-e295e53d3f4c
4917 :END:
4918 *** S-mouse-2 mode line
4919 :PROPERTIES:
4920 :CUSTOM_ID: f389cdbb-186a-4cad-af45-b3c75a508275
4921 :END:
4922 *** C-M-mouse-2 mode line
4923 :PROPERTIES:
4924 :CUSTOM_ID: cb2be69c-f86c-4120-b7f2-1c09b7bcd816
4925 :END:
4926 *** C-S-mouse2 mode line
4927 :PROPERTIES:
4928 :CUSTOM_ID: 7b4eced3-ce5e-49ce-8bfe-8823e8f5f93e
4929 :END:
4930 *** [mouse-3 mode line] :drill:
4931 SCHEDULED: <2014-03-19 Wed>
4932 :PROPERTIES:
4933 :ID: 324e43e7-d468-4edc-b892-c1e249ff49fa
4934 :CUSTOM_ID: 917a1844-8c38-4f31-8616-50fc81334f2c
4935 :DRILL_LAST_INTERVAL: 27.607
4936 :DRILL_REPEATS_SINCE_FAIL: 4
4937 :DRILL_TOTAL_REPEATS: 4
4938 :DRILL_FAILURE_COUNT: 0
4939 :DRILL_AVERAGE_QUALITY: 3.5
4940 :DRILL_EASE: 2.73
4941 :DRILL_LAST_QUALITY: 3
4942 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:50>
4943 :END:
4944 mouse-delete-window
4945 *** C-mouse-3 mode line
4946 :PROPERTIES:
4947 :CUSTOM_ID: b36a218f-6a92-4594-940b-13ffdf79cc9c
4948 :END:
4949 *** M-mouse-3 mode line
4950 :PROPERTIES:
4951 :CUSTOM_ID: 11c48311-05a4-440e-b742-ec397f22f479
4952 :END:
4953 *** S-mouse-3 mode line
4954 :PROPERTIES:
4955 :CUSTOM_ID: 03768943-d8cd-4dcb-bc48-393e9a6bb31f
4956 :END:
4957 *** C-M-mouse-3 mode line
4958 :PROPERTIES:
4959 :CUSTOM_ID: ab213201-bab7-4d30-8f61-fee80e7f2c6f
4960 :END:
4961 *** C-S-mouse-3 mode line
4962 :PROPERTIES:
4963 :CUSTOM_ID: 0bcac7a3-2943-49b7-b281-d834d374caf9
4964 :END:
4965 *** mouse-1
4966 :PROPERTIES:
4967 :CUSTOM_ID: 4e60e2e4-8c2f-4450-8060-2d793ede530c
4968 :END:
4969 set cursor/mark
4970 *** [C-mouse-1] :drill:
4971 SCHEDULED: <2014-03-15 Sat>
4972 :PROPERTIES:
4973 :CUSTOM_ID: b661f84f-57df-4095-9dc1-d1a876a53ee5
4974 :ID: 6b82708e-d5de-48cc-8abd-225186eb8729
4975 :DRILL_LAST_INTERVAL: 24.4352
4976 :DRILL_REPEATS_SINCE_FAIL: 4
4977 :DRILL_TOTAL_REPEATS: 4
4978 :DRILL_FAILURE_COUNT: 0
4979 :DRILL_AVERAGE_QUALITY: 3.75
4980 :DRILL_EASE: 2.929
4981 :DRILL_LAST_QUALITY: 4
4982 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 18:03>
4983 :END:
4984 buffer list context menu
4985 *** M-mouse-1
4986 :PROPERTIES:
4987 :CUSTOM_ID: c71c8a71-7027-44f3-be19-1d3c18ff5129
4988 :END:
4989 *** S-mouse-1
4990 :PROPERTIES:
4991 :CUSTOM_ID: 84507cd6-8a75-4754-bf9e-5a30f57fa4ac
4992 :END:
4993 *** C-M-mouse-1
4994 :PROPERTIES:
4995 :CUSTOM_ID: 95eea58e-82b0-48a3-a7c8-0d17c50b7c2e
4996 :END:
4997 *** C-S-mouse-1
4998 :PROPERTIES:
4999 :CUSTOM_ID: 2d450c06-d9aa-4751-a926-0922c0c3a402
5000 :END:
5001 *** mouse-2
5002 :PROPERTIES:
5003 :CUSTOM_ID: 086b0b50-054f-462d-92fa-b27852f887b0
5004 :END:
5005 paste
5006 *** C-mouse-2
5007 :PROPERTIES:
5008 :CUSTOM_ID: 48b8de22-6638-44da-986f-16e0e69312dd
5009 :END:
5010 *** M-mouse-2
5011 :PROPERTIES:
5012 :CUSTOM_ID: fb315a27-6351-4ce2-9692-589608793c43
5013 :END:
5014 *** S-mouse-2
5015 :PROPERTIES:
5016 :CUSTOM_ID: 7cc73036-844b-44d3-afe1-1e76ee626b53
5017 :END:
5018 *** C-M-mouse-2
5019 :PROPERTIES:
5020 :CUSTOM_ID: 85f35287-5130-47ab-832d-af78dc2a3e70
5021 :END:
5022 *** C-S-mouse-2
5023 :PROPERTIES:
5024 :CUSTOM_ID: a27ad43f-3be2-4155-9a9f-c144170372ce
5025 :END:
5026 *** mouse-3
5027 :PROPERTIES:
5028 :CUSTOM_ID: 0481632e-9c50-4328-9365-c4b5bf967b66
5029 :END:
5030 set-mark
5031 #+begin_src emacs-lisp
5032 (define-key global-map [down-mouse-3] 'mouse3-func)
5033 (global-set-key [mouse-3] 'mouse3-set-mark)
5034 (global-set-key [drag-mouse-3] 'mouse3-set-mark)
5035 #+end_src
5036 *** [C-mouse-3] :drill:
5037 SCHEDULED: <2014-03-13 Thu>
5038 :PROPERTIES:
5039 :ID: b075e62c-55c6-46f5-a23a-4c4c5b9f267e
5040 :CUSTOM_ID: 9623c78f-7705-4cbe-a990-c24eb1067377
5041 :DRILL_LAST_INTERVAL: 22.1939
5042 :DRILL_REPEATS_SINCE_FAIL: 4
5043 :DRILL_TOTAL_REPEATS: 4
5044 :DRILL_FAILURE_COUNT: 0
5045 :DRILL_AVERAGE_QUALITY: 3.5
5046 :DRILL_EASE: 2.73
5047 :DRILL_LAST_QUALITY: 4
5048 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 16:38>
5049 :END:
5050 global menu
5051 *** M-mouse-3
5052 :PROPERTIES:
5053 :CUSTOM_ID: fb6f4840-7e44-4c94-b913-f2014fda3325
5054 :END:
5055 *** S-mouse-3
5056 :PROPERTIES:
5057 :CUSTOM_ID: a6d91332-c731-474c-9959-ddd03e8b2786
5058 :END:
5059 *** C-M-mouse-3
5060 :PROPERTIES:
5061 :CUSTOM_ID: 6b4d0e4d-1a2c-4e42-a925-e39548c4e264
5062 :END:
5063 *** C-S-mouse-3
5064 :PROPERTIES:
5065 :CUSTOM_ID: a983a7c5-c17e-4e08-b3e2-a45a44d7a2b6
5066 :END:
5067 *** [mouse-9]
5068 :PROPERTIES:
5069 :CUSTOM_ID: efaec161-b279-4129-86fd-b410430926e4
5070 :END:
5071 move-mouse-to-point
5072 [
5073 #+begin_src emacs-lisp
5074 (global-set-key (kbd "<mouse-6>") 'move-mouse-to-point)
5075 #+end_src
5076 ]
5077 *** C-mouse-9
5078 :PROPERTIES:
5079 :CUSTOM_ID: e055ae8a-cc94-4e0f-9e98-9cb62453b8d6
5080 :END:
5081 *** M-mouse-9
5082 :PROPERTIES:
5083 :CUSTOM_ID: 7d1c03a9-b153-47dc-a037-7ee333ca8da9
5084 :END:
5085 *** S-mouse-9
5086 :PROPERTIES:
5087 :CUSTOM_ID: 8f688d00-8cdb-4163-818c-a0cfba3b1c0a
5088 :END:
5089 *** C-M-mouse-9
5090 :PROPERTIES:
5091 :CUSTOM_ID: 90ce7df8-2346-4203-8ced-5da51c7c1bfc
5092 :END:
5093 *** C-S-mouse-9
5094 :PROPERTIES:
5095 :CUSTOM_ID: 0afdad0a-f9c4-4bfa-baa8-cc20d6cab628
5096 :END:
5097 *** mouse-8
5098 :PROPERTIES:
5099 :CUSTOM_ID: ea9d2415-0fd7-4f83-9867-a7a81899e74b
5100 :END:
5101 *** C-mouse-8
5102 :PROPERTIES:
5103 :CUSTOM_ID: dc2428d2-412c-4811-8327-3bb70bfa0e76
5104 :END:
5105 *** M-mouse-8
5106 :PROPERTIES:
5107 :CUSTOM_ID: 530ed41d-6ed6-4bcd-9df7-58ddbfe8b44a
5108 :END:
5109 *** S-mouse-8
5110 :PROPERTIES:
5111 :CUSTOM_ID: c7d388c3-f4a6-4489-b23a-20ebb7515430
5112 :END:
5113 *** C-M-mouse-8
5114 :PROPERTIES:
5115 :CUSTOM_ID: fc6ac9e8-fd9a-4270-9cd8-26713d6bc40f
5116 :END:
5117 *** C-S-mouse-8
5118 :PROPERTIES:
5119 :CUSTOM_ID: 401503ad-3750-4002-a28e-1f1345412bc6
5120 :END:
5121 *** 1/kp-end
5122 :PROPERTIES:
5123 :CUSTOM_ID: c306a3ef-4b81-4d54-a914-99f312d8f92f
5124 :END:
5125 *** C-1/kp-end
5126 :PROPERTIES:
5127 :CUSTOM_ID: 11059916-0a48-4f08-b85a-9b82243e4145
5128 :END:
5129 *** M-1/kp-end
5130 :PROPERTIES:
5131 :CUSTOM_ID: fddd8716-5b16-484e-9d70-358fea201d99
5132 :END:
5133 *** S-1/kp-end
5134 :PROPERTIES:
5135 :CUSTOM_ID: c6a7978b-a5cf-4ae7-b1d2-57ea72adb487
5136 :END:
5137 *** C-M-1/kp-end
5138 :PROPERTIES:
5139 :CUSTOM_ID: 376b8b84-ae1b-4bff-b1c8-263049186637
5140 :END:
5141 *** C-S-1/kp-end
5142 :PROPERTIES:
5143 :CUSTOM_ID: 4e8081cb-5692-4d2e-8657-c6c7931046fd
5144 :END:
5145 *** 2/kp-down
5146 :PROPERTIES:
5147 :CUSTOM_ID: a1108fd9-0df0-43ac-9dbb-0402d24f5b57
5148 :END:
5149 *** C-2/kp-down
5150 :PROPERTIES:
5151 :CUSTOM_ID: e9fe4916-14f5-4dc6-8dba-ed982b7172a1
5152 :END:
5153 *** M-2/kp-down
5154 :PROPERTIES:
5155 :CUSTOM_ID: 50db5a06-452e-491f-875b-3de936a4d04a
5156 :END:
5157 #+begin_src emacs-lisp
5158 ;; for when we have a standard keyboard which is not remapped
5159 (global-set-key (kbd "M-2") 'smex)
5160
5161 #+end_src
5162
5163 *** S-2/kp-down
5164 :PROPERTIES:
5165 :CUSTOM_ID: c3ad691b-0082-46f3-8588-ef2223eab643
5166 :END:
5167 *** C-M-2/kp-down
5168 :PROPERTIES:
5169 :CUSTOM_ID: 90963055-086b-4d96-8131-d890ff3cb597
5170 :END:
5171 *** C-S-2/kp-down
5172 :PROPERTIES:
5173 :CUSTOM_ID: 4d13741e-2207-4d2c-a719-e818bb9f3419
5174 :END:
5175 *** 3/kp-next
5176 :PROPERTIES:
5177 :CUSTOM_ID: b441f9e2-d035-4907-b947-0f3b4d6d062d
5178 :END:
5179 *** C-3/kp-next
5180 :PROPERTIES:
5181 :CUSTOM_ID: 3ea6ff26-4db4-46c8-b681-e08acd9b6a06
5182 :END:
5183 *** M-3/kp-next
5184 :PROPERTIES:
5185 :CUSTOM_ID: a376d2fb-999d-48fd-8c9e-36b7661c5ba7
5186 :END:
5187 *** S-3/kp-next
5188 :PROPERTIES:
5189 :CUSTOM_ID: 50b8356c-7ba5-4e89-b4d6-618f6c571678
5190 :END:
5191 *** C-M-3/kp-next
5192 :PROPERTIES:
5193 :CUSTOM_ID: cd997379-f611-4d06-91c7-ed6cabb618ee
5194 :END:
5195 *** C-S-3/kp-next
5196 :PROPERTIES:
5197 :CUSTOM_ID: 1c8941c9-3025-4dff-bcf3-09d8de44f44f
5198 :END:
5199 *** 4/kp-left
5200 :PROPERTIES:
5201 :ID: bef4fed5-5338-4c66-a759-13dc20ab9bfb
5202 :CUSTOM_ID: c44d0f65-9502-4cc6-9642-96d907f6b093
5203 :END:
5204 indent-region
5205 #+begin_src emacs-lisp
5206 (global-set-key (kbd "<kp-left>") 'indent-region)
5207 #+end_src
5208 *** C-4/kp-left
5209 :PROPERTIES:
5210 :CUSTOM_ID: dd0cd32a-1d62-4b19-9d4f-ee242fb7c7b9
5211 :END:
5212 *** M-4/kp-left
5213 :PROPERTIES:
5214 :CUSTOM_ID: 4f7c3799-28a7-4fc2-85fc-16d768d2047c
5215 :END:
5216 *** S-4/kp-left
5217 :PROPERTIES:
5218 :CUSTOM_ID: f84a7347-f88a-4888-bf5d-e15b98b5c3a2
5219 :END:
5220 *** C-M-4/kp-left
5221 :PROPERTIES:
5222 :CUSTOM_ID: 74a1afca-bd24-469b-93e9-7a9681a9e467
5223 :END:
5224 *** C-S-4/kp-left
5225 :PROPERTIES:
5226 :CUSTOM_ID: 6c822a4a-0e64-430b-8d21-46b387911f2f
5227 :END:
5228 *** 5/kp-begin
5229 :PROPERTIES:
5230 :ID: 0e93f6a0-3d6f-45b1-b14e-10abbdfa3ee4
5231 :CUSTOM_ID: 2458c6bc-7113-4d4b-bbdf-206e1cb842a7
5232 :END:
5233 mark-defun
5234 #+begin_src emacs-lisp
5235 (global-set-key (kbd "<kp-begin>") 'mark-defun)
5236 #+end_src
5237 *** C-5/kp-begin
5238 :PROPERTIES:
5239 :CUSTOM_ID: 39588066-77b8-4863-be0d-0f1fad8f0e2a
5240 :END:
5241 *** M-5/kp-begin
5242 :PROPERTIES:
5243 :CUSTOM_ID: b3542b42-9d71-4a3f-92b1-f79f275bcf52
5244 :END:
5245 *** S-5/kp-begin
5246 :PROPERTIES:
5247 :CUSTOM_ID: 66aed3e7-d7bb-4393-a95b-b90b3a410684
5248 :END:
5249 *** C-M-5/kp-begin
5250 :PROPERTIES:
5251 :CUSTOM_ID: 1060d464-eed3-4a17-a5c4-d8e8941f6925
5252 :END:
5253 *** C-S-5/kp-begin
5254 :PROPERTIES:
5255 :CUSTOM_ID: efd7867a-a87f-43ef-a849-0e4029431d7f
5256 :END:
5257 *** 6/kp-right
5258 :PROPERTIES:
5259 :ID: d156225a-b48e-45e2-80a7-ea1a7dbbc794
5260 :CUSTOM_ID: 3b79bc58-6067-43bd-9471-9d592744a25a
5261 :END:
5262 ibuffer
5263 #+begin_src emacs-lisp
5264 (global-set-key (kbd "<kp-right>") 'ibuffer)
5265 #+end_src
5266 *** C-6/kp-right
5267 :PROPERTIES:
5268 :CUSTOM_ID: 5592b3d3-7ade-4486-ac94-aed0aa3d78f5
5269 :END:
5270 *** M-6/kp-right
5271 :PROPERTIES:
5272 :CUSTOM_ID: c76bedd9-90a7-41fe-9327-607f88f60a3a
5273 :END:
5274 *** S-6/kp-right
5275 :PROPERTIES:
5276 :CUSTOM_ID: 8bbda9a2-7909-44fb-af24-a86dbbd5d16f
5277 :END:
5278 *** C-M-6/kp-right
5279 :PROPERTIES:
5280 :CUSTOM_ID: 7c5838f6-5cc9-4bbc-bd07-403cc009cf35
5281 :END:
5282 *** C-S-6/kp-right
5283 :PROPERTIES:
5284 :CUSTOM_ID: c6f2edc9-ffd3-400f-8014-bb92ea6e520b
5285 :END:
5286 *** 7/kp-home
5287 :PROPERTIES:
5288 :CUSTOM_ID: c98ba390-f2e3-4c14-8d41-142b54e76d77
5289 :END:
5290 *** C-7/kp-home
5291 :PROPERTIES:
5292 :CUSTOM_ID: 5597d00f-4a89-4af2-aac1-98808763744c
5293 :END:
5294 *** M-7/kp-home
5295 :PROPERTIES:
5296 :CUSTOM_ID: 5cbafd0e-0c8f-4e14-a24e-f847c341e5c1
5297 :END:
5298 *** S-7/kp-home
5299 :PROPERTIES:
5300 :CUSTOM_ID: 92f7d836-ae32-4bba-9120-72e747feb832
5301 :END:
5302 *** C-M-7/kp-home
5303 :PROPERTIES:
5304 :CUSTOM_ID: 30170d01-412e-4098-b27e-ed9294d8cf92
5305 :END:
5306 *** C-S-7/kp-home
5307 :PROPERTIES:
5308 :CUSTOM_ID: 81300d39-e60e-4b09-865e-584153f3b827
5309 :END:
5310 *** 8/kp-up
5311 :PROPERTIES:
5312 :CUSTOM_ID: 0591db2b-6c5c-4438-9451-dcd686170c9d
5313 :END:
5314 *** C-8/kp-up
5315 :PROPERTIES:
5316 :CUSTOM_ID: 028ad953-1641-4f0c-83c2-72787310e447
5317 :END:
5318 *** M-8/kp-up
5319 :PROPERTIES:
5320 :CUSTOM_ID: 7c55f717-1093-48a7-b764-8f788540a4d7
5321 :END:
5322 *** S-8/kp-up
5323 :PROPERTIES:
5324 :CUSTOM_ID: f477fa15-3f04-48f6-a66a-4ba6eb0475f1
5325 :END:
5326 *** C-M-8/kp-up
5327 :PROPERTIES:
5328 :CUSTOM_ID: f280c9ab-49a8-4399-987b-bfde07c339be
5329 :END:
5330 *** C-S-8/kp-up
5331 :PROPERTIES:
5332 :CUSTOM_ID: 68a316aa-a05d-4ab0-87e4-88e8f2613795
5333 :END:
5334 *** 9/kp-prior
5335 :PROPERTIES:
5336 :ID: f3c60889-d948-4144-b5b0-04aeeec95309
5337 :CUSTOM_ID: a3b51adb-4405-4d9f-9b88-a8faa479fbe7
5338 :END:
5339 delete-horizontal-space
5340 #+begin_src emacs-lisp
5341 (global-set-key (kbd "<kp-prior>") 'delete-horizontal-space)
5342 #+end_src
5343 *** C-9/kp-prior
5344 :PROPERTIES:
5345 :CUSTOM_ID: 2683f49c-a465-42d0-b85b-6aa345ac2213
5346 :END:
5347 *** M-9/kp-prior
5348 :PROPERTIES:
5349 :CUSTOM_ID: 91b0ee09-9eba-4b60-b05f-720eaca53065
5350 :END:
5351 *** S-9/kp-prior
5352 :PROPERTIES:
5353 :CUSTOM_ID: b79e626c-4425-409f-92ce-b88335629c34
5354 :END:
5355 *** C-M-9/kp-prior
5356 :PROPERTIES:
5357 :CUSTOM_ID: 4838285f-905b-4e18-8605-ff24a20ce9e1
5358 :END:
5359 *** C-S-9/kp-prior
5360 :PROPERTIES:
5361 :CUSTOM_ID: 763edfac-da7d-4360-a383-6a7f42cc2e02
5362 :END:
5363 *** 10/kp-insert
5364 :PROPERTIES:
5365 :CUSTOM_ID: 57e1a794-26f8-4fb6-b753-ef1ad1ff0af9
5366 :END:
5367 *** C-10/kp-insert
5368 :PROPERTIES:
5369 :CUSTOM_ID: 32426751-f87b-4fd5-b435-914ac8f54e5f
5370 :END:
5371 *** M-10/kp-insert
5372 :PROPERTIES:
5373 :CUSTOM_ID: 1b83659c-61dc-425f-bead-fc2a0d198dde
5374 :END:
5375 *** S-10/kp-insert
5376 :PROPERTIES:
5377 :CUSTOM_ID: d2f07180-2d20-4633-9c79-78f4d992f7a6
5378 :END:
5379 *** C-M-10/kp-insert
5380 :PROPERTIES:
5381 :CUSTOM_ID: 1f6eabdc-703c-4a05-829c-553ccf7d082d
5382 :END:
5383 *** C-S-10/kp-insert
5384 :PROPERTIES:
5385 :CUSTOM_ID: bb361418-370f-4b15-b7e1-8e85c7a6f032
5386 :END:
5387 *** 11/kp-subtract
5388 :PROPERTIES:
5389 :CUSTOM_ID: 0f84dddc-a1d2-428d-8c17-cf9ddbd24784
5390 :END:
5391 *** C-11/kp-subtract
5392 :PROPERTIES:
5393 :CUSTOM_ID: 4c3309ee-eb67-43ff-bc4a-44574b1c5e0f
5394 :END:
5395 *** M-11/kp-subtract
5396 :PROPERTIES:
5397 :CUSTOM_ID: e95a2822-5f0d-4b32-a17f-15d4650e086f
5398 :END:
5399 *** S-11/kp-subtract
5400 :PROPERTIES:
5401 :CUSTOM_ID: 667a9853-38c6-4bb2-8c01-6a30075929b4
5402 :END:
5403 *** C-M-11/kp-subtract
5404 :PROPERTIES:
5405 :CUSTOM_ID: d5b17698-9bfe-4bd7-af26-b5dd51684e7d
5406 :END:
5407 *** C-S-11/kp-subtract
5408 :PROPERTIES:
5409 :CUSTOM_ID: cfde57be-a728-4955-8b96-9ae5aa1cce01
5410 :END:
5411 *** 12/kp-add
5412 :PROPERTIES:
5413 :CUSTOM_ID: 5e7a0116-a847-4fec-81ed-a0286bb08ac5
5414 :END:
5415 *** C-12/kp-add
5416 :PROPERTIES:
5417 :CUSTOM_ID: 41dcdb69-8436-495b-9e55-a0cd623ac5aa
5418 :END:
5419 *** M-12/kp-add
5420 :PROPERTIES:
5421 :CUSTOM_ID: ebda57a2-cab3-4fed-b3b0-014a7e60c96f
5422 :END:
5423 *** S-12/kp-add
5424 :PROPERTIES:
5425 :CUSTOM_ID: 7e4c6085-cfbe-4c05-9edb-2aec2325f7b9
5426 :END:
5427 *** C-M-12/kp-add
5428 :PROPERTIES:
5429 :CUSTOM_ID: 7904cafb-7371-4bc9-a661-262d78f8f9b8
5430 :END:
5431 *** C-S-12/kp-add
5432 :PROPERTIES:
5433 :CUSTOM_ID: dcf498f0-5bcf-4402-bce0-561c11effb38
5434 :END:
5435 *** scroll
5436 :PROPERTIES:
5437 :CUSTOM_ID: 33433f0f-5b0e-46ba-8452-d2a51e54769b
5438 :END:
5439 up/dn / scroll
5440 on standard mouse, this scrolls,
5441 because we have the accuracy to pick things up and
5442 down easier, and because it is familiar.
5443 *** [C-scroll] :drill:
5444 SCHEDULED: <2014-03-27 Thu>
5445 :PROPERTIES:
5446 cycle recent buffers
5447 :ID: 678b14e8-e991-46da-84a0-50d142ecbbba
5448 :CUSTOM_ID: 16506ba5-e8f2-4aec-bc1b-d2854d4e504c
5449 :DRILL_LAST_INTERVAL: 50.6823
5450 :DRILL_REPEATS_SINCE_FAIL: 3
5451 :DRILL_TOTAL_REPEATS: 3
5452 :DRILL_FAILURE_COUNT: 0
5453 :DRILL_AVERAGE_QUALITY: 5.0
5454 :DRILL_EASE: 5.815
5455 :DRILL_LAST_QUALITY: 5
5456 :DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:36>
5457 :END:
5458 cursor up/down fast
5459 [
5460 #+begin_src emacs-lisp
5461 ;; compiling warns that next-line should be called interactively,
5462 ;; but we would have to do something dumb, like give it a
5463 ;; vector of keys in order to supply the 8 argument
5464 (defun down-fast ()
5465 (interactive)
5466 (next-line 8))
5467 (defun up-fast ()
5468 (interactive)
5469 (next-line -8))
5470
5471 (global-set-key (kbd "<C-up>") 'up-fast)
5472 (global-set-key (kbd "<C-down>") 'down-fast)
5473
5474 (add-hook 'comint-mode-hook
5475 (lambda ()
5476 (define-key comint-mode-map (kbd "<C-mouse-4>") 'comint-previous-prompt)
5477 (define-key comint-mode-map (kbd "<C-mouse-5>") 'comint-next-prompt)))
5478 #+end_src
5479 ]
5480
5481 *** [M-scroll]
5482 :PROPERTIES:
5483 :CUSTOM_ID: e1e2e253-450d-4620-af9e-78d378f49ad5
5484 :END:
5485 forward/back s-exp
5486 [
5487 #+begin_src emacs-lisp
5488 (global-set-key (kbd "<M-mouse-4>") 'backward-sexp)
5489 (global-set-key (kbd "<M-mouse-5>") 'forward-sexp)
5490 #+end_src
5491 ]
5492 *** [S-scroll] :drill:
5493 SCHEDULED: <2014-03-22 Sat>
5494 :PROPERTIES:
5495 expand region
5496 :ID: c2da442e-b8c0-4b8a-899f-989af89bd857
5497 :CUSTOM_ID: 74b2196a-345d-453a-b7be-1915360eb201
5498 :DRILL_LAST_INTERVAL: 27.0855
5499 :DRILL_REPEATS_SINCE_FAIL: 5
5500 :DRILL_TOTAL_REPEATS: 5
5501 :DRILL_FAILURE_COUNT: 2
5502 :DRILL_AVERAGE_QUALITY: 3.4
5503 :DRILL_EASE: 2.666
5504 :DRILL_LAST_QUALITY: 4
5505 :DRILL_LAST_REVIEWED: <2014-02-23 Sun 02:26>
5506 :END:
5507 expand/contract region
5508 [
5509 #+begin_src emacs-lisp
5510 (global-set-key (kbd "<S-mouse-13>") 'my-contract-region)
5511 (global-set-key (kbd "<S-mouse-14>") 'er/expand-region)
5512 (global-set-key (kbd "<S-mouse-4>") 'my-contract-region)
5513 (global-set-key (kbd "<S-mouse-5>") 'er/expand-region)
5514 (global-set-key (kbd "<S-up>") 'my-contract-region)
5515 (global-set-key (kbd "<S-down>") 'er/expand-region)
5516
5517 (defun my-contract-region (arg)
5518 (interactive "p")
5519 (let ((current-prefix-arg '-))
5520 (call-interactively 'er/expand-region)))
5521 #+end_src
5522 ]
5523 *** [C-M-scroll] :drill:
5524 SCHEDULED: <2014-03-27 Thu>
5525 :PROPERTIES:
5526 scroll
5527 :ID: b94d89ed-5a06-4916-b5f5-e0bf1a552362
5528 :CUSTOM_ID: bd2ca117-408c-49fc-a5ac-a938be21dfc0
5529 :DRILL_LAST_INTERVAL: 50.6823
5530 :DRILL_REPEATS_SINCE_FAIL: 3
5531 :DRILL_TOTAL_REPEATS: 3
5532 :DRILL_FAILURE_COUNT: 0
5533 :DRILL_AVERAGE_QUALITY: 5.0
5534 :DRILL_EASE: 5.815
5535 :DRILL_LAST_QUALITY: 5
5536 :DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:40>
5537 :END:
5538 scroll
5539 [
5540 background: I originally tried to make c-scroll be scroll
5541 , but this made
5542 for better compatibility with the standard mouse
5543 #+begin_src emacs-lisp
5544 (global-set-key (kbd "<C-M-mouse-4>") 'mwheel-scroll)
5545 (global-set-key (kbd "<C-M-mouse-5>") 'mwheel-scroll)
5546 ; (require 'smooth-scroll)
5547 ; (smooth-scroll-mode nil)
5548 ; (global-set-key (kbd "<C-M-mouse-4>") 'scroll-up-1)
5549 ;(global-set-key (kbd "<C-M-mouse-5>") 'scroll-down-1)
5550 #+end_src
5551 ]
5552 *** [C-S-scroll] :drill:
5553 SCHEDULED: <2014-03-18 Tue>
5554 :PROPERTIES:
5555 zoom
5556 :ID: 368f60cb-91e5-4694-b342-e0049e5d3e2c
5557 :CUSTOM_ID: a69254a4-cf2d-450f-b477-2694b44a7e0d
5558 :DRILL_LAST_INTERVAL: 9.2113
5559 :DRILL_REPEATS_SINCE_FAIL: 3
5560 :DRILL_TOTAL_REPEATS: 7
5561 :DRILL_FAILURE_COUNT: 3
5562 :DRILL_AVERAGE_QUALITY: 2.943
5563 :DRILL_EASE: 2.429
5564 :DRILL_LAST_QUALITY: 3
5565 :DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:34>
5566 :END:
5567 increase / decrease text size
5568 [
5569 #+begin_src emacs-lisp
5570 (global-set-key (kbd "<C-S-mouse-4>") 'text-scale-increase)
5571 (global-set-key (kbd "<C-S-mouse-5>") 'text-scale-decrease)
5572 (global-set-key (kbd "<C-S-mouse-13>") 'text-scale-increase)
5573 (global-set-key (kbd "<C-S-mouse-14>") 'text-scale-decrease)
5574 (global-set-key (kbd "<C-S-down>") 'text-scale-increase)
5575 (global-set-key (kbd "<C-S-up>") 'text-scale-decrease)
5576 #+end_src
5577 ]
5578 *** left-scroll
5579 :PROPERTIES:
5580 :CUSTOM_ID: d2d5c5c7-f0de-4e08-953b-d41d3e282ba7
5581 :END:
5582 left/right
5583 *** [C-left-scroll] :drill:
5584 SCHEDULED: <2014-03-27 Thu>
5585 :PROPERTIES:
5586 :CUSTOM_ID: 7bb95aa5-381e-454a-a6c6-aaeec728db08
5587 :ID: 04bdffa0-52fe-4d90-a222-a6e41d75b13b
5588 :DRILL_LAST_INTERVAL: 50.6823
5589 :DRILL_REPEATS_SINCE_FAIL: 3
5590 :DRILL_TOTAL_REPEATS: 3
5591 :DRILL_FAILURE_COUNT: 0
5592 :DRILL_AVERAGE_QUALITY: 5.0
5593 :DRILL_EASE: 5.815
5594 :DRILL_LAST_QUALITY: 5
5595 :DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:35>
5596 :END:
5597 back / forward word
5598 #+begin_src emacs-lisp
5599 (global-set-key (kbd "<C-left>") 'backward-symbol)
5600 (global-set-key (kbd "<C-right>") 'forward-symbol)
5601 #+end_src
5602 *** [M-left-scroll] :drill:
5603 :PROPERTIES:
5604 winner undo redo
5605 :CUSTOM_ID: 49db3764-b154-4cfc-8d0d-f0e0451815e3
5606 :ID: 97ef29fd-aea5-49ce-aff2-7a8c8d1b3d5d
5607 :DRILL_LAST_INTERVAL: 0.0
5608 :DRILL_REPEATS_SINCE_FAIL: 0
5609 :DRILL_TOTAL_REPEATS: 9
5610 :DRILL_FAILURE_COUNT: 10
5611 :DRILL_AVERAGE_QUALITY: 2.518
5612 :DRILL_EASE: 2.225
5613 :DRILL_LAST_QUALITY: 2
5614 :DRILL_LAST_REVIEWED: <2014-04-14 Mon 11:30>
5615 :END:
5616
5617 *** S-left-scroll
5618 :PROPERTIES:
5619 :CUSTOM_ID: ca5cdcd4-b3da-4d7b-86ab-4c7c0ac2caf7
5620 :END:
5621 ---
5622 unreachable
5623 *** C-M-left-scroll
5624 unreachable
5625 *** C-S-left-scroll
5626 :PROPERTIES:
5627 :CUSTOM_ID: 7b4f1f49-6d93-4210-a30c-8278d6e63655
5628 :ID: b6ea3b66-d9a6-4a33-ae1c-0464d118f006
5629 :END:
5630 unreachable
5631 ** left primary
5632 *** [C-2] :drill:
5633 SCHEDULED: <2014-04-04 Fri>
5634 :PROPERTIES:
5635 :ID: 845cf47f-22d5-4100-837d-fbc066e33c9c
5636 :CUSTOM_ID: 4f29b011-3844-4a4a-b75d-cdf8f49e9adb
5637 :DRILL_LAST_INTERVAL: 26.3927
5638 :DRILL_REPEATS_SINCE_FAIL: 5
5639 :DRILL_TOTAL_REPEATS: 6
5640 :DRILL_FAILURE_COUNT: 2
5641 :DRILL_AVERAGE_QUALITY: 3.25
5642 :DRILL_EASE: 2.58
5643 :DRILL_LAST_QUALITY: 4
5644 :DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:36>
5645 :END:
5646 narrow-to-defun/subtree
5647 [
5648 #+begin_src emacs-lisp
5649 (global-unset-key (kbd "C-2"))
5650 (defun copy-symbol (&optional arg)
5651 "Copy symbol at point into kill-ring"
5652 (interactive "P")
5653 (kill-new (thing-at-point 'symbol)))
5654
5655 (global-set-key (kbd "C-2") 'copy-symbol)
5656
5657 (global-set-key (kbd "C-4") 'narrow-to-defun)
5658 (add-hook 'org-mode-hook
5659 (lambda () (local-set-key (kbd "C-4") 'org-narrow-to-subtree)))
5660 #+end_src
5661 ]
5662 *** M-2
5663 :PROPERTIES:
5664 :CUSTOM_ID: 53ecfda2-d9f6-4882-b7a2-9b3c859e3bcb
5665 :END:
5666 *** [C-M-2]
5667 :PROPERTIES:
5668 :CUSTOM_ID: 33c4996d-92bc-4df0-b005-11553677be13
5669 :END:
5670 ---
5671 [
5672 #+begin_src emacs-lisp
5673 (global-unset-key (kbd "C-M-2"))
5674 #+end_src
5675 ]
5676 *** C-S-2
5677 :PROPERTIES:
5678 :CUSTOM_ID: 43af8e87-216d-47f7-9779-48ef66c7ca5f
5679 :END:
5680 *** [C-3] :drill:
5681 SCHEDULED: <2014-03-27 Thu>
5682 :PROPERTIES:
5683 :ID: 9495ba60-017a-49b0-b0b6-366c3334e909
5684 :CUSTOM_ID: 7851a05e-7177-4a8f-af5a-3325a8f116fe
5685 :DRILL_LAST_INTERVAL: 50.6823
5686 :DRILL_REPEATS_SINCE_FAIL: 3
5687 :DRILL_TOTAL_REPEATS: 3
5688 :DRILL_FAILURE_COUNT: 0
5689 :DRILL_AVERAGE_QUALITY: 5.0
5690 :DRILL_EASE: 5.815
5691 :DRILL_LAST_QUALITY: 5
5692 :DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:41>
5693 :END:
5694 dot-mode-execute
5695 [
5696 #+begin_src emacs-lisp
5697 (global-set-key (kbd "C-3") 'dot-mode-execute)
5698 #+end_src
5699 ]
5700 *** M-3
5701 :PROPERTIES:
5702 :CUSTOM_ID: ddceb843-06db-4078-914f-da225cac107e
5703 :END:
5704 *** [C-M-3] :drill:
5705 SCHEDULED: <2014-03-11 Tue>
5706 :PROPERTIES:
5707 :CUSTOM_ID: 9a00e17f-a1c9-48fc-b03b-c6a1a3cbda1c
5708 :ID: 75be5945-8bc4-4041-a44f-de2d9af66f4f
5709 :DRILL_LAST_INTERVAL: 19.6736
5710 :DRILL_REPEATS_SINCE_FAIL: 4
5711 :DRILL_TOTAL_REPEATS: 5
5712 :DRILL_FAILURE_COUNT: 1
5713 :DRILL_AVERAGE_QUALITY: 3.4
5714 :DRILL_EASE: 2.666
5715 :DRILL_LAST_QUALITY: 4
5716 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:48>
5717 :END:
5718 recenter-top-bottom
5719 [
5720 #+begin_src emacs-lisp
5721 (global-set-key (kbd "C-M-3") 'recenter-top-bottom)
5722 #+end_src
5723 ]
5724 *** C-S-3
5725 :PROPERTIES:
5726 :CUSTOM_ID: 224cf9b0-2e12-4cc7-a7e1-746784c87777
5727 :END:
5728 *** [C-q] :drill:
5729 SCHEDULED: <2014-03-27 Thu>
5730 :PROPERTIES:
5731 :ID: e7f30a61-8557-4b7e-898c-96db9d649f39
5732 :CUSTOM_ID: 679fd3cd-c43b-409c-be36-4175a5f27cd3
5733 :DRILL_LAST_INTERVAL: 50.6823
5734 :DRILL_REPEATS_SINCE_FAIL: 3
5735 :DRILL_TOTAL_REPEATS: 3
5736 :DRILL_FAILURE_COUNT: 0
5737 :DRILL_AVERAGE_QUALITY: 5.0
5738 :DRILL_EASE: 5.815
5739 :DRILL_LAST_QUALITY: 5
5740 :DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:42>
5741 :END:
5742 org-cycle, comint previous arg
5743 [
5744 #+begin_src emacs-lisp
5745 (add-hook 'org-mode-hook
5746 (lambda () (define-key org-mode-map (kbd "C-q") 'org-cycle)))
5747 (define-key widget-keymap (kbd "C-q") 'widget-forward)
5748 (add-hook 'comint-mode-hook
5749 (lambda () (define-key comint-mode-map (kbd "C-q") 'comint-insert-previous-argument)))
5750 #+end_src
5751 ]
5752 *** [M-q] :drill:
5753 SCHEDULED: <2014-03-19 Wed>
5754 :PROPERTIES:
5755 org-archive-to-archive-sibling
5756 :CUSTOM_ID: 72bada0e-5d62-4a8f-ae62-4972778ff1bc
5757 :ID: 4c8104f4-9251-4915-b076-6989c7cce3be
5758 :DRILL_LAST_INTERVAL: 10.3717
5759 :DRILL_REPEATS_SINCE_FAIL: 4
5760 :DRILL_TOTAL_REPEATS: 8
5761 :DRILL_FAILURE_COUNT: 6
5762 :DRILL_AVERAGE_QUALITY: 2.6
5763 :DRILL_EASE: 2.266
5764 :DRILL_LAST_QUALITY: 3
5765 :DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:35>
5766 :END:
5767 org-archive-to-archive-sibling
5768 [
5769 #+begin_src emacs-lisp
5770 (global-set-key (kbd "M-q") 'org-archive-to-archive-sibling)
5771 #+end_src
5772 ]
5773
5774 *** [C-M-q] :drill:
5775 SCHEDULED: <2014-03-12 Wed>
5776 :PROPERTIES:
5777 :ID: ab67e1da-41dd-40bd-96c1-556cafc6b630
5778 :DRILL_LAST_INTERVAL: 9.9427
5779 :DRILL_REPEATS_SINCE_FAIL: 3
5780 :DRILL_TOTAL_REPEATS: 6
5781 :DRILL_FAILURE_COUNT: 2
5782 :DRILL_AVERAGE_QUALITY: 3.104
5783 :DRILL_EASE: 2.506
5784 :DRILL_LAST_QUALITY: 4
5785 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 20:57>
5786 :CUSTOM_ID: 1f5e9b63-7ce0-445c-a426-b41839585d38
5787 :END:
5788 quoted-insert
5789 [
5790 #+begin_src emacs-lisp
5791 (global-set-key (kbd "C-M-q") 'quoted-insert)
5792 #+end_src
5793 ]
5794 *** C-S-q
5795 :PROPERTIES:
5796 :CUSTOM_ID: c16f1753-126b-499b-af0e-669129ccd3ea
5797 :END:
5798 *** [C-w]
5799 :PROPERTIES:
5800 :CUSTOM_ID: 20005b6d-9a9d-4b58-882c-7ce860c7a395
5801 :END:
5802 goto-t.org
5803 [
5804 #+begin_src emacs-lisp
5805 (global-set-key (kbd "C-w") (lambda () (interactive) (goto-buffer-or-find-file "/a/t.org")))
5806 #+end_src
5807 ]
5808 *** [M-w] :drill:
5809 SCHEDULED: <2014-03-18 Tue>
5810 :PROPERTIES:
5811 org-clock-in
5812 :ID: c271d82d-e40a-43c3-9c16-753633c1fc14
5813 :CUSTOM_ID: 331da6e5-7936-4663-8f58-9d8601b5915c
5814 :DRILL_LAST_INTERVAL: 41.7787
5815 :DRILL_REPEATS_SINCE_FAIL: 3
5816 :DRILL_TOTAL_REPEATS: 3
5817 :DRILL_FAILURE_COUNT: 0
5818 :DRILL_AVERAGE_QUALITY: 4.667
5819 :DRILL_EASE: 4.583
5820 :DRILL_LAST_QUALITY: 4
5821 :DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:36>
5822 :END:
5823 org-clock-in
5824 [
5825 #+begin_src emacs-lisp
5826 (global-set-key (kbd "M-w") 'org-clock-in)
5827 #+end_src
5828 ]
5829 *** C-M-w
5830 :PROPERTIES:
5831 :CUSTOM_ID: cede4936-de2f-404f-a0e6-264f08215a7c
5832 :END:
5833 *** C-S-w
5834 :PROPERTIES:
5835 :CUSTOM_ID: 3465b986-717a-43b4-910f-3d187789c027
5836 :END:
5837 *** [C-e]
5838 copy-line
5839 [
5840 #+begin_src emacs-lisp
5841 ; todo, make repeated calls to this append the kills
5842 (defun copy-line (&optional arg)
5843 "Copy lines (as many as prefix argument) in the kill ring.
5844 Ease of use features:
5845 - Move to start of next line.
5846 - Appends the copy on sequential calls.
5847 - Use newline as last char even on the last line of the buffer.
5848 - If region is active, copy its lines."
5849 (interactive "p")
5850 (let ((beg (line-beginning-position))
5851 (end (line-end-position (or arg 1))))
5852 (when mark-active
5853 (if (> (point) (mark))
5854 (setq beg (save-excursion (goto-char (mark)) (line-beginning-position)))
5855 (setq end (save-excursion (goto-char (mark)) (line-end-position)))))
5856 (if (eq last-command 'copy-line)
5857 (kill-append (buffer-substring beg end) (< end beg))
5858 (kill-ring-save beg end)))
5859 (kill-append "\n" nil)
5860 ;; dun need cuz I have yank-better
5861 ;;(beginning-of-line (or (and arg (1+ arg)) 2))
5862 (if (and arg (not (= 1 arg))) (message "%d lines copied" arg)))
5863
5864 (global-set-key (kbd "C-e") 'copy-line)
5865 #+end_src
5866 :PROPERTIES:
5867 :ID: 4ff8e0ad-15c0-4cb0-b6cc-314e7b5f80c0
5868 :CUSTOM_ID: 24e34f4b-d1e8-4380-933f-ab1f78ebc782
5869 :DRILL_LAST_INTERVAL: 2.4849
5870 :DRILL_REPEATS_SINCE_FAIL: 1
5871 :DRILL_TOTAL_REPEATS: 1
5872 :DRILL_FAILURE_COUNT: 0
5873 :DRILL_AVERAGE_QUALITY: 5.0
5874 :DRILL_EASE: 5.815
5875 :DRILL_LAST_QUALITY: 5
5876 :DRILL_LAST_REVIEWED: <2014-01-11 Sat 01:30>
5877 :END:
5878 ]
5879 *** [M-e] :drill:
5880 SCHEDULED: <2014-04-01 Tue>
5881 :PROPERTIES:
5882 org-clock-in-last
5883 :ID: 39424175-21e2-4126-9a51-dea451497841
5884 :CUSTOM_ID: 0a771449-0cd5-4dc9-82ca-bcac5f7abd17
5885 :DRILL_LAST_INTERVAL: 36.7949
5886 :DRILL_REPEATS_SINCE_FAIL: 4
5887 :DRILL_TOTAL_REPEATS: 4
5888 :DRILL_FAILURE_COUNT: 0
5889 :DRILL_AVERAGE_QUALITY: 4.0
5890 :DRILL_EASE: 3.204
5891 :DRILL_LAST_QUALITY: 3
5892 :DRILL_LAST_REVIEWED: <2014-02-23 Sun 01:48>
5893 :END:
5894 org-clock-in-last
5895 [
5896 #+begin_src emacs-lisp
5897 (global-set-key (kbd "M-e") 'org-clock-in-last)
5898 #+end_src
5899 ]
5900 *** C-M-e
5901 :PROPERTIES:
5902 :CUSTOM_ID: 4a7a4324-e03d-43dc-8e9c-9622788519fb
5903 :END:
5904 *** C-S-e
5905 :PROPERTIES:
5906 :CUSTOM_ID: e202e1d5-b7ac-4171-b86a-b77592344f30
5907 :END:
5908 *** [C-r] :drill:
5909 SCHEDULED: <2014-04-07 Mon>
5910 :PROPERTIES:
5911 isearch-backward
5912 :ID: 39bcde9c-2b49-401e-9e81-ee42941233bf
5913 :CUSTOM_ID: 5c55f461-f43f-493d-81eb-1ca747175ef1
5914 :DRILL_LAST_INTERVAL: 42.8284
5915 :DRILL_REPEATS_SINCE_FAIL: 4
5916 :DRILL_TOTAL_REPEATS: 4
5917 :DRILL_FAILURE_COUNT: 0
5918 :DRILL_AVERAGE_QUALITY: 4.5
5919 :DRILL_EASE: 4.122
5920 :DRILL_LAST_QUALITY: 5
5921 :DRILL_LAST_REVIEWED: <2014-02-23 Sun 01:51>
5922 :END:
5923 isearch-backward
5924 [
5925 #+begin_src emacs-lisp
5926 (global-set-key (kbd "C-r") 'isearch-backward)
5927 (add-hook 'comint-mode-hook
5928 (lambda ()
5929 (define-key comint-mode-map (kbd "C-r") 'comint-history-isearch-backward-regexp)))
5930
5931 #+end_src
5932 ]
5933 *** [M-r] :drill:
5934 SCHEDULED: <2014-04-30 Wed>
5935 :PROPERTIES:
5936 org-clock-out
5937 :ID: dc2c7192-6cfb-4c06-bd17-ff2cef3b05a6
5938 :CUSTOM_ID: dd9575bd-e471-418e-9519-4fc2b874ddcd
5939 :DRILL_LAST_INTERVAL: 59.1432
5940 :DRILL_REPEATS_SINCE_FAIL: 4
5941 :DRILL_TOTAL_REPEATS: 4
5942 :DRILL_FAILURE_COUNT: 0
5943 :DRILL_AVERAGE_QUALITY: 4.25
5944 :DRILL_EASE: 3.59
5945 :DRILL_LAST_QUALITY: 3
5946 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:10>
5947 :END:
5948 org-clock-out
5949 [
5950 #+begin_src emacs-lisp
5951 (global-set-key (kbd "M-r") 'org-clock-out)
5952 #+end_src
5953 ]
5954 *** C-M-r
5955 *** C-S-r
5956 :PROPERTIES:
5957 :CUSTOM_ID: 05e2290b-0d2c-407c-9bf0-adc7a008336b
5958 :END:
5959 *** [C-a] :drill:
5960 SCHEDULED: <2014-03-15 Sat>
5961 :PROPERTIES:
5962 copy-all
5963 :CUSTOM_ID: db4b76df-9420-4256-8242-dc44b56d55d7
5964 :ID: f6b2b504-b88d-418b-b6b0-5e0e582bd205
5965 :DRILL_LAST_INTERVAL: 24.4352
5966 :DRILL_REPEATS_SINCE_FAIL: 4
5967 :DRILL_TOTAL_REPEATS: 4
5968 :DRILL_FAILURE_COUNT: 0
5969 :DRILL_AVERAGE_QUALITY: 3.75
5970 :DRILL_EASE: 2.929
5971 :DRILL_LAST_QUALITY: 4
5972 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:39>
5973 :END:
5974 copy buffer
5975 [
5976 #+begin_src emacs-lisp
5977 (defun copy-all ()
5978 "Copy entire buffer to clipboard"
5979 (interactive)
5980 (clipboard-kill-ring-save (point-min) (point-max)))
5981 (global-set-key (kbd "C-a") 'copy-all)
5982 #+end_src
5983 ]
5984 *** [M-a] :drill:
5985 SCHEDULED: <2014-03-27 Thu>
5986 :PROPERTIES:
5987 kmacro-start-macro-or-in...
5988 :ID: 4019514b-abb1-464e-b4c9-d9ca39af2a82
5989 :CUSTOM_ID: e865a1e5-55bf-4a98-a0d0-cb05a88de352
5990 :DRILL_LAST_INTERVAL: 50.6823
5991 :DRILL_REPEATS_SINCE_FAIL: 3
5992 :DRILL_TOTAL_REPEATS: 3
5993 :DRILL_FAILURE_COUNT: 0
5994 :DRILL_AVERAGE_QUALITY: 5.0
5995 :DRILL_EASE: 5.815
5996 :DRILL_LAST_QUALITY: 5
5997 :DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:40>
5998 :END:
5999 macro record
6000 [
6001 #+begin_src emacs-lisp
6002 (global-set-key (kbd "M-a") 'kmacro-start-macro-or-insert-counter)
6003
6004 #+end_src
6005 ]
6006 *** [C-M-a] :drill:
6007 SCHEDULED: <2014-03-27 Thu>
6008 :PROPERTIES:
6009 kmacro-end-or-call-macro
6010 :ID: 10cdc522-2bea-4601-acf9-ec81a52a34d8
6011 :CUSTOM_ID: c6278a5a-024f-4c80-a8d4-65f127fd24a8
6012 :DRILL_LAST_INTERVAL: 50.6823
6013 :DRILL_REPEATS_SINCE_FAIL: 3
6014 :DRILL_TOTAL_REPEATS: 3
6015 :DRILL_FAILURE_COUNT: 0
6016 :DRILL_AVERAGE_QUALITY: 5.0
6017 :DRILL_EASE: 5.815
6018 :DRILL_LAST_QUALITY: 5
6019 :DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:35>
6020 :END:
6021 macro end / call
6022 [
6023 #+begin_src emacs-lisp
6024 (global-set-key (kbd "C-M-a") 'kmacro-end-or-call-macro)
6025 (add-hook 'perl-mode-hook (lambda () (define-key perl-mode-map (kbd "C-M-a") nil)))
6026 (add-hook 'LaTeX-mode-hook (lambda () (define-key LaTeX-mode-map (kbd "C-M-a") nil)))
6027 (add-hook 'c-mode-hook
6028 (lambda () (define-key c-mode-map (kbd "C-M-a") nil)))
6029
6030 #+end_src
6031 ]
6032 *** C-S-a
6033 :PROPERTIES:
6034 :CUSTOM_ID: 649a3fe7-3932-475a-b23c-28db9874de27
6035 :END:
6036 *** C-s
6037 :PROPERTIES:
6038 C-x prefix
6039 :ID: e05a67d7-f7ee-4b23-afb1-0053d5eefb4c
6040 :CUSTOM_ID: 01da04da-cdba-493f-892b-c4c064cf937e
6041 :END:
6042 c-x prefix
6043
6044 *** M-s
6045 :PROPERTIES:
6046 :CUSTOM_ID: 5e4bf939-90a1-4ace-a7bf-add95c8596d2
6047 :END:
6048 *** [C-M-s] :drill:
6049 SCHEDULED: <2014-03-18 Tue>
6050 :PROPERTIES:
6051 split-window-vertically
6052 :ID: 18a271e1-c1d2-45e6-aed3-6b81b4b6ea71
6053 :CUSTOM_ID: 4b33022d-27f0-4d21-9931-2e2e692790e8
6054 :DRILL_LAST_INTERVAL: 26.5334
6055 :DRILL_REPEATS_SINCE_FAIL: 4
6056 :DRILL_TOTAL_REPEATS: 4
6057 :DRILL_FAILURE_COUNT: 0
6058 :DRILL_AVERAGE_QUALITY: 3.75
6059 :DRILL_EASE: 2.929
6060 :DRILL_LAST_QUALITY: 3
6061 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:46>
6062 :END:
6063 split-window-vertically
6064 [
6065 #+begin_src emacs-lisp
6066 (global-set-key (kbd "C-M-s") 'split-window-vertically)
6067 #+end_src
6068 ]
6069 *** C-S-s
6070 :PROPERTIES:
6071 :CUSTOM_ID: 901a2445-200c-42f2-91c6-4309d71b39dd
6072 :END:
6073 *** C-d
6074 :PROPERTIES:
6075 :CUSTOM_ID: b699614a-9994-4fe7-b2c6-f0fe81b7ad2b
6076 :END:
6077 C-c prefix
6078 *** [M-d] :drill:
6079 SCHEDULED: <2014-04-05 Sat>
6080 :PROPERTIES:
6081 whitespace-cleanup
6082 :ID: 58f5421a-9df0-44cd-acb9-d018ccdba58c
6083 :CUSTOM_ID: 06bcc5e2-f3a7-41c6-a793-ac6c9813fb6e
6084 :DRILL_LAST_INTERVAL: 27.3693
6085 :DRILL_REPEATS_SINCE_FAIL: 5
6086 :DRILL_TOTAL_REPEATS: 6
6087 :DRILL_FAILURE_COUNT: 2
6088 :DRILL_AVERAGE_QUALITY: 3.417
6089 :DRILL_EASE: 2.676
6090 :DRILL_LAST_QUALITY: 4
6091 :DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:36>
6092 :END:
6093 whitespace-cleanup
6094 [
6095 #+begin_src emacs-lisp
6096 (global-set-key (kbd "M-d") 'whitespace-cleanup)
6097 #+end_src
6098 ]
6099 *** [C-M-d] :drill:
6100 SCHEDULED: <2014-03-19 Wed>
6101 :PROPERTIES:
6102 swap buffer
6103 :CUSTOM_ID: 8cf6053d-792b-4abd-a3a6-66efd7fbee68
6104 :ID: 747aabec-b164-4813-93c8-92d5c8778635
6105 :DRILL_LAST_INTERVAL: 9.5325
6106 :DRILL_REPEATS_SINCE_FAIL: 4
6107 :DRILL_TOTAL_REPEATS: 10
6108 :DRILL_FAILURE_COUNT: 8
6109 :DRILL_AVERAGE_QUALITY: 2.636
6110 :DRILL_EASE: 2.284
6111 :DRILL_LAST_QUALITY: 3
6112 :DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:35>
6113 :END:
6114 swap buffer across windows
6115 [
6116 from http://www.emacswiki.org/emacs/TransposeWindows
6117 #+begin_src emacs-lisp
6118 (setq swapping-buffer nil)
6119 (setq swapping-window nil)
6120 (defun swap-buffers-in-windows ()
6121 "Swap buffers between two windows"
6122 (interactive)
6123 (if (and swapping-window
6124 swapping-buffer)
6125 (let ((this-buffer (current-buffer))
6126 (this-window (selected-window)))
6127 (if (and (window-live-p swapping-window)
6128 (buffer-live-p swapping-buffer))
6129 (progn (switch-to-buffer swapping-buffer)
6130 (select-window swapping-window)
6131 (switch-to-buffer this-buffer)
6132 (select-window this-window)
6133 (message "Swapped buffers."))
6134 (message "Old buffer/window killed. Aborting."))
6135 (setq swapping-buffer nil)
6136 (setq swapping-window nil))
6137 (progn
6138 (setq swapping-buffer (current-buffer))
6139 (setq swapping-window (selected-window))
6140 (message "Buffer and window marked for swapping."))))
6141
6142 (global-set-key (kbd "C-M-d") 'swap-buffers-in-windows)
6143 #+end_src
6144 ]
6145 *** C-S-d
6146 :PROPERTIES:
6147 :CUSTOM_ID: d3166178-3d87-4caa-a937-9797fc2b6a39
6148 :END:
6149 *** [C-f]
6150 :PROPERTIES:
6151 :CUSTOM_ID: 2695ed8a-e0d3-4e84-8688-98e3c50723b0
6152 :END:
6153 kill-whole-line
6154 [
6155 #+begin_src emacs-lisp
6156 (global-set-key (kbd "C-f") 'kill-whole-line-wrapper)
6157 (defun kill-whole-line-wrapper (&optional arg)
6158 "If we are at the end of the file, kill backwards instead of doing nothing."
6159 (interactive "P")
6160 (if (= (point) (point-max))
6161 (kill-whole-line -1)
6162 (kill-whole-line arg)))
6163 #+end_src
6164 ]
6165 *** M-f
6166 :PROPERTIES:
6167 :CUSTOM_ID: 869f0aec-c739-4fb7-8e3a-8b55ab637765
6168 :END:
6169 *** [C-M-f]
6170 :PROPERTIES:
6171 :CUSTOM_ID: e7e4dd0b-418f-48ee-b366-9e733e3bec61
6172 :END:
6173 kill rest of line
6174 [
6175 #+begin_src emacs-lisp
6176
6177 (add-hook 'org-mode-hook
6178 (lambda ()
6179 (define-key org-mode-map (kbd "C-M-f") 'org-kill-line)))
6180
6181 (global-set-key (kbd "C-M-f") 'kill-line)
6182 #+end_src
6183 ]
6184 *** C-S-f
6185 :PROPERTIES:
6186 :CUSTOM_ID: a59eb2ca-9439-4836-81f9-384bc8c07739
6187 :END:
6188 *** [C-g]
6189 SCHEDULED: <2014-01-13 Mon>
6190 :PROPERTIES:
6191 other-window / cancel
6192 :ID: a4e9c495-02c1-432e-beba-12a9d4d61e8a
6193 :CUSTOM_ID: 4af40595-7010-4be6-8cfe-a43797ca6e33
6194 :DRILL_LAST_INTERVAL: 2.4849
6195 :DRILL_REPEATS_SINCE_FAIL: 1
6196 :DRILL_TOTAL_REPEATS: 1
6197 :DRILL_FAILURE_COUNT: 0
6198 :DRILL_AVERAGE_QUALITY: 5.0
6199 :DRILL_EASE: 5.815
6200 :DRILL_LAST_QUALITY: 5
6201 :DRILL_LAST_REVIEWED: <2014-01-11 Sat 01:41>
6202 :END:
6203 cancel / other window
6204 [
6205 #+begin_src emacs-lisp
6206 (global-set-key (kbd "C-g") 'other-window)
6207 #+end_src
6208 ]
6209 *** [M-g] :drill:
6210 SCHEDULED: <2014-03-13 Thu>
6211 :PROPERTIES:
6212 abort-recursive-edit
6213 :ID: 1e8e0c57-2885-4c0c-9b94-3ec0c02b706e
6214 :CUSTOM_ID: fb0b343f-fdff-463a-94f4-3152191e17c4
6215 :DRILL_LAST_INTERVAL: 22.1939
6216 :DRILL_REPEATS_SINCE_FAIL: 4
6217 :DRILL_TOTAL_REPEATS: 4
6218 :DRILL_FAILURE_COUNT: 0
6219 :DRILL_AVERAGE_QUALITY: 3.5
6220 :DRILL_EASE: 2.73
6221 :DRILL_LAST_QUALITY: 4
6222 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 16:33>
6223 :END:
6224 abort-recursive-edit
6225 [
6226 #+begin_src emacs-lisp
6227 (global-set-key (kbd "M-g") 'abort-recursive-edit)
6228 #+end_src
6229 ]
6230 *** [C-M-g]
6231 :PROPERTIES:
6232 :CUSTOM_ID: 327e18af-30b7-47e5-aa53-5f678788b4c1
6233 :END:
6234 gnus
6235 [
6236 #+begin_src emacs-lisp
6237 (global-set-key (kbd "C-M-g") 'gnus)
6238 #+end_src
6239 ]
6240 *** C-S-g
6241 :PROPERTIES:
6242 :CUSTOM_ID: 1d4edc55-7b30-4648-b869-b82f8f1d7b1a
6243 :END:
6244 *** C-z
6245 :PROPERTIES:
6246 undo-tree-undo
6247 :ID: 42d7f2bf-3ba3-488b-b501-bd4680dbb8de
6248 :CUSTOM_ID: 707c4938-a790-4da9-8230-61855ea57d09
6249 :END:
6250 [
6251 #+begin_src emacs-lisp
6252 (global-set-key (kbd "C-z") 'undo-tree-undo)
6253 #+end_src
6254 ]
6255 *** M-z
6256 :PROPERTIES:
6257 :CUSTOM_ID: a01c110e-9970-4571-84ab-379eecc7dd31
6258 :END:
6259 *** [C-M-z]
6260 *** C-S-z
6261 :PROPERTIES:
6262 :CUSTOM_ID: 3d56370d-11cd-4026-8e6b-3ae9b7b51714
6263 :END:
6264 *** C-x
6265 :PROPERTIES:
6266 :CUSTOM_ID: ec1403d3-528e-41b1-a195-5563bc93e124
6267 :END:
6268 kill-region
6269 #+begin_src emacs-lisp
6270 (global-set-key (kbd "C-s") 'kill-region)
6271 #+end_src
6272 *** [M-x] :drill:
6273 SCHEDULED: <2014-03-31 Mon>
6274 :PROPERTIES:
6275 :CUSTOM_ID: bb7c95d5-dd97-439d-bf1f-cdac98d11543
6276 :ID: 909cf249-c2f2-4251-bf18-c990ca9c6ff9
6277 :DRILL_LAST_INTERVAL: 21.5453
6278 :DRILL_REPEATS_SINCE_FAIL: 4
6279 :DRILL_TOTAL_REPEATS: 4
6280 :DRILL_FAILURE_COUNT: 0
6281 :DRILL_AVERAGE_QUALITY: 3.25
6282 :DRILL_EASE: 2.58
6283 :DRILL_LAST_QUALITY: 3
6284 :DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:33>
6285 :END:
6286 append-next-kill
6287 [
6288 #+begin_src emacs-lisp
6289 (global-set-key (kbd "M-x") 'append-next-kill)
6290 #+end_src
6291 ]
6292 *** [C-M-x] :drill:
6293 SCHEDULED: <2014-03-17 Mon>
6294 :PROPERTIES:
6295 append-next-kill
6296 :ID: b2b60fb4-95a3-4311-8ccd-7132f03ac9a8
6297 :CUSTOM_ID: c988370e-602c-431c-80a9-608459583f8b
6298 :DRILL_LAST_INTERVAL: 26.0772
6299 :DRILL_REPEATS_SINCE_FAIL: 4
6300 :DRILL_TOTAL_REPEATS: 4
6301 :DRILL_FAILURE_COUNT: 1
6302 :DRILL_AVERAGE_QUALITY: 3.5
6303 :DRILL_EASE: 2.73
6304 :DRILL_LAST_QUALITY: 3
6305 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:49>
6306 :END:
6307 cut-to-register
6308 [
6309 #+begin_src emacs-lisp
6310 ;; same args as copy-to-register
6311 (defun cut-to-register (register start end &optional delete-flag region)
6312 (interactive (list (register-read-with-preview "Cut to register: ")
6313 (region-beginning)
6314 (region-end)
6315 current-prefix-arg
6316 t))
6317 (copy-to-register register start end t region))
6318
6319 (global-set-key (kbd "C-M-x") 'cut-to-register)
6320 #+end_src
6321 ]
6322 *** C-S-x
6323 :PROPERTIES:
6324 :CUSTOM_ID: 0ce7383c-0776-407e-9ac5-981d1476f541
6325 :END:
6326 *** C-c
6327 :PROPERTIES:
6328 :ID: 5416e482-6f36-4d35-84c3-49bb184a53e9
6329 :CUSTOM_ID: 400f06e1-8e45-443c-8d7b-3d1bb1176aab
6330 :END:
6331 copy
6332 #+begin_src emacs-lisp
6333 (global-set-key (kbd "C-d") 'kill-ring-save)
6334 (add-hook 'c-mode-hook
6335 (lambda () (define-key c-mode-map (kbd "C-d") nil)))
6336 (add-hook 'comint-mode-hook
6337 (lambda ()
6338 (define-key comint-mode-map (kbd "C-d") nil)))
6339 ;; the base map is shared by many c-modes, like java
6340 (add-hook 'c-mode-hook
6341 (lambda ()
6342 (define-key c-mode-base-map "\C-d" nil)
6343 (define-key c-mode-base-map (kbd "<deletechar>") 'c-electric-delete-forward)))
6344
6345 #+end_src
6346 *** [M-c] :drill:
6347 SCHEDULED: <2014-03-24 Mon>
6348 :PROPERTIES:
6349 org-capture
6350 :ID: bf1cb358-ec72-425d-aebb-0c1f0ece7717
6351 :CUSTOM_ID: f4c3317a-a317-4d04-8cb7-e46d0716bf1d
6352 :DRILL_LAST_INTERVAL: 32.7466
6353 :DRILL_REPEATS_SINCE_FAIL: 4
6354 :DRILL_TOTAL_REPEATS: 4
6355 :DRILL_FAILURE_COUNT: 0
6356 :DRILL_AVERAGE_QUALITY: 4.0
6357 :DRILL_EASE: 3.204
6358 :DRILL_LAST_QUALITY: 4
6359 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:53>
6360 :END:
6361 org-capture
6362 [
6363 #+begin_src emacs-lisp
6364 (define-key global-map "\M-c" 'org-capture)
6365 #+end_src
6366 ]
6367 *** [C-M-c] :drill:
6368 SCHEDULED: <2014-03-24 Mon>
6369 :PROPERTIES:
6370 copy-to-register
6371 :ID: 956fd2ec-ad26-4842-b56c-f2165648c461
6372 :CUSTOM_ID: 0a151d99-47ae-4e8f-8407-82e77d24a3e7
6373 :DRILL_LAST_INTERVAL: 32.7466
6374 :DRILL_REPEATS_SINCE_FAIL: 4
6375 :DRILL_TOTAL_REPEATS: 4
6376 :DRILL_FAILURE_COUNT: 0
6377 :DRILL_AVERAGE_QUALITY: 4.0
6378 :DRILL_EASE: 3.204
6379 :DRILL_LAST_QUALITY: 4
6380 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:51>
6381 :END:
6382 copy-to-register
6383 [
6384 #+begin_src emacs-lisp
6385 (global-set-key (kbd "C-M-c") 'copy-to-register)
6386 #+end_src
6387 ]
6388 *** C-S-c
6389 :PROPERTIES:
6390 :CUSTOM_ID: b78d717f-cfb3-477a-b951-63f523635f5c
6391 :END:
6392 *** C-v
6393 :PROPERTIES:
6394 :CUSTOM_ID: 16411f68-7fe0-49e8-9a73-212471594f9e
6395 :END:
6396 yank
6397 #+begin_src emacs-lisp
6398 (global-set-key (kbd "C-v") 'yank-better)
6399
6400
6401
6402 (defun yank-better (arg)
6403 "Paste, linewise if our kill ends with a newline.
6404 I change the behavior of plain prefix. It makes it not do linewise paste,
6405 because sometimes you want to yank pop and a linewise paste screws that up.
6406 c-u with no number normally makes the point go before the yank.
6407 That is pointless for me, as it would be just as easier and less
6408 thought to pop the mark after yanking cuz it is set to before the mark."
6409 (interactive "*P")
6410 (if (and (not (equal arg '(4))) (string-suffix-p "\n" (current-kill 0 t)))
6411 (beginning-of-line))
6412 (if (and (stringp mode-name) (string= mode-name "Org"))
6413 (call-interactively 'org-yank)
6414 (setq this-command 'yank)
6415 (call-interactively 'yank (and (not (equal arg '(4)))))))
6416
6417 (put 'yank-better 'delete-selection 'yank)
6418 #+end_src
6419 *** [M-v] :drill:
6420 SCHEDULED: <2014-03-11 Tue>
6421 :PROPERTIES:
6422 insert-register
6423 :ID: 7e21df8d-fdf7-47ed-8648-f9d182445145
6424 :CUSTOM_ID: d67f6371-a13f-4a75-8d8c-e4013ff4e131
6425 :DRILL_LAST_INTERVAL: 2.2172
6426 :DRILL_REPEATS_SINCE_FAIL: 1
6427 :DRILL_TOTAL_REPEATS: 5
6428 :DRILL_FAILURE_COUNT: 2
6429 :DRILL_AVERAGE_QUALITY: 2.84
6430 :DRILL_EASE: 2.381
6431 :DRILL_LAST_QUALITY: 3
6432 :DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:38>
6433 :END:
6434 insert-register
6435 [
6436 #+begin_src emacs-lisp
6437 (global-set-key (kbd "M-v") 'insert-register)
6438 #+end_src
6439 ]
6440 *** [C-M-v] :drill:
6441 SCHEDULED: <2014-05-13 Tue>
6442 :PROPERTIES:
6443 yank pop
6444 :ID: e05d9d8f-1387-44b3-b348-a45cf6083bd2
6445 :CUSTOM_ID: 25f86658-9999-40f7-b3a4-615981751b93
6446 :DRILL_LAST_INTERVAL: 71.5839
6447 :DRILL_REPEATS_SINCE_FAIL: 4
6448 :DRILL_TOTAL_REPEATS: 4
6449 :DRILL_FAILURE_COUNT: 0
6450 :DRILL_AVERAGE_QUALITY: 4.75
6451 :DRILL_EASE: 4.85
6452 :DRILL_LAST_QUALITY: 5
6453 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:10>
6454 :END:
6455 yank-pop
6456 [
6457 #+begin_src emacs-lisp
6458 (global-set-key (kbd "C-M-v") 'yank-pop)
6459 #+end_src
6460 ]
6461 *** C-S-v
6462 :PROPERTIES:
6463 :CUSTOM_ID: 6732ed10-a473-445d-b14a-5f4c17c6a3ef
6464 :END:
6465 *** [C-b] :drill:
6466 SCHEDULED: <2014-03-27 Thu>
6467 :PROPERTIES:
6468 delete-other-windows
6469 :ID: c9309da7-6801-4d94-a21e-140f4b258c28
6470 :CUSTOM_ID: e682305e-0110-4d2f-afbd-2c401bcb9313
6471 :DRILL_LAST_INTERVAL: 50.6823
6472 :DRILL_REPEATS_SINCE_FAIL: 3
6473 :DRILL_TOTAL_REPEATS: 3
6474 :DRILL_FAILURE_COUNT: 0
6475 :DRILL_AVERAGE_QUALITY: 5.0
6476 :DRILL_EASE: 5.815
6477 :DRILL_LAST_QUALITY: 5
6478 :DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:34>
6479 :END:
6480 delete-other-windows
6481 [
6482 #+begin_src emacs-lisp
6483 (global-set-key (kbd "C-b") 'delete-other-windows)
6484 #+end_src
6485 ]
6486 *** [M-b] :drill:
6487 SCHEDULED: <2014-04-07 Mon>
6488 :PROPERTIES:
6489 isearch-backward-current-symbol
6490 :CUSTOM_ID: 05e3d0db-36dc-455f-8bed-f87886ca6004
6491 :ID: 0272efdb-eb85-485c-b24f-410ceabeb330
6492 :DRILL_LAST_INTERVAL: 28.6736
6493 :DRILL_REPEATS_SINCE_FAIL: 5
6494 :DRILL_TOTAL_REPEATS: 5
6495 :DRILL_FAILURE_COUNT: 1
6496 :DRILL_AVERAGE_QUALITY: 3.4
6497 :DRILL_EASE: 2.666
6498 :DRILL_LAST_QUALITY: 4
6499 :DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:36>
6500 :END:
6501 isearch-backward-current-symbol
6502 [
6503 #+begin_src emacs-lisp
6504 (global-set-key (kbd "M-b") 'isearch-backward-current-symbol)
6505 #+end_src
6506 ]
6507 *** [C-M-b] :drill:
6508 SCHEDULED: <2014-04-04 Fri>
6509 :PROPERTIES:
6510 isearch-current-symbol
6511 :ID: 235b96a8-e724-419d-8d07-8d0a021213eb
6512 :CUSTOM_ID: 6c63790c-28c1-4b73-96e2-ee859f57e734
6513 :DRILL_LAST_INTERVAL: 40.0706
6514 :DRILL_REPEATS_SINCE_FAIL: 4
6515 :DRILL_TOTAL_REPEATS: 4
6516 :DRILL_FAILURE_COUNT: 0
6517 :DRILL_AVERAGE_QUALITY: 3.75
6518 :DRILL_EASE: 2.929
6519 :DRILL_LAST_QUALITY: 3
6520 :DRILL_LAST_REVIEWED: <2014-02-23 Sun 02:26>
6521 :END:
6522 isearch-current-symbol
6523 [
6524 #+begin_src emacs-lisp
6525 (global-set-key (kbd "C-M-b") 'isearch-current-symbol)
6526 #+end_src
6527 ]
6528 *** C-S-b
6529 :PROPERTIES:
6530 :CUSTOM_ID: a220d7e0-12df-4d37-a57a-266785e7f3c5
6531 :END:
6532 *** [C-tab] :drill:
6533 SCHEDULED: <2014-03-27 Thu>
6534 :PROPERTIES:
6535 yas-insert-snippet
6536 :CUSTOM_ID: edc45592-c69f-4439-8305-48f2c65696c3
6537 :ID: 92eac3e1-0675-4746-a130-7539f9bc213a
6538 :DRILL_LAST_INTERVAL: 50.6823
6539 :DRILL_REPEATS_SINCE_FAIL: 3
6540 :DRILL_TOTAL_REPEATS: 3
6541 :DRILL_FAILURE_COUNT: 0
6542 :DRILL_AVERAGE_QUALITY: 5.0
6543 :DRILL_EASE: 5.815
6544 :DRILL_LAST_QUALITY: 5
6545 :DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:42>
6546 :END:
6547 ---
6548 [
6549 in terminal, it's just TAB, duplicate keybind.
6550 ]
6551 *** [M-tab] :drill:
6552 SCHEDULED: <2014-03-14 Fri>
6553 :PROPERTIES:
6554 indent line
6555 :ID: 35b77d8a-9e69-4f8e-a2ac-c78fcf6dc1f5
6556 :CUSTOM_ID: 71264957-45fd-455a-a6d1-b08823c02d25
6557 :DRILL_LAST_INTERVAL: 23.0811
6558 :DRILL_REPEATS_SINCE_FAIL: 4
6559 :DRILL_TOTAL_REPEATS: 4
6560 :DRILL_FAILURE_COUNT: 1
6561 :DRILL_AVERAGE_QUALITY: 3.75
6562 :DRILL_EASE: 2.929
6563 :DRILL_LAST_QUALITY: 4
6564 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 16:35>
6565 :END:
6566 ---
6567 [
6568 in terminal it's duplicated of C-M-i
6569 ]
6570 *** C-M-tab
6571 :PROPERTIES:
6572 :CUSTOM_ID: 33b76824-317c-4657-8a5b-2b126b8f7fc9
6573 :END:
6574 *** C-S-tab
6575 :PROPERTIES:
6576 :CUSTOM_ID: 89d1aeca-47ed-4e4a-89d2-ff70c06e08c8
6577 :END:
6578 *** [C-delete] :drill:
6579 SCHEDULED: <2014-05-13 Tue>
6580 :PROPERTIES:
6581 kill-symbol
6582 :ID: bb7ae41f-8fab-42ee-9338-33dd22d7f173
6583 :CUSTOM_ID: 2688b61d-9fdd-44af-b9bd-b126f0da00bd
6584 :DRILL_LAST_INTERVAL: 71.5839
6585 :DRILL_REPEATS_SINCE_FAIL: 4
6586 :DRILL_TOTAL_REPEATS: 4
6587 :DRILL_FAILURE_COUNT: 0
6588 :DRILL_AVERAGE_QUALITY: 4.75
6589 :DRILL_EASE: 4.85
6590 :DRILL_LAST_QUALITY: 5
6591 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:12>
6592 :END:
6593 kill-symbol
6594 [
6595 #+begin_src emacs-lisp
6596 (global-set-key (kbd "<C-delete>") 'kill-symbol)
6597 (defun kill-symbol (arg)
6598 (interactive "p")
6599 (kill-region (point) (save-excursion (forward-symbol arg) (point))))
6600
6601 #+end_src
6602 ]
6603 *** M-delete
6604 :PROPERTIES:
6605 :CUSTOM_ID: 60747222-b0e5-4983-9bed-e6d44f65483a
6606 :END:
6607 *** [C-M-delete] :drill:
6608 SCHEDULED: <2014-03-24 Mon>
6609 :PROPERTIES:
6610 kill-sexp
6611 kill-sexp
6612 :CUSTOM_ID: 21876759-a8e6-4896-8a08-eda40d0eaff3
6613 :ID: 7f2797e1-dd39-4d0a-8b87-264e2757543b
6614 :DRILL_LAST_INTERVAL: 28.5089
6615 :DRILL_REPEATS_SINCE_FAIL: 5
6616 :DRILL_TOTAL_REPEATS: 5
6617 :DRILL_FAILURE_COUNT: 2
6618 :DRILL_AVERAGE_QUALITY: 3.6
6619 :DRILL_EASE: 2.802
6620 :DRILL_LAST_QUALITY: 4
6621 :DRILL_LAST_REVIEWED: <2014-02-23 Sun 02:27>
6622 :END:
6623 kill-sexp
6624 [
6625 #+begin_src emacs-lisp
6626 (global-set-key (kbd "<C-M-delete>") 'kill-sexp)
6627 #+end_src
6628 ]
6629 *** C-S-delete
6630 :PROPERTIES:
6631 :CUSTOM_ID: 696e9e0f-f717-44cd-90e7-a73d76a58162
6632 :END:
6633
6634 *** [C-left-arrow] :drill:
6635 SCHEDULED: <2014-03-15 Sat>
6636 :PROPERTIES:
6637 compile
6638 :ID: fbc09f29-fb89-479f-b509-255352e4e9d1
6639 :CUSTOM_ID: b15da91f-0786-49d1-b0b9-331b3b94f6ae
6640 :DRILL_LAST_INTERVAL: 24.2738
6641 :DRILL_REPEATS_SINCE_FAIL: 4
6642 :DRILL_TOTAL_REPEATS: 4
6643 :DRILL_FAILURE_COUNT: 1
6644 :DRILL_AVERAGE_QUALITY: 4.0
6645 :DRILL_EASE: 3.204
6646 :DRILL_LAST_QUALITY: 5
6647 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:24>
6648 :END:
6649 compile / comint search
6650 [
6651 #+begin_src emacs-lisp
6652 (defun set-p (var)
6653 (and (bound-and-true-p var)
6654 (not (eq var 'unset))))
6655 (global-set-key (kbd "C-(") 'run)
6656
6657 ;; make compile work from the gtags root dir
6658 (defadvice compile (before pre-compile-advice activate)
6659 (basic-save-buffer)
6660 (when (set-p ggtags-project-root)
6661 (setq-local compile-saved-dir default-directory)
6662 (setq default-directory ggtags-project-root)))
6663 (defadvice compile (after post-compile-advice activate)
6664 (when (bound-and-true-p compile-saved-dir)
6665 (setq default-directory compile-saved-dir)))
6666
6667
6668 (add-hook 'c-mode-hook (lambda () (define-key c-mode-map (kbd "C-(") 'compile)))
6669 (add-hook 'comint-mode-hook
6670 (lambda ()
6671 (define-key isearch-mode-map (kbd "C-(") 'isearch-repeat-backward)
6672 (define-key comint-mode-map (kbd "C-(") 'isearch-backward)))
6673
6674 #+end_src
6675 ]
6676 *** M-left-arrow
6677 :PROPERTIES:
6678 :CUSTOM_ID: 73085b60-95f3-44bf-af71-70d6a7f9b9c6
6679 :END:
6680 *** [C-M-left-arrow] :drill:
6681 SCHEDULED: <2014-03-10 Mon>
6682 :PROPERTIES:
6683 org-shiftup
6684 :CUSTOM_ID: 13faf5d4-34be-4363-948d-4ff04a9f570b
6685 :ID: 39390478-6d33-460e-ab47-0dc6ac4c5249
6686 :DRILL_LAST_INTERVAL: 7.6079
6687 :DRILL_REPEATS_SINCE_FAIL: 3
6688 :DRILL_TOTAL_REPEATS: 7
6689 :DRILL_FAILURE_COUNT: 6
6690 :DRILL_AVERAGE_QUALITY: 2.886
6691 :DRILL_EASE: 2.402
6692 :DRILL_LAST_QUALITY: 3
6693 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:01>
6694 :END:
6695 org-shiftup
6696 [
6697 #+begin_src emacs-lisp
6698 (add-hook 'org-mode-hook
6699 (lambda () (define-key org-mode-map (kbd "C-M-(") 'org-shiftup)))
6700 #+end_src
6701 ]
6702 *** C-S-left-arrow
6703 :PROPERTIES:
6704 :CUSTOM_ID: 4e3a7ead-efb5-46d8-9465-1867d47e5ec2
6705 :END:
6706 *** [C-right-arrow] :drill:
6707 SCHEDULED: <2014-05-13 Tue>
6708 :PROPERTIES:
6709 paste selection
6710 :CUSTOM_ID: 3f3cac16-097d-451a-a14a-da7717d06730
6711 :ID: 1b0ac338-d87b-4a37-b192-bc4305a337cc
6712 :DRILL_LAST_INTERVAL: 71.5839
6713 :DRILL_REPEATS_SINCE_FAIL: 4
6714 :DRILL_TOTAL_REPEATS: 4
6715 :DRILL_FAILURE_COUNT: 0
6716 :DRILL_AVERAGE_QUALITY: 4.75
6717 :DRILL_EASE: 4.85
6718 :DRILL_LAST_QUALITY: 5
6719 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:11>
6720 :END:
6721 keyboard-yank-primary
6722 [
6723 #+begin_src emacs-lisp
6724 (defun keyboard-yank-primary ()
6725 (interactive)
6726 (let ((mouse-yank-at-point t))
6727 (mouse-yank-primary nil)))
6728 ;; paste selection
6729 (global-set-key (kbd "C-)") 'keyboard-yank-primary)
6730 #+end_src
6731 ]
6732 *** M-right-arrow
6733 :PROPERTIES:
6734 :CUSTOM_ID: 97a4513f-6837-47c5-9e2b-354542d67d29
6735 :END:
6736 *** C-M-right-arrow
6737 :PROPERTIES:
6738 org-shiftdown
6739 :CUSTOM_ID: 34e66314-1d97-4eeb-b704-fe0733849ae4
6740 :END:
6741 [
6742 #+begin_src emacs-lisp
6743 (add-hook 'org-mode-hook
6744 (lambda () (define-key org-mode-map (kbd "C-M-)") 'org-shiftdown)))
6745 #+end_src
6746 ]
6747 *** C-S-right-arrow
6748 :PROPERTIES:
6749 :CUSTOM_ID: f441e351-ccd7-4ac1-9a4d-a0a1dd17b73e
6750 :END:
6751 *** [C-backspace] :drill:
6752 SCHEDULED: <2014-05-13 Tue>
6753 :PROPERTIES:
6754 backward-kill-symbol
6755 :CUSTOM_ID: 85bb4701-42e6-4617-8de8-dfb1f03b0358
6756 :ID: 9c0e1f0a-7b45-4670-86a2-9df945142cbe
6757 :DRILL_LAST_INTERVAL: 71.5839
6758 :DRILL_REPEATS_SINCE_FAIL: 4
6759 :DRILL_TOTAL_REPEATS: 4
6760 :DRILL_FAILURE_COUNT: 0
6761 :DRILL_AVERAGE_QUALITY: 4.75
6762 :DRILL_EASE: 4.85
6763 :DRILL_LAST_QUALITY: 5
6764 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:12>
6765 :END:
6766 backward-kill-symbol
6767 [
6768 #+begin_src emacs-lisp
6769 (global-set-key (kbd "<C-backspace>") 'backward-kill-symbol)
6770 (add-hook 'comint-mode-hook
6771 (lambda ()
6772 (define-key comint-mode-map (kbd "<C-backspace>") 'backward-kill-word)))
6773 (defun backward-kill-symbol (arg)
6774 (interactive "p")
6775 (kill-region (point) (save-excursion (backward-symbol arg) (point))))
6776 #+end_src
6777 ]
6778 *** M-backspace
6779 :PROPERTIES:
6780 :CUSTOM_ID: d4b3e996-208a-4b6d-a747-076e56bd7da3
6781 :END:
6782 *** [C-M-backspace] :drill:
6783 SCHEDULED: <2014-03-18 Tue>
6784 :PROPERTIES:
6785 :ID: 1030c81d-2cc2-42ba-8aa5-fe98271a00f2
6786 :DRILL_LAST_INTERVAL: 26.5334
6787 :DRILL_REPEATS_SINCE_FAIL: 4
6788 :DRILL_TOTAL_REPEATS: 4
6789 :DRILL_FAILURE_COUNT: 0
6790 :DRILL_AVERAGE_QUALITY: 3.75
6791 :DRILL_EASE: 2.929
6792 :DRILL_LAST_QUALITY: 3
6793 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:46>
6794 :CUSTOM_ID: 606b0991-7431-4a8a-a909-b872e104cc88
6795 :END:
6796 backward-kill-sexp
6797 [
6798 #+begin_src emacs-lisp
6799 (global-set-key (kbd "<C-M-backspace>") 'backward-kill-sexp)
6800 #+end_src
6801 ]
6802 *** C-S-backspace
6803 :PROPERTIES:
6804 :CUSTOM_ID: 9c826109-76fd-403e-b15e-ceee5f925f6c
6805 :END:
6806 *** C-f7
6807 :PROPERTIES:
6808 :CUSTOM_ID: 8e4b9a2c-35ff-4300-91ff-65d19d6b2fde
6809 :END:
6810 *** M-f7
6811 :PROPERTIES:
6812 :CUSTOM_ID: 390a5b78-f5fe-41b6-bb36-ea9c81806989
6813 :END:
6814 *** C-M-f7
6815 :PROPERTIES:
6816 :CUSTOM_ID: a8e9d8e4-4f29-4da6-a7b8-3d136a3e1c18
6817 :END:
6818 *** C-S-f7
6819 :PROPERTIES:
6820 :CUSTOM_ID: 60bb5cd8-aeb3-4014-81f2-4cee72e9547c
6821 :END:
6822
6823 ** right primary
6824 *** [C-*] :drill:
6825 SCHEDULED: <2014-03-16 Sun>
6826 :PROPERTIES:
6827 split-window-horizontally
6828 :ID: c9f11b06-583f-48e5-8d0a-56107feb0010
6829 :CUSTOM_ID: f745b337-8b65-44cc-849a-5e0953c9ebd9
6830 :DRILL_LAST_INTERVAL: 13.9711
6831 :DRILL_REPEATS_SINCE_FAIL: 4
6832 :DRILL_TOTAL_REPEATS: 6
6833 :DRILL_FAILURE_COUNT: 3
6834 :DRILL_AVERAGE_QUALITY: 2.982
6835 :DRILL_EASE: 2.447
6836 :DRILL_LAST_QUALITY: 4
6837 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:04>
6838 :END:
6839 split-window-horizontally
6840 [
6841 #+begin_src emacs-lisp
6842 (global-set-key (kbd "C-*") 'split-window-horizontally)
6843 #+end_src
6844 ]
6845 *** M-*
6846 *** [C-M-*] :drill:
6847 SCHEDULED: <2014-03-17 Mon>
6848 :PROPERTIES:
6849 calc-dispatch
6850 :CUSTOM_ID: 5dbe3437-7364-4802-b558-00b2d5faacf6
6851 :ID: 2cffe3fb-a21a-4a49-83f8-65218c7a45a2
6852 :DRILL_LAST_INTERVAL: 15.2345
6853 :DRILL_REPEATS_SINCE_FAIL: 4
6854 :DRILL_TOTAL_REPEATS: 7
6855 :DRILL_FAILURE_COUNT: 2
6856 :DRILL_AVERAGE_QUALITY: 2.893
6857 :DRILL_EASE: 2.405
6858 :DRILL_LAST_QUALITY: 3
6859 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:09>
6860 :END:
6861 calc-dispatch
6862 [
6863 #+begin_src emacs-lisp
6864 (global-set-key (kbd "C-M-*") 'calc-dispatch)
6865 #+end_src
6866 ]
6867 *** C-S-*
6868 :PROPERTIES:
6869 :CUSTOM_ID: 8c414142-8a42-46df-9ab2-898f1be636c8
6870 :END:
6871 *** [C-9] :drill:
6872 SCHEDULED: <2014-03-27 Thu>
6873 :PROPERTIES:
6874 :ID: eda4444e-f1c4-4db7-918d-96789f6a0b2b
6875 :CUSTOM_ID: 43d14154-2722-4ba5-b547-1b78c6274ebf
6876 :DRILL_LAST_INTERVAL: 50.6823
6877 :DRILL_REPEATS_SINCE_FAIL: 3
6878 :DRILL_TOTAL_REPEATS: 3
6879 :DRILL_FAILURE_COUNT: 0
6880 :DRILL_AVERAGE_QUALITY: 5.0
6881 :DRILL_EASE: 5.815
6882 :DRILL_LAST_QUALITY: 5
6883 :DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:40>
6884 :END:
6885 delete-window-or-exit
6886 [
6887 #+begin_src emacs-lisp
6888 (global-set-key (kbd "C-9") 'delete-window-or-exit)
6889
6890 (defun delete-window-or-exit ()
6891 "Delete window or exit emacs."
6892 (interactive)
6893 (if (condition-case nil (delete-window) (error t))
6894 (if (or (boundp 'server-process) (> (length (frame-list)) 1))
6895 (delete-frame)
6896 (save-buffers-kill-terminal t))))
6897
6898 #+end_src
6899 ]
6900 *** [M-9] :drill:
6901 SCHEDULED: <2014-03-12 Wed>
6902 :PROPERTIES:
6903 kill-buffer-and-window
6904 :CUSTOM_ID: 9dc95338-4321-4354-9de2-69409f383a10
6905 :ID: 24b7dd06-c5cc-4264-954f-d8190d44c1bf
6906 :DRILL_LAST_INTERVAL: 20.7344
6907 :DRILL_REPEATS_SINCE_FAIL: 4
6908 :DRILL_TOTAL_REPEATS: 4
6909 :DRILL_FAILURE_COUNT: 0
6910 :DRILL_AVERAGE_QUALITY: 3.75
6911 :DRILL_EASE: 2.928
6912 :DRILL_LAST_QUALITY: 5
6913 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 16:33>
6914 :END:
6915 kill-buffer
6916 [
6917 #+begin_src emacs-lisp
6918 (defun kill-buffer-no-ido ()
6919 "kill-buffer, avoid the ido remapping"
6920 (interactive)
6921 (kill-buffer))
6922 (global-set-key (kbd "M-9") 'kill-buffer-no-ido)
6923 #+end_src
6924 ]
6925 strangely, in simple mode, this is overridden.
6926 I found this map to override, but it didn't work, so it seems its being bound some other way.
6927 I did a grep of the emacs sources, but couldn't find anything.
6928 (define-key universal-argument-map [?9] nil)
6929
6930 *** [C-M-9] :drill:
6931 SCHEDULED: <2014-03-17 Mon>
6932 :PROPERTIES:
6933 kill client buffer
6934 :ID: 2046ac28-1c06-410b-bdd9-39eaeada50c0
6935 :CUSTOM_ID: ffe9f636-31e5-48ba-b8fe-7c158ace744c
6936 :DRILL_LAST_INTERVAL: 25.6978
6937 :DRILL_REPEATS_SINCE_FAIL: 4
6938 :DRILL_TOTAL_REPEATS: 4
6939 :DRILL_FAILURE_COUNT: 0
6940 :DRILL_AVERAGE_QUALITY: 4.0
6941 :DRILL_EASE: 3.204
6942 :DRILL_LAST_QUALITY: 5
6943 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:41>
6944 :END:
6945 end server edit
6946 ,save & kill buffer it was opened externally via emacsclient
6947
6948 [
6949 #+begin_src emacs-lisp
6950 (defun server-edit-save ()
6951 (interactive)
6952 (save-buffer)
6953 (server-edit))
6954 (global-set-key (kbd "C-M-9") 'server-edit-save)
6955 #+end_src
6956 ]
6957 *** C-S-9
6958 :PROPERTIES:
6959 :CUSTOM_ID: 56d86cb3-cb86-42d8-9516-d7f2e086d88a
6960 :END:
6961 *** [C-u] :drill:
6962 SCHEDULED: <2014-03-27 Thu>
6963 :PROPERTIES:
6964 :ID: a254c137-8a33-440d-b71e-5fbf9a21e2f5
6965 :CUSTOM_ID: 327992c0-6eba-4935-aec1-49871c2a8619
6966 :DRILL_LAST_INTERVAL: 50.6823
6967 :DRILL_REPEATS_SINCE_FAIL: 3
6968 :DRILL_TOTAL_REPEATS: 3
6969 :DRILL_FAILURE_COUNT: 0
6970 :DRILL_AVERAGE_QUALITY: 5.0
6971 :DRILL_EASE: 5.815
6972 :DRILL_LAST_QUALITY: 5
6973 :DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:45>
6974 :END:
6975 universal-argument
6976 *** M-u
6977 *** [C-M-u] :drill:
6978 SCHEDULED: <2014-03-27 Thu>
6979 :PROPERTIES:
6980 search-keybind
6981 :ID: a2e31aed-143f-4aa2-841b-857729417993
6982 :CUSTOM_ID: 62735d64-b89a-46b7-b32e-2453b651039d
6983 :DRILL_LAST_INTERVAL: 50.6823
6984 :DRILL_REPEATS_SINCE_FAIL: 3
6985 :DRILL_TOTAL_REPEATS: 3
6986 :DRILL_FAILURE_COUNT: 0
6987 :DRILL_AVERAGE_QUALITY: 5.0
6988 :DRILL_EASE: 5.815
6989 :DRILL_LAST_QUALITY: 5
6990 :DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:43>
6991 :END:
6992 search-keybind
6993 [
6994 #+begin_src emacs-lisp
6995 (global-set-key (kbd "C-M-u") 'search-keybind)
6996
6997 (defun search-keybind (regexp &optional nlines)
6998 (interactive (occur-read-primary-args))
6999 (save-excursion
7000 (describe-bindings)
7001 (set-buffer "*Help*")
7002 (occur regexp)
7003 (delete-windows-on "*Help*")
7004 ))
7005 #+end_src
7006 ]
7007 *** C-S-u
7008 :PROPERTIES:
7009 :CUSTOM_ID: 7f72dfa0-ba8e-4cd5-b25b-8ff6066464e6
7010 :END:
7011 *** C-i
7012 :PROPERTIES:
7013 :CUSTOM_ID: 3124e200-1d6e-4ad2-9a36-0d03e1e7dc38
7014 :END:
7015 -----
7016 *** M-i
7017 :PROPERTIES:
7018 :CUSTOM_ID: 95ab2045-88bf-4656-b8b1-6cebc87b89e0
7019 :END:
7020 *** [C-M-i] :drill:
7021 SCHEDULED: <2014-03-17 Mon>
7022 :PROPERTIES:
7023 query-replace-regexp
7024 :CUSTOM_ID: a3260b61-7c51-4d97-9a91-3ed702c5ae29
7025 :ID: 93f569b8-4bc8-49e1-a38e-ced3d3198ce8
7026 :DRILL_LAST_INTERVAL: 26.3579
7027 :DRILL_REPEATS_SINCE_FAIL: 4
7028 :DRILL_TOTAL_REPEATS: 4
7029 :DRILL_FAILURE_COUNT: 1
7030 :DRILL_AVERAGE_QUALITY: 4.0
7031 :DRILL_EASE: 3.204
7032 :DRILL_LAST_QUALITY: 4
7033 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:45>
7034 :END:
7035 query-replace-regexp
7036 [
7037 #+begin_src emacs-lisp
7038 (global-set-key (kbd "C-M-i") 'query-replace-regexp)
7039 (add-hook 'flyspell-mode-hook
7040 (lambda () (define-key flyspell-mode-map (kbd "C-M-i") nil)))
7041 (add-hook 'text-mode-hook
7042 (lambda () (define-key text-mode-map (kbd "C-M-i") nil)))
7043
7044 #+end_src
7045 ]
7046 *** C-S-i
7047 :PROPERTIES:
7048 :CUSTOM_ID: 076edcc2-040e-4371-9851-4e587766e1fe
7049 :END:
7050 *** [C-o] :drill:
7051 SCHEDULED: <2014-05-13 Tue>
7052 :PROPERTIES:
7053 occur
7054 :ID: a502687a-24b4-4b73-9abc-bc85b89ab235
7055 :CUSTOM_ID: 82215193-63b3-4d63-8f70-d11a328fe72d
7056 :DRILL_LAST_INTERVAL: 71.5839
7057 :DRILL_REPEATS_SINCE_FAIL: 4
7058 :DRILL_TOTAL_REPEATS: 4
7059 :DRILL_FAILURE_COUNT: 0
7060 :DRILL_AVERAGE_QUALITY: 4.75
7061 :DRILL_EASE: 4.85
7062 :DRILL_LAST_QUALITY: 5
7063 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:10>
7064 :END:
7065 occur
7066 [
7067 #+begin_src emacs-lisp
7068 (global-set-key (kbd "C-o") 'occur)
7069 #+end_src
7070 ]
7071 *** M-o
7072 :PROPERTIES:
7073 :CUSTOM_ID: 8c58b99d-b1e4-4270-8d4a-8ae72e2a6470
7074 :END:
7075 *** [C-M-o] :drill:
7076 SCHEDULED: <2014-03-12 Wed>
7077 :PROPERTIES:
7078 counsel-imenu
7079 :CUSTOM_ID: 05d1ef50-43ee-46d7-b1ad-dd952543ab45
7080 :ID: 6dfcaa31-d223-4a14-904e-2f2395b2cf75
7081 :DRILL_LAST_INTERVAL: 10.3122
7082 :DRILL_REPEATS_SINCE_FAIL: 4
7083 :DRILL_TOTAL_REPEATS: 9
7084 :DRILL_FAILURE_COUNT: 9
7085 :DRILL_AVERAGE_QUALITY: 2.994
7086 :DRILL_EASE: 2.453
7087 :DRILL_LAST_QUALITY: 4
7088 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:09>
7089 :END:
7090 counsel-imenu
7091 [
7092 #+begin_src emacs-lisp
7093 (global-set-key (kbd "C-M-o") 'counsel-imenu)
7094 #+end_src
7095 ]
7096 *** C-S-o
7097 :PROPERTIES:
7098 :CUSTOM_ID: 7eacf048-4da8-4b2b-8a51-a4772111e285
7099 :END:
7100 *** [C-p] :drill:
7101 SCHEDULED: <2014-03-15 Sat>
7102 :PROPERTIES:
7103 move-mouse-to-point
7104 :ID: 6b1abcf6-7f95-45c4-a87f-0e86c43c5af1
7105 :CUSTOM_ID: 9c2e2ba9-f34e-48fe-b4ff-b9826882c1cc
7106 :DRILL_LAST_INTERVAL: 23.5247
7107 :DRILL_REPEATS_SINCE_FAIL: 4
7108 :DRILL_TOTAL_REPEATS: 4
7109 :DRILL_FAILURE_COUNT: 0
7110 :DRILL_AVERAGE_QUALITY: 3.5
7111 :DRILL_EASE: 2.73
7112 :DRILL_LAST_QUALITY: 3
7113 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:41>
7114 :END:
7115 move-mouse-to-point
7116 [
7117 #+begin_src emacs-lisp
7118 (global-set-key (kbd "C-p") 'move-mouse-to-point)
7119 #+end_src
7120 ]
7121 *** M-p
7122 *** [C-M-p] :drill:leech:
7123 :PROPERTIES:
7124 delete-horizontal-space
7125 :ID: e2972d5b-28e7-46aa-896f-66d68a6df0de
7126 :CUSTOM_ID: d55616d3-a3f6-4e83-8807-748578a7b726
7127 :DRILL_LAST_INTERVAL: 0.0
7128 :DRILL_REPEATS_SINCE_FAIL: 0
7129 :DRILL_TOTAL_REPEATS: 10
7130 :DRILL_FAILURE_COUNT: 16
7131 :DRILL_AVERAGE_QUALITY: 2.433
7132 :DRILL_EASE: 2.18
7133 :DRILL_LAST_QUALITY: 2
7134 :DRILL_LAST_REVIEWED: <2014-04-14 Mon 11:31>
7135 :END:
7136 delete-horizontal-space
7137 [
7138 #+begin_src emacs-lisp
7139 (global-set-key (kbd "C-M-p") 'delete-horizontal-space)
7140 #+end_src
7141 ]
7142 *** C-S-p
7143 :PROPERTIES:
7144 :CUSTOM_ID: f0cffe8d-d2cb-4f5d-a3f2-fa900e093ef7
7145 :END:
7146 *** [C-j] :drill:
7147 SCHEDULED: <2014-03-15 Sat>
7148 pop-to-mark
7149 [
7150 #+begin_src emacs-lisp
7151 (defun my-pop-to-mark-command ()
7152 "Jump to mark, and pop a new position for mark off the ring.
7153 \(Does not affect global mark ring\)."
7154 (interactive)
7155 (pop-to-mark-command)
7156 (if (and (derived-mode-p 'org-mode) (outline-invisible-p))
7157 (org-show-context 'mark-goto)))
7158
7159 (global-set-key (kbd "C-j") 'my-pop-to-mark-command)
7160 (define-key ido-common-completion-map (kbd "C-j") 'ido-select-text)
7161 (add-hook 'ido-setup-hook
7162 (lambda () (define-key ido-common-completion-map (kbd "C-j") 'ido-select-text)))
7163 (add-hook 'lisp-interaction-mode-hook
7164 (lambda ()
7165 (define-key lisp-interaction-mode-map (kbd "C-j") nil)))
7166
7167 #+end_src
7168 ]
7169 *** [M-j] :drill:
7170 SCHEDULED: <2014-03-13 Thu>
7171 :PROPERTIES:
7172 previous-error
7173 :ID: cb5f0e6f-815d-488f-bfb2-5d31bd5dc215
7174 :CUSTOM_ID: 474a3e12-95ac-4f43-b83a-36716f3e6f76
7175 :DRILL_LAST_INTERVAL: 21.5453
7176 :DRILL_REPEATS_SINCE_FAIL: 4
7177 :DRILL_TOTAL_REPEATS: 4
7178 :DRILL_FAILURE_COUNT: 0
7179 :DRILL_AVERAGE_QUALITY: 3.25
7180 :DRILL_EASE: 2.58
7181 :DRILL_LAST_QUALITY: 3
7182 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 16:39>
7183 :END:
7184 previous-error
7185 [
7186 #+begin_src emacs-lisp
7187 (global-set-key (kbd "M-j") 'previous-error)
7188 #+end_src
7189 ]
7190 *** [C-M-j]
7191
7192 register prefix
7193 [
7194 :PROPERTIES:
7195 :CUSTOM_ID: ebcf7c71-3c93-431b-af6b-7c5df7f2945e
7196 :ID: d2604f6e-341d-4d57-91c8-ec6f2cdeb901
7197 :DRILL_LAST_INTERVAL: 23.5247
7198 :DRILL_REPEATS_SINCE_FAIL: 4
7199 :DRILL_TOTAL_REPEATS: 4
7200 :DRILL_FAILURE_COUNT: 0
7201 :DRILL_AVERAGE_QUALITY: 3.5
7202 :DRILL_EASE: 2.73
7203 :DRILL_LAST_QUALITY: 3
7204 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:45>
7205 :END:
7206 #+begin_src emacs-lisp
7207 (define-key global-map (kbd "C-M-j") ctl-x-r-map)
7208 (define-key ctl-x-r-map "m" 'kmacro-to-register)
7209 #+end_src
7210 ]
7211
7212 *** C-S-j
7213 :PROPERTIES:
7214 :CUSTOM_ID: 381a6c7c-e763-4d9a-86f5-55a5e0afcee1
7215 :END:
7216 *** [C-k] :drill:
7217 SCHEDULED: <2014-05-13 Tue>
7218 :PROPERTIES:
7219 jump to register
7220 :CUSTOM_ID: 25a7ba1c-ddf3-47f1-9516-914a552e7a36
7221 :ID: 095be13e-f98c-4f42-9353-08329fa47d06
7222 :DRILL_LAST_INTERVAL: 71.5839
7223 :DRILL_REPEATS_SINCE_FAIL: 4
7224 :DRILL_TOTAL_REPEATS: 4
7225 :DRILL_FAILURE_COUNT: 0
7226 :DRILL_AVERAGE_QUALITY: 4.75
7227 :DRILL_EASE: 4.85
7228 :DRILL_LAST_QUALITY: 5
7229 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:10>
7230 :END:
7231 jump-to-register
7232 [
7233 #+begin_src emacs-lisp
7234
7235 (global-set-key (kbd "C-k") 'jump-to-register)
7236 #+end_src
7237 ]
7238 *** [M-k] :drill:
7239 SCHEDULED: <2014-03-15 Sat>
7240 :PROPERTIES:
7241 next-error
7242 :ID: c9f19dcc-4c14-4bdd-b350-c426dff14189
7243 :CUSTOM_ID: a96691bb-9e4c-414b-a093-d9961d453e21
7244 :DRILL_LAST_INTERVAL: 24.4352
7245 :DRILL_REPEATS_SINCE_FAIL: 4
7246 :DRILL_TOTAL_REPEATS: 4
7247 :DRILL_FAILURE_COUNT: 0
7248 :DRILL_AVERAGE_QUALITY: 3.75
7249 :DRILL_EASE: 2.929
7250 :DRILL_LAST_QUALITY: 4
7251 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:40>
7252 :END:
7253 next-error
7254 [
7255 #+begin_src emacs-lisp
7256 (global-set-key (kbd "M-k") 'next-error)
7257 #+end_src
7258 ]
7259 *** [C-M-k] :drill:
7260 SCHEDULED: <2014-03-21 Fri>
7261 :PROPERTIES:
7262 man
7263 :CUSTOM_ID: f61ea4ea-4597-422e-b7e3-d3cfad82603d
7264 :ID: 4c874a82-22dd-4bc2-a0ac-24420c30b888
7265 :DRILL_LAST_INTERVAL: 29.8228
7266 :DRILL_REPEATS_SINCE_FAIL: 4
7267 :DRILL_TOTAL_REPEATS: 4
7268 :DRILL_FAILURE_COUNT: 0
7269 :DRILL_AVERAGE_QUALITY: 4.25
7270 :DRILL_EASE: 3.589
7271 :DRILL_LAST_QUALITY: 5
7272 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:46>
7273 :END:
7274 man
7275 [
7276 #+begin_src emacs-lisp
7277 (global-set-key (kbd "C-M-k") 'man)
7278 #+end_src
7279 ]
7280 *** C-S-k
7281 :PROPERTIES:
7282 :CUSTOM_ID: da51b99a-1782-45ad-92be-f4c0a645bea8
7283 :END:
7284 *** [C-l] :drill:
7285 SCHEDULED: <2014-05-13 Tue>
7286 :PROPERTIES:
7287 ivy-switch-buffer
7288 :ID: 3c7fabd9-572d-4945-ab4b-d7a8dc2cd9c5
7289 :CUSTOM_ID: 8a7572bd-4b5e-4464-b937-3d35adb1783f
7290 :DRILL_LAST_INTERVAL: 71.5839
7291 :DRILL_REPEATS_SINCE_FAIL: 4
7292 :DRILL_TOTAL_REPEATS: 4
7293 :DRILL_FAILURE_COUNT: 0
7294 :DRILL_AVERAGE_QUALITY: 4.75
7295 :DRILL_EASE: 4.85
7296 :DRILL_LAST_QUALITY: 5
7297 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:10>
7298 :END:
7299 ivy-switch-buffer
7300 [
7301 #+begin_src emacs-lisp
7302 (global-set-key (kbd "C-l") 'ivy-switch-buffer)
7303 #+end_src
7304 ]
7305 *** M-l
7306 :PROPERTIES:
7307 :CUSTOM_ID: 27f47c6c-36ad-430e-b4b0-5e96b635bf36
7308 :END:
7309
7310 *** [C-M-l] :drill:
7311 SCHEDULED: <2014-04-04 Fri>
7312 :PROPERTIES:
7313 move cursor top bottom mid
7314 :ID: 37a3ccad-9b61-44b0-bddb-219a024cd963
7315 :CUSTOM_ID: 24b660d4-3ec4-4416-8a6a-b8224ed1ee8b
7316 :DRILL_LAST_INTERVAL: 25.8141
7317 :DRILL_REPEATS_SINCE_FAIL: 5
7318 :DRILL_TOTAL_REPEATS: 5
7319 :DRILL_FAILURE_COUNT: 1
7320 :DRILL_AVERAGE_QUALITY: 3.0
7321 :DRILL_EASE: 2.456
7322 :DRILL_LAST_QUALITY: 3
7323 :DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:36>
7324 :END:
7325 move cursor top bottom mid, comint clear screen
7326 [
7327 #+begin_src emacs-lisp
7328 (global-set-key (kbd "C-M-l") 'move-to-window-line-top-bottom)
7329 #+end_src
7330 ]
7331 *** C-S-l
7332 :PROPERTIES:
7333 :CUSTOM_ID: c355178f-c9b4-4ae7-9627-b4117fef45b9
7334 :END:
7335 *** [C-;] :drill:
7336 SCHEDULED: <2014-03-19 Wed>
7337 :PROPERTIES:
7338 comment-dwim
7339 :CUSTOM_ID: 7e3710eb-5460-4460-8bf0-488302e4ce35
7340 :ID: 1c1b7a4a-484b-4faf-ae20-65d096ff2574
7341 :DRILL_LAST_INTERVAL: 27.9041
7342 :DRILL_REPEATS_SINCE_FAIL: 4
7343 :DRILL_TOTAL_REPEATS: 4
7344 :DRILL_FAILURE_COUNT: 0
7345 :DRILL_AVERAGE_QUALITY: 4.0
7346 :DRILL_EASE: 3.204
7347 :DRILL_LAST_QUALITY: 4
7348 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:45>
7349 :END:
7350 used in flyspell, not sure what for, otherwise unbound
7351 *** M-;
7352 :PROPERTIES:
7353 :CUSTOM_ID: 211e76d9-d89a-4cc6-abce-69397d456fda
7354 :END:
7355 comment-dwim
7356 *** [C-M-;] :drill:
7357 SCHEDULED: <2014-04-07 Mon>
7358 :PROPERTIES:
7359 comment-current-line-dwim
7360 :ID: 9ff312cc-f460-4f5d-9e4b-37f7ed538209
7361 :CUSTOM_ID: 28680a96-5223-4632-80b9-b1facdd541e7
7362 :DRILL_LAST_INTERVAL: 42.8284
7363 :DRILL_REPEATS_SINCE_FAIL: 4
7364 :DRILL_TOTAL_REPEATS: 4
7365 :DRILL_FAILURE_COUNT: 0
7366 :DRILL_AVERAGE_QUALITY: 4.5
7367 :DRILL_EASE: 4.122
7368 :DRILL_LAST_QUALITY: 5
7369 :DRILL_LAST_REVIEWED: <2014-02-23 Sun 01:51>
7370 :END:
7371 comment-current-line-dwim
7372 [
7373 #+begin_src emacs-lisp
7374 (defun comment-current-line-dwim ()
7375 "Comment or uncomment the current line."
7376 (interactive)
7377 (save-excursion
7378 (push-mark (beginning-of-line) t t)
7379 (end-of-line)
7380 (comment-dwim nil))
7381 (move-beginning-of-line 2))
7382 (global-set-key (kbd "C-M-;") 'comment-current-line-dwim)
7383 #+end_src
7384 ]
7385 *** C-S-;
7386 :PROPERTIES:
7387 :CUSTOM_ID: c9f00d6c-f9d2-420f-a08e-21ea78023066
7388 :END:
7389 *** [C-m]
7390 :PROPERTIES:
7391 :CUSTOM_ID: deee53ba-dfa2-4910-894c-55ae98d11aa4
7392 :END:
7393 *** M-m
7394 :PROPERTIES:
7395 :CUSTOM_ID: f7237459-96b6-4de9-937f-5fbfa9ca5b1e
7396 :END:
7397 *** [C-M-m] :drill:
7398 SCHEDULED: <2014-03-11 Tue>
7399 :PROPERTIES:
7400 recursive grep
7401 :CUSTOM_ID: f283f705-cba0-45db-b80f-5d20415b2eee
7402 :ID: b952fa90-b492-4f85-9d8e-5cd24c060b94
7403 :DRILL_LAST_INTERVAL: 9.1491
7404 :DRILL_REPEATS_SINCE_FAIL: 3
7405 :DRILL_TOTAL_REPEATS: 7
7406 :DRILL_FAILURE_COUNT: 3
7407 :DRILL_AVERAGE_QUALITY: 2.924
7408 :DRILL_EASE: 2.42
7409 :DRILL_LAST_QUALITY: 3
7410 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:05>
7411 :END:
7412 recursive grep
7413 [
7414 #+begin_src emacs-lisp
7415 (define-key global-map (kbd "C-M-m") 'rgrep)
7416 #+end_src
7417 ]
7418 *** C-S-m
7419 :PROPERTIES:
7420 :CUSTOM_ID: dd3136a5-5383-4fc7-8c9f-fcbaba251a76
7421 :END:
7422 *** [C-,] :drill:
7423 SCHEDULED: <2014-05-13 Tue>
7424 :PROPERTIES:
7425 counsel-find-file
7426 :CUSTOM_ID: 6cbf3a85-f260-453a-920b-850ff5e986b1
7427 :ID: df0f3769-bcfc-4cb9-8943-bb86dafb2711
7428 :DRILL_LAST_INTERVAL: 71.5839
7429 :DRILL_REPEATS_SINCE_FAIL: 4
7430 :DRILL_TOTAL_REPEATS: 4
7431 :DRILL_FAILURE_COUNT: 0
7432 :DRILL_AVERAGE_QUALITY: 4.75
7433 :DRILL_EASE: 4.85
7434 :DRILL_LAST_QUALITY: 5
7435 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:10>
7436 :END:
7437 counsel-find-file
7438 [
7439 #+begin_src emacs-lisp
7440 (global-set-key (kbd "C-,") 'counsel-find-file)
7441 (add-hook 'flyspell-mode-hook
7442 (lambda () (define-key flyspell-mode-map (kbd "C-,") nil)))
7443 #+end_src
7444 ]
7445 *** M-,
7446 *** [C-M-,] :drill:
7447 SCHEDULED: <2014-03-19 Wed>
7448 :PROPERTIES:
7449 find-file-in-project
7450 :ID: fca85295-0567-4443-ac74-a54b93a2e603
7451 :CUSTOM_ID: bfdf6111-029d-462b-bcca-50a3ed2162d5
7452 :DRILL_LAST_INTERVAL: 24.3844
7453 :DRILL_REPEATS_SINCE_FAIL: 5
7454 :DRILL_TOTAL_REPEATS: 5
7455 :DRILL_FAILURE_COUNT: 2
7456 :DRILL_AVERAGE_QUALITY: 3.0
7457 :DRILL_EASE: 2.456
7458 :DRILL_LAST_QUALITY: 3
7459 :DRILL_LAST_REVIEWED: <2014-02-23 Sun 01:51>
7460 :END:
7461 find-file-in-project
7462 [
7463 #+begin_src emacs-lisp
7464 (global-set-key (kbd "C-M-,") 'find-file-in-project)
7465 #+end_src
7466 ]
7467 *** C-S-,
7468 :PROPERTIES:
7469 :CUSTOM_ID: 74a86b9e-9a56-4f5e-a6eb-9f2cd09da613
7470 :END:
7471 *** [C-.] :drill:
7472 SCHEDULED: <2014-03-27 Thu>
7473 :PROPERTIES:
7474 recentf-ido-find-file
7475 :CUSTOM_ID: 0675c171-8677-44a8-882c-e7ed42715e31
7476 :ID: a600d171-1964-4a81-a39e-cfac4716f96d
7477 :DRILL_LAST_INTERVAL: 50.6823
7478 :DRILL_REPEATS_SINCE_FAIL: 3
7479 :DRILL_TOTAL_REPEATS: 3
7480 :DRILL_FAILURE_COUNT: 0
7481 :DRILL_AVERAGE_QUALITY: 5.0
7482 :DRILL_EASE: 5.815
7483 :DRILL_LAST_QUALITY: 5
7484 :DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:41>
7485 :END:
7486 find recent file
7487 [
7488 Taken from starter kit.
7489 #+begin_src emacs-lisp
7490 (defun recentf-ido-find-file ()
7491 "Find a recent file using Ido."
7492 (interactive)
7493 (let* ((file-assoc-list
7494 (mapcar (lambda (x)
7495 (cons (file-name-nondirectory x)
7496 x))
7497 recentf-list))
7498 (filename-list
7499 (remove-duplicates (mapcar #'car file-assoc-list)
7500 :test #'string=))
7501 (filename (ido-completing-read "Choose recent file: "
7502 filename-list
7503 nil
7504 t)))
7505 (when filename
7506 (find-file (cdr (assoc filename
7507 file-assoc-list))))))
7508
7509 (add-hook 'flyspell-mode-hook
7510 (lambda () (define-key flyspell-mode-map (kbd "C-.") nil)))
7511 (define-key dot-mode-map (kbd "C-.") nil)
7512 (global-set-key (kbd "C-.") 'recentf-ido-find-file)
7513 (add-hook 'php-mode-hook
7514 (lambda () (define-key php-mode-map (kbd "C-.") nil)))
7515 #+end_src
7516 ]
7517 *** M-.
7518 *** C-M-.
7519 :PROPERTIES:
7520 :CUSTOM_ID: 824d422c-67b6-4d68-af11-6a2135e528f5
7521 :END:
7522 -
7523 [
7524 #+begin_src emacs-lisp
7525 (define-key dot-mode-map (kbd "C-M-.") nil)
7526 ;; (global-set-key (kbd "C-M-.") 'execute-extended-command)
7527 #+end_src
7528 ]
7529 *** C-S-.
7530 :PROPERTIES:
7531 :CUSTOM_ID: 346effe7-027b-4c4a-a236-3bc6ef541a0c
7532 :END:
7533 *** [C-/] :drill:
7534 :PROPERTIES:
7535 :CUSTOM_ID: 941a7fa8-84b9-434d-89a0-1487385ec479
7536 :ID: 1bf4af8d-58bb-4b58-af60-2ed87f32f4eb
7537 :END:
7538 join lines
7539 [
7540 #+begin_src emacs-lisp
7541 (defun vim-style-join-line ()
7542 (interactive)
7543 (join-line '(4)))
7544 (global-set-key (kbd "C-/") 'vim-style-join-line)
7545 (define-key undo-tree-map (kbd "C-/") nil)
7546 #+end_src
7547 ]
7548 *** M-/
7549 :PROPERTIES:
7550 :CUSTOM_ID: f65acefa-7e11-438e-a59c-42a9c7c71607
7551 :END:
7552 *** [C-M-/] :drill:
7553 :PROPERTIES:
7554 :CUSTOM_ID: 37f67593-4f60-4d3b-9aad-6c9bc4882443
7555 :ID: c41dd5ab-619f-40fe-9471-9ba59d0fef46
7556 :END:
7557 copy-variable
7558 [
7559 #+begin_src emacs-lisp
7560 (defun copy-variable (variable)
7561 (interactive
7562 (let ((v (variable-at-point))
7563 (enable-recursive-minibuffers t)
7564 val)
7565 (setq val (completing-read (if (symbolp v)
7566 (format
7567 "Describe variable (default %s): " v)
7568 "Describe variable: ")
7569 obarray
7570 (lambda (vv)
7571 (or (get vv 'variable-documentation)
7572 (and (boundp vv) (not (keywordp vv)))))
7573 t nil nil
7574 (if (symbolp v) (symbol-name v))))
7575 (list (if (equal val "")
7576 v (intern val)))))
7577 (kill-new (symbol-value variable)))
7578 (global-set-key (kbd "C-M-/") 'copy-variable)
7579
7580 #+end_src
7581 ]
7582 *** C-S-/
7583 :PROPERTIES:
7584 :CUSTOM_ID: ff612b05-8a3f-4599-a95b-f8af19b71b47
7585 :END:
7586 *** [C-8] :drill:
7587 SCHEDULED: <2014-03-13 Thu>
7588 :PROPERTIES:
7589 calc-embedded-word
7590 :CUSTOM_ID: 251c4a1a-a683-4804-a706-d0d3752e42fa
7591 :ID: 8084cd41-1833-4e16-ac01-60a5738d0bf3
7592 :DRILL_LAST_INTERVAL: 22.2211
7593 :DRILL_REPEATS_SINCE_FAIL: 4
7594 :DRILL_TOTAL_REPEATS: 4
7595 :DRILL_FAILURE_COUNT: 1
7596 :DRILL_AVERAGE_QUALITY: 3.5
7597 :DRILL_EASE: 2.73
7598 :DRILL_LAST_QUALITY: 3
7599 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 16:35>
7600 :END:
7601 calc-embedded-word
7602 [
7603 #+begin_src emacs-lisp
7604 (global-set-key (kbd "C-8") 'calc-embedded-word)
7605 #+end_src
7606 ]
7607 *** M-8
7608 :PROPERTIES:
7609 :CUSTOM_ID: 34f4f850-c3e4-4724-aabc-08eee19f034a
7610 :END:
7611 *** C-M-8
7612 :PROPERTIES:
7613 :CUSTOM_ID: 52191c76-756e-4dcc-87a5-2b84c550db5f
7614 :END:
7615 *** C-S-8
7616 :PROPERTIES:
7617 :CUSTOM_ID: 3f677c1a-7011-467e-ae4c-4b944807376b
7618 :END:
7619 *** [C-up-arrow] :drill:
7620 SCHEDULED: <2014-03-14 Fri>
7621 :PROPERTIES:
7622 back defun/headline
7623 :CUSTOM_ID: f47d312a-063d-42ed-a352-176298a2cb0c
7624 :ID: 93fe8dac-4206-4131-9264-3411e6467b01
7625 :DRILL_LAST_INTERVAL: 23.4066
7626 :DRILL_REPEATS_SINCE_FAIL: 5
7627 :DRILL_TOTAL_REPEATS: 5
7628 :DRILL_FAILURE_COUNT: 3
7629 :DRILL_AVERAGE_QUALITY: 3.2
7630 :DRILL_EASE: 2.554
7631 :DRILL_LAST_QUALITY: 4
7632 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 18:04>
7633 :END:
7634 org prev headline
7635 [
7636 #+begin_src emacs-lisp
7637 (define-key undo-tree-map "\C-_" nil)
7638 ;; disabled just because i don't want to accidentally hit it
7639 (define-key global-map "\C-_" nil)
7640 (global-set-key (kbd "<C-_>") 'beginning-of-defun)
7641
7642 (add-hook 'org-mode-hook
7643 (lambda ()
7644 (define-key org-mode-map (kbd "\C-_") 'outline-previous-visible-heading)))
7645
7646 #+end_src
7647
7648
7649 ]
7650 *** M-up-arrow
7651 :PROPERTIES:
7652 :CUSTOM_ID: 30f87801-2c2d-4722-9348-fb38ea6c09b0
7653 :END:
7654 *** C-M-up-arrow
7655 *** C-S-up-arrow :drill:
7656 winner undo
7657 [
7658 #+begin_src emacs-lisp
7659 (global-set-key (kbd "<C-S-_>") 'winner-undo)
7660 #+end_src
7661 ]
7662 *** [C-down-arrow] :drill:
7663 SCHEDULED: <2014-03-13 Thu>
7664 :PROPERTIES:
7665 forward dfun/headline
7666 :CUSTOM_ID: 27435136-b3d7-4f25-aa85-2a7363a7f366
7667 :ID: da405d83-b0af-4778-9703-a3f109a1233d
7668 :DRILL_LAST_INTERVAL: 10.7692
7669 :DRILL_REPEATS_SINCE_FAIL: 3
7670 :DRILL_TOTAL_REPEATS: 6
7671 :DRILL_FAILURE_COUNT: 1
7672 :DRILL_AVERAGE_QUALITY: 3.167
7673 :DRILL_EASE: 2.537
7674 :DRILL_LAST_QUALITY: 4
7675 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:09>
7676 :END:
7677 org next headline
7678 [
7679 #+begin_src emacs-lisp
7680 (global-set-key (kbd "<C-kp-enter>") 'end-of-defun)
7681
7682 (add-hook 'org-mode-hook
7683 (lambda ()
7684 (define-key org-mode-map (kbd "<C-kp-enter>") 'outline-next-visible-heading)))
7685
7686 #+end_src
7687
7688
7689 ]
7690 *** M-down-arrow
7691 *** [C-M-down-arrow] :drill:
7692 SCHEDULED: <2014-03-20 Thu>
7693 :PROPERTIES:
7694 toggle-mark-activation
7695 :ID: c57f3bab-8ea1-423d-b759-e1ec2586753c
7696 :CUSTOM_ID: 3bcb35fd-6d54-4213-b94f-2739c0bc0041
7697 :DRILL_LAST_INTERVAL: 17.6506
7698 :DRILL_REPEATS_SINCE_FAIL: 4
7699 :DRILL_TOTAL_REPEATS: 7
7700 :DRILL_FAILURE_COUNT: 4
7701 :DRILL_AVERAGE_QUALITY: 3.661
7702 :DRILL_EASE: 2.851
7703 :DRILL_LAST_QUALITY: 5
7704 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:10>
7705 :END:
7706 toggle-mark-activation
7707 [
7708 #+begin_src emacs-lisp
7709 (defun toggle-mark-activation ()
7710 (interactive)
7711 (if mark-active
7712 (deactivate-mark t)
7713 (activate-mark)))
7714
7715 (global-set-key (kbd "<C-M-kp-enter>") 'toggle-mark-activation)
7716 #+end_src
7717 ]
7718 winner redo
7719 [
7720 #+begin_src emacs-lisp
7721 (global-set-key (kbd "<C-S-kp-enter>") 'winner-redo)
7722 #+end_src
7723 ]
7724
7725 *** [C-S-down-arrow] :drill:
7726 SCHEDULED: <2014-03-19 Wed>
7727 :PROPERTIES:
7728 smex-major-mode-commands
7729 :CUSTOM_ID: 1434bdd0-c5a8-4c96-9b92-9474e88fd1c5
7730 :ID: 1e992e46-ec69-416c-b7d7-7c87da109b43
7731 :DRILL_LAST_INTERVAL: 24.3844
7732 :DRILL_REPEATS_SINCE_FAIL: 5
7733 :DRILL_TOTAL_REPEATS: 5
7734 :DRILL_FAILURE_COUNT: 2
7735 :DRILL_AVERAGE_QUALITY: 3.0
7736 :DRILL_EASE: 2.456
7737 :DRILL_LAST_QUALITY: 3
7738 :DRILL_LAST_REVIEWED: <2014-02-23 Sun 02:28>
7739 :END:
7740 m-x for major mode
7741 [
7742 #+begin_src emacs-lisp
7743 (global-set-key (kbd "<C-S-kp-enter>") 'smex-major-mode-commands)
7744 #+end_src
7745 ]
7746 *** C-lbracket
7747 :PROPERTIES:
7748 :CUSTOM_ID: 9d9916dd-3280-47dd-aab1-cd28d5ebfe15
7749 :END:
7750 ----
7751 *** M-lbracket
7752 *** [C-M-lbracket] :drill:
7753 SCHEDULED: <2014-03-15 Sat>
7754 :PROPERTIES:
7755 scroll-right
7756 :CUSTOM_ID: 7411b1a5-c8fa-4bcc-8788-798e5635dd62
7757 :ID: 0bf13532-1df9-4eb3-953c-10901f2a5da5
7758 :DRILL_LAST_INTERVAL: 23.5247
7759 :DRILL_REPEATS_SINCE_FAIL: 4
7760 :DRILL_TOTAL_REPEATS: 4
7761 :DRILL_FAILURE_COUNT: 0
7762 :DRILL_AVERAGE_QUALITY: 3.5
7763 :DRILL_EASE: 2.73
7764 :DRILL_LAST_QUALITY: 3
7765 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:25>
7766 :END:
7767 scroll-right
7768 [
7769 #+begin_src emacs-lisp
7770 (global-set-key (kbd "C-M-[") 'scroll-right)
7771 #+end_src
7772 ]
7773 *** C-S-lbracket
7774 *** [C-rbracket]
7775 :PROPERTIES:
7776 :CUSTOM_ID: 21b38c6b-3a46-4a08-8eca-d44abb148287
7777 :END:
7778 fill-paragraph
7779 #+begin_src emacs-lisp
7780 (global-set-key (kbd "C-]") 'fill-paragraph)
7781 #+end_src
7782 *** M-rbracket
7783 *** [C-M-rbracket] :drill:
7784 SCHEDULED: <2014-03-15 Sat>
7785 :PROPERTIES:
7786 scroll-left
7787 :CUSTOM_ID: c9c18f48-d0ca-4a1b-a751-7165f40118a3
7788 :ID: ff008422-b6f5-4770-9e53-e6acdac90b45
7789 :DRILL_LAST_INTERVAL: 24.4352
7790 :DRILL_REPEATS_SINCE_FAIL: 4
7791 :DRILL_TOTAL_REPEATS: 4
7792 :DRILL_FAILURE_COUNT: 0
7793 :DRILL_AVERAGE_QUALITY: 3.75
7794 :DRILL_EASE: 2.929
7795 :DRILL_LAST_QUALITY: 4
7796 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:44>
7797 :END:
7798 scroll-left
7799 [
7800 #+begin_src emacs-lisp
7801 (global-set-key (kbd "C-M-]") 'scroll-left)
7802 #+end_src
7803 ]
7804 *** C-S-rbracket
7805 :PROPERTIES:
7806 :CUSTOM_ID: d42245ca-3246-477b-bda9-8776cd668cd1
7807 :END:
7808 *** [C-return] :drill:
7809 SCHEDULED: <2014-03-12 Wed>
7810 :PROPERTIES:
7811 newline next line
7812 :ID: 20e450f0-6467-40f2-bd1b-b4038693e73f
7813 :CUSTOM_ID: baf7ea5a-d16d-4fee-a6ce-542cc11beb97
7814 :DRILL_LAST_INTERVAL: 20.7344
7815 :DRILL_REPEATS_SINCE_FAIL: 4
7816 :DRILL_TOTAL_REPEATS: 4
7817 :DRILL_FAILURE_COUNT: 0
7818 :DRILL_AVERAGE_QUALITY: 3.75
7819 :DRILL_EASE: 2.928
7820 :DRILL_LAST_QUALITY: 5
7821 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 16:29>
7822 :END:
7823 newline-anywhere
7824 [
7825 #+begin_src emacs-lisp
7826 (defun newline-anywhere ()
7827 "Add a newline from anywhere in the line."
7828 (interactive)
7829 (end-of-line)
7830 (newline-and-indent))
7831 (global-set-key (kbd "<C-return>") 'newline-anywhere)
7832
7833 #+end_src
7834 ]
7835 *** [M-return] :drill:
7836 SCHEDULED: <2014-03-11 Tue>
7837 :PROPERTIES:
7838 non-indented newline
7839 :ID: 4fc4d372-765e-4e2e-87f4-0a0e1fd93f34
7840 :CUSTOM_ID: e6895ad3-a2c8-46c8-abbc-1bba94a88596
7841 :DRILL_LAST_INTERVAL: 19.9622
7842 :DRILL_REPEATS_SINCE_FAIL: 4
7843 :DRILL_TOTAL_REPEATS: 4
7844 :DRILL_FAILURE_COUNT: 0
7845 :DRILL_AVERAGE_QUALITY: 3.5
7846 :DRILL_EASE: 2.73
7847 :DRILL_LAST_QUALITY: 4
7848 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 16:30>
7849 :END:
7850 plain newline
7851 [
7852 #+begin_src emacs-lisp
7853 (defun plain-newline ()
7854 (interactive)
7855 (insert "\n"))
7856 (global-set-key (kbd "<M-return>") 'plain-newline)
7857 #+end_src
7858 ]
7859
7860 *** C-M-return
7861 :PROPERTIES:
7862 open newline on previous line
7863 :CUSTOM_ID: 2a8fc6ea-a550-4437-9e35-3b3f2776788a
7864 :END:
7865 [
7866 #+begin_src emacs-lisp
7867 (defun newline-anywhere-previous ()
7868 "Add a newline from anywhere in the line."
7869 (interactive)
7870 (forward-line -1)
7871 (end-of-line)
7872 (newline-and-indent))
7873 (global-set-key (kbd "<C-M-return>") 'newline-anywhere-previous)
7874 #+end_src
7875 ]
7876 *** C-S-return
7877 :PROPERTIES:
7878 :CUSTOM_ID: 787cc59e-ce0f-4291-a9d5-fd4e14b0b83b
7879 :END:
7880 *** [C-space] :drill:
7881 SCHEDULED: <2014-03-18 Tue>
7882 :PROPERTIES:
7883 org-edit-special
7884 :CUSTOM_ID: 132daa1a-8e5f-47f1-a28d-35bee873aeac
7885 :ID: 3204f2ca-10b2-469b-8b70-fb660e35478a
7886 :DRILL_LAST_INTERVAL: 41.7787
7887 :DRILL_REPEATS_SINCE_FAIL: 3
7888 :DRILL_TOTAL_REPEATS: 3
7889 :DRILL_FAILURE_COUNT: 0
7890 :DRILL_AVERAGE_QUALITY: 4.667
7891 :DRILL_EASE: 4.583
7892 :DRILL_LAST_QUALITY: 4
7893 :DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:44>
7894 :END:
7895 org-edit-special
7896 [
7897 #+begin_src emacs-lisp
7898 ;; (kbd "<C-space>") does not work, (kbd "C-SPC") should work
7899 (add-hook 'org-mode-hook
7900 (lambda ()
7901 (define-key org-mode-map (kbd "C-SPC") 'org-edit-special)
7902 ;; org-src-mode-map is broken in git version of emacs.
7903 ;; temporarily use this for exiting edit-special mode.
7904 (global-set-key (kbd "C-M--") 'org-edit-src-exit)
7905 (define-key org-src-mode-map (kbd "C-SPC") 'org-edit-src-exit)))
7906 #+end_src
7907 ]
7908 *** M-space
7909 :PROPERTIES:
7910 :CUSTOM_ID: bbffb12e-03f2-4a26-a9e4-fd263ad6b518
7911 :END:
7912 *** C-M-space
7913 :PROPERTIES:
7914 spell check word
7915 :CUSTOM_ID: 02359b66-bf6e-4f41-9f03-e83fcbe3e68c
7916 :END:
7917 [
7918 before or under cursor
7919 #+begin_src emacs-lisp
7920 (global-set-key (kbd "C-M-SPC") 'ispell-word)
7921 #+end_src
7922 ]
7923 *** C-S-space
7924 :PROPERTIES:
7925 :CUSTOM_ID: a28e904f-f2bd-48d3-9718-af3f541e611e
7926 :END:
7927 ** left secondary
7928 *** C-=
7929 :PROPERTIES:
7930 :CUSTOM_ID: 6b01dcdd-d1c1-4e3f-9e28-9c3574682f95
7931 :END:
7932 *** M-=
7933 :PROPERTIES:
7934 :CUSTOM_ID: 6a63486f-ea5b-4ece-a535-5277022e0cde
7935 :END:
7936 *** C-M-=
7937 :PROPERTIES:
7938 :CUSTOM_ID: 1e245ef6-5bdb-4f99-b8e2-f5d45a7c0847
7939 :END:
7940 *** C-S-=
7941 :PROPERTIES:
7942 :CUSTOM_ID: 0f9aa2b8-83c7-433c-80e0-f90ee802365f
7943 :END:
7944 *** C-1
7945 :PROPERTIES:
7946 :CUSTOM_ID: 06374c1c-025b-47c2-90b2-82f37031093b
7947 :END:
7948 *** M-1
7949 :PROPERTIES:
7950 :CUSTOM_ID: 51810ebd-52f3-4e68-9434-e2347a834787
7951 :END:
7952 *** C-M-1
7953 :PROPERTIES:
7954 :CUSTOM_ID: 9207526f-a925-4ecc-bd30-98cbd580d67a
7955 :END:
7956 *** C-S-1
7957 :PROPERTIES:
7958 :CUSTOM_ID: 58a7a929-50b5-4393-9b08-59ad2039b263
7959 :END:
7960 *** C-4
7961 :PROPERTIES:
7962 :CUSTOM_ID: 24a0c3c4-bce7-4a94-8a31-e5259387c573
7963 :END:
7964 *** M-4
7965 :PROPERTIES:
7966 :CUSTOM_ID: 2d4fa927-2140-424b-9990-e8f2c3424e57
7967 :END:
7968 *** C-M-4 :drill:
7969 widen
7970 [
7971 :PROPERTIES:
7972 :CUSTOM_ID: 3ff50f5f-f286-4a73-962b-58dbcf3b09b1
7973 :ID: addc832b-5547-4d45-a1f5-3e9283920612
7974 :END:
7975 #+begin_src emacs-lisp
7976 (global-set-key (kbd "C-M-4") 'widen)
7977 #+end_src
7978 ]
7979 *** C-S-4
7980 :PROPERTIES:
7981 :CUSTOM_ID: ba9ed568-7ba1-4283-b4c7-57fcb9a5a477
7982 :END:
7983 *** C-5
7984 :PROPERTIES:
7985 :CUSTOM_ID: 83bc2d8a-a225-4b6f-ab98-f47aa6d1e73f
7986 :END:
7987 *** M-5
7988 :PROPERTIES:
7989 :CUSTOM_ID: 1b8f04c3-91b5-43cd-8a1a-94c8105eff24
7990 :END:
7991 *** C-M-5
7992 :PROPERTIES:
7993 :CUSTOM_ID: fab28de6-7fe4-45d7-a856-5d29a9085f5d
7994 :END:
7995 *** C-S-5
7996 :PROPERTIES:
7997 :CUSTOM_ID: b22cdf04-bc77-493b-a65c-5992befc1a62
7998 :END:
7999 *** [C-tab-key] :drill:
8000 SCHEDULED: <2014-03-12 Wed>
8001 :PROPERTIES:
8002 query-replace
8003 :CUSTOM_ID: 68313551-90cd-47a6-8170-1745348add17
8004 :ID: 5b315ca6-c623-4b23-bef3-31b325591d01
8005 :DRILL_LAST_INTERVAL: 20.9905
8006 :DRILL_REPEATS_SINCE_FAIL: 4
8007 :DRILL_TOTAL_REPEATS: 4
8008 :DRILL_FAILURE_COUNT: 2
8009 :DRILL_AVERAGE_QUALITY: 3.5
8010 :DRILL_EASE: 2.73
8011 :DRILL_LAST_QUALITY: 3
8012 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 16:32>
8013 :END:
8014 query-replace
8015 [
8016 #+begin_src emacs-lisp
8017
8018 (global-set-key (kbd "<C-kp-add>") 'query-replace)
8019 #+end_src
8020 ]
8021 *** M-tab-key
8022 *** C-M-tab-key
8023 *** C-S-tab-key
8024 *** [C-t] :drill:
8025 SCHEDULED: <2014-03-24 Mon>
8026 :PROPERTIES:
8027 org change todo state
8028 :ID: b9a6ec32-9b64-403f-be09-73769f778d1f
8029 :CUSTOM_ID: aaac3048-9125-4fd5-b8f2-21bafcc1ff1c
8030 :DRILL_LAST_INTERVAL: 32.7466
8031 :DRILL_REPEATS_SINCE_FAIL: 4
8032 :DRILL_TOTAL_REPEATS: 4
8033 :DRILL_FAILURE_COUNT: 0
8034 :DRILL_AVERAGE_QUALITY: 4.0
8035 :DRILL_EASE: 3.204
8036 :DRILL_LAST_QUALITY: 4
8037 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:53>
8038 :END:
8039 org cycle todo / toggle comint motion
8040 [
8041 #+begin_src emacs-lisp
8042 (add-hook 'org-mode-hook
8043 (lambda ()
8044 (define-key org-mode-map (kbd "C-t") 'org-todo)))
8045
8046 (defun my-comint-previous-input (arg)
8047 (interactive "*p")
8048 (if (comint-after-pmark-p)
8049 (comint-previous-input arg)
8050 (forward-line -1)))
8051
8052 (defun my-comint-next-input (arg)
8053 (interactive "*p")
8054 (if (comint-after-pmark-p)
8055 (comint-next-input arg)
8056 (forward-line)))
8057
8058 (add-hook 'comint-mode-hook
8059 (lambda ()
8060 (define-key comint-mode-map (kbd "C-t") 'comint-toggle-arrow-keys)
8061 (define-key comint-mode-map (kbd "<up>") 'my-comint-previous-input)
8062 (define-key comint-mode-map (kbd "<down>") 'my-comint-next-input)))
8063
8064
8065 (defun comint-toggle-arrow-keys ()
8066 (interactive)
8067 (toggle-arrow-keys comint-mode-map))
8068
8069 (setq-default comint-arrow-movement nil)
8070 (defun toggle-arrow-keys (map)
8071 (cond ((lookup-key map (kbd "<up>"))
8072 (setq-local comint-arrow-movement t)
8073 (define-key map (kbd "<up>") nil)
8074 (define-key map (kbd "<down>") nil))
8075 (t
8076 (setq-local comint-arrow-movement nil)
8077 (define-key map (kbd "<up>") 'my-comint-previous-input)
8078 (define-key map (kbd "<down>") 'my-comint-next-input)
8079 (goto-char (point-max)))))
8080
8081 (defun ian-sign-email ()
8082 (interactive)
8083 (insert "Ian Kelling
8084 https://iankelling.org"))
8085
8086 (eval-after-load "message"
8087 '(define-key message-mode-map (kbd "C-t") 'ian-sign-email))
8088 #+end_src
8089 Thanks for the update. I will be enjoying it.
8090
8091 #+RESULTS:
8092 : comint-toggle-arrow-keys
8093 ]
8094 *** M-t
8095 :PROPERTIES:
8096 :CUSTOM_ID: 4542dc3a-d876-4726-8c8e-61c7c9cecd64
8097 :END:
8098 *** [C-M-t] :drill:
8099 SCHEDULED: <2014-03-15 Sat>
8100 :PROPERTIES:
8101 org insert timestamp
8102 :ID: ed43d561-cf73-4123-8cf2-12e184f99e0f
8103 :CUSTOM_ID: 5bc609b1-9428-4b82-a55d-811fefe65331
8104 :DRILL_LAST_INTERVAL: 23.5247
8105 :DRILL_REPEATS_SINCE_FAIL: 4
8106 :DRILL_TOTAL_REPEATS: 4
8107 :DRILL_FAILURE_COUNT: 0
8108 :DRILL_AVERAGE_QUALITY: 3.5
8109 :DRILL_EASE: 2.73
8110 :DRILL_LAST_QUALITY: 3
8111 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:41>
8112 :END:
8113 org timestamp
8114 [
8115 #+begin_src emacs-lisp
8116 (global-set-key (kbd "C-M-t") 'org-time-stamp-with-time)
8117 #+end_src
8118 ]
8119 *** C-S-t
8120 :PROPERTIES:
8121 :CUSTOM_ID: 6a6fcd06-5822-4a3d-8e2e-1fc0f64357b2
8122 :END:
8123 *** C-home
8124 :PROPERTIES:
8125 :CUSTOM_ID: 1919659a-b466-4519-9276-8bf06a916066
8126 :END:
8127 start of buffer
8128 *** M-home
8129 :PROPERTIES:
8130 :CUSTOM_ID: 29a3b536-201d-4499-b131-afe58e6f45b4
8131 :END:
8132 *** C-M-home
8133 :PROPERTIES:
8134 :CUSTOM_ID: d9df9b43-357a-43e1-bb1c-47d61f095738
8135 :END:
8136 *** C-S-home
8137 :PROPERTIES:
8138 :CUSTOM_ID: a91ee772-a59c-4083-a65c-6f9b294b517c
8139 :END:
8140 *** C-end
8141 :PROPERTIES:
8142 :CUSTOM_ID: 0a7bd629-cbcc-4761-8fe2-cc9370b985a4
8143 :END:
8144 end of buffer
8145 *** M-end
8146 :PROPERTIES:
8147 :CUSTOM_ID: 1c215db5-a50c-4718-868a-871d69acf117
8148 :END:
8149 *** C-M-end
8150 :PROPERTIES:
8151 :CUSTOM_ID: cf2df317-a0b1-41e6-9919-67e77bb796f8
8152 :END:
8153 *** C-S-end
8154 :PROPERTIES:
8155 :CUSTOM_ID: a4721bb0-9cbc-4f3c-b292-645d5121c839
8156 :END:
8157 *** C-f9
8158 :PROPERTIES:
8159 :CUSTOM_ID: 014536d9-68e3-46f5-9594-e74fe64f4d9e
8160 :END:
8161 *** M-f9
8162 :PROPERTIES:
8163 :CUSTOM_ID: 6dee0f1b-3680-4a72-8a80-e31b9c7c219d
8164 :END:
8165 *** C-M-f9
8166 :PROPERTIES:
8167 :CUSTOM_ID: f5e835dd-e2b8-42eb-b7f1-9ec76c7dfcb8
8168 :END:
8169 *** C-S-f9
8170 :PROPERTIES:
8171 :CUSTOM_ID: c3aba493-9e85-40b7-989d-7e17ba2b55a7
8172 :END:
8173 ** right secondary
8174 *** C-6
8175 :PROPERTIES:
8176 :CUSTOM_ID: e44e584b-d925-4036-9ad5-a90d02e74bef
8177 :END:
8178 save-buffers-kill-emacs
8179 [
8180 #+begin_src emacs-lisp
8181 (global-set-key (kbd "C-6") 'save-buffers-kill-emacs)
8182 #+end_src
8183 ]
8184 *** M-6
8185 *** [C-M-6] :drill:
8186 :PROPERTIES:
8187 :CUSTOM_ID: da73de75-0914-4f48-81d5-9b408433b14b
8188 :ID: bcf78e2e-810e-4a6d-9056-bd488aaa373b
8189 :END:
8190 insert-small-copyright
8191 [
8192 #+begin_src emacs-lisp
8193 (defun insert-small-copyright ()
8194 (interactive)
8195 (beginning-of-line)
8196 (let ((beg (point)))
8197 (insert "Copyright (C) 2016 Ian Kelling\nThis program is under GPL v. 3 or later, see <http://www.gnu.org/licenses/>")
8198 (comment-region beg (point))))
8199
8200 (global-set-key (kbd "C-M-6") 'insert-small-copyright)
8201 #+end_src
8202 ]
8203 *** C-S-6
8204 *** C-7
8205 *** M-7
8206 *** [C-M-7] :drill:
8207 :PROPERTIES:
8208 :CUSTOM_ID: a68c6b8e-9911-475e-ab35-e239771fe881
8209 :ID: ae9704b8-1492-4dc0-806a-dd3407526733
8210 :END:
8211 insert-full-copyright
8212 [
8213 #+begin_src emacs-lisp
8214 (defun insert-full-copyright ()
8215 (interactive)
8216 (beginning-of-line)
8217 (let ((beg (point)))
8218 (insert "Copyright (C) 2016 Ian Kelling\n")
8219 (insert "\n")
8220 (insert "This program is free software: you can redistribute it and/or modify\n")
8221 (insert "it under the terms of the GNU General Public License as published by\n")
8222 (insert "the Free Software Foundation, either version 3 of the License, or\n")
8223 (insert "(at your option) any later version.\n")
8224 (insert "\n")
8225 (insert "This program is distributed in the hope that it will be useful,\n")
8226 (insert "but WITHOUT ANY WARRANTY; without even the implied warranty of\n")
8227 (insert "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n")
8228 (insert "GNU General Public License for more details.\n")
8229 (insert "\n")
8230 (insert "You should have received a copy of the GNU General Public License\n")
8231 (insert "along with this program. If not, see <http://www.gnu.org/licenses/>.\n")
8232 (comment-region beg (point))))
8233
8234 (global-set-key (kbd "C-M-7") 'insert-full-copyright)
8235
8236 #+end_src
8237 ]
8238 *** C-S-7
8239 :PROPERTIES:
8240 :CUSTOM_ID: 05f5737b-a320-403c-a8f1-fa0a02f679e1
8241 :END:
8242 *** C-0
8243 :PROPERTIES:
8244 :CUSTOM_ID: 96ae2fcc-3a0c-40c4-aef8-06aff3fd42be
8245 :END:
8246 text-scale-reset
8247 [
8248 #+begin_src emacs-lisp
8249 (defun text-scale-reset ()
8250 (interactive)
8251 (text-scale-set 0))
8252 (global-set-key (kbd "C-0") 'text-scale-reset)
8253 #+end_src
8254 ]
8255 *** M-0
8256 :PROPERTIES:
8257 :CUSTOM_ID: c5735fdf-d0d9-468c-917c-3936e409a2bc
8258 :END:
8259 *** C-M-0
8260 :PROPERTIES:
8261 :CUSTOM_ID: 0e7f83a5-600e-4016-af98-95904300c016
8262 :END:
8263 insert-apache
8264 [
8265 #+begin_src emacs-lisp
8266 (defun insert-apache ()
8267 (interactive)
8268 (beginning-of-line)
8269 (let ((beg (point)))
8270 (insert "Copyright (C) 2016 Ian Kelling\n")
8271 (insert "\n")
8272 (insert "Licensed under the Apache License, Version 2.0 (the \"License\");\n")
8273 (insert "you may not use this file except in compliance with the License.\n")
8274 (insert "You may obtain a copy of the License at\n")
8275 (insert "\n")
8276 (insert " http://www.apache.org/licenses/LICENSE-2.0\n")
8277 (insert "\n")
8278 (insert "Unless required by applicable law or agreed to in writing, software\n")
8279 (insert "distributed under the License is distributed on an \"AS IS\" BASIS,\n")
8280 (insert "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n")
8281 (insert "See the License for the specific language governing permissions and\n")
8282 (insert "limitations under the License.\n")
8283 (comment-region beg (point))))
8284 (global-set-key (kbd "C-M-0") 'insert-apache)
8285 #+end_src
8286 ]
8287
8288 *** C-S-0
8289 :PROPERTIES:
8290 :CUSTOM_ID: d1706bc7-7cf0-4b49-87d0-15bf76eaca5f
8291 :END:
8292 *** C--
8293 :PROPERTIES:
8294 :CUSTOM_ID: 3713b701-b31a-4612-b663-f232005b4122
8295 :END:
8296 *** M--
8297 :PROPERTIES:
8298 :CUSTOM_ID: ca833b78-b279-4d1f-b1c9-6c70fdf20f57
8299 :END:
8300 *** C-M--
8301 :PROPERTIES:
8302 :CUSTOM_ID: 6febc7ea-9cc7-488c-af34-538b8e69633b
8303 :END:
8304 org-edit-src-exit
8305 *** C-S--
8306 :PROPERTIES:
8307 :CUSTOM_ID: c73af1d7-61f2-4c1b-935e-43f077d8d915
8308 :END:
8309 *** [C-y] :drill:
8310 SCHEDULED: <2014-03-27 Thu>
8311 :PROPERTIES:
8312 :ID: 4c0f74f8-04ed-40d8-8ec3-6e2bed03c2b9
8313 :CUSTOM_ID: 97aee7f1-3647-4602-a65a-45e8a3aa3a7c
8314 :DRILL_LAST_INTERVAL: 50.6823
8315 :DRILL_REPEATS_SINCE_FAIL: 3
8316 :DRILL_TOTAL_REPEATS: 3
8317 :DRILL_FAILURE_COUNT: 0
8318 :DRILL_AVERAGE_QUALITY: 5.0
8319 :DRILL_EASE: 5.815
8320 :DRILL_LAST_QUALITY: 5
8321 :DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:45>
8322 :END:
8323 undo-tree-redo
8324 [
8325 #+begin_src emacs-lisp
8326 (global-set-key (kbd "C-y") 'undo-tree-redo)
8327 #+end_src
8328
8329 ]
8330 *** M-y
8331 :PROPERTIES:
8332 :CUSTOM_ID: 35072ca8-7fd6-4a64-bc7a-2636de575bd1
8333 :END:
8334 *** C-M-y
8335 *** C-S-y
8336 :PROPERTIES:
8337 :CUSTOM_ID: 964fa784-37e3-48c6-af4b-c7e91f67a93a
8338 :END:
8339 *** C-\
8340 :PROPERTIES:
8341 sr-speedbar-toggle
8342 :CUSTOM_ID: b8ad3ee9-7bf6-4069-a300-49cd298008a7
8343 :END:
8344 [
8345 #+begin_src emacs-lisp
8346 (global-set-key (kbd "C-\\") 'sr-speedbar-toggle)
8347 #+end_src
8348 ]
8349 *** M-\
8350 :PROPERTIES:
8351 :CUSTOM_ID: c1d53d84-b8a9-49cb-bfd6-4420931c8873
8352 :END:
8353 *** [C-M-\] :drill:
8354 SCHEDULED: <2014-03-21 Fri>
8355 :PROPERTIES:
8356 mark-defun
8357 :ID: d45bce17-45bc-41f0-8994-aa7bc3b2fa92
8358 :CUSTOM_ID: 6a583354-48f8-4503-bf87-b8ba56411435
8359 :DRILL_LAST_INTERVAL: 11.7003
8360 :DRILL_REPEATS_SINCE_FAIL: 4
8361 :DRILL_TOTAL_REPEATS: 9
8362 :DRILL_FAILURE_COUNT: 6
8363 :DRILL_AVERAGE_QUALITY: 2.815
8364 :DRILL_EASE: 2.369
8365 :DRILL_LAST_QUALITY: 3
8366 :DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:36>
8367 :END:
8368 mark-defun
8369 [
8370 #+begin_src emacs-lisp
8371 (global-set-key (kbd "C-M-\\") 'mark-defun)
8372 #+end_src
8373 ]
8374 *** C-S-\
8375 :PROPERTIES:
8376 :CUSTOM_ID: 30edfb48-852f-4f2c-ba38-2635927d4950
8377 :END:
8378 *** C-h
8379 :PROPERTIES:
8380 :CUSTOM_ID: 3c5f241f-fc62-459d-ab85-6b7c1fb04801
8381 :END:
8382 help-prefix
8383
8384 *** M-h
8385 :PROPERTIES:
8386 :CUSTOM_ID: 6df13b90-490b-4cca-a49d-4f2e3ce5bea3
8387 :END:
8388 *** C-M-h
8389 :PROPERTIES:
8390 :CUSTOM_ID: 47f0d1f3-78ea-49d7-a6d7-06627ca745bd
8391 :END:
8392 *** C-S-h
8393 :PROPERTIES:
8394 :CUSTOM_ID: 3be3db5c-9905-474b-b773-1aee515625f5
8395 :END:
8396 *** C-'
8397 :PROPERTIES:
8398 :CUSTOM_ID: 9f252721-a2d5-46c6-b268-8ed597256229
8399 :END:
8400 eval-expression
8401 [
8402 #+begin_src emacs-lisp
8403 (global-set-key (kbd "C-'") 'eval-expression)
8404 #+end_src
8405 ]
8406 *** M-'
8407 :PROPERTIES:
8408 :CUSTOM_ID: f00b9c88-68bb-4831-872f-afb5ff82c104
8409 :END:
8410 *** C-M-'
8411 :PROPERTIES:
8412 :CUSTOM_ID: 0d39d36c-115a-4570-b4b1-818718409a49
8413 :END:
8414 *** C-S-'
8415 :PROPERTIES:
8416 :CUSTOM_ID: 230f50ef-48fd-4f13-aa62-e4a492c4515d
8417 :END:
8418 *** [C-n] :drill:
8419 SCHEDULED: <2014-04-07 Mon>
8420 :PROPERTIES:
8421 unpop-to-mark-command
8422 :CUSTOM_ID: 52ebb720-589b-485c-89dc-0dfb78e6dad4
8423 :ID: 32f1c87d-ee1f-4117-8059-32fd8facbeff
8424 :DRILL_LAST_INTERVAL: 42.8284
8425 :DRILL_REPEATS_SINCE_FAIL: 4
8426 :DRILL_TOTAL_REPEATS: 4
8427 :DRILL_FAILURE_COUNT: 0
8428 :DRILL_AVERAGE_QUALITY: 4.5
8429 :DRILL_EASE: 4.122
8430 :DRILL_LAST_QUALITY: 5
8431 :DRILL_LAST_REVIEWED: <2014-02-23 Sun 01:51>
8432 :END:
8433 unpop to mark
8434 [
8435 #+begin_src emacs-lisp
8436 (defun unpop-to-mark-command ()
8437 "Unpop off mark ring. Does nothing if mark ring is empty."
8438 (interactive)
8439 (when mark-ring
8440 (let ((pos (marker-position (car (last mark-ring)))))
8441 (if (not (= (point) pos))
8442 (goto-char pos)
8443 (setq mark-ring (cons (copy-marker (mark-marker)) mark-ring))
8444 (set-marker (mark-marker) pos)
8445 (setq mark-ring (nbutlast mark-ring))
8446 (goto-char (marker-position (car (last mark-ring))))))))
8447
8448 (global-set-key (kbd "C-n") 'unpop-to-mark-command)
8449 #+end_src
8450 ]
8451 *** M-n
8452 :PROPERTIES:
8453 :CUSTOM_ID: 00c2ab64-696d-4492-8236-f7ebc12e4a93
8454 :END:
8455 *** [C-M-n] :drill:
8456 SCHEDULED: <2014-03-17 Mon>
8457 :PROPERTIES:
8458 narrow-to-region
8459 :ID: 59e48dcc-434b-4c96-bdb3-c083c41ae8b3
8460 :CUSTOM_ID: 43997316-8d3f-4750-873b-ade09628fdd5
8461 :DRILL_LAST_INTERVAL: 7.6409
8462 :DRILL_REPEATS_SINCE_FAIL: 3
8463 :DRILL_TOTAL_REPEATS: 8
8464 :DRILL_FAILURE_COUNT: 4
8465 :DRILL_AVERAGE_QUALITY: 2.59
8466 :DRILL_EASE: 2.261
8467 :DRILL_LAST_QUALITY: 3
8468 :DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:34>
8469 :END:
8470 narrow-to-region
8471 [
8472 #+begin_src emacs-lisp
8473 (global-set-key (kbd "C-M-n") 'narrow-to-region)
8474 #+end_src
8475 ]
8476 *** C-S-n
8477 :PROPERTIES:
8478 :CUSTOM_ID: f01c2c61-f606-49ea-885a-63a831eaae3d
8479 :END:
8480 *** C-rshift
8481 *** M-rshift
8482 *** C-M-rshift
8483 *** C-S-rshift
8484 *** [C-escape] :drill:
8485 SCHEDULED: <2014-04-05 Sat>
8486 :PROPERTIES:
8487 find-tag
8488 :ID: a6dd7e4c-1831-4493-bbfd-557dc2f9c856
8489 :CUSTOM_ID: 6901fa1b-c827-4525-b24b-bdb8fe5f638b
8490 :DRILL_LAST_INTERVAL: 27.3693
8491 :DRILL_REPEATS_SINCE_FAIL: 5
8492 :DRILL_TOTAL_REPEATS: 6
8493 :DRILL_FAILURE_COUNT: 2
8494 :DRILL_AVERAGE_QUALITY: 3.417
8495 :DRILL_EASE: 2.676
8496 :DRILL_LAST_QUALITY: 4
8497 :DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:37>
8498 :END:
8499 find-tag
8500 [
8501 #+begin_src emacs-lisp
8502 (global-set-key (kbd "<C-escape>") 'find-tag)
8503 #+end_src
8504 ]
8505 *** M-escape
8506 :PROPERTIES:
8507 :ID: 7224837b-addc-4c82-8313-467c6dcb7a52
8508 :CUSTOM_ID: f505f1b9-82f6-4139-9e3e-78df548175ec
8509 :END:
8510 *** C-M-escape
8511 :PROPERTIES:
8512 :CUSTOM_ID: d77136c5-4aec-4f02-8b4b-e417249fbac1
8513 :END:
8514 *** C-S-escape
8515 :PROPERTIES:
8516 :CUSTOM_ID: d61ae40a-3f2d-4ef6-a515-8864a7d7c8ea
8517 :END:
8518 * keybind table src
8519 :PROPERTIES:
8520 :CUSTOM_ID: ff8f3092-187a-4b2c-940f-01743f7a51b6
8521 :END:
8522 not necessary to have at the end, but its convenient to have it next
8523 to its output.
8524 #+NAME: keybind-table-generator
8525 #+BEGIN_SRC emacs-lisp :results silent
8526 (defun org-custom-id-get (&optional pom create prefix)
8527 "Get the CUSTOM_ID property of the entry at point-or-marker POM.
8528 If POM is nil, refer to the entry at point.
8529 If the entry does not have a CUSTOM_ID, the function returns nil.
8530 However, when CREATE is non nil, create an ID if none is present already.
8531 PREFIX will be passed through to `org-id-new'.
8532 In any case, the CUSTOM_ID of the entry is returned."
8533 (org-with-point-at pom
8534 (let ((id (org-entry-get nil "CUSTOM_ID")))
8535 (cond
8536 ((and id (stringp id) (string-match "\\S-" id))
8537 id)
8538 (create
8539 (setq id (org-id-new prefix))
8540 (org-entry-put pom "CUSTOM_ID" id)
8541 (org-id-add-location id (buffer-file-name (buffer-base-buffer)))
8542 id)))))
8543
8544 (defun get-title()
8545 (interactive)
8546 (let ((title (plist-get (cadr (org-element-at-point)) ':title)))
8547 ;; remove brackets from [title]
8548 (string-match "[^[ ][^]]*" title)
8549 (setq title (match-string 0 title))
8550 (print title)
8551 title))
8552
8553
8554 (defun org-dblock-write:keybind-dblock (arg)
8555 (let (output)
8556 (save-excursion
8557 (goto-char (org-find-entry-with-id "beginning-of-keybind-table-data"))
8558 (let* ((table-level (org-current-level))
8559 (keybind-level (1+ table-level))
8560 (prefixes (list "C-M-S-" "C-M-" "C-S-" "M-S-" "M-" "C-" "S-"))
8561 table-title
8562 previous-prefixes
8563 )
8564 (while (>= (org-current-level) table-level)
8565 (setq table-title (get-title))
8566 (outline-next-heading)
8567 (let (found-prefixes
8568 found-all-prefixes)
8569 ;; go through the first few elements of the table to find out what column headings aka prefixes it should have
8570 (save-excursion
8571 (while (not found-all-prefixes)
8572 (let ((prefixes-copy prefixes)
8573 current-prefix
8574 found-prefix)
8575 (while (and prefixes-copy (not found-prefix))
8576 (setq current-prefix (car prefixes-copy))
8577 (when (and (> (length (get-title)) (length current-prefix))
8578 (string= (substring (get-title) 0 (length current-prefix)) current-prefix))
8579 (setq found-prefix t))
8580 (setq prefixes-copy (cdr prefixes-copy)))
8581 (unless found-prefix
8582 (setq current-prefix ""))
8583 (if (and found-prefixes (string= (car (last found-prefixes)) current-prefix))
8584 (setq found-all-prefixes t)
8585 (push current-prefix found-prefixes)))
8586 (outline-next-heading)))
8587 (setq found-prefixes (reverse found-prefixes))
8588
8589 ;; start a new table or repeat the prefixes in the current table
8590
8591 (if (or (not previous-prefixes) (equal previous-prefixes found-prefixes))
8592 (setq output (concat output "|-|\n| "))
8593 (setq output (concat output "|-|\n\n|-|\n| ")))
8594 (setq output (concat output table-title " | "))
8595 (setq previous-prefixes found-prefixes)
8596
8597 ;; add the prefixes
8598 (dolist (prefix found-prefixes)
8599 (setq output (concat output prefix "|")))
8600 (setq output (concat output "\n|-|\n"))
8601
8602
8603 (let (subtree-end)
8604 (while (>= (org-current-level) keybind-level)
8605 (dotimes (i (length found-prefixes))
8606 ;; add keybind name
8607 (when (= i 0)
8608 (setq output (concat output "| " (substring (get-title) (length (car found-prefixes))) " | ")))
8609 ;; add keybinds by searching for regex [keybind] to the start of the next heading
8610 (save-excursion
8611 (outline-next-heading)
8612 (setq subtree-end (point)))
8613 ;; skip over scheduled line
8614 (re-search-forward "^SCHEDULED:" subtree-end t)
8615
8616 ;; see comment after source block to understand this regex
8617 (re-search-forward "^\\s-*\\([^*: ].*?$\\)" subtree-end t)
8618 (let ((m (match-string 1)))
8619 (when m
8620 (setq output (concat output "[[#" (org-custom-id-get (point) 'create) "][" m "]]")))
8621 (setq output (concat output " | ")))
8622 ;; advance to next keybind
8623 (outline-next-heading))
8624 (setq output (concat output "\n"))
8625 ))))))
8626 (setq output (concat output "|-|"))
8627 (insert output))
8628 (org-table-map-tables 'org-table-align 'quietly))
8629
8630
8631 #+END_SRC
8632 after source block due to bad parsing of comments in non emacs lisp mode
8633 some easily forgotten regex elements. whitespace: \\s-
8634 non-greedy star: *?
8635 subexpression for close bracket char or nothing: \\(\\]\\|\\)
8636
8637 * keybind tables
8638 :LOGBOOK:
8639 CLOCK: [2016-11-28 Mon 10:59]--[2016-11-28 Mon 10:59] => 0:00
8640 :END:
8641 dunno why but it takes doing ctrl-c twice to update this
8642 #+BEGIN: keybind-dblock
8643 |---------------------+------------------------|
8644 | single/special keys | |
8645 |---------------------+------------------------|
8646 | tab key | [[#6c10a716-1d8e-4ce4-8e26-64468f19c17a][isearch]] |
8647 | tab | [[#51ece189-1840-41a1-8ca0-19f9a0481895][isearch-forward]] |
8648 | end | [[#00d589b7-2b8e-494c-b761-3afefebe6ec6][move-end-of-line]] |
8649 | home | [[#7800e455-c3f6-4a8f-8907-b2292449ab67][back-to-indentation]] |
8650 | s-tab | [[#3072901e-5cf3-4d6e-9ac8-3ef64a5f6ad2][indent-buffer]] |
8651 | s-delete | [[#e53728b6-054d-4443-a03e-6cf02d13724d][send-shell]] |
8652 | s-left arrow | [[#d8c473ac-5507-4a6b-9e5a-46558c17b09f][shell]] |
8653 | s-right arrow | [[#2365f5a7-b89a-4a97-b272-ac8ae9c2cc66][previous-buffer]] |
8654 | esc | |
8655 | return | [[#fab6adea-ed20-45ab-a0a3-776c68d5c3a5][new line]] |
8656 | s-return | [[#819cfb55-3a2f-4f20-8591-f819d1a6869a][auto-correct-prev-word]] |
8657 | down arrow | [[#7a868484-9c63-4a73-abda-7751cb2c02be][mark]] |
8658 | s-down arrow | [[#097b97e0-8ad8-40f7-8388-c4ace1706b38][extended command]] |
8659 | s-up arrow | |
8660 |---------------------+------------------------|
8661
8662 |-------------------+----------------------------+---------------------------------+--------------------+---------------+-------------------+-------------|
8663 | mouse | | C- | M- | S- | C-M- | C-S- |
8664 |-------------------+----------------------------+---------------------------------+--------------------+---------------+-------------------+-------------|
8665 | mouse-2 mode line | [[#69aaa631-6fb5-4beb-b2d8-c0f3d92c0a98][mouse-delete-other-windows]] | [[#501479ab-e1e2-497e-bd86-071f8afa3378][mouse-split-window-horizontally]] | | | | |
8666 | mouse-3 mode line | [[#917a1844-8c38-4f31-8616-50fc81334f2c][mouse-delete-window]] | | | | | |
8667 | mouse-1 | [[#4e60e2e4-8c2f-4450-8060-2d793ede530c][set cursor/mark]] | [[#b661f84f-57df-4095-9dc1-d1a876a53ee5][buffer list context menu]] | | | | |
8668 | mouse-2 | [[#086b0b50-054f-462d-92fa-b27852f887b0][paste]] | | | | | |
8669 | mouse-3 | [[#0481632e-9c50-4328-9365-c4b5bf967b66][set-mark]] | [[#9623c78f-7705-4cbe-a990-c24eb1067377][global menu]] | | | | |
8670 | mouse-9 | [[#efaec161-b279-4129-86fd-b410430926e4][move-mouse-to-point]] | | | | | |
8671 | mouse-8 | | | | | | |
8672 | 1/kp-end | | | | | | |
8673 | 2/kp-down | | | | | | |
8674 | 3/kp-next | | | | | | |
8675 | 4/kp-left | [[#c44d0f65-9502-4cc6-9642-96d907f6b093][indent-region]] | | | | | |
8676 | 5/kp-begin | [[#2458c6bc-7113-4d4b-bbdf-206e1cb842a7][mark-defun]] | | | | | |
8677 | 6/kp-right | [[#3b79bc58-6067-43bd-9471-9d592744a25a][ibuffer]] | | | | | |
8678 | 7/kp-home | | | | | | |
8679 | 8/kp-up | | | | | | |
8680 | 9/kp-prior | [[#a3b51adb-4405-4d9f-9b88-a8faa479fbe7][delete-horizontal-space]] | | | | | |
8681 | 10/kp-insert | | | | | | |
8682 | 11/kp-subtract | | | | | | |
8683 | 12/kp-add | | | | | | |
8684 | scroll | [[#33433f0f-5b0e-46ba-8452-d2a51e54769b][up/dn / scroll]] | [[#16506ba5-e8f2-4aec-bc1b-d2854d4e504c][cycle recent buffers]] | [[#e1e2e253-450d-4620-af9e-78d378f49ad5][forward/back s-exp]] | [[#74b2196a-345d-453a-b7be-1915360eb201][expand region]] | [[#bd2ca117-408c-49fc-a5ac-a938be21dfc0][scroll]] | [[#a69254a4-cf2d-450f-b477-2694b44a7e0d][zoom]] |
8685 | left-scroll | [[#d2d5c5c7-f0de-4e08-953b-d41d3e282ba7][left/right]] | [[#7bb95aa5-381e-454a-a6c6-aaeec728db08][back / forward word]] | [[#49db3764-b154-4cfc-8d0d-f0e0451815e3][winner undo redo]] | [[#ca5cdcd4-b3da-4d7b-86ab-4c7c0ac2caf7][---]] | [[#32c00bb2-3e5a-4670-8849-04d23b9f8364][forward/back sexp]] | [[#7b4f1f49-6d93-4210-a30c-8278d6e63655][unreachable]] |
8686 |-------------------+----------------------------+---------------------------------+--------------------+---------------+-------------------+-------------|
8687
8688 |-----------------+--------------------------------+---------------------------------+-------------------------------+--------------------------|
8689 | left primary | C- | M- | C-M- | C-S- |
8690 |-----------------+--------------------------------+---------------------------------+-------------------------------+--------------------------|
8691 | 2 | [[#4f29b011-3844-4a4a-b75d-cdf8f49e9adb][narrow-to-defun/subtree]] | | [[#33c4996d-92bc-4df0-b005-11553677be13][---]] | |
8692 | 3 | [[#7851a05e-7177-4a8f-af5a-3325a8f116fe][dot-mode-execute]] | | [[#9a00e17f-a1c9-48fc-b03b-c6a1a3cbda1c][recenter-top-bottom]] | |
8693 | q | [[#679fd3cd-c43b-409c-be36-4175a5f27cd3][org-cycle, comint previous arg]] | [[#72bada0e-5d62-4a8f-ae62-4972778ff1bc][org-archive-to-archive-sibling]] | [[#1f5e9b63-7ce0-445c-a426-b41839585d38][quoted-insert]] | |
8694 | w | [[#20005b6d-9a9d-4b58-882c-7ce860c7a395][goto-t.org]] | [[#331da6e5-7936-4663-8f58-9d8601b5915c][org-clock-in]] | | |
8695 | e | [[#24e34f4b-d1e8-4380-933f-ab1f78ebc782][copy-line]] | [[#0a771449-0cd5-4dc9-82ca-bcac5f7abd17][org-clock-in-last]] | | |
8696 | r | [[#5c55f461-f43f-493d-81eb-1ca747175ef1][isearch-backward]] | [[#dd9575bd-e471-418e-9519-4fc2b874ddcd][org-clock-out]] | | |
8697 | a | [[#db4b76df-9420-4256-8242-dc44b56d55d7][copy-all]] | [[#e865a1e5-55bf-4a98-a0d0-cb05a88de352][kmacro-start-macro-or-in...]] | [[#c6278a5a-024f-4c80-a8d4-65f127fd24a8][kmacro-end-or-call-macro]] | |
8698 | s | [[#01da04da-cdba-493f-892b-c4c064cf937e][C-x prefix]] | | [[#4b33022d-27f0-4d21-9931-2e2e692790e8][split-window-vertically]] | |
8699 | d | [[#b699614a-9994-4fe7-b2c6-f0fe81b7ad2b][C-c prefix]] | [[#06bcc5e2-f3a7-41c6-a793-ac6c9813fb6e][whitespace-cleanup]] | [[#8cf6053d-792b-4abd-a3a6-66efd7fbee68][swap buffer]] | |
8700 | f | [[#2695ed8a-e0d3-4e84-8688-98e3c50723b0][kill-whole-line]] | | [[#e7e4dd0b-418f-48ee-b366-9e733e3bec61][kill rest of line]] | |
8701 | g | [[#4af40595-7010-4be6-8cfe-a43797ca6e33][other-window / cancel]] | [[#fb0b343f-fdff-463a-94f4-3152191e17c4][abort-recursive-edit]] | [[#327e18af-30b7-47e5-aa53-5f678788b4c1][gnus]] | |
8702 | z | [[#707c4938-a790-4da9-8230-61855ea57d09][undo-tree-undo]] | | | |
8703 | x | [[#ec1403d3-528e-41b1-a195-5563bc93e124][kill-region]] | [[#bb7c95d5-dd97-439d-bf1f-cdac98d11543][append-next-kill]] | [[#c988370e-602c-431c-80a9-608459583f8b][append-next-kill]] | |
8704 | c | [[#400f06e1-8e45-443c-8d7b-3d1bb1176aab][copy]] | [[#f4c3317a-a317-4d04-8cb7-e46d0716bf1d][org-capture]] | [[#0a151d99-47ae-4e8f-8407-82e77d24a3e7][copy-to-register]] | |
8705 | v | [[#16411f68-7fe0-49e8-9a73-212471594f9e][yank]] | [[#d67f6371-a13f-4a75-8d8c-e4013ff4e131][insert-register]] | [[#25f86658-9999-40f7-b3a4-615981751b93][yank pop]] | |
8706 | b | [[#e682305e-0110-4d2f-afbd-2c401bcb9313][delete-other-windows]] | [[#05e3d0db-36dc-455f-8bed-f87886ca6004][isearch-backward-current-symbol]] | [[#6c63790c-28c1-4b73-96e2-ee859f57e734][isearch-current-symbol]] | |
8707 | tab | [[#edc45592-c69f-4439-8305-48f2c65696c3][yas-insert-snippet]] | [[#71264957-45fd-455a-a6d1-b08823c02d25][indent line]] | | |
8708 | delete | [[#2688b61d-9fdd-44af-b9bd-b126f0da00bd][kill-symbol]] | | [[#21876759-a8e6-4896-8a08-eda40d0eaff3][kill-sexp]] | |
8709 | left-arrow | [[#b15da91f-0786-49d1-b0b9-331b3b94f6ae][compile]] | | [[#13faf5d4-34be-4363-948d-4ff04a9f570b][org-shiftup]] | |
8710 | right-arrow | [[#3f3cac16-097d-451a-a14a-da7717d06730][paste selection]] | | [[#34e66314-1d97-4eeb-b704-fe0733849ae4][org-shiftdown]] | |
8711 | backspace | [[#85bb4701-42e6-4617-8de8-dfb1f03b0358][backward-kill-symbol]] | | [[#606b0991-7431-4a8a-a909-b872e104cc88][backward-kill-sexp]] | |
8712 | f7 | | | | |
8713 |-----------------+--------------------------------+---------------------------------+-------------------------------+--------------------------|
8714 | right primary | C- | M- | C-M- | C-S- |
8715 |-----------------+--------------------------------+---------------------------------+-------------------------------+--------------------------|
8716 | * | [[#f745b337-8b65-44cc-849a-5e0953c9ebd9][split-window-horizontally]] | | [[#5dbe3437-7364-4802-b558-00b2d5faacf6][calc-dispatch]] | |
8717 | 9 | [[#43d14154-2722-4ba5-b547-1b78c6274ebf][delete-window-or-exit]] | [[#9dc95338-4321-4354-9de2-69409f383a10][kill-buffer-and-window]] | [[#ffe9f636-31e5-48ba-b8fe-7c158ace744c][kill client buffer]] | |
8718 | u | [[#327992c0-6eba-4935-aec1-49871c2a8619][universal-argument]] | | [[#62735d64-b89a-46b7-b32e-2453b651039d][search-keybind]] | |
8719 | i | [[#3124e200-1d6e-4ad2-9a36-0d03e1e7dc38][-----]] | | [[#a3260b61-7c51-4d97-9a91-3ed702c5ae29][query-replace-regexp]] | |
8720 | o | [[#82215193-63b3-4d63-8f70-d11a328fe72d][occur]] | | [[#05d1ef50-43ee-46d7-b1ad-dd952543ab45][ido-goto-symbol]] | |
8721 | p | [[#9c2e2ba9-f34e-48fe-b4ff-b9826882c1cc][move-mouse-to-point]] | | [[#d55616d3-a3f6-4e83-8807-748578a7b726][delete-horizontal-space]] | |
8722 | j | [[#ebcf7c71-3c93-431b-af6b-7c5df7f2945e][register prefix]] | [[#474a3e12-95ac-4f43-b83a-36716f3e6f76][previous-error]] | | |
8723 | k | [[#25a7ba1c-ddf3-47f1-9516-914a552e7a36][jump to register]] | [[#a96691bb-9e4c-414b-a093-d9961d453e21][next-error]] | [[#f61ea4ea-4597-422e-b7e3-d3cfad82603d][man]] | |
8724 | l | [[#8a7572bd-4b5e-4464-b937-3d35adb1783f][ivy-switch-buffer]] | | [[#24b660d4-3ec4-4416-8a6a-b8224ed1ee8b][move cursor top bottom mid]] | |
8725 | ; | [[#7e3710eb-5460-4460-8bf0-488302e4ce35][comment-dwim]] | | [[#28680a96-5223-4632-80b9-b1facdd541e7][comment-current-line-dwim]] | |
8726 | m | [[#deee53ba-dfa2-4910-894c-55ae98d11aa4][pop-to-mark]] | | [[#f283f705-cba0-45db-b80f-5d20415b2eee][recursive grep]] | |
8727 | , | [[#6cbf3a85-f260-453a-920b-850ff5e986b1][counsel-find-file]] | | [[#bfdf6111-029d-462b-bcca-50a3ed2162d5][find-file-in-project]] | |
8728 | . | [[#0675c171-8677-44a8-882c-e7ed42715e31][recentf-ido-find-file]] | | [[#824d422c-67b6-4d68-af11-6a2135e528f5][-]] | |
8729 | / | [[#941a7fa8-84b9-434d-89a0-1487385ec479][join lines]] | | [[#37f67593-4f60-4d3b-9aad-6c9bc4882443][copy-variable]] | |
8730 | 8 | [[#251c4a1a-a683-4804-a706-d0d3752e42fa][calc-embedded-word]] | | | |
8731 | up-arrow | [[#f47d312a-063d-42ed-a352-176298a2cb0c][back defun/headline]] | | | |
8732 | down-arrow | [[#27435136-b3d7-4f25-aa85-2a7363a7f366][forward dfun/headline]] | | [[#3bcb35fd-6d54-4213-b94f-2739c0bc0041][toggle-mark-activation]] | [[#1434bdd0-c5a8-4c96-9b92-9474e88fd1c5][smex-major-mode-commands]] |
8733 | lbracket | [[#9d9916dd-3280-47dd-aab1-cd28d5ebfe15][----]] | | [[#7411b1a5-c8fa-4bcc-8788-798e5635dd62][scroll-right]] | |
8734 | rbracket | [[#21b38c6b-3a46-4a08-8eca-d44abb148287][fill-paragraph]] | | [[#c9c18f48-d0ca-4a1b-a751-7165f40118a3][scroll-left]] | |
8735 | return | [[#baf7ea5a-d16d-4fee-a6ce-542cc11beb97][newline next line]] | [[#e6895ad3-a2c8-46c8-abbc-1bba94a88596][non-indented newline]] | [[#2a8fc6ea-a550-4437-9e35-3b3f2776788a][open newline on previous line]] | |
8736 | space | [[#132daa1a-8e5f-47f1-a28d-35bee873aeac][org-edit-special]] | | [[#02359b66-bf6e-4f41-9f03-e83fcbe3e68c][spell check word]] | |
8737 |-----------------+--------------------------------+---------------------------------+-------------------------------+--------------------------|
8738 | left secondary | C- | M- | C-M- | C-S- |
8739 |-----------------+--------------------------------+---------------------------------+-------------------------------+--------------------------|
8740 | = | | | | |
8741 | 1 | | | | |
8742 | 4 | | | [[#3ff50f5f-f286-4a73-962b-58dbcf3b09b1][widen]] | |
8743 | 5 | | | | |
8744 | tab-key | [[#68313551-90cd-47a6-8170-1745348add17][query-replace]] | | | |
8745 | t | [[#aaac3048-9125-4fd5-b8f2-21bafcc1ff1c][org change todo state]] | | [[#5bc609b1-9428-4b82-a55d-811fefe65331][org insert timestamp]] | |
8746 | home | [[#1919659a-b466-4519-9276-8bf06a916066][start of buffer]] | | | |
8747 | end | [[#0a7bd629-cbcc-4761-8fe2-cc9370b985a4][end of buffer]] | | | |
8748 | f9 | | | | |
8749 |-----------------+--------------------------------+---------------------------------+-------------------------------+--------------------------|
8750 | right secondary | C- | M- | C-M- | C-S- |
8751 |-----------------+--------------------------------+---------------------------------+-------------------------------+--------------------------|
8752 | 6 | [[#e44e584b-d925-4036-9ad5-a90d02e74bef][save-buffers-kill-emacs]] | | [[#da73de75-0914-4f48-81d5-9b408433b14b][insert-small-copyright]] | |
8753 | 7 | | | [[#a68c6b8e-9911-475e-ab35-e239771fe881][insert-full-copyright]] | |
8754 | 0 | | | | |
8755 | - | | | | |
8756 | y | [[#97aee7f1-3647-4602-a65a-45e8a3aa3a7c][undo-tree-redo]] | | | |
8757 | \ | [[#b8ad3ee9-7bf6-4069-a300-49cd298008a7][sr-speedbar-toggle]] | | [[#6a583354-48f8-4503-bf87-b8ba56411435][mark-defun]] | |
8758 | h | [[#3c5f241f-fc62-459d-ab85-6b7c1fb04801][help-prefix]] | | | |
8759 | ' | [[#9f252721-a2d5-46c6-b268-8ed597256229][eval-expression]] | | | |
8760 | n | [[#52ebb720-589b-485c-89dc-0dfb78e6dad4][unpop-to-mark-command]] | | [[#43997316-8d3f-4750-873b-ade09628fdd5][narrow-to-region]] | |
8761 | rshift | | | | |
8762 | escape | [[#6901fa1b-c827-4525-b24b-bdb8fe5f638b][find-tag]] | | | |
8763 |-----------------+--------------------------------+---------------------------------+-------------------------------+--------------------------|
8764 #+END:
8765
8766 * persistent registers
8767 This needs to be at the end, because I visit a file, thus setting a
8768 mode, and the mode hook needs to be setup before that.
8769
8770 I'm using persistent registers instead of bookmarks. I dun use them
8771 much, so the added hassle of having to set it within this file is
8772 worth the benefit of only having one concept in my mind.
8773 #+begin_src emacs-lisp
8774 (dolist
8775 (r `(
8776 (?i (file . ,"~/.emacs.d/my-init.org"))
8777 (?t (file . ,"/a/x.txt"))
8778 ))
8779 (set-register (car r) (cadr r)))
8780 #+end_src
8781
8782 * keybind notes
8783 common keys, which would be better off doing swaps than rebinds:
8784 c-x prefix -> c-s
8785 c-c prefix -> c-d
8786 yank c-y -> c-c
8787 search c-s -> kp-add
8788 kill line c-k -> c-f
8789 undo c-_ -> c-z
8790 set-mark-command c-@ -> kp-enter
8791 quoted-insert c-q -> c-m-q
8792 recenter-top-bottom c-l -> c-m-3
8793 kill-region c-w -> c-x
8794
8795 commands to make less accessible
8796 narrow-to-defun/subtree -> M-2 maybe
8797 occur
8798
8799 command to make more accessible, ...
8800
8801
8802 * misc useful functions I'd rather have in a list than burried
8803 #+begin_src emacs-lisp :tangle no
8804 ;; these are usefull with (goto-char)
8805 ;; find named entity, other than headline
8806 (org-find-entry-with-id "string-number-or-symbol")
8807
8808 (org-find-exact-headline-in-buffer "heading" nil t)
8809
8810 (byte-recompile-file (expand-file-name "~/.emacs.d/my-init.el") t 0)
8811 (byte-recompile-directory (expand-file-name "~/.emacs.d") 0)
8812 (byte-recompile-directory (expand-file-name "~/.emacs.d/src/haskell-mode") 0)
8813
8814 ;; remove any indent level which is throughout the buffer
8815 (org-do-remove-indentation)
8816
8817 #+end_src
8818
8819 * TESTING / DEVELOPMENT AREA
8820
8821 :PROPERTIES:
8822 :header-args: :tangle no
8823 :END:
8824 ** new
8825 #+begin_src emacs-lisp
8826
8827
8828 #+end_src
8829
8830 ** key logging
8831 this article convinced me that trying to experiment with modal editing is a waste.
8832 http://chrisdone.com/posts/speculations-on-exclusive-editing
8833 I want to record my emacs commands simply to find optimiaztions, like if I often do some M-x command and should bind it
8834 to a key.
8835
8836
8837 #+begin_src emacs-lisp :tangle no
8838
8839 (setq keylog-list nil)
8840 (setq keylog-mode nil)
8841
8842 (defun keylog-save ()
8843
8844 ;; Check that the lock file does not exist
8845 (when (keyfreq-file-is-unlocked)
8846 ;; Lock the file
8847 (keyfreq-file-claim-lock)
8848
8849 ;; Check that we have the lock
8850 (if (eq (keyfreq-file-owner) (emacs-pid))
8851 (unwind-protect
8852 (progn
8853 ;; Load values and merge them with the current keyfreq-table
8854 (keyfreq-table-load table)
8855
8856 ;; Write the new frequencies
8857 (with-temp-file keyfreq-file
8858 (prin1 (cdr (keyfreq-list table 'no-sort)) (current-buffer))))
8859
8860 ;; Release the lock and reset the hash table.
8861 (keyfreq-file-release-lock)
8862 (clrhash table))
8863 )))
8864
8865 (defun my-keylogger-function ()
8866 (setq keylog-list (cons (list (current-time) current-prefix-arg this-command) keylog-list)))
8867 (add-hook 'pre-command-hook 'my-keylogger-function)
8868
8869 #+end_src
8870
8871 in a lisp expression, ; \\[ throws off forward-sexp
8872 when not in emacs lisp mode,
8873 even with (with-syntax-table emacs-lisp-mode-syntax-table
8874 forward-sexp)
8875 which is found in preceding-sexp
8876 potentially a bug, either in with-syntax-table, or
8877 in scan-lists, which is implemented in C
8878
8879
8880
8881
8882 why did it go to the init file?
8883 change EDITOR to emacsclient
8884 xserver-xorg-core=2:1.14.3-3ubuntu2
8885 (setq-default header-line-format nil) ; Copy mode-line
8886 (setq-default mode-line-format nil) ;
8887
8888
8889 #+RESULTS:
8890 : set-food-completions
8891
8892
8893
8894 useless gnus group keys:
8895 a
8896 c
8897
8898
8899 (add-to-list 'load-path "~/.emacs.d/emacs/site-lisp/org")
8900
8901 #+begin_src emacs-lisp
8902 (add-hook 'org-mode-hook
8903 (lambda () (define-key org-mode-map (kbd "C-y") nil)))
8904
8905 #+end_src
8906
8907
8908
8909
8910 (defun comint-send-string (process string)
8911 "Like `process-send-string', but also does extra bookkeeping for Comint mode."
8912 (if process
8913 (with-current-buffer (if (processp process)
8914 (process-buffer process)
8915 (get-buffer process))
8916 (comint-snapshot-last-prompt))
8917 (comint-snapshot-last-prompt))
8918 (process-send-string process string))
8919
8920
8921 * python
8922 todo: get smart-operator to work
8923 todo, checkout https://github.com/python-rope/ropemacs refactoring python,
8924 todo, try py-autopep8, autoformatter
8925 todo, check out some python linting stuff. pychecker is one, others are in *packages*
8926 todo, finish reading through python-mode.el functions
8927 ;; todo, figure out multi-line input in shell mode
8928
8929
8930 usefull m-x commands:
8931 m-x py-describe-mode: doc for mode which is extensive
8932 m-x py-sort-imports
8933 m-x py-guess-indent-offset: setup indent for code i didn't write
8934
8935 possibly usefull commands:
8936 found via looking through python-mode.el, quit like 1/4 through, cuz its tedious, last spot was at:
8937 (defun py-comment-region (beg end &optional arg)
8938 after finding py-describe-mode, it seemed to do a good job of documenting all the most important stuff
8939
8940 py-switch-to-python
8941 python-shell-completion-complete-or-indent may be usefull to get completion working in the shell
8942 py-insert-default-shebang
8943 py-electric-*
8944 py-indent-line-outmost
8945 py-newline-and-close-block
8946 py-indent-and-forward (indent line, move to next)
8947 py-fill-*
8948 py-which-function (for showing in the modeline)
8949 py-help-at-point
8950 py-execute-import-or-reload
8951 py-execute-def-or-class
8952 various pdb functions
8953
8954
8955 installing jedi
8956 #+begin_src sh :tangle no
8957 pi python-pip
8958 s pip install jedi virtualenv
8959 #+end_src
8960 then do m-x jedi:install-server
8961
8962
8963
8964 disabled because it takes 152 ms to load,
8965 and I don't know how to do it conditioally
8966 #+begin_src emacs-lisp :tangle no
8967
8968 ;; change from default python3 to be compatibile with Pywikibot
8969 (setq py-shell-name "/usr/bin/python")
8970 (require 'python-mode)
8971
8972 (setq py-autopep8-options '("--max-line-length=110"))
8973
8974 (defun py-execute-block-or-clause-create-shell ()
8975 (interactive)
8976 (cond ((get-buffer "*Python*")
8977 (py--execute-prepare "block-or-clause")
8978 (py-execute-block-or-clause)
8979 (call-interactively 'next-line))
8980 (t
8981 (py-shell)
8982 ;; py-shell starts the shell but not display the buffer on the first run
8983 ;; subsequent runs, it does. I grabbed this command from inside to
8984 ;; do just the relevant part from the second run, as a hack.
8985 ;; todo: report a bug on this
8986 (py--shell-manage-windows py-buffer-name))))
8987 (setq py-tab-shifts-region-p t)
8988 (setq py-tab-indents-region-p t)
8989
8990 (defun py-run ()
8991 "default action to run the current buffer"
8992 (basic-save-buffer)
8993 (py-execute-buffer))
8994
8995
8996 (add-hook 'python-mode-hook
8997 (lambda ()
8998 (setq run-fun 'py-run)
8999 (define-key python-mode-map (kbd "C-M-a") nil)
9000 (define-key python-mode-map (kbd "C-M-d") nil)
9001 (define-key python-mode-map (kbd "C-M-e") nil)
9002 (define-key python-mode-map (kbd "C-M-h") nil)
9003 (define-key python-mode-map (kbd "C-M-i") nil)
9004 (define-key python-mode-map (kbd "C-M-u") nil)
9005 (define-key python-mode-map (kbd "C-M-x") nil)
9006 (define-key python-mode-map (kbd "<tab>") 'indent-for-tab-command)
9007 (define-key python-mode-map (kbd "C-j") nil)
9008 (define-key python-mode-map (kbd "<C-backspace>") nil)
9009 ;;(define-key python-mode-map (kbd "C-(") (lambda () (interactive) (basic-save-buffer) (py-execute-buffer)))
9010 ;; fix default return bindings
9011 (define-key python-mode-map (kbd "C-j") nil)
9012 (define-key python-mode-map (kbd "RET") nil)
9013 (define-key python-mode-map (kbd "<return>") 'py-newline-and-indent)
9014 (define-key python-mode-map (kbd "<M-tab>") 'py-indent-line)
9015 (define-key python-mode-map (kbd "C-M-(") 'py-shift-left)
9016 (define-key python-mode-map (kbd "C-M-)") 'py-shift-right)
9017 (define-key python-mode-map (kbd "<home>") 'py-beginning-of-line)
9018 (define-key python-mode-map (kbd "<end>") 'py-end-of-line)
9019 (define-key python-mode-map (kbd "C-t") 'py-execute-block-or-clause-create-shell)
9020 (define-key python-mode-map (kbd "<S-delete>") 'py-ian-execute-line-or-region)
9021 ;; python mode adds these to this list, which is normally empty.
9022 ;; it makes my send-python function not reuse an existing python shell window
9023 ;; there are other ways to override this, but I don't know of any other value of
9024 ;; having this set.
9025 (setq same-window-buffer-names (delete "*Python*" same-window-buffer-names))
9026 (setq same-window-buffer-names (delete "*IPython*" same-window-buffer-names))))
9027
9028 ;; i dunno, why, but this didn't work:
9029 ;; and we can't eval-after-load cuz it is part of the greater python mode file
9030 (add-hook 'py-shell-hook
9031 (lambda ()
9032 (define-key py-shell-map "\r" nil)
9033 (define-key py-shell-map (kbd "<return>") 'comint-send-input)
9034 (define-key py-shell-map (kbd "C-t") 'py-shell-toggle-arrow-keys)
9035 (define-key py-shell-map "\C-d" nil)
9036 (define-key py-shell-map (kbd "<up>") 'my-comint-previous-input)
9037 (define-key py-shell-map (kbd "<down>") 'my-comint-next-input)))
9038
9039
9040 (defun py-ian-execute-line-or-region ()
9041 (interactive)
9042 (cond ((get-buffer "*Python*")
9043 (if mark-active
9044 (py-execute-region)
9045 (py-execute-statement))
9046 (call-interactively 'next-line))
9047 (t (py-shell))))
9048
9049 ;; http://tkf.github.io/emacs-jedi/latest/
9050 (add-hook 'python-mode-hook 'jedi:setup)
9051 (setq jedi:complete-on-dot t)
9052
9053 (defun py-shell-toggle-arrow-keys ()
9054 (interactive)
9055 (toggle-arrow-keys py-shell-map))
9056
9057 #+end_src
9058
9059
9060 ;; py-shell window stuff
9061 ;; it splits the window if the shell is in a different frame
9062 ;; which seems to be a bug, but it can be fixed with this option
9063 ;; (setq py-keep-windows-configuration 'force)
9064 ;; however, with py-execute-block-or-clause, if the shell is in a different frame,
9065 ;; you get errors "buffer is read only", when the point is near the beginning of a command
9066 ;; todo: test with emacs -Q and file a bug
9067 ;; if you execute py-execute-... without a python shell open,
9068 ;; it starts one, doesn't display it, and subsequent py-execute commands
9069 ;; give error "buffer is read only"
9070 ;; these functions fix / improve these problems
9071
9072
9073 ** initial python-mode setup
9074
9075 python-mode seems to be the most canonical package, based on
9076 https://docs.python.org/devguide/emacs.html
9077 much more feature rich than the emacs built in one.
9078
9079 getting it, it wants you to setup an account on launchpad by default,
9080 there is some way to get anonymous bzr access, but google didn't answer it right away,
9081 so fuck it, ill go the happy path.
9082
9083 based on error messages,
9084 add public ssh key to https://launchpad.net/people/+me
9085 bzr launchpad-login iank
9086 cd ~/.emacs.d/src/
9087 bzr branch lp:python-mode
9088
9089 add lines from INSTALL to init
9090
9091
9092 ** background on packages
9093 jedi appears most popular based on github stats
9094 pysmell appears dead
9095 ac-python appears dead
9096 https://github.com/proofit404/anaconda-mode seems to be kicking along
9097
9098
9099 ** misc notes:
9100
9101 python-mode has a TON of functions that are just aliases or verbatim wrappers of other functions.
9102 also has undocumented/unused vars all around. it is quite annoying.
9103
9104 the dedicated argument to py-shell does nothing,
9105 and py-dedicated-shell just sets that, so it is a waste
9106
9107
9108 ** background on sending to python shell
9109
9110 using the builtin python execute shell functions, sending one line doesn't really work well.
9111 The bulit in functions don't wait for further input if a block is not closed.
9112 And doing a copy/paste thing gets messed up because of indents.
9113 With some hacking, I could probably do copy/paste and remove indents, only to a
9114 certain level if we have entered a block and are waiting to finish it.
9115 But just doing the builtin execute block is a decent work around.
9116
9117
9118 Here is the scrapped function for single line built in sending to shell.
9119
9120
9121 (setq w32-enable-num-lock nil)
9122 (global-set-key (kbd "<num_lock>") 'left-char)
9123
9124
9125 (defun sqlup-find-correct-keywords ()
9126 "If emacs is handling the logic for syntax highlighting of SQL keywords, then we piggyback on top of that logic. If not, we use an sql-mode function to create a list of regular expressions and use that."
9127 (mapcar 'car (sql-add-product-keywords sql-product '())))
9128
9129
9130 largest subarray sum, array of pos and neg ints.