emacs - gnugo support
[dotfiles.git] / emacs.d_2 / config.org
index 6c8ff38..8a07bec 100644 (file)
@@ -10,6 +10,15 @@ Most config are just copied from [[https://github.com/howardabrams/dot-files][ho
 
 ** 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"))
+  (setq exec-path (append exec-path '("/usr/local/bin")))
+
+#+END_SRC
+
 Set the emacs load path
 
 #+BEGIN_SRC emacs-lisp :tangle yes :results silent
@@ -20,16 +29,17 @@ Set the emacs load path
 
 ** 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
 
@@ -425,6 +435,14 @@ Use [[https://github.com/DarwinAwardWinner/ido-ubiquitous][ido-ubiquitous]] for
 
 * File and Buffer Operation
 
+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
 
 Use =ESC= to exit minibuffer. Also I map =Super-h= the same as =C-g=
@@ -542,6 +560,7 @@ I use the prefix =M-s= for searching in buffers
   (define-key isearch-mode-map (kbd "M-s") 'isearch-forward-regexp)
 
 #+END_SRC
+
 * Misc Settings
 
 
@@ -631,7 +650,9 @@ Refer [[https://github.com/abo-abo/hydra/blob/master/hydra-examples.el][hydra-ex
            (split-window-below)
            (windmove-down))
      "horz")
-    ("o" delete-other-windows "one" :exit t)
+    ;; ("o" delete-other-windows "one" :exit t)
+    ;; Todo define o to triggle delete others windows and restore windows layout
+    ("o" triggle-windows-max-size "maximize" :exit t)
     ("a" ace-window "ace")
     ("s" ace-swap-window "swap")
     ("d" ace-delete-window "ace-one" :exit t)
@@ -646,6 +667,12 @@ Refer [[https://github.com/abo-abo/hydra/blob/master/hydra-examples.el][hydra-ex
   (global-unset-key (kbd "M-o"))
   (global-set-key (kbd "M-o") 'sd/hydra-window/body)
 
+  (defun triggle-windows-max-size ()
+    (interactive)
+    (if (> (length (window-list)) 1)
+        (delete-other-windows)
+      (winner-undo)))
+
 #+END_SRC
 
 ** Line Number
@@ -785,6 +812,67 @@ Type =o= to go to the link
     (:map projectile-mode-map
           ("s-p" . projectile-persp-switch-project)))
 
+  ;; projectile-find-file
+  ;; projectile-switch-buffer
+  ;; projectile-find-file-other-window
+#+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
+
+** Emms
+
+We can use [[https://www.gnu.org/software/emms/quickstart.html][Emms]] for multimedia in Emacs
+
+#+BEGIN_SRC emacs-lisp :tangle yes :results silent
+
+  (use-package emms
+    :ensure t
+    :init
+    (setq emms-source-file-default-directory "~/Music/emms/")
+    :config
+    (emms-standard)
+    (emms-default-players)
+    (define-emms-simple-player mplayer '(file url)
+      (regexp-opt '(".ogg" ".mp3" ".mgp" ".wav" ".wmv" ".wma" ".ape"
+                    ".mov" ".avi" ".ogm" ".asf" ".mkv" ".divx" ".mpeg"
+                    "http://" "mms://" ".rm" ".rmvb" ".mp4" ".flac" ".vob"
+                    ".m4a" ".flv" ".ogv" ".pls"))
+      "mplayer" "-slave" "-quiet" "-really-quiet" "-fullscreen")
+    (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]]
+
+#+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