From: Andreas Gerler Date: Thu, 4 Jun 2015 19:56:16 +0000 (+0200) Subject: adding bba/org-search-src-sh for literate devops jobs. Bound to C-c S-n. X-Git-Url: http://git.bundesbrandschatzamt.de/?a=commitdiff_plain;h=ffbd9120116d81e8cc48442d5a3fb94100a5728d;p=emacsconfig.git adding bba/org-search-src-sh for literate devops jobs. Bound to C-c S-n. Signed-off-by: Andreas Gerler --- diff --git a/bba.org b/bba.org index f63c6fcc..8723d3fc 100644 --- a/bba.org +++ b/bba.org @@ -472,6 +472,25 @@ Some initial languages we want org-babel to support #+END_SRC +Find next and previous =#+BEGIN_SRC sh= block. +Very useful for repetitive literate devops jobs. + then and so on. + +#+BEGIN_SRC emacs-lisp + (add-hook 'org-mode-hook + (lambda () + + (fset 'bba/org-search-src-sh + (lambda (&optional arg) "Find next BEGIN_SRC sh block." (interactive "p") (kmacro-exec-ring-item (quote ([19 94 35 92 43 66 69 71 73 78 95 83 82 67 32 115 104 down] 0 "%d")) arg))) + (define-key org-mode-map "\C-c\S-n" 'bba/org-search-src-sh) + + (fset 'bba/org-search-src-sh-reverse + (lambda (&optional arg) "Find previous BEGIN_SRC sh block." (interactive "p") (kmacro-exec-ring-item (quote ([18 94 35 92 43 66 69 71 73 78 95 83 82 67 32 115 104 18 down] 0 "%d")) arg))) + (define-key org-mode-map "\C-c\S-p" 'bba/org-search-src-sh-reverse) + )) + +#+END_SRC + Define some shortcuts to access major org files. #+BEGIN_SRC emacs-lisp