X-Git-Url: http://47.100.26.94:8080/?a=blobdiff_plain;f=emacs.d%2Fconfig.org;h=60afe0b2acf5a5778d35a882262491e748393b67;hb=1c282fe29001f942bd32ff822b8d2dbe1db717f2;hp=ffb0e13c367c68b08617eccb5236cd86779b4f50;hpb=926b297e2d85018982407bb7c1f692cbc1028bc6;p=dotfiles.git diff --git a/emacs.d/config.org b/emacs.d/config.org index ffb0e13..60afe0b 100644 --- a/emacs.d/config.org +++ b/emacs.d/config.org @@ -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 "") 'ivy-resume) - ;; ;; (global-set-key (kbd "C-x C-f") 'counsel-find-file) - ;; (global-set-key (kbd " l") 'counsel-load-library) - ;; (global-set-key (kbd " i") 'counsel-info-lookup-symbol) - ;; (global-set-key (kbd " 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 @@ -726,7 +706,11 @@ Always indents header, and hide header leading starts so that no need type =#+ST (setq org-hide-emphasis-markers t) (setq org-html-validation-link nil) ;; open link when return clicked - (setq org-return-follows-link t)) + (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 @@ -736,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 @@ -760,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) @@ -834,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 @@ -1137,6 +1123,8 @@ extend org-mode's easy templates, refer to [[http://coldnew.github.io/coldnew-em ,#+OPTIONS: toc:nil\n")) (add-to-list 'org-structure-template-alist '("d" "#+BEGIN_SRC ditaa :file ? :cmdline -r -s 0.8 :cache yes \n\n#+END_SRC")) + (add-to-list 'org-structure-template-alist + '("u" "#+BEGIN_SRC plantuml :file ? \n\n#+END_SRC")) #+END_SRC @@ -1637,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 @@ -1952,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 @@ -1965,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 @@ -2102,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 @@ -3000,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) @@ -3469,7 +3486,25 @@ 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 + ;; (perspeen-mode) + ) + ;; super-i to switch to ith workspace + + (defmacro sd/define-keys (map key func &rest args) + "A macro to define multi keys " + `(define-key ,map ,key (lambda () (interactive) (,func ,@args)))) + + (with-eval-after-load "perspeen" + (dotimes (ii 9) + (sd/define-keys perspeen-mode-map (kbd (concat "s-" (number-to-string (+ ii 1)))) + perspeen-goto-ws (+ ii 1)))) +#+END_SRC * TODO todolist ** Rucket ** player video on iphone for