X-Git-Url: http://47.100.26.94:8080/?a=blobdiff_plain;f=emacs.d%2Fconfig.org;h=690bbe655e33caaa182f6753a6bfd32e4386355e;hb=6536132c3d7943e7d0c79263144f487a4a05d4d8;hp=fdd9843d92dbea5b10b62178ca4209d455937d72;hpb=a8af98dedf21eb2f2829d0565ba13aa578deaf36;p=dotfiles.git diff --git a/emacs.d/config.org b/emacs.d/config.org index fdd9843..690bbe6 100644 --- a/emacs.d/config.org +++ b/emacs.d/config.org @@ -781,39 +781,6 @@ Some global bindings on =Super=, on Mac, it is =Command= #+END_SRC ** Search Replace and highlight -*** Occur -Occur search key bindings -#+BEGIN_SRC emacs-lisp :tangle yes :results silent - (add-hook 'occur-hook (lambda () - (switch-to-buffer-other-window "*Occur*") - (define-key occur-mode-map (kbd "C-o") nil))) - ;; auto select occur window - - (define-key occur-mode-map (kbd "C-n") - (lambda () - (interactive) - (occur-next) - (occur-mode-goto-occurrence-other-window) - (recenter) - (other-window 1))) - - (define-key occur-mode-map (kbd "C-p") - (lambda () - (interactive) - (occur-prev) - (occur-mode-goto-occurrence-other-window) - (recenter) - (other-window 1))) - - (use-package color-moccur - :ensure t - :commands (isearch-moccur isearch-all) - :init - (setq isearch-lazy-highlight t) - :config - (use-package moccur-edit)) -#+END_SRC - *** swiper #+BEGIN_SRC emacs-lisp :tangle yes :results silent (use-package swiper @@ -899,7 +866,6 @@ use the prefix =M-s= for searching in buffers ;; M-u, #+END_SRC - * Org-mode Settings ** Org-mode Basic setting @@ -941,6 +907,12 @@ Always indents header, and hide header leading starts so that no need type =#+ST (define-key org-mode-map (kbd "C-'") nil) ;; C-M-i is mapped to imenu globally (define-key org-mode-map (kbd "C-M-i") nil) + + ;; set the ditta.jar path + (setq org-ditaa-jar-path "/usr/local/Cellar/ditaa/0.9/libexec/ditaa0_9.jar") + (unless + (file-exists-p org-ditaa-jar-path) + (error "seudut: ditaa.jar not found at %s " org-ditaa-jar-path)) #+END_SRC ** Org-bullets @@ -1444,9 +1416,9 @@ Refer [[https://github.com/abo-abo/hydra/blob/master/hydra-examples.el][hydra-ex Enable linum mode on programming modes #+BEGIN_SRC emacs-lisp :tangle yes :results silent - (add-hook 'prog-mode-hook 'linum-mode) - + ;; (add-hook 'prog-mode-hook (lambda () + ;; (setq-default indicate-empty-lines t))) #+END_SRC Fix the font size of line number @@ -2340,8 +2312,7 @@ Use =Avy= for motion (use-package avy :ensure t :config - (avy-setup-default) - ) + (avy-setup-default)) (global-set-key (kbd "C-M-j") 'avy-goto-line-below) (global-set-key (kbd "C-M-n") 'avy-goto-line-below) @@ -2394,5 +2365,54 @@ Use =Avy= for motion ;; ("s" . isearch-forward-regexp "search-forward" :exit t) ;; ("r" . isearch-backward-regexp "search-backward" :exit t) ;; ) + + ;; (setq-default indicate-empty-lines t) #+END_SRC +*** Occur +Occur search key bindings +#+BEGIN_SRC emacs-lisp :tangle yes :results silent + (defun sd/occur-keys () + "My key bindings in occur-mode" + (interactive) + (switch-to-buffer-other-window "*Occur*") + (define-key occur-mode-map (kbd "C-o") nil) + (define-key occur-mode-map (kbd "C-n") (lambda () + (interactive) + (occur-next) + (occur-mode-goto-occurrence-other-window) + (recenter) + (other-window 1))) + (define-key occur-mode-map (kbd "C-p") (lambda () + (interactive) + (occur-prev) + (occur-mode-goto-occurrence-other-window) + (recenter) + (other-window 1)))) + + (add-hook 'occur-hook #'sd/occur-keys) + + (use-package color-moccur + :ensure t + :commands (isearch-moccur isearch-all) + :init + (setq isearch-lazy-highlight t) + :config + (use-package moccur-edit)) +#+END_SRC + +* test +#+BEGIN_SRC ditaa :file temp/hello-world.png :cmdline -r ++--------------+ +| | +| Hello World! | +| | ++--------------+ +#+END_SRC + +#+RESULTS: +[[file:temp/hello-world.png]] + + +* =C-u C-h a= search funtions +=apropos-command=