emacs - set custom.el file
[dotfiles.git] / emacs.d_2 / config.org
index 58e13b4..b087ec4 100644 (file)
@@ -64,6 +64,15 @@ Disable scroll bar, tool-bar and menu-bar
 
 #+END_SRC
 
+set custom file 
+
+#+BEGIN_SRC emacs-lisp :tangle yes :results silent 
+
+  (setq custom-file "~/.emacs.d/custom.el")
+  (load custom-file)
+
+#+END_SRC
+
 Switch the focus to help window when it appears
 
 #+BEGIN_SRC emacs-lisp :tangle yes :results silent
@@ -268,6 +277,28 @@ improve color for org-mode
 
 #+END_SRC
 
+** Rainbow-delimiter
+
+#+BEGIN_SRC emacs-lisp :tangle yes :results silent
+
+  (use-package rainbow-delimiters
+    :ensure t
+    :init
+    (add-hook 'prog-mode-hook #'rainbow-delimiters-mode))
+
+#+END_SRC
+
+** page-break-lines
+
+#+BEGIN_SRC emacs-lisp :tangle yes :results silent
+
+  (use-package page-break-lines
+    :ensure t
+    :config
+    (turn-on-page-break-lines-mode))
+
+#+END_SRC
+
 * Org-mode Settings
 
 ** Org-mode Basic setting
@@ -435,6 +466,31 @@ Install MacTex-basic and some tex packages
 
 #+END_SRC
 
+** others
+
+refer to [[http://coldnew.github.io/coldnew-emacs/#orgheadline94][fancy todo states]]
+
+#+BEGIN_SRC emacs-lisp :tangle yes :results silent
+
+  (setq org-todo-keywords '((sequence "☛ TODO(t)" "|" "✔ DONE(d)")
+                            (sequence "⚑ WAITING(w)" "|")
+                            (sequence "|" "✘ CANCELED(c)")))
+
+#+END_SRC
+
+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\n?\n#+END_SRC"))
+  (add-to-list 'org-structure-template-alist
+               '("S" "#+BEGIN_SRC sh\n?\n#+END_SRC"))
+  (add-to-list 'org-structure-template-alist
+               '("p" "#+BEGIN_SRC plantuml :file uml.png \n?\n#+END_SRC"))
+
+#+END_SRC
+
 * Magit
 
 [[https://github.com/magit/magit][Magit]] is a very cool git interface on Emacs.
@@ -637,11 +693,14 @@ Some global bindings on =Super=, on Mac, it is =Command=
 
   ;; (global-set-key (kbd "s-y") 'projectile-find-file)
   (global-set-key (kbd "s-f") 'projectile-find-file)
-  (global-set-key (kbd "s-[") 'next-buffer)
-  (global-set-key (kbd "s-]") 'previous-buffer)
+  (global-set-key (kbd "s-[") 'persp-next)
+  (global-set-key (kbd "s-]") 'persp-prev)
 
   (global-set-key (kbd "s-`") 'mode-line-other-buffer)
 
+  (global-set-key (kbd "s-n") 'persp-next)
+  (global-set-key (kbd "s-p") 'persp-prev)
+
 
 
   ;; someothers default mapping on super (command) key
@@ -816,16 +875,17 @@ Quickly start eshll in split window below, refer [[http://www.howardism.org/Tech
                        (file-name-directory (buffer-file-name))
                      default-directory))
            (height (/ (window-total-height) 3))
-           (name   (car (last (split-string parent "/" t)))))
+           (name   (car (last (split-string parent "/" t))))
+           (eshell-name (concat "*eshell: " name "*")))
       (split-window-vertically (- height))
       (other-window 1)
-      (if (get-buffer (concat "*eshell: " name "*"))
+      (if (get-buffer eshell-name)
           (progn
             (message "buffer exist")
-            (switch-to-buffer (concat "*eshell: " name "*")))
+            (switch-to-buffer eshell-name))
         (progn
           (eshell "new")
-          (rename-buffer (concat "*eshell: " name "*"))
+          (rename-buffer eshell-name)
 
           (insert (concat "ls"))
           (eshell-send-input)))))
@@ -836,8 +896,6 @@ Quickly start eshll in split window below, refer [[http://www.howardism.org/Tech
 
 #+END_SRC
 
-
-
 * Misc Settings
 
 ** [[https://github.com/abo-abo/hydra][Hydra]]
@@ -1084,7 +1142,7 @@ Type =o= to go to the link
     (persp-mode)
     :bind
     (:map projectile-mode-map
-          ("s-p" . projectile-persp-switch-project)))
+          ("s-t" . projectile-persp-switch-project)))
 
   ;; projectile-find-file
   ;; projectile-switch-buffer
@@ -1187,6 +1245,25 @@ Play Go in Emacs, gnugo xpm refert [[https://github.com/okanotor/dotemacs/blob/f
 
 #+END_SRC
 
+** Tabbar
+
+#+BEGIN_SRC emacs-lisp :tangle yes :results silent
+
+  ;; (use-package tabbar-ruler
+  ;;   :ensure t
+  ;;   :init
+  ;;   (setq tabbar-ruler-global-tabbar t)
+  ;;   (setq tabbar-ruler-global-ruler t)
+  ;;   (setq tabbar-ruler-popu-menu t)
+  ;;   (setq tabbar-ruler-popu-toolbar t)
+  ;;   (setq tabbar-use-images t)
+  ;;   :config
+  ;;   (tabbar-ruler-group-by-projectile-project)
+  ;;   (global-set-key (kbd "s-1") 'tabbar-forward-group)
+  ;;   (global-set-key (kbd "s-2") 'tabbar-ruler-forward))
+
+#+END_SRC
+
 * Programming
 
 ** Languages
@@ -1389,6 +1466,17 @@ company mode
 
 #+END_SRC
 
+[[https://github.com/company-mode/company-statistics][company-statistics]]
+
+#+BEGIN_SRC emacs-lisp :tangle yes :results silent
+
+  (use-package company-statistics
+    :ensure t
+    :config
+    (company-statistics-mode))
+
+#+END_SRC
+
 * Todo 
 
 - change M-o to trigger to delete other windows and restore previous config