X-Git-Url: http://47.100.26.94:8080/?a=blobdiff_plain;f=emacs.d_2%2Fconfig.org;h=e1c9f8c5ee82ab5a7e17838d59d40761559222c5;hb=7a61db417646acfebe92d8fe62bce3b0a8733ac9;hp=aa1c91b1c822342750b032f8152a6724eb471b92;hpb=b377a1bbc8a823eb2410b50a6f7623c203522ae2;p=dotfiles.git diff --git a/emacs.d_2/config.org b/emacs.d_2/config.org index aa1c91b..e1c9f8c 100644 --- a/emacs.d_2/config.org +++ b/emacs.d_2/config.org @@ -14,8 +14,11 @@ Set system PATH and emacs exec path #+BEGIN_SRC emacs-lisp :tangle yes :results silent - (setenv "PATH" (concat (getenv "PATH") ":/usr/local/bin")) + (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 @@ -345,6 +348,92 @@ cause we cannot input =[= and =]=, so here I unset this mappings. And redifined ** Capture +** Export PDF + +Install MacTex-basic and some tex packages + +#+BEGIN_SRC bash + + 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 + +#+END_SRC + +#+BEGIN_SRC emacs-lisp :tangle yes :results silent + ;; ;; allow for export=>beamer by placing + + ;; http://emacs-fu.blogspot.com/2011/04/nice-looking-pdfs-with-org-mode-and.html + ;; #+LaTeX_CLASS: beamer in org files + (unless (boundp 'org-export-latex-classes) + (setq org-export-latex-classes nil)) + (add-to-list 'org-export-latex-classes + ;; beamer class, for presentations + '("beamer" + "\\documentclass[11pt]{beamer}\n + \\mode<{{{beamermode}}}>\n + \\usetheme{{{{beamertheme}}}}\n + \\usecolortheme{{{{beamercolortheme}}}}\n + \\beamertemplateballitem\n + \\setbeameroption{show notes} + \\usepackage[utf8]{inputenc}\n + \\usepackage[T1]{fontenc}\n + \\usepackage{hyperref}\n + \\usepackage{color} + \\usepackage{listings} + \\lstset{numbers=none,language=[ISO]C++,tabsize=4, + frame=single, + basicstyle=\\small, + showspaces=false,showstringspaces=false, + showtabs=false, + keywordstyle=\\color{blue}\\bfseries, + commentstyle=\\color{red}, + }\n + \\usepackage{verbatim}\n + \\institute{{{{beamerinstitute}}}}\n + \\subject{{{{beamersubject}}}}\n" + + ("\\section{%s}" . "\\section*{%s}") + + ("\\begin{frame}[fragile]\\frametitle{%s}" + "\\end{frame}" + "\\begin{frame}[fragile]\\frametitle{%s}" + "\\end{frame}"))) + + ;; letter class, for formal letters + + (add-to-list 'org-export-latex-classes + + '("letter" + "\\documentclass[11pt]{letter}\n + \\usepackage[utf8]{inputenc}\n + \\usepackage[T1]{fontenc}\n + \\usepackage{color}" + + ("\\section{%s}" . "\\section*{%s}") + ("\\subsection{%s}" . "\\subsection*{%s}") + ("\\subsubsection{%s}" . "\\subsubsection*{%s}") + ("\\paragraph{%s}" . "\\paragraph*{%s}") + ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))) + + + (require 'ox-md) + (require 'ox-beamer) + + (setq org-latex-pdf-process + '("pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f" + "pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f" + "pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f")) + + (setq TeX-parse-self t) + + (setq TeX-PDF-mode t) + (add-hook 'LaTeX-mode-hook + (lambda () + (LaTeX-math-mode) + (setq TeX-master t))) + +#+END_SRC * Magit [[https://github.com/magit/magit][Magit]] is a very cool git interface on Emacs. @@ -433,9 +522,22 @@ Use [[https://github.com/DarwinAwardWinner/ido-ubiquitous][ido-ubiquitous]] for #+END_SRC -* File and Buffer Operation +** Ido-exit-target + +[[https://github.com/waymondo/ido-exit-target][ido-exit-target]] let you open file/buffer on =other-windows= when call =ido-switch-buffer= + +#+BEGIN_SRC emacs-lisp :tangle yes :results silent + + (use-package ido-exit-target + :ensure t + :init + (define-key ido-common-completion-map (kbd "C-j") #'ido-exit-target-other-window)) + +#+END_SRC + +* Key bindings -Remove prefix =ESC=, refer [[http://emacs.stackexchange.com/questions/14755/how-to-remove-bindings-to-the-esc-prefix-key][here]] +** Remove prefix =ESC=, refer [[http://emacs.stackexchange.com/questions/14755/how-to-remove-bindings-to-the-esc-prefix-key][here]] #+BEGIN_SRC emacs-lisp :tangle yes :results silent @@ -474,6 +576,11 @@ Some global bindings on =Super=, on Mac, it is =Command= (global-set-key (kbd "s-h") 'keyboard-quit) (global-set-key (kbd "s-j") 'ido-switch-buffer) ;; s-k --> kill-this-buffer + (global-set-key (kbd "s-k") (lambda () + (interactive) + (if (> (length (window-list)) 1) + (delete-window) + (message "Only one Windows now!")))) ;; s-l --> goto-line ;; s-; --> ;; s-' --> 'next-multiframe-window