#+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
** Package Initialization
-#+BEGIN_SRC emacs-lisp :tangle yes
+#+BEGIN_SRC emacs-lisp :tangle yes :results silent
(require 'package)
(setq package-archives '(("mepla" . "http://melpa.milkbox.net/packages/")
+ ("gnu" . "http://elpa.gnu.org/packages/")
("org" . "http://orgmode.org/elpa/")))
(package-initialize)
-#+END_SRC
+#+END_SRC
** General Setting
** 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.
#+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-split-window-right)
+ (define-key ido-common-completion-map (kbd "C-l") #'ido-exit-target-split-window-below))
+
+#+END_SRC
+
+* Key bindings
+
+** 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
+
+ ;; (define-key key-translation-map (kbd "ESC") (kbd "C-g"))
+
+#+END_SRC
** Esc on Minibuffer
#+END_SRC
+
** =Super= bindings for file, buffer and windows
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
(global-set-key key keymap))
(global-set-key (kbd "M-s M-s") 'isearch-forward-regexp)
- (global-set-key (kbd "M-s M-r") 'isearch-forward-regexp)
+ (global-set-key (kbd "M-s M-r") 'isearch-backward-regexp)
- (define-key isearch-mode-map (kbd "M-s") 'isearch-forward-regexp)
+ (define-key isearch-mode-map "\M-s" 'isearch-repeat-forward)
+ (define-key isearch-mode-map "\M-r" 'isearch-repeat-backward)
+
+ ;; (global-set-key (kbd "M-s M-r") 'isearch-backward-regexp)
#+END_SRC
+
+
* Misc Settings
(emms-history-load))
#+END_SRC
+
+** GnoGo
+
+Play Go in Emacs, gnugo xpm refert [[https://github.com/okanotor/dotemacs/blob/f95b774cb292d1169748bc0a62ba647bbd8c0652/etc/my-inits/my-inits-gnugo.el][to here]]. start at image display mode and grid mode
+
+#+BEGIN_SRC emacs-lisp :tangle yes :results silent
+
+ (use-package gnugo
+ :ensure t
+ :defer t
+ :init
+ (require 'gnugo-imgen)
+ (setq gnugo-xpms 'gnugo-imgen-create-xpms)
+ (add-hook 'gnugo-start-game-hook '(lambda ()
+ (gnugo-image-display-mode)
+ (gnugo-grid-mode)))
+ :config
+ (add-to-list 'gnugo-option-history (format "--boardsize 19 --color black --level 1")))
+
+#+END_SRC
+
* Programming
** Languages
:diminish color-identifiers-mode)
+ (global-prettify-symbols-mode t)
+
#+END_SRC
**** Lispy Mode
* Todo
- change M-o to trigger to delete other windows and restore previous config
--
+