X-Git-Url: http://47.100.26.94:8080/?a=blobdiff_plain;f=emacs.d%2Fconfig.org;h=8e6bbe721899908d0da9ca132b86c8110676551b;hb=5c411170a6aebdf4fd123ab90e679b5552620221;hp=37bac28b772bda9567c5ba90c5e26d80dd921488;hpb=1bfc86966df77dbd77d923801891bb2d1a7572ca;p=dotfiles.git diff --git a/emacs.d/config.org b/emacs.d/config.org index 37bac28..8e6bbe7 100644 --- a/emacs.d/config.org +++ b/emacs.d/config.org @@ -8,29 +8,22 @@ Most config are just copied from [[https://github.com/howardabrams/dot-files][ho * Basic Settings ** Setting loading Path - Set system PATH and emacs exec path - #+BEGIN_SRC emacs-lisp :tangle yes :results silent - (setenv "PATH" (concat (getenv "PATH") ":" "/usr/local/bin" ":" "/Library/TeX/texbin")) (setq exec-path (append exec-path '("/usr/local/bin"))) (setq exec-path (append exec-path '("/Library/TeX/texbin/"))) - #+END_SRC Set the emacs load path - #+BEGIN_SRC emacs-lisp :tangle yes :results silent ;; (add-to-list 'load-path "~/.emacs.d/elisp") #+END_SRC ** Package Initialization - #+BEGIN_SRC emacs-lisp :tangle yes :results silent - (require 'package) (setq package-archives '(("mepla" . "http://melpa.milkbox.net/packages/") @@ -38,7 +31,6 @@ Set the emacs load path ("org" . "http://orgmode.org/elpa/"))) (package-initialize) - #+END_SRC ** General Setting @@ -109,7 +101,6 @@ Make a temp directory for all cache/history files #+END_SRC * Package Management Tools - ** Use-package Using [[https://github.com/jwiegley/use-package][use-package]] to manage emacs packages #+BEGIN_SRC emacs-lisp :tangle yes :results silent @@ -348,7 +339,6 @@ Enable rainbow mode in emacs lisp mode #+END_SRC * Mode-line - ** clean mode line clean mode line, Refer to [[https://www.masteringemacs.org/article/hiding-replacing-modeline-strings][Marstering Emacs]], some greek character see [[http://xahlee.info/math/math_unicode_greek.html][math_unicode_greek]] #+BEGIN_SRC emacs-lisp :tangle yes :results silent @@ -650,11 +640,8 @@ let helm windows split inside current window #+END_SRC * Org-mode Settings - ** Org-mode Basic setting - Always indents header, and hide header leading starts so that no need type =#+STATUP: indent= - #+BEGIN_SRC emacs-lisp :tangle yes :results silent (use-package org :ensure t @@ -676,6 +663,7 @@ Always indents header, and hide header leading starts so that no need type =#+ST (latex . t) (java . t) (ruby . t) + (lua . t) (lisp . t) (scheme . t) (sh . t) @@ -696,12 +684,14 @@ Always indents header, and hide header leading starts so that no need type =#+ST (unless (file-exists-p org-ditaa-jar-path) (error "seudut: ditaa.jar not found at %s " org-ditaa-jar-path)) + + ;; Lua support + (use-package ob-lua + :ensure t) #+END_SRC ** Org-bullets - use [[https://github.com/sabof/org-bullets][org-bullets]] package to show utf-8 charactes - #+BEGIN_SRC emacs-lisp :tangle yes :results silent (use-package org-bullets :ensure t @@ -717,12 +707,10 @@ use [[https://github.com/sabof/org-bullets][org-bullets]] package to show utf-8 #+END_SRC ** Worf Mode - [[https://github.com/abo-abo/worf][worf]] mode is an extension of vi-like binding for org-mode. In =worf-mode=, it is mapping =[=, =]= as =worf-backward= and =worf-forward= in global, wich cause we cannot input =[= and =]=, so here I unset this mappings. And redifined this two to =M-[= and =M-]=. see this [[https://github.com/abo-abo/worf/issues/19#issuecomment-223756599][issue]] - #+BEGIN_SRC emacs-lisp :tangle yes :results silent (use-package worf @@ -739,12 +727,9 @@ cause we cannot input =[= and =]=, so here I unset this mappings. And redifined #+END_SRC ** Get Things Done - Refer to [[http://doc.norang.ca/org-mode.html][Organize Your Life in Plain Text]] *** basic setup - standard key binding - #+BEGIN_SRC emacs-lisp :tangle yes :results silent (global-set-key "\C-cl" 'org-store-link) (global-set-key "\C-ca" 'org-agenda) @@ -752,9 +737,7 @@ standard key binding #+END_SRC *** Plain List - Replace the list bullet =-=, =+=, with =•=, a litter change based [[https://github.com/howardabrams/dot-files/blob/master/emacs-org.org][here]] - #+BEGIN_SRC emacs-lisp :tangle yes :results silent ;; (use-package org-mode ;; :init @@ -917,6 +900,8 @@ Setting agenda files and the agenda view ** Export PDF Install MacTex-basic [[http://www.tug.org/mactex/morepackages.html][MacTex-basic]] and some tex packages #+BEGIN_SRC sh + wget http://tug.org/cgi-bin/mactex-download/BasicTeX.pkg + sudo tlmgr update --self sudo tlmgr install titlesec framed threeparttable wrapfig multirow enumitem bbding titling tabu mdframed tcolorbox textpos import varwidth needspace tocloft ntheorem environ trimspaces collection-fontsrecommended capt-of @@ -997,19 +982,17 @@ Install MacTex-basic [[http://www.tug.org/mactex/morepackages.html][MacTex-basic #+END_SRC -** others - +** Org structure template extend org-mode's easy templates, refer to [[http://coldnew.github.io/coldnew-emacs/#orgheadline94][Extend org-modes' esay templates]] - #+BEGIN_SRC emacs-lisp :tangle yes :results silent - (add-to-list 'org-structure-template-alist '("E" "#+BEGIN_SRC emacs-lisp :tangle yes :results silent\n?\n#+END_SRC")) (add-to-list 'org-structure-template-alist - '("S" "#+BEGIN_SRC sh\n?\n#+END_SRC")) + '("S" "#+BEGIN_SRC sh :results output replace\n?\n#+END_SRC")) (add-to-list 'org-structure-template-alist '("p" "#+BEGIN_SRC plantuml :file uml.png \n?\n#+END_SRC")) - + (add-to-list 'org-structure-template-alist + '("P" "#+BEGIN_SRC perl \n?\n#+END_SRC")) #+END_SRC * Magit @@ -1123,7 +1106,6 @@ Toggle an eshell in split window below, refer [[http://www.howardism.org/Technic (exec-path-from-shell-initialize)) #+END_SRC -** TODO smart display * Misc Settings ** [[https://github.com/abo-abo/hydra][Hydra]] @@ -1263,68 +1245,50 @@ I like [[https://github.com/coldnew/linum-relative][linum-relative]], just like #+END_SRC ** Multi-term - #+BEGIN_SRC emacs-lisp :tangle yes :results silent - (use-package multi-term :ensure t) - #+END_SRC ** ace-link - [[https://github.com/abo-abo/ace-link][ace-link]] is a package written by [[https://github.com/abo-abo][Oleh Krehel]]. It is convenient to jump to link in help mode, info-mode, etc Type =o= to go to the link - #+BEGIN_SRC emacs-lisp :tangle yes :results silent - (use-package ace-link :ensure t :init (ace-link-setup-default)) - #+END_SRC ** Smart Parens - #+BEGIN_SRC emacs-lisp :tangle yes :results silent - (use-package smartparens :ensure t :config (progn (require 'smartparens-config) (add-hook 'prog-mode-hook 'smartparens-mode))) - #+END_SRC ** Ace-Windows - [[https://github.com/abo-abo/ace-window][ace-window]] - #+BEGIN_SRC emacs-lisp :tangle yes :results silent - (use-package ace-window :ensure t :defer t - ; :init - ; (global-set-key (kbd "M-o") 'ace-window) + ; :init + ; (global-set-key (kbd "M-o") 'ace-window) :config (setq aw-keys '(?a ?s ?d ?f ?j ?k ?l))) - #+END_SRC ** Which key - [[https://github.com/justbur/emacs-which-key][which-key]] show the key bindings - #+BEGIN_SRC emacs-lisp :tangle yes :results silent - (use-package which-key :ensure t :config (which-key-mode)) - #+END_SRC ** View only for some directory @@ -1382,9 +1346,6 @@ When see function by =C-h f=, and visit the source code, I would like the buffer (require 'info+)) #+END_SRC -** TODO bookmark - -** TODO Calendar ** advice info #+BEGIN_SRC emacs-lisp :tangle yes :results silent (defun sd/info-mode () @@ -1406,9 +1367,6 @@ When see function by =C-h f=, and visit the source code, I would like the buffer (sd/delete-current-window)) #+END_SRC -** TODO Man mode -Color for Man-mode - ** Demo It #+BEGIN_SRC emacs-lisp :tangle yes :results silent ;; (el-get-bundle howardabrams/demo-it) @@ -1472,6 +1430,23 @@ Color for Man-mode (add-hook 'help-mode-hook 'sd/help-mode-hook) #+END_SRC +** goto-last-change +#+BEGIN_SRC emacs-lisp :tangle yes :results silent + (use-package goto-last-change + :ensure t) +#+END_SRC + +** Ag +install =ag=, =the-silver-searcher= by homebrew on mac +#+BEGIN_SRC sh +brew install the-silver-searcher +#+END_SRC + +#+BEGIN_SRC emacs-lisp :tangle yes :results silent + (use-package ag + :ensure t) +#+END_SRC + * Dired ** Dired bindings =C-o= is defined as a global key for window operation, here unset it in dired mode @@ -1894,6 +1869,12 @@ irony-company (add-hook 'c-mode-hook 'google-set-c-style)) #+END_SRC +** Lua +#+BEGIN_SRC emacs-lisp :tangle yes :results silent + (use-package lua-mode + :ensure t) +#+END_SRC + * Compile Set the environments vairables in compilation mode #+BEGIN_SRC emacs-lisp :tangle yes :results silent @@ -2193,6 +2174,11 @@ See [[https://www.emacswiki.org/emacs/GnusWindowLayout][GnusWindowLayout]] #+END_SRC * Gnu Plot +Install =gnuplot= on Mac +#+BEGIN_SRC sh + brew install gnuplot --with-qt +#+END_SRC + To fix some issue that =toolbar-make-button-list= is void, see the [[https://github.com/bruceravel/gnuplot-mode/issues/31][issue]], here I set some variable as =nil= #+BEGIN_SRC emacs-lisp :tangle yes :results silent (use-package gnuplot @@ -2471,7 +2457,7 @@ Most use =C-o C-o= to switch buffers; =C-o x, v= to split window; =C-o o= to del ;; buffer / windows switch ("o" sd/toggle-max-windows "one" :exit t) ("C-k" sd/delete-current-window "del" :exit t) - ("D" (lambda () + ("C-d" (lambda () (interactive) (kill-buffer) (sd/delete-current-window)) @@ -2939,9 +2925,9 @@ stolen from [[https://github.com/mariolong/emacs.d/blob/f6a061594ef1b5d1f4750e9d - vision - mission -* TODO jump last change point - * TODO todolist ** rucket ** player video on iphone for ** SICP +** music searcher +search music on some music web site