+* Entertainment
+** GnuGo
+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
+
+** 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-directory (concat sd-temp-directory "emms"))
+ (setq emms-source-file-default-directory "~/Music/")
+ :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
+
+* Dictionary
+#+BEGIN_SRC emacs-lisp :tangle yes :results silent
+ (use-package bing-dict
+ :ensure t
+ :init
+ (global-set-key (kbd "s-d") 'bing-dict-brief)
+ :commands (bing-dict-brief))
+#+END_SRC
+
+* Project operations - =super=
+
+** Windown & Buffer - =C-o=
+Defind a =hydra= function for windows, buffer & bookmark operations. And map it to =C-o= globally.
+Most use =C-o C-o= to switch buffers; =C-o x, v= to split window; =C-o o= to delete other windows
+#+BEGIN_SRC emacs-lisp :tangle yes :results silent
+ (winner-mode 1)
+
+ (require 'utilities)
+ ;; (defhydra sd/hydra-window (:color red :columns nil)
+ ;; "C-o"
+ ;; ;; windows switch
+ ;; ("h" windmove-left nil :exit t)
+ ;; ("j" windmove-down nil :exit t)
+ ;; ("k" windmove-up nil :exit t)
+ ;; ("l" windmove-right nil :exit t)
+ ;; ("C-o" other-window nil :exit t)
+ ;; ;; window resize
+ ;; ("H" hydra-move-splitter-left nil)
+ ;; ("J" hydra-move-splitter-down nil)
+ ;; ("K" hydra-move-splitter-up nil)
+ ;; ("L" hydra-move-splitter-right nil)
+ ;; ;; windows split
+ ;; ("v" (lambda ()
+ ;; (interactive)
+ ;; (split-window-right)
+ ;; (windmove-right))
+ ;; nil :exit t)
+ ;; ("x" (lambda ()
+ ;; (interactive)
+ ;; (split-window-below)
+ ;; (windmove-down))
+ ;; nil :exit t)
+ ;; ;; buffer / windows switch
+ ;; ("o" sd/toggle-max-windows nil :exit t)
+ ;; ("C-k" sd/delete-current-window nil :exit t)
+ ;; ("C-d" (lambda ()
+ ;; (interactive)
+ ;; (kill-buffer)
+ ;; (sd/delete-current-window))
+ ;; nil :exit t)
+
+ ;; ;; ace-window
+ ;; ;; ("'" other-window "other" :exit t)
+ ;; ;; ("a" ace-window "ace")
+ ;; ("s" ace-swap-window nil)
+ ;; ("D" ace-delete-window nil :exit t)
+ ;; ;; ("i" ace-maximize-window "ace-one" :exit t)
+ ;; ;; Windows undo - redo
+ ;; ("u" (progn (winner-undo) (setq this-command 'winner-undo)) nil)
+ ;; ("r" (progn (winner-redo) (setq this-command 'winner-redo)) nil)
+
+ ;; ;; ibuffer, dired, eshell, bookmarks
+ ;; ;; ("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 nil :exit t)
+ ;; ;; ("C-t" projectile-persp-switch-project nil :exit t)
+
+ ;; ;; other special buffers
+ ;; ("d" sd/project-or-dired-jump nil :exit t)
+ ;; ("b" ibuffer nil :exit t)
+ ;; ("t" multi-term nil :exit t)
+ ;; ("e" sd/toggle-project-eshell nil :exit t)
+ ;; ("m" bookmark-jump-other-window nil :exit t)
+ ;; ("M" bookmark-set nil :exit t)
+ ;; ("g" magit-status nil :exit t)
+ ;; ;; ("p" paradox-list-packages nil :exit t)
+
+ ;; ;; quit
+ ;; ("q" nil nil)
+ ;; ("<ESC>" nil nil)
+ ;; ("C-h" windmove-left nil :exit t)
+ ;; ("C-j" windmove-down nil :exit t)
+ ;; ("C-k" windmove-up nil :exit t)
+ ;; ("C-l" windmove-right nil :exit t)
+ ;; ("C-;" nil nil :exit t)
+ ;; ("n" nil nil :exit t)
+ ;; ("[" nil nil :exit t)
+ ;; ("]" nil nil :exit t)
+ ;; ("f" nil nil))
+
+ ;; (global-unset-key (kbd "C-o"))
+ ;; (global-set-key (kbd "C-o") 'sd/hydra-window/body)
+
+ ;; (defun sd/project-or-dired-jump ()
+ ;; "If under project, jump to the root directory, otherwise
+ ;; jump to dired of current file"
+ ;; (interactive)
+ ;; (if (projectile-project-p)
+ ;; (projectile-dired)
+ ;; (dired-jump)))
+#+END_SRC
+
+Kill the help window and buffer when quit.
+#+BEGIN_SRC emacs-lisp :tangle yes :results silent
+ (with-eval-after-load "help-mode"
+ (define-key help-mode-map (kbd "q") (lambda ()
+ (interactive)
+ (quit-window t))))
+
+ (with-eval-after-load 'man
+ (set-face-attribute 'Man-overstrike nil :inherit 'bold :foreground "orange red")
+ (set-face-attribute 'Man-underline nil :inherit 'underline :foreground "forest green")
+ (define-key Man-mode-map (kbd "q") (lambda ()
+ (interactive)
+ (Man-kill))))
+
+
+ ;; (advice-add 'man :after (lambda (man-args) (other-window 1)))
+ (advice-add 'man :after (apply-partially 'other-window 1))
+
+
+ (require 'shell-command-output-mode)
+
+ (defun my/shell-command-after (command &optional output-buffer error-buffer)
+ (let* ((buffer (get-buffer "*Shell Command Output*"))
+ (window (get-buffer-window buffer)))
+ (if buffer (with-current-buffer buffer
+ (shell-command-output-mode)))
+ (if window
+ (select-window window))))
+
+ (advice-add 'shell-command :after 'my/shell-command-after)
+#+END_SRC
+
+** Motion
+
+*** Marks
+=C-<SPC>= set marks toggle the region
+=C-u C-<SPC>= Jump to the mark, repeated calls go further back the mark ring
+=C-x C-x= Exchanges the point and mark.