emacs - add C-o C-r invoke ivy-recentf
[dotfiles.git] / emacs.d / config.org
index 904ba56..455ef21 100644 (file)
@@ -256,6 +256,8 @@ Loading theme should be after all required loaded, refere [[https://github.com/j
 
 #+BEGIN_SRC emacs-lisp :tangle yes :results silent
   (setq vc-follow-symlinks t)
+  (use-package molokai-theme
+    :ensure t)
 
   (use-package color-theme
     :ensure t
@@ -671,28 +673,6 @@ Use [[https://github.com/DarwinAwardWinner/ido-ubiquitous][ido-ubiquitous]] for
     ;; (set-face-attribute 'ivy-current-match nil :background "Orange" :foreground "black")
     (define-key read-expression-map (kbd "C-r") 'counsel-expression-history)
     (global-set-key (kbd "C-c C-r") 'ivy-resume))
-
-
-
-  ;; (global-set-key "\C-s" 'swiper)
-  ;; (global-set-key (kbd "<f6>") 'ivy-resume)
-  ;; ;; (global-set-key (kbd "C-x C-f") 'counsel-find-file)
-  ;; (global-set-key (kbd "<f1> l") 'counsel-load-library)
-  ;; (global-set-key (kbd "<f2> i") 'counsel-info-lookup-symbol)
-  ;; (global-set-key (kbd "<f2> u") 'counsel-unicode-char)
-  ;; (global-set-key (kbd "C-c g") 'counsel-git)
-  ;; (global-set-key (kbd "C-c j") 'counsel-git-grep)
-  ;; (global-set-key (kbd "C-c k") 'counsel-ag)
-  ;; (global-set-key (kbd "C-x l") 'counsel-locate)
-  ;; (global-set-key (kbd "C-S-o") 'counsel-rhythmbox)
-
-  ;; (set-face-attribute
-  ;;  'ivy-current-match nil
-  ;;  :background "Orange"
-  ;;  :foreground "black")
-
-  ;; ivy-resume
-  ;; (define-key swiper-map (kbd "M-%") 'swiper-aa-replace)
 #+END_SRC
 
 ** helm
@@ -729,6 +709,7 @@ Always indents header, and hide header leading starts so that no need type =#+ST
     (setq org-return-follows-link t)
     ;; open the ppt file by external open instead of emacs
     (add-to-list 'org-file-apps '("\\.pptx" . "open %s"))
+    (add-to-list 'org-file-apps '("\\.doc" . "open %s"))
     (setq org-image-actual-width nil))
 #+END_SRC
 
@@ -739,8 +720,8 @@ Always indents header, and hide header leading starts so that no need type =#+ST
     :features ob-racket)
 
   ;; Lua support
-  (use-package ob-lua
-    :ensure t)
+  ;(use-package ob-lua
+  ;  :ensure t)
 
   ;; use current window for org source buffer editting
 
@@ -763,7 +744,7 @@ Always indents header, and hide header leading starts so that no need type =#+ST
                                  (latex . t)
                                  (java . t)
                                  (ruby . t)
-                                 (lua . t)
+  ;                               (lua . t)
                                  (lisp . t)
                                  (scheme . t)
                                  (racket . t)
@@ -837,7 +818,9 @@ cause we cannot input =[= and =]=, so here I unset this mappings. And redifined
   (use-package worf
     :ensure t
     :commands worf-mode
-    :init (add-hook 'org-mode-hook 'worf-mode))
+    :init
+    (require 'ivy)
+    (add-hook 'org-mode-hook 'worf-mode))
 #+END_SRC
 
 ** Get Things Done
@@ -1642,6 +1625,23 @@ When see function by =C-h f=, and visit the source code, I would like the buffer
   (add-hook 'help-mode-hook 'sd/help-mode-hook)
 #+END_SRC
 
+Wiki [[http://stackoverflow.com/questions/3480173/show-keys-in-emacs-keymap-value][show-keys-in-emacs-keymap-value]], Helpplus mode can show keymap as human-readable, use ~describe-keymap~ or =C-h M-k=
+
+#+BEGIN_SRC emacs-lisp :tangle yes :results silent
+  (el-get-bundle help-macro+
+    :url "https://raw.githubusercontent.com/emacsmirror/emacswiki.org/master/help-macro+.el"
+    :features help-macro+)
+  (el-get-bundle help+
+    :url "https://raw.githubusercontent.com/emacsmirror/emacswiki.org/master/help+.el"
+    :features help+)
+  (el-get-bundle help-fns+
+    :url "https://raw.githubusercontent.com/emacsmirror/emacswiki.org/master/help-fns+.el"
+    :features help-fns+)
+  (el-get-bundle help-mode+
+    :url "https://raw.githubusercontent.com/emacsmirror/emacswiki.org/master/help-mode+.el"
+    :features help-mode+)
+#+END_SRC
+
 ** goto-last-change
 #+BEGIN_SRC emacs-lisp :tangle yes :results silent
   (use-package goto-last-change
@@ -1957,6 +1957,7 @@ here on Mac, just use "open" commands to pen =.pdf=,  =.html= and image files
     :config
     (define-key company-active-map (kbd "M-n") nil)
     (define-key company-active-map (kbd "M-p") nil)
+    (define-key company-active-map (kbd "SPC") #'sd/company-stop-input-space)
     (define-key company-active-map (kbd "C-n") #'company-select-next)
     (define-key company-active-map (kbd "C-p") #'company-select-previous)
     ;; should map both (kbd "TAB") and [tab],https://github.com/company-mode/company-mode/issues/75
@@ -1970,6 +1971,12 @@ here on Mac, just use "open" commands to pen =.pdf=,  =.html= and image files
     :ensure t
     :config
     (company-statistics-mode))
+
+  (defun sd/company-stop-input-space ()
+    "Stop completing and input a space,a workaround of a semantic issue `https://github.com/company-mode/company-mode/issues/614'"
+    (interactive)
+    (company-abort)
+    (insert " "))
 #+END_SRC
 
 ** YASnippet
@@ -2107,11 +2114,15 @@ bindings in =lispy-mode-map= after loaded. see [[http://stackoverflow.com/questi
   (use-package lispy
     :ensure t
     :init
-    (eval-after-load "lispy"
-      `(progn
-         (define-key lispy-mode-map (kbd "M-o") nil)))
+    (with-eval-after-load "lispy"
+      (define-key lispy-mode-map (kbd "M-o") nil)
+      (define-key lispy-mode-map (kbd "g") 'special-lispy-goto-local)
+      (define-key lispy-mode-map (kbd "G") 'special-lispy-goto)
+      (define-key lispy-mode-map (kbd "M-m") 'back-to-indentation))
     :config
     (add-hook 'emacs-lisp-mode-hook (lambda () (lispy-mode 1))))
+
+
 #+END_SRC
 
 ** Perl
@@ -3005,6 +3016,7 @@ Most use =C-o C-o= to switch buffers; =C-o x, v= to split window; =C-o o= to del
     ;; ("C-i" other-window nil :exit t)
     ("C-b" ido-switch-buffer nil :exit t)
     ("C-f" projectile-find-file nil :exit t)
+    ("C-r" ivy-recentf nil :exit t)
     ("C-p" persp-switch :exit t)
     ("C-t" projectile-persp-switch-project nil :exit t)
 
@@ -3474,7 +3486,12 @@ Refer [[https://github.com/fnwiya/dotfiles/blob/c9ca79f1b22c919d9f4c3a0f944ba828
 
   (global-set-key (kbd "C-w") 'sd/kill-region-or-backward-kill-word)
 #+END_SRC
-
+* Developing
+** perspeen
+#+BEGIN_SRC emacs-lisp :tangle yes :results silent
+  (el-get-bundle seudut/perspeen
+    :features perspeen)
+#+END_SRC
 * TODO todolist
 ** Rucket
 ** player video on iphone for