rename old emacs folder
authorPeng Li <seudut@gmail.com>
Wed, 22 Jun 2016 16:31:56 +0000 (00:31 +0800)
committerPeng Li <seudut@gmail.com>
Wed, 22 Jun 2016 16:31:56 +0000 (00:31 +0800)
74 files changed:
emacs.d/.gitignore [deleted file]
emacs.d/config/init-base.el [deleted file]
emacs.d/config/init-c-cpp.el [deleted file]
emacs.d/config/init-colo-theme2.el [deleted file]
emacs.d/config/init-color-theme-2.el [deleted file]
emacs.d/config/init-color-theme.el [deleted file]
emacs.d/config/init-elscreen.el [deleted file]
emacs.d/config/init-eshell.el [deleted file]
emacs.d/config/init-evil.el [deleted file]
emacs.d/config/init-font.el [deleted file]
emacs.d/config/init-ggtags.el [deleted file]
emacs.d/config/init-helm.el [deleted file]
emacs.d/config/init-hydra.el [deleted file]
emacs.d/config/init-ido.el [deleted file]
emacs.d/config/init-key-binding.el [deleted file]
emacs.d/config/init-linum.el [deleted file]
emacs.d/config/init-magit.el [deleted file]
emacs.d/config/init-minibuffer.el [deleted file]
emacs.d/config/init-mode-line.el [deleted file]
emacs.d/config/init-multi-term.el [deleted file]
emacs.d/config/init-org.el [deleted file]
emacs.d/config/init-perl.el [deleted file]
emacs.d/config/init-project.el [deleted file]
emacs.d/config/init-projectile.el [deleted file]
emacs.d/config/init-rencentf.el [deleted file]
emacs.d/config/init-test-minibufer.el [deleted file]
emacs.d/config/init-winner.el [deleted file]
emacs.d/config/init-workgroup2.el [deleted file]
emacs.d/config/my-packages.el [deleted file]
emacs.d/config/my-powerline.el [deleted file]
emacs.d/elisp/init-base.el [deleted file]
emacs.d/elisp/init-helm.el [deleted file]
emacs.d/elisp/init-hydra.el [deleted file]
emacs.d/elisp/init-magit.el [deleted file]
emacs.d/elisp/init-org.el [deleted file]
emacs.d/elisp/init-projectile.el [deleted file]
emacs.d/init.el [deleted file]
emacs.d_old/.gitignore [new file with mode: 0644]
emacs.d_old/config/init-base.el [new file with mode: 0644]
emacs.d_old/config/init-c-cpp.el [new file with mode: 0644]
emacs.d_old/config/init-colo-theme2.el [new file with mode: 0644]
emacs.d_old/config/init-color-theme-2.el [new file with mode: 0644]
emacs.d_old/config/init-color-theme.el [new file with mode: 0644]
emacs.d_old/config/init-elscreen.el [new file with mode: 0644]
emacs.d_old/config/init-eshell.el [new file with mode: 0644]
emacs.d_old/config/init-evil.el [new file with mode: 0644]
emacs.d_old/config/init-font.el [new file with mode: 0644]
emacs.d_old/config/init-ggtags.el [new file with mode: 0644]
emacs.d_old/config/init-helm.el [new file with mode: 0644]
emacs.d_old/config/init-hydra.el [new file with mode: 0644]
emacs.d_old/config/init-ido.el [new file with mode: 0644]
emacs.d_old/config/init-key-binding.el [new file with mode: 0644]
emacs.d_old/config/init-linum.el [new file with mode: 0644]
emacs.d_old/config/init-magit.el [new file with mode: 0644]
emacs.d_old/config/init-minibuffer.el [new file with mode: 0644]
emacs.d_old/config/init-mode-line.el [new file with mode: 0644]
emacs.d_old/config/init-multi-term.el [new file with mode: 0644]
emacs.d_old/config/init-org.el [new file with mode: 0644]
emacs.d_old/config/init-perl.el [new file with mode: 0644]
emacs.d_old/config/init-project.el [new file with mode: 0644]
emacs.d_old/config/init-projectile.el [new file with mode: 0644]
emacs.d_old/config/init-rencentf.el [new file with mode: 0644]
emacs.d_old/config/init-test-minibufer.el [new file with mode: 0644]
emacs.d_old/config/init-winner.el [new file with mode: 0644]
emacs.d_old/config/init-workgroup2.el [new file with mode: 0644]
emacs.d_old/config/my-packages.el [new file with mode: 0644]
emacs.d_old/config/my-powerline.el [new file with mode: 0644]
emacs.d_old/elisp/init-base.el [new file with mode: 0644]
emacs.d_old/elisp/init-helm.el [new file with mode: 0644]
emacs.d_old/elisp/init-hydra.el [new file with mode: 0644]
emacs.d_old/elisp/init-magit.el [new file with mode: 0644]
emacs.d_old/elisp/init-org.el [new file with mode: 0644]
emacs.d_old/elisp/init-projectile.el [new file with mode: 0644]
emacs.d_old/init.el [new file with mode: 0644]

diff --git a/emacs.d/.gitignore b/emacs.d/.gitignore
deleted file mode 100644 (file)
index 439af01..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-.*
-elpa/*
-games/*
-test/*
-vendor/*
-el-get/*
-auto-save-list/*
-ido.*
-smex-items
-ac-comphist.dat
-\#init.el\#
-url/*
-recentf
-projectile-bookmarks.eld
-config/init-my-theme-2.el
-config/my-color-theme.el
-\#*
-temp/*
-history
-irony/*
-projectile.cache
-site-lisp/*
-Emacs-PDE*
-helm-adaptive-history
-network-security.data
-custom.el
diff --git a/emacs.d/config/init-base.el b/emacs.d/config/init-base.el
deleted file mode 100644 (file)
index 8a5d6c8..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-(scroll-bar-mode -1)
-(tool-bar-mode -1)
-(menu-bar-mode -1)
-(add-to-list 'default-frame-alist '(width  . 120))
-(add-to-list 'default-frame-alist '(height . 40))
-(add-to-list 'default-frame-alist '(font . "Source Code Pro for Powerline-12:weight:light" ))
-;(add-to-list 'default-frame-alist '(font . "Source Code Pro for Powerline-12" ))
-
-(setq inhibit-startup-message t)
-
-(put 'set-goal-column 'disabled nil)
-(setq vc-follow-symlinks t)
-(setq visible-bell 1)
-(setq ring-bell-function 'ignore)
-(setq resize-mini-windows t)
-(blink-cursor-mode 0)
-
-;(custom-set-variables
-; '(fringe-mode (quote (0 . 0)) nil (fringe)))
-
-(fringe-mode (quote (0 . 0)))
-
-(add-to-list 'auto-mode-alist '("emacs\\'" . emacs-lisp-mode))
-
-
-
-;;; Set symbol for the border
-(set-display-table-slot standard-display-table
-                        'vertical-border 
-                        (make-glyph-code ?┃))
-
-(set-face-attribute 'vertical-border nil  :foreground "gray")
-
-(defalias 'yes-or-no-p 'y-or-n-p)
-
-(setq scroll-margin 5)
-(setq scroll-conservatively 10000)
-(show-paren-mode t)
-
-
-(add-hook 'help-mode-hook
-         (lambda ()
-           (linum-mode -1)))
-
-;; Dired mode
-(require 'dired+)
-;; create new file  key map
-(define-key dired-mode-map "c" 'find-file)
-;; ^ goto-up directory
-(define-key dired-mode-map (kbd "C-c C-u") 'dired-up-directory)
-
-(setq diredp-hide-details-initially-flag t)
-(setq diredp-hide-details-propagate-flag t)
-
-(setq term-buffer-maximum-size 10000)
-
-(provide 'init-base)
diff --git a/emacs.d/config/init-c-cpp.el b/emacs.d/config/init-c-cpp.el
deleted file mode 100644 (file)
index 8f0e945..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-
-
-;---------------------------------------------------------------------------------------
-;; irony-mode
-;;
-; set LD_LIBRARY_PATH 
-(setenv "LD_LIBRARY_PATH" "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/")
-; load irony-mode
-;( add-to-list 'load-path (expand-file-name "~/.emacs.d/irony-mode/elisp/"))
-(require 'irony)
-(add-hook 'c++-mode-hook 'irony-mode)
-(add-hook 'c-mode-hook 'irony-mode)
-(add-hook 'objc-mode-hook 'irony-mode)
-
-;; replace the `completion-at-point' and `complete-symbol' bindings in
-;; irony-mode's buffers by irony-mode's function
-(defun my-irony-mode-hook ()
-  (define-key irony-mode-map [remap completion-at-point]
-    'irony-completion-at-point-async)
-  (define-key irony-mode-map [remap complete-symbol]
-    'irony-completion-at-point-async))
-(add-hook 'irony-mode-hook 'my-irony-mode-hook)
-(add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options)
-
-
-;---------------------------------------------------------------------------------------
-;; auto-complete, yasnippt, auto-complete-c-headers, iedit
-;;
-;; c/c++ auto-complete, yasnippet, auto-complet-c-headers
-;;https://www.youtube.com/watch?v=HTUE03LnaXA&list=PL-mFLc7R_MJet8ItKipCtYc7PWoS5KTfM
-;; input TAB to 
-(require 'yasnippet)
-(yas-global-mode 1)
-
-;; auto-complete-c-headers
-(defun my:ac-c-header-init ()
-  (require 'auto-complete-c-headers)
-  (add-to-list 'ac-sources 'ac-source-c-headers)
-  (add-to-list 'achead:include-directories "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include")
-)
-(add-hook 'c++-mode-hook 'my:ac-c-header-init)
-(add-hook 'c-mode-hook 'my:ac-c-header-init)
-
-;;; iedit, fix iedit bug in Mac, C-c ; to trigger multiple cursor edit
-(define-key global-map (kbd "C-c ;") 'iedit-mode)
-
-
-;; flymake-google-cpplint-load
-;; define a function for flymake initialization
-;(defun my:flymake-google-init ()
-;  (require 'flymake-google-cpplint)
-;  (custom-set-variables
-;   '(flymake-google-cpplint-command "/usr/local/bin/cpplint"))
-;  (flymake-google-cpplint-load)
-;  )
-;(add-hook 'c-mode-hook 'my:flymake-google-init)
-;(add-hook 'c++-mode-hook 'my:flymake-google-init)
-
-;; start google-c-style with emacs
-;(require 'google-c-style)
-;(add-hook 'c-mode-hook 'google-set-c-style)
-;(add-hook 'c++-mode-hook 'google-make-newline-indent)
-
-
-
-;---------------------------------------------------------------------------------------
-;; cedet
-;;
-(semantic-mode 1)
-;; let's define a function which adds semantic as a suggestion backend to auto complete
-(defun my:add-semantic-to-autocomplete()
-  (add-to-list 'ac-sources 'ac-source-semantic)
-  )
-(add-hook 'c-mode-common-hook 'my:add-semantic-to-autocomplete)
-;; turn on ede mode
-(global-ede-mode 1)
-
-;(ede-cpp-root-project "my project" :file "~/demos/my_program/src/main.cpp"
-;                    :include-path '("/../my_inc"))
-;; you can use system-include-path for setting up the system header file locations.
-
-;; turn on automatic reparsing of open buffers in semantic
-(global-semantic-idle-scheduler-mode 1)
-(global-semantic-stickyfunc-mode 1)
-
-
-(provide 'init-c-cpp)
diff --git a/emacs.d/config/init-colo-theme2.el b/emacs.d/config/init-colo-theme2.el
deleted file mode 100644 (file)
index 3795b91..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-(require 'color-theme)
-
-(color-theme-sanityinc-tomorrow-bright)
-
-
-
-(provide 'init-color-theme-2)
diff --git a/emacs.d/config/init-color-theme-2.el b/emacs.d/config/init-color-theme-2.el
deleted file mode 100644 (file)
index ba4ca33..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-(require 'color-theme)
-
-(load-theme 'sanityinc-tomorrow-bright t)
-
-
-(provide 'init-color-theme-2)
diff --git a/emacs.d/config/init-color-theme.el b/emacs.d/config/init-color-theme.el
deleted file mode 100644 (file)
index 883e802..0000000
+++ /dev/null
@@ -1,330 +0,0 @@
-
-
-;(setq display-time-day-and-date t)
-;(display-time-mode t)
-
-
-(setq ns-use-srgb-colorspace nil)
-
-(require 'color-theme)
-
-(load-theme 'cyberpunk t)
-
-(require 'evil)
-(require 'powerline)
-;(require 'powerline-evil)
-
-
-
-;(set-face-attribute 'mode-line nil :font "Source Code Pro for Powerline-10")
-
-;;; this variable should equal as height in mode-line
-(custom-set-variables
- '(powerline-height 14)
- '(powerline-text-scale-factor 0.85)) ;; 100/140
-
-(custom-set-faces
-;;; '(mode-line ((t (:foreground "#030303" :background "#bdbdbd" :box nil :height 0.8 ))))
-;;; '(mode-line-inactive ((t (:foreground "#f9f9f9" :background "#666666" :box nil :height 0.8)))))
- '(mode-line ((t (:foreground "#030303" :background "#bdbdbd" :box nil  :family "Source Code Pro for Powerline" :height 100))))
-;; '(mode-line ((t (:foreground "#030303" :background "#bdbdbd" :box nil  :family "Source Code Pro for Powerline" :height 80))))
- '(mode-line-inactive ((t (:foreground "#f9f9f9" :background "#666666" :box nil :family "Source Code Pro for Powerline" :height 100)))))
-
-(defface powerline-active00 '((t (:foreground "#030303" :background "#bdbdbd" :box nil :inherit mode-line)))
-  "Powerline face 1."
-  :group 'powerline)
-
-(defface powerline-inactive00 '((t (:foreground "#f9f9f9" :background "#666666" :box nil :inherit mode-line)))
-  "Powerline face 1."
-  :group 'powerline)
-
-(defface powerline-active11 '((t (:background "grey22" :inherit mode-line)))
-  "Powerline face 1."
-  :group 'powerline)
-
-(defface powerline-active22 '((t (:background "grey40" :inherit mode-line)))
-  "Powerline face 2."
-  :group 'powerline)
-
-(defface powerline-inactive11   '((t (:background "grey11" :inherit mode-line)))
-  "Powerline face 1."
-  :group 'powerline)
-
-(defface powerline-inactive22   '((t (:background "grey20" :inherit mode-line)))
-  "Powerline face 2."
-  :group 'powerline)
-
-
-;(defface powerline-active-yel '((t (:background "yellow" :inherit mode-line)))
-(defface powerline-active-yel '((t (:background "yellow" :inherit mode-line)))
-  "Powerline face 1."
-  :group 'powerline)
-
-(defface powerline-active-blue '((t (:background "blue" :inherit mode-line)))
-  "Powerline face 1."
-  :group 'powerline)
-
-;;;---------------- evil powerline
-; https://github.com/raugturi/powerline-evil/blob/master/powerline-evil.el
-; ;https://github.com/laynor/emacs-conf/blob/master/packages/sm-package-powerline.el
-;(defface powerline-evil-base-face '((t (:foreground "white" :inherit mode-line)))
-;(defface powerline-evil-base-face '((t (:foreground "black" :weight bold )))
-(defface powerline-evil-base-face '((t (:foreground "black" :weight bold :inherit mode-line)))
-  "Base face for powerline evil faces."
-  :group 'powerline)
-
-(defface powerline-evil-normal-face '((t (:background "green" :inherit powerline-evil-base-face)))
-  "Powerline face for evil NORMAL state."
-  :group 'powerline)
-
-(defface powerline-evil-insert-face '((t (:background "blue" :inherit powerline-evil-base-face)))
-  "Powerline face for evil INSERT state."
-  :group 'powerline)
-
-(defface powerline-evil-visual-face '((t (:background "orange" :inherit powerline-evil-base-face)))
-  "Powerline face for evil VISUAL state."
-  :group 'powerline)
-
-(defface powerline-evil-operator-face   '((t (:background "cyan" :inherit powerline-evil-base-face)))
-  "Powerline face for evil OPERATOR state."
-  :group 'powerline)
-
-(defface powerline-evil-replace-face    '((t (:background "red" :inherit powerline-evil-base-face)))
-  "Powerline face for evil REPLACE state."
-  :group 'powerline)
-
-(defface powerline-evil-motion-face '((t (:background "magenta" :inherit powerline-evil-base-face)))
-  "Powerline face for evil MOTION state."
-  :group 'powerline)
-
-(defface powerline-evil-emacs-face  '((t (:background "violet" :inherit powerline-evil-base-face)))
-  "Powerline face for evil EMACS state."
-  :group 'powerline)
-
-(defun powerline-evil-face ()
-  "Function to select appropriate face based on `evil-state'."
-  (let* ((face (intern (concat "powerline-evil-" (symbol-name evil-state) "-face"))))
-    (if (facep face) face nil)))
-
-
-  (defun powerline-evil-face (active)
-    (let ((face (intern (concat "powerline-evil-" (symbol-name evil-state) "-face"))))
-      (cond ((and active (facep face))
-             face)
-            (active 'powerline-active22)
-            (t 'powerline-inactive22))))
-
-  (defun powerline-evil-face-22 (active)
-    (if (equal (symbol-name evil-state) "normal")
-
-        (let ((face (intern (concat "powerline-evil-emacs-face"))))
-          face)
-
-        (let ((face (intern (concat "powerline-evil-normal-face"))))
-          face)
-
-;;          (cond ((and active (facep face))
-;;                 face)
-;;                (active 'powerline-active22)
-;;                (t 'powerline-inactive22)))
-
-;;;;    (let ((face (intern (concat "powerline-evil-" (symbol-name evil-state) "-face"))))
-;;;;      (cond ((and active (facep face))
-;;;;             face)
-;;;;            (active 'powerline-active22)
-;;;;            (t 'powerline-inactive22)))
-    )
-    )
-
-
-
-  (defpowerline powerline-evil-tag
-    (concat " " (replace-regexp-in-string "[<> ]" "" (eval (evil-state-property evil-state :tag))) " "))
-
-
-
-
-
-;;
-;;http://emacser.com/mode-line.htm
-(defun get-lines-4-mode-line ()
-  (let ((lines (count-lines (point-min) (point-max))))
-    (concat (propertize
-             (format "%d" lines)
-             'mouse-face 'mode-line-highlight
-             'face 'mode-line-lines-face
-             'help-echo (format "%d lines" lines)) " ")))
-
-
-
-(defun powerline-simpler-vc-mode (s)
-  (if s
-      (replace-regexp-in-string "Git:" "" s)
-    s))
-
-(defun powerline-simpler-minor-display (s)
-  (replace-regexp-in-string
-   (concat " "
-           (mapconcat 'identity '("Undo-Tree" "GitGutter" "Projectile"
-                                  "Abbrev" "ColorIds" "MRev" "ElDoc" "Paredit"
-                                  "+1" "+2" "FlyC" "Fly" ;; ":1/0"
-                                  "Fill" "AC" "FIC") "\\|")) "" s))
-
-(defun powerline-format-default-directory (s)
-  (if s
-    (replace-regexp-in-string "/Users/peli3/"  "~/" s)
-    s))
-
-(defun powerline-evil-tag-new ()
-  (concat (replace-regexp-in-string "[<>]" "" (powerline-evil-tag)) " ")
-  )
-
-;; -----------------------------------------------------------------------------
-
-;; -----------------------------------------------------------------------------
-;; |evil| buffer_name | major-mode | vc |            | position | pwd | time |
-;; -----------------------------------------------------------------------------
-;;
-;; ToDo:
-;; position and pwd only shows in some mode, such as programming mode
-;; using workgroup instead of pwd
-;; some other modes such as eshell, package, help, don't need the posittion and
-;; pwd
-;;
-
-;; -----------------------------------------------------------------------------
-
-(defun powerline-ha-theme ()
-  "A powerline theme that removes many minor-modes that don't serve much purpose on the mode-line."
-  (interactive)
-  (setq-default mode-line-format
-                '("%e"
-                  (:eval
-                   (let*
-                       ((active
-                         (powerline-selected-window-active))
-                        (mode-line
-                         (if active 'powerline-active00 'powerline-inactive00))
-                        (face1
-                         (if active 'powerline-active11 'powerline-inactive11))
-                        (face2
-                         (if active 'powerline-active22 'powerline-inactive22))
-                        (face-yel
-                         (if active 'powerline-active-yel 'powerline-inactive22))
-                        (face-blue
-                         (if active 'powerline-active-blue 'powerline-inactive22))
-                        (pl-evil-face (ignore-errors (powerline-evil-face active)))
-                        (pppp-face
-                           (intern (concat "powerline-evil-" (symbol-name evil-state) "-face")))
-
-                        (face-yel22
-                         (if active 'powerline-active-yel 'powerline-inactive22))
-                        (separator-left
-                         (intern
-                          (format "powerline-%s-%s" powerline-default-separator
-                                  (car powerline-default-separator-dir))))
-                        (separator-right
-                         (intern
-                          (format "powerline-%s-%s" powerline-default-separator
-                                  (cdr powerline-default-separator-dir))))
-                        (lhs
-                            (list
-;;                                (let ((evil-face (powerline-evil-face)))
-;;                                    (if evil-mode
-;;                                            (powerline-raw (powerline-evil-tag) evil-face)
-;;                                    )
-;;
-;;                                )
-                                (if evil-mode
-                                (powerline-raw (powerline-evil-tag) pl-evil-face))
-;;;                                (and evil-mode (funcall separator-left pppp-face face-yel))
-;;;;;;                                (funcall separator-left pppp-face pppp-face)
-;;;;                                (powerline-raw (powerline-evil-tag) pppp-face face-yel)
-;;                                (funcall separator-left (powerline-evil-face) face-yel)
-
-                                (powerline-raw "%*" face-yel 'l)
-                                (powerline-buffer-id face-yel 'l)
-                                (powerline-raw " " face-yel)
-                                (funcall separator-left face-yel face-blue )
-                                               (powerline-raw " " face-blue)
-                                (powerline-major-mode face-blue 'r)
-                                (funcall separator-left face-blue mode-line)
-                                (powerline-narrow mode-line 'l)
-;                                (powerline-vc mode-line 'r)
-                                (powerline-simpler-vc-mode (powerline-vc mode-line 'r))
-                                (funcall separator-left mode-line face1)))
-;                                (powerline-simpler-vc-mode (powerline-vc face2))))
-                       
-                        (rhs
-                            (list
-                                (funcall separator-right face1 mode-line)
-                               ;;  position
-;;                             (powerline-raw (concat " [" (powerline-format-default-directory default-directory) "] ") mode-line)
-                                (powerline-raw (format " P:[%s] " (projectile-project-name))  mode-line)
-                                               (funcall separator-right mode-line face-blue)
-                               ;; pwd/workgroups
-                                (powerline-raw (concat "%3c, %l/" (format "%d" (count-lines (point-min) (point-max))) " %4p ") face-blue)
-;                                              (funcall separator-right face-blue face1)
-                                ;; date and time
-;;;                                        (powerline-raw (format-time-string " %m-%d") face1 'r)
-                                (funcall separator-right face-blue face-yel)
-                                           (powerline-raw (format-time-string " %I:%M %p %m-%d %a ") face-yel 'r)))
-                        (center
-                            (list
-                                (powerline-raw " " face1)
-                                (funcall separator-left face1 face2)
-                                (when
-                                    (boundp 'erc-modified-channels-object)
-                                (powerline-raw erc-modified-channels-object face2 'l))
-                                (powerline-major-mode face2 'l)
-                                (powerline-process face2)
-                                (powerline-raw " :" face2)
-
-                                (powerline-simpler-minor-display (powerline-minor-modes face2 'l))
-
-                                (powerline-raw " " face2)
-                                (funcall separator-right face2 face1))))
-
-
-                     (concat
-                      (powerline-render lhs)
-                      (powerline-fill face1
-                                      (powerline-width rhs))
-                      (powerline-render rhs))
-                     ); let
-                   ); :eval
-                  ); '(
-                ); setq
-  ); defun
-
-
-(powerline-ha-theme)
-
-
-
-;;(let ((faces '(mode-line
-;;               powerline-active00
-;;               powerline-active11
-;;               powerline-active22
-;;               powerline-active-yel
-;;               powerline-active-blue
-;;               mode-line-buffer-id
-;;               mode-line-emphasis
-;;               mode-line-highlight
-;;               mode-line-inactive)))
-;;     (mapc
-;;;      (lambda (face) (set-face-attribute face nil :font "Source Code Pro for Powerline-10"))
-;;      (lambda (face) (set-face-attribute face nil :font "Courier"))
-;;      faces))
-
-
-
-(provide 'init-color-theme)
-
-
-
-;; TODO
-;; 1. change color when buffer is modified
-;; 2. 
-;; show date and time in the right below minibuffer
-
diff --git a/emacs.d/config/init-elscreen.el b/emacs.d/config/init-elscreen.el
deleted file mode 100644 (file)
index 3edbacf..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-;; this config file is based on  seudut/elscreen.git, which added two interface and one property 
-;; default directory
-
-(elscreen-set-default-directory (elscreen-get-current-screen) "~/")
-
-
-;; tab face
-
-(custom-set-faces
- '(elscreen-tab-current-screen-face ((t (:background "Yellow" :foreground "black"))))
- '(elscreen-tab-other-screen-face ((t (:background "gray22" :foreground "black")))))
-
-;;(add-hook 'elscreen-create-hook
-;;          (lambda ()
-;;            (elscreen-set-default-directory  
-;;              (elscreen-get-current-screen) "~/")))
-
-
-(add-hook 'elscreen-goto-hook
-          (lambda ()
-            (elscreen-cd-default-directory
-              (elscreen-get-default-directory (elscreen-get-current-screen)))))
-
-(defun sd-cd-dd (dir)
-  "Set default directory screen."
-  (interactive "sSet dir:")
-  (elscreen-set-default-directory (elscreen-get-current-screen) dir)
-  (cd dir)
-)
-
-    
-(defun sd-show-dir ()
-  "show elscreen default directory."
-  (interactive)
-  (message
-  (elscreen-get-default-directory (elscreen-get-current-screen))))
-
-(defun sd-update-elscreen-dir ()
-  "update elscreen dir as current default directory"
-  (interactive)
-  (elscreen-set-default-directory (elscreen-get-current-screen) default-directory))
-
-
-
-
-;;(add-hook 'buffer-list-update-hook
-;;          (lambda ()
-;;            (let ((el-dir (elscreen-get-default-directory (elscreen-get-current-screen))))
-;;              (if (> (length el-dir) 0)
-;;                 (cd el-dir)))))
-
-(defvar elscreen-exclude-modes '(eshell-mode magit magit-status-mode magit-commit-mode magit-diff-mode) "the major modes don't update directory")
-
-;; when major-mode is magit-*, don't change default-directory, otherwise, there is error when usingit command in magin-* mode
-(add-hook 'elscreen-screen-update-hook
-          (lambda ()
-            (let ((el-dir (elscreen-get-default-directory (elscreen-get-current-screen))))
-             (unless (member  major-mode elscreen-exclude-modes)
-                (if (> (length el-dir) 0)
-                  (cd el-dir))))))
-
-
-
-
-
-;; elscreen should be placed begin of https://github.com/knu/elscreen/issues/6
-;(elscreen-start)
-;(require 'init-elscreen)
-;(require 'elscreen)
-;(custom-set-faces
-; '(elscreen-tab-current-screen-face ((t (:background "Yellow" :foreground "black"))))
-; '(elscreen-tab-other-screen-face ((t (:background "gray22" :foreground "black")))))
-
-
-
-
-
-(provide 'init-elscreen)
diff --git a/emacs.d/config/init-eshell.el b/emacs.d/config/init-eshell.el
deleted file mode 100644 (file)
index 0193ee7..0000000
+++ /dev/null
@@ -1,194 +0,0 @@
-
-;;(add-hook 'eshell-mode-hook
-;;       (lambda ()
-;;         (linum-mode -1)
-;;         (highlight-current-line-on nil)))
-
-(setenv "PATH"
-        (concat
-         "/usr/local/bin:/usr/local/sbin:"
-         (getenv "PATH")))
-
-(setq eshell-scroll-to-bottom-on-input t)
-
-
-;; copied from howardabrams's config
-(defun eshell/gst (&rest args)
-    (magit-status (pop args) nil)
-    (eshell/echo))  
-
-
-
-(add-hook 'eshell-mode-hook
-   (lambda ()
-      (add-to-list 'eshell-visual-commands "ssh")
-      (add-to-list 'eshell-visual-commands "tail")))
-
-; copied from howard's github
-(defun curr-dir-git-branch-string (pwd)
-  "Returns current git branch as a string, or the empty string if
-PWD is not in a git repo (or the git command is not found)."
-  (interactive)
-  (when (and (eshell-search-path "git")
-             (locate-dominating-file pwd ".git"))
-    (let ((git-output (shell-command-to-string (concat "cd " pwd " && git branch | grep '\\*' | sed -e 's/^\\* //'"))))
-      (if (> (length git-output) 0)
-          (concat " :" (substring git-output 0 -1))
-        "(no branch)"))))
-
-
-
-
-(defun pwd-replace-home (pwd)
-  "Replace home in PWD with tilde (~) character."
-  (interactive)
-  (let* ((home (expand-file-name (getenv "HOME")))
-         (home-len (length home)))
-    (if (and
-         (>= (length pwd) home-len)
-         (equal home (substring pwd 0 home-len)))
-        (concat "~" (substring pwd home-len))
-      pwd)))
-
-
-
-
-(defun pwd-shorten-dirs (pwd)
-  "Shorten all directory names in PWD except the last two."
-  (let ((p-lst (split-string pwd "/")))
-    (if (> (length p-lst) 2)
-        (concat
-         (mapconcat (lambda (elm) (if (zerop (length elm)) ""
-                               (substring elm 0 1)))
-                    (butlast p-lst 2)
-                    "/")
-         "/"
-         (mapconcat (lambda (elm) elm)
-                    (last p-lst 2)
-                    "/"))
-      pwd  ;; Otherwise, we just return the PWD
-      )))
-
-;; Turn off the default prompt.
-(setq eshell-highlight-prompt nil)
-
-
-
-
-(defun split-directory-prompt (directory)
-  (if (string-match-p ".*/.*" directory)
-      (list (file-name-directory directory) (file-name-base directory))
-    (list "" directory)))
-
-
-(setq eshell-prompt-function
-      (lambda ()
-        (let* ((directory (split-directory-prompt (pwd-shorten-dirs (pwd-replace-home (eshell/pwd)))))
-               (parent (car directory))
-               (name (cadr directory))
-               (branch (or (curr-dir-git-branch-string (eshell/pwd)) "")))
-
-          (if (eq 'dark (frame-parameter nil 'background-mode))
-              (concat   ;; Prompt for Dark Themes
-               (propertize parent 'face `(:foreground "#8888FF"))
-               (propertize name   'face `(:foreground "#8888FF" :weight bold))
-               (propertize branch 'face `(:foreground "green"))
-               (propertize " $"   'face `(:weight ultra-bold))
-               (propertize " "    'face `(:weight bold)))
-
-            (concat    ;; Prompt for Light Themes
-             (propertize parent 'face `(:foreground "blue"))
-             (propertize name   'face `(:foreground "blue" :weight bold))
-             (propertize branch 'face `(:foreground "dark green"))
-             (propertize " $"   'face `(:weight ultra-bold))
-             (propertize " "    'face `(:weight bold)))))))
-
-
-
-(setq eshell-highlight-prompt nil)
-
-
-
-(when (require 'esh-buf-stack nil t)
-  (setup-eshell-buf-stack)
-  (add-hook 'eshell-mode-hook
-            (lambda () (local-set-key (kbd "M-q") 'eshell-push-command))))
-
-(defun eshell/x ()
-  "Closes the EShell session and gets rid of the EShell window."
-  (kill-buffer)
-  (delete-window))
-
-
-(defun eshell-here ()
-  "Opens up a new shell in the directory associated with the
-current buffer's file. The eshell is renamed to match that
-directory to make multiple eshell windows easier."
-  (interactive)
-  (let* ((parent (if (buffer-file-name)
-                     (file-name-directory (buffer-file-name))
-                   default-directory))
-         (height (/ (window-total-height) 3))
-         (name   (car (last (split-string parent "/" t)))))
-    (split-window-vertically (- height))
-    (other-window 1)
-    (eshell "new")
-    (rename-buffer (concat "*eshell: " name "*"))
-
-    (insert (concat "ls"))
-    (eshell-send-input)))
-
-(global-set-key (kbd "C-!") 'eshell-here)
-
-
-
-(add-hook 'eshell-mode-hook
-     (lambda ()
-       (local-set-key (kbd "M-P") 'eshell-previous-prompt)
-       (local-set-key (kbd "M-N") 'eshell-next-prompt)
-       (local-set-key (kbd "M-R") 'eshell-list-history)
-       (local-set-key (kbd "M-r")
-              (lambda ()
-                (interactive)
-                (insert
-                 (ido-completing-read "Eshell history: "
-                                      (delete-dups
-                                       (ring-elements eshell-history-ring))))))))
-
-
-
-
-(require 'em-smart)
-(setq eshell-where-to-jump 'begin)
-(setq eshell-review-quick-commands nil)
-(setq eshell-smart-space-goes-to-end t)
-
-
-
-(defun execute-command-on-file-buffer (cmd)
-  (interactive "sCommand to execute: ")
-  (let* ((file-name (buffer-file-name))
-         (full-cmd (concat cmd " " file-name)))
-    (shell-command full-cmd)))
-
-(defun execute-command-on-file-directory (cmd)
-  (interactive "sCommand to execute: ")
-  (let* ((dir-name (file-name-directory (buffer-file-name)))
-         (full-cmd (concat "cd " dir-name "; " cmd)))
-    (shell-command full-cmd)))
-
-(global-set-key (kbd "A-1") 'execute-command-on-file-buffer)
-(global-set-key (kbd "A-!") 'execute-command-on-file-directory)
-
-
-
-
-
-;; alias
-
-(defalias 'e 'find-file)
-(defalias 'ee 'find-file-other-window)
-
-
-
-(provide 'init-eshell)
diff --git a/emacs.d/config/init-evil.el b/emacs.d/config/init-evil.el
deleted file mode 100644 (file)
index 3e7856e..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-
-;;---------------------------------------------------------------------------------------
-;; evil
-;;
-
-(require 'evil)
-
-(defalias 'evil-insert-state 'evil-emacs-state)
-
-;;https://github.com/toumorokoshi/yt.rc/blob/master/emacs/my-evil.el
-(define-key evil-visual-state-map "\C-w" nil)
-;(define-key evil-normal-state-map (kbd "M-.") nil)
-(define-key evil-normal-state-map "\C-t" nil)
-(define-key evil-normal-state-map "\C-p" nil)
-(define-key evil-normal-state-map "\C-n" nil)
-(define-key evil-normal-state-map "\C-k" nil)
-(define-key evil-normal-state-map "\C-l" nil)
-(define-key evil-normal-state-map "\C-k" nil)
-(define-key evil-normal-state-map "\C-j" nil)
-(define-key evil-normal-state-map "\C-o" nil)
-
-
-;; M-e not works correctly in evil-normal mode, this fix it
-(define-key evil-normal-state-map "\M-e" (lambda() (interactive)
-                                          (forward-sentence 2)))
-(define-key evil-motion-state-map "\C-e" (move-end-of-line 1))
-
-
-;; most common keys in normal-mode to swith buffer, project, windows,
-;; in emacs mode, Esc + s + x, the same
-(global-evil-leader-mode)
-(evil-leader/set-leader "s")
-(evil-leader/set-key "j" 'pl-switch-buffers)
-(evil-leader/set-key "h" 'persp-switch)
-(evil-leader/set-key "k" 'helm-cmd-t)
-(evil-leader/set-key "b" 'helm-mini)
-(evil-leader/set-key "m" 'helm-mini)
-
-
-(setq key-chord-two-keys-delay 0.5)
-(key-chord-define evil-insert-state-map "jj" 'evil-normal-state)
-(key-chord-define evil-emacs-state-map "jj" 'evil-normal-state)
-
-(key-chord-define evil-normal-state-map ";s" 'split-window-below)
-(key-chord-define evil-normal-state-map ";v" 'split-window-right)
-
-(key-chord-mode 1)
-
-(define-key evil-normal-state-map [escape] 'keyboard-quit)
-(define-key evil-visual-state-map [escape] 'keyboard-quit)
-
-(setq evil-emacs-state-cursor '("red" box))
-(setq evil-normal-state-cursor '("green" box))
-(setq evil-visual-state-cursor '("orange" box))
-(setq evil-insert-state-cursor '("red" bar))
-(setq evil-replace-state-cursor '("red" bar))
-(setq evil-operator-state-cursor '("red" hollow))
-(loop for (mode . state) in '(
-                  (nrepl-mode . insert)
-                  (pylookup-mode . emacs)
-                  (comint-mode . normal)
-                  (shell-mode . emacs)
-                  (git-commit-mode . emacs)
-                  (git-rebase-mode . emacs)
-                  (term-mode . emacs)
-                  (help-mode . emacs)
-                  (helm-grep-mode . emacs)
-                  (grep-mode . emacs)
-                  (bc-menu-mode . emacs)
-                  (magit-branch-manager-mode . emacs)
-                  (magit-popup-mode . emacs)
-                  (rdictcc-buffer-mode . emacs)
-                  (dired-mode . emacs)
-                  (text-mode . emacs)
-                  (wdired-mode . normal)
-;                          (inferior-emacs-lisp-mode . emacs)
-;                          (wdired-mode . normal)
-                           (eshell-mode . emacs))
-    do (evil-set-initial-state mode state))
-
-
-;(global-evil-tabs-mode t)
-(evil-mode 1)
-
-(provide 'init-evil)
diff --git a/emacs.d/config/init-font.el b/emacs.d/config/init-font.el
deleted file mode 100644 (file)
index 9e41fc2..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-
-;; http://coldnew.github.io/blog/2013/11/16_d2f3a.html
-(defvar emacs-english-font "Source Code Pro for Powerline:weigth:light"
-  "The font name of English.")
-
-(defvar emacs-cjk-font "Heiti SC"
-  "The font name for CJK.")
-
-
-(defvar emacs-font-size-pair '(12 . 14)
-  "Default font size pair for (english . chinese)")
-
-(defvar emacs-font-size-pair-list
-  '(( 5 .  6) (10 . 12) (12 . 14)
-    (13 . 16) (15 . 18) (17 . 20)
-    (19 . 22) (20 . 24) (21 . 26)
-    (24 . 28) (26 . 32) (28 . 34)
-    (30 . 36) (34 . 40) (36 . 44))
-  "This list is used to store matching (englis . chinese) font-size.")
-
-
-(defun font-exist-p (fontname)
-  "Test if this font is exist or not."
-  (if (or (not fontname) (string= fontname ""))
-      nil
-    (if (not (x-list-fonts fontname)) nil t)))
-
-(defun set-font (english chinese size-pair)
-  "Setup emacs English and Chinese font on x window-system."
-
-  (if (font-exist-p english)
-      (set-frame-font (format "%s:pixelsize=%d" english (car size-pair)) t))
-
-  (if (font-exist-p chinese)
-      (dolist (charset '(kana han symbol cjk-misc bopomofo))
-        (set-fontset-font (frame-parameter nil 'font) charset
-                          (font-spec :family chinese :size (cdr size-pair))))))
-
-
-;; Setup font size based on emacs-font-size-pair
-;(if (display-graphic-p)
-;    (set-font emacs-english-font emacs-cjk-font emacs-font-size-pair))
-
-
-(defun emacs-step-font-size (step)
-  "Increase/Decrease emacs's font size."
-  (let ((scale-steps emacs-font-size-pair-list))
-    (if (< step 0) (setq scale-steps (reverse scale-steps)))
-    (setq emacs-font-size-pair
-          (or (cadr (member emacs-font-size-pair scale-steps))
-              emacs-font-size-pair))
-    (when emacs-font-size-pair
-      (message "emacs font size set to %.1f" (car emacs-font-size-pair))
-      (set-font emacs-english-font emacs-cjk-font emacs-font-size-pair))))
-
-
-(defun increase-emacs-font-size ()
-  "Decrease emacs's font-size acording emacs-font-size-pair-list."
-  (interactive) (emacs-step-font-size 1))
-
-(defun decrease-emacs-font-size ()
-  "Increase emacs's font-size acording emacs-font-size-pair-list."
-  (interactive) (emacs-step-font-size -1))
-
-
-;(global-set-key (kbd "C-=") 'increase-emacs-font-size)
-;(global-set-key (kbd "C--") 'decrease-emacs-font-size)
-
-(global-set-key (kbd "C-=") 'text-scale-increase)
-(global-set-key (kbd "C--") 'text-scale-decrease)
-
-
-
-(provide 'init-font)
diff --git a/emacs.d/config/init-ggtags.el b/emacs.d/config/init-ggtags.el
deleted file mode 100644 (file)
index d109e68..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-
-;;;; show default directory on mode-line
-(ggtags-mode 1)
-
-;;;; using ido-completion for ggtags
-;;;; https://github.com/leoliu/ggtags/issues/56
-;;(setq ggtags-completing-read-function
-;;      (lambda (&rest args)
-;;        (apply #'ido-completing-read
-;;               (car args)
-;;               (all-completions "" ggtags-completion-table)
-;;               (cddr args))))
-
-(custom-set-variables
- '(ggtags-split-window-function (quote split-window-vertically)))
-
-
-(setq-local imenu-create-index-function #'ggtags-build-imenu-index)
-
-
-; gnu global support
-(require 'semantic/db)
-(global-semanticdb-minor-mode 1)
-
-(provide 'init-ggtags)
diff --git a/emacs.d/config/init-helm.el b/emacs.d/config/init-helm.el
deleted file mode 100644 (file)
index 316aeb6..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-
-(require 'helm)
-(require 'helm-config)
-
-
-
-;(require 'helm-adaptive)
-(helm-mode 1)
-
-;; helm-M-x
-(global-set-key (kbd "M-x") 'helm-M-x)
-(setq helm-M-x-fuzzy-match t) ;; optional fuzzy matching for helm-M-x
-
-;; helm-mini
-;;(global-set-key (kbd "C-x b") 'helm-mini)
-;;(global-set-key (kbd "C-o C-j") 'helm-mini)
-(setq helm-buffers-fuzzy-matching t
-      helm-recentf-fuzzy-match    t)
-
-;; helm-find-file
-;(global-set-key (kbd "C-x C-f") 'helm-find-files)
-;;(global-set-key (kbd "C-o C-f") 'helm-find-files)
-
-(setq helm-candidate-number-limit 30)
-
-;; http://stackoverflow.com/questions/9992475/how-to-show-anything-buffers-always-in-new-window
-(setq helm-display-function
-      (lambda (buf)
-        (split-window-vertically)
-        (other-window 1)
-        (switch-to-buffer buf)))
-
-
-;;;;;;; http://tuhdo.github.io/helm-intro.html
-;;;;;(setq helm-split-window-in-side-p           t ; open helm buffer inside current window, not occupy whole other window
-;;;;;      helm-move-to-line-cycle-in-source     t ; move to end or beginning of source when reaching top or bottom of source.
-;;;;;      helm-ff-search-library-in-sexp        t ; search for library in `require' and `declare-function' sexp.
-;;;;;      helm-scroll-amount                    8 ; scroll 8 lines other window using M-<next>/M-<prior>
-;;;;;      helm-ff-file-name-history-use-recentf t)
-
-
-
-(helm-autoresize-mode 1)
-(helm-adaptive-mode 1)
-(helm-adaptative-mode 1)
-(setq helm-adaptive-history 1)
-
-
-;;j;(defun helm-buffer-face-mode ()
-;;j;  "Helm buffer face"
-;;j;  (interactive)
-;;j;  (with-helm-buffer ;;j;  (setq line-spacing 2)
-;;j;  (buffer-face-set '(:family "Source Code Pro" :height 100))))
-                                                             
-
-;;;(add-hook 'helm-update-hook 'helm-buffer-face-mode)
-
-(require 'helm-cmd-t)
-(require 'helm-C-x-b)
-
-(provide 'init-helm)
diff --git a/emacs.d/config/init-hydra.el b/emacs.d/config/init-hydra.el
deleted file mode 100644 (file)
index 2f8e41b..0000000
+++ /dev/null
@@ -1,316 +0,0 @@
-
-(require 'hydra)
-
-;; misc operation for toggle some style
-;; such as toggle line number
-;; windows layout restore / maximum
-
-
-  (defhydra hydra-zoom (global-map "<f2>")
-    "zoom"
-    ("g" text-scale-increase "in")
-    ("l" text-scale-decrease "out"))
-
-;; Misc commands
-(defhydra hydra-misc (:exit t)
-  "Misc commancs"
-  ("p" (lambda ()
-        (interactive)
-        (if (buffer-exists "*Packages*")
-            (switch-to-buffer "*Packages*")
-          (package-list-packages)))
-   "list-package" :color red)
-  ("e" eval-buffer "eval-buffer" :color red))
-
-(defun buffer-exists (bufname)   (not (eq nil (get-buffer bufname))))
-(global-set-key (kbd "M-c") 'hydra-misc/body)
-
-(global-set-key
-; (kbd "C-M-o")
- (kbd "M-o")
-      (defhydra hydra-window ()
-       "window"
-       ("h" windmove-left)
-       ("j" windmove-down)
-       ("l" windmove-right)
-       ("k" windmove-up)
-       ("v" (lambda ()
-              (interactive)
-              (split-window-right)
-              (windmove-right))
-        "vert")
-       ("s" (lambda ()
-              (interactive)
-              (split-window-below)
-              (windmove-down))
-        "horz")
-       ("o" delete-other-windows "one" :color blue)
-       ("a" ace-window "ace")
-       ("w" ace-swap-window "swap")
-       ("d" ace-delete-window "del")
-       ("i" ace-maximize-window "ace-one" :color blue)
-       ("b" ido-switch-buffer "buf")
-       ("u" (progn (winner-undo) (setq this-command 'winner-undo)) "undo")
-       ("q" nil "cancel")))
-
-;(defun pl-last-winner ()
-  
-
-;;(defhydra hydra-launcher (:color blue :columns 2)
-;;   "Launch"
-;;   ("h" man "man")
-;;   ("r" (browse-url "http://www.reddit.com/r/emacs/") "reddit")
-;;   ("w" (browse-url "http://www.emacswiki.org/") "emacswiki")
-;;   ("s" shell "shell")
-;;   ("q" nil "cancel"))
-
-;; define C-space start mark 
-
-
-;;** Example 2: move window splitter
-
-  (defhydra hydra-splitter (global-map "C-M-s")
-    "splitter"
-    ("h" hydra-move-splitter-left)
-    ("j" hydra-move-splitter-down)
-    ("k" hydra-move-splitter-up)
-    ("l" hydra-move-splitter-right))
-
-;;** Example 3: jump to error
-
-  (defhydra hydra-error (global-map "M-g")
-    "goto-error"
-    ("h" first-error "first")
-    ("j" next-error "next")
-    ("k" previous-error "prev")
-    ("v" recenter-top-bottom "recenter")
-    ("q" nil "quit"))
-
-
-
-
-
-;;** Example 5: mini-vi
-(defun hydra-vi/pre ()
-  (set-cursor-color "#e52b50"))
-
-(defun hydra-vi/post ()
-  (set-cursor-color "#ffffff"))
-
-
-;  (global-set-key
-;   (kbd "C-z")
-;   (defhydra hydra-vi (:pre hydra-vi/pre :post hydra-vi/post :color amaranth)
-;     "vi"
-;     ("l" forward-char)
-;     ("h" backward-char)
-;     ("j" next-line)
-;     ("k" previous-line)
-;     ("m" set-mark-command "mark")
-;     ("a" move-beginning-of-line "beg")
-;     ("e" move-end-of-line "end")
-;     ("d" delete-region "del" :color blue)
-;     ("y" kill-ring-save "yank" :color blue)
-;     ("q" nil "quit")))
-
-(setq hydra-lv nil)
-
-;;** Example 6: selective global bind
-
-  (defhydra hydra-next-error (global-map "C-x")
-    "next-error"
-    ("`" next-error "next")
-    ("j" next-error "next" :bind nil)
-    ("k" previous-error "previous" :bind nil))
-
-;; This example will bind "C-x `" in `global-map', but it will not
-;; bind "C-x j" and "C-x k".
-;; You can still "C-x `jjk" though.
-
-;;** Example 7: toggle with Ruby-style docstring
-(defvar whitespace-mode nil)
-(defhydra hydra-toggle (:color pink)
-  "
-_a_ abbrev-mode:       %`abbrev-mode
-_d_ debug-on-error:    %`debug-on-error
-_f_ auto-fill-mode:    %`auto-fill-function
-_t_ truncate-lines:    %`truncate-lines
-_w_ whitespace-mode:   %`whitespace-mode
-
-"
-  ("a" abbrev-mode nil)
-  ("d" toggle-debug-on-error nil)
-  ("f" auto-fill-mode nil)
-  ("t" toggle-truncate-lines nil)
-  ("w" whitespace-mode nil)
-  ("q" nil "quit"))
-;; Recommended binding:
-;; (global-set-key (kbd "C-c C-v") 'hydra-toggle/body)
-
-;; Here, using e.g. "_a_" translates to "a" with proper face.
-;; More interestingly:
-;;
-;;     "foobar %`abbrev-mode" means roughly (format "foobar %S" abbrev-mode)
-;;
-;; This means that you actually see the state of the mode that you're changing.
-
-;;** Example 8: the whole menu for `Buffer-menu-mode'
-(defhydra hydra-buffer-menu (:color pink
-                             :hint nil)
-  "
-^Mark^             ^Unmark^           ^Actions^          ^Search
-^^^^^^^^-----------------------------------------------------------------                        (__)
-_m_: mark          _u_: unmark        _x_: execute       _R_: re-isearch                         (oo)
-_s_: save          _U_: unmark up     _b_: bury          _I_: isearch                      /------\\/
-_d_: delete        ^ ^                _g_: refresh       _O_: multi-occur                 / |    ||
-_D_: delete up     ^ ^                _T_: files only: % -28`Buffer-menu-files-only^^    *  /\\---/\\
-_~_: modified      ^ ^                ^ ^                ^^                                 ~~   ~~
-"
-  ("m" Buffer-menu-mark)
-  ("u" Buffer-menu-unmark)
-  ("U" Buffer-menu-backup-unmark)
-  ("d" Buffer-menu-delete)
-  ("D" Buffer-menu-delete-backwards)
-  ("s" Buffer-menu-save)
-  ("~" Buffer-menu-not-modified)
-  ("x" Buffer-menu-execute)
-  ("b" Buffer-menu-bury)
-  ("g" revert-buffer)
-  ("T" Buffer-menu-toggle-files-only)
-  ("O" Buffer-menu-multi-occur :color blue)
-  ("I" Buffer-menu-isearch-buffers :color blue)
-  ("R" Buffer-menu-isearch-buffers-regexp :color blue)
-  ("c" nil "cancel")
-  ("v" Buffer-menu-select "select" :color blue)
-  ("o" Buffer-menu-other-window "other-window" :color blue)
-  ("q" quit-window "quit" :color blue))
-;; Recommended binding:
-;; (define-key Buffer-menu-mode-map "." 'hydra-buffer-menu/body)
-
-;;** Example 9: s-expressions in the docstring
-;; You can inline s-expresssions into the docstring like this:
-(defvar dired-mode-map)
-(when (bound-and-true-p hydra-examples-verbatim)
-  (require 'dired)
-  (defhydra hydra-marked-items (dired-mode-map "")
-    "
-Number of marked items: %(length (dired-get-marked-files))
-"
-    ("m" dired-mark "mark")))
-
-;; This results in the following dynamic docstring:
-;;
-;;     (format "Number of marked items: %S\n"
-;;             (length (dired-get-marked-files)))
-;;
-;; You can use `format'-style width specs, e.g. % 10(length nil).
-
-;;** Example 10: apropos family
-(defhydra hydra-apropos (:color blue
-                         :hint nil)
-  "
-_a_propos        _c_ommand
-_d_ocumentation  _l_ibrary
-_v_ariable       _u_ser-option
-^ ^          valu_e_"
-  ("a" apropos)
-  ("d" apropos-documentation)
-  ("v" apropos-variable)
-  ("c" apropos-command)
-  ("l" apropos-library)
-  ("u" apropos-user-option)
-  ("e" apropos-value))
-;; Recommended binding:
-;; (global-set-key (kbd "C-c h") 'hydra-apropos/body)
-
-;;** Example 11: rectangle-mark-mode
-(defhydra hydra-rectangle (:body-pre (rectangle-mark-mode 1)
-                           :color pink
-                           :post (deactivate-mark))
-  "
-  ^_k_^     _d_elete    _s_tring
-_h_   _l_   _o_k        _y_ank
-  ^_j_^     _n_ew-copy  _r_eset
-^^^^        _e_xchange  _u_ndo
-^^^^        ^ ^         _p_aste
-"
-  ("h" backward-char nil)
-  ("l" forward-char nil)
-  ("k" previous-line nil)
-  ("j" next-line nil)
-  ("e" hydra-ex-point-mark nil)
-  ("n" copy-rectangle-as-kill nil)
-  ("d" delete-rectangle nil)
-  ("r" (if (region-active-p)
-           (deactivate-mark)
-         (rectangle-mark-mode 1)) nil)
-  ("y" yank-rectangle nil)
-  ("u" undo nil)
-  ("s" string-rectangle nil)
-  ("p" kill-rectangle nil)
-  ("o" nil nil))
-
-;; Recommended binding:
-;; (global-set-key (kbd "C-x SPC") 'hydra-rectangle/body)
-
-;;* Helpers
-(require 'windmove)
-
-(defun hydra-move-splitter-left (arg)
-  "Move window splitter left."
-  (interactive "p")
-  (if (let ((windmove-wrap-around))
-        (windmove-find-other-window 'right))
-      (shrink-window-horizontally arg)
-    (enlarge-window-horizontally arg)))
-
-(defun hydra-move-splitter-right (arg)
-  "Move window splitter right."
-  (interactive "p")
-  (if (let ((windmove-wrap-around))
-        (windmove-find-other-window 'right))
-      (enlarge-window-horizontally arg)
-    (shrink-window-horizontally arg)))
-
-(defun hydra-move-splitter-up (arg)
-  "Move window splitter up."
-  (interactive "p")
-  (if (let ((windmove-wrap-around))
-        (windmove-find-other-window 'up))
-      (enlarge-window arg)
-    (shrink-window arg)))
-
-(defun hydra-move-splitter-down (arg)
-  "Move window splitter down."
-  (interactive "p")
-  (if (let ((windmove-wrap-around))
-        (windmove-find-other-window 'up))
-      (shrink-window arg)
-    (enlarge-window arg)))
-
-(defvar rectangle-mark-mode)
-(defun hydra-ex-point-mark ()
-  "Exchange point and mark."
-  (interactive)
-  (if rectangle-mark-mode
-      (exchange-point-and-mark)
-    (let ((mk (mark)))
-      (rectangle-mark-mode 1)
-      (goto-char mk))))
-
-(provide 'init-hydra)
-
-
-;;** Example 4: toggle rarely used modes
-
-;  (defvar whitespace-mode nil)
-;  (global-set-key
-;   (kbd "C-c C-v")
-;   (defhydra hydra-toggle-simple (:color blue)
-;     "toggle"
-;     ("a" abbrev-mode "abbrev")
-;     ("d" toggle-debug-on-error "debug")
-;     ("f" auto-fill-mode "fill")
-;     ("t" toggle-truncate-lines "truncate")
-;     ("w" whitespace-mode "whitespace")
-;     ("q" nil "cancel")))
diff --git a/emacs.d/config/init-ido.el b/emacs.d/config/init-ido.el
deleted file mode 100644 (file)
index 0f0ca0b..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-
-;---------------------------------------------------------------------------------------
-;; Ido
-;;
-(require 'ido-vertical-mode)
-(ido-vertical-mode 1)
-(require 'flx-ido)
-(ido-mode 1)
-(ido-everywhere 1)
-(flx-ido-mode 1)
-(setq ido-use-faces nil)
-
-(setq org-completion-use-ido t)
-(setq magit-completing-read-function 'magit-ido-completing-read)
-
-(require 'ido-ubiquitous)
-(ido-ubiquitous-mode 1)
-
-;; smex
-(require 'smex) 
-(global-set-key (kbd "M-x") 'smex)
-(global-set-key (kbd "M-X") 'smex-major-mode-commands)
-
-
-(provide 'init-ido)
diff --git a/emacs.d/config/init-key-binding.el b/emacs.d/config/init-key-binding.el
deleted file mode 100644 (file)
index cadcf29..0000000
+++ /dev/null
@@ -1,242 +0,0 @@
-;; This  file is for some global key binding
-
-
-(setq mac-command-modifier 'super) ; make cmd key do Meta
-
-(global-set-key (kbd "<s-return>") 'toggle-frame-fullscreen)
-
-;; global swith project - plugin projectile
-(global-set-key (kbd "s-t") 'helm-projectile-switch-project)
-(global-set-key (kbd "s-n") 'persp-next)
-(global-set-key (kbd "s-p") 'persp-prev)
-(global-set-key (kbd "s-h") 'persp-switch)
-(global-set-key (kbd "s-j") 'helm-projectile-switch-to-buffer)
-(global-set-key (kbd "s-k") 'helm-cmd-t)
-
-
-(defun pl-make-keymap (key bindings)
-  (setq keymap (make-sparse-keymap))
-  (dolist (binding bindings)
-    (define-key keymap (car binding) (cdr binding)))
-  (global-set-key key keymap))
-
-;; Esc s or M-s as prefix key
-(pl-make-keymap "\M-s"
-            '(("j" . pl-switch-buffers)
-             ("h" . persp-switch)
-             ("k" . helm-cmd-t)
-             ("w" . save-buffer)
-             ("q" . helm-find-files)
-             ("-" . split-window-below)
-             ("\\" . split-window-right)
-             ("o" . occur)
-             ("b" . helm-find-files)))
-
-;; if current is not a project, useing helm-mini instead
-(defun pl-switch-buffers ()
-  (interactive)
-  (if (projectile-project-p)
-      (helm-projectile-switch-to-buffer)
-    (helm-mini)))
-  
-
-;; key-chord
-(require 'key-chord)
-
-(setq key-chord-two-keys-delay 0.5)
-
-;; from emacs conference 2015 workshop
-(defun keychord-keymap (keychord bindings)
-  (setq keymap (make-sparse-keymap))
-  (dolist (binding bindings)
-    (define-key keymap (car binding) (cdr binding)))
-  (key-chord-define-global keychord keymap))
-
-(defun switch-to-previous-buffer ()
-  "Switch to previously open buffer. Repeated invocations toggle between the two most recently open buffers."
-  (interactive)
-  (switch-to-buffer (other-buffer (current-buffer) 1)))
-
-
-;; main keymap
-;n(keychord-keymap "ss"
-;                 '(("j" . helm-mini)
-;                   ("k" . find-file)
-;                 ("o" . delete-other-windows)))
-
-;; for some helm key mapping
-;(key-chord-define-global "sj" 'helm-mini)
-;(key-chord-define-global "sk" 'helm-find-files)
-
-
-;(key-chord-define-global "JJ" 'save-buffer)
-;(key-chord-define-global "HH" 'save-buffer)
-;(key-chord-define-global "KK" 'save-buffer)
-;(key-chord-define-global "LL" 'save-buffer)
-;(key-chord-define-global "LL" 'save-buffer)
-;(key-chord-define-global "UU" 'save-buffer)
-;(key-chord-define-global "II" 'save-buffer)
-;(key-chord-define-global "OO" 'save-buffer)
-;(key-chord-define-global "NN" 'save-buffer)
-;(key-chord-define-global "MM" 'save-buffer)
-;(key-chord-define-global "PP" 'save-buffer)
-;(key-chord-define-global "YY" 'save-buffer)
-
-
-
-(key-chord-define minibuffer-local-map "jj"  'keyboard-escape-quit)
-(key-chord-define minibuffer-local-ns-map "jj"  'keyboard-escape-quit)
-(key-chord-define minibuffer-local-isearch-map "jj"  'keyboard-escape-quit)
-(key-chord-define minibuffer-local-completion-map "jj"  'keyboard-escape-quit)
-(key-chord-define minibuffer-local-must-match-map "jj"  'keyboard-escape-quit)
-(key-chord-define minibuffer-local-must-match-filename-map "jj"  'keyboard-escape-quit)
-(key-chord-define minibuffer-local-filename-completion-map "jj"  'keyboard-escape-quit)
-(key-chord-define minibuffer-local-filename-must-match-map "jj"  'keyboard-escape-quit)
-
-
-(define-key minibuffer-local-map [escape]  'keyboard-escape-quit)
-(define-key minibuffer-local-ns-map [escape]  'keyboard-escape-quit)
-(define-key minibuffer-local-isearch-map [escape]  'keyboard-escape-quit)
-(define-key minibuffer-local-completion-map [escape]  'keyboard-escape-quit)
-(define-key minibuffer-local-must-match-map [escape]  'keyboard-escape-quit)
-(define-key minibuffer-local-must-match-filename-map [escape]  'keyboard-escape-quit)
-(define-key minibuffer-local-filename-completion-map [escape]  'keyboard-escape-quit)
-(define-key minibuffer-local-filename-must-match-map [escape]  'keyboard-escape-quit)
-
-
-
-(key-chord-mode 1)
-
-
-
-
-;; ESC ; j M-; add comment, 
-(pl-make-keymap "\M-;"
-            '(("v" . split-window-below)
-             ("h" . split-window-right)
-             ("b" . helm-find-files)))
-
-;; ESC c 
-;(pl-make-keymap "\M-c"
-;            '(("v" . split-window-below)
-;            ("h" . split-window-right)
-;            ("b" . helm-find-files)))
-
-
-;; Esc o - set font , can change
-;; M-l M-u low/up caps can changed
-;; M-t transpose, not used, changed
-;; M-z
-;; M-c capitialize
-
-
-;(global-set-key (kbd "M-s j") 'helm-mini)
-;(global-set-key (kbd "M-s k") 'helm-find-files)
-
-;; ESC ESC + i
-(global-set-key (kbd "ESC M-h") 'helm-mini)
-(global-set-key (kbd "ESC M-j") 'helm-mini)
-(global-set-key (kbd "ESC M-k") 'helm-mini)
-(global-set-key (kbd "ESC M-l") 'helm-mini)
-(global-set-key (kbd "ESC M-;") 'helm-mini)
-(global-set-key (kbd "ESC M-y") 'helm-mini)
-(global-set-key (kbd "ESC M-u") 'helm-mini)
-(global-set-key (kbd "ESC M-i") 'helm-mini)
-(global-set-key (kbd "ESC M-o") 'other-window)
-(global-set-key (kbd "ESC M-p") 'helm-mini)
-(global-set-key (kbd "ESC M-n") 'helm-mini)
-(global-set-key (kbd "ESC M-m") 'helm-mini)
-(global-set-key (kbd "ESC M-y") 'helm-mini)
-(global-set-key (kbd "ESC M-s") 'split-window-below)
-(global-set-key (kbd "ESC M-v") 'split-window-right)
-(global-set-key (kbd "ESC M-u") 'helm-mini)
-(global-set-key (kbd "ESC M-i") 'helm-mini)
-(global-set-key (kbd "ESC M-p") 'helm-mini)
-(global-set-key (kbd "ESC M-;") 'helm-mini)
-(global-set-key (kbd "ESC M-1") 'delete-other-windows)
-(global-set-key (kbd "ESC M-2") 'split-window-below)
-(global-set-key (kbd "ESC M-3") 'split-window-right)
-
-
-(global-set-key (kbd "C-; C-j") 'helm-mini)
-
-;(global-set-key (kbd "<escape> j") 'helm-mini)
-;(global-set-key (kbd "<escape> k") 'helm-find-files)
-;(global-set-key (kbd "<escape> l") 'find-file)
-;(global-set-key (kbd "<escape> f") 'find-file)
-;(global-set-key (kbd "<escape> M-a") 'find-file)
-;(global-set-key (kbd "<escape> M-a") 'find-file)
-;(global-set-key (kbd "<escape> M-a") 'find-file)
-;(global-set-key (kbd "<escape> M-o") 'delete-other-windows)
-;(global-set-key (kbd "<escape> M-h") 'other-window)
-;(global-set-key (kbd "<escape> M-j") 'find-file)
-;(global-set-key (kbd "<escape> M-k") 'find-file)
-;(global-set-key (kbd "<escape> M-l") 'find-file)
-
-
-
-;; project
-;(global-set-key (kbd "<escape> M-n") 'find-file)
-;(global-set-key (kbd "<escape> M-m") 'find-file)
-;(global-set-key (kbd "<escape> M-p") 'find-file)
-;(global-set-key (kbd "<escape> M-u") 'find-file)
-;(global-set-key (kbd "<escape> M-y") 'find-file)
-;(global-set-key (kbd "<escape> <escape>") 'find-file)
-
-
-
-
-
-;;(global-set-key (kbd "s-k") (lambda () (interactive) (elscreen-kill (elscreen-get-current-screen))))
-;;(global-set-key (kbd "s-d") (lambda () (interactive) (elscreen-kill (elscreen-get-current-screen))))
-;; C-c C-d
-
-(global-set-key (kbd "s-`") (lambda () (interactive) (elscreen-goto 0)))
-(global-set-key (kbd "s-1") (lambda () (interactive) (elscreen-goto 1)))
-(global-set-key (kbd "s-2") (lambda () (interactive) (elscreen-goto 2)))
-(global-set-key (kbd "s-3") (lambda () (interactive) (elscreen-goto 3)))
-(global-set-key (kbd "s-4") (lambda () (interactive) (elscreen-goto 4)))
-(global-set-key (kbd "s-5") (lambda () (interactive) (elscreen-goto 5)))
-(global-set-key (kbd "s-6") (lambda () (interactive) (elscreen-goto 6)))
-(global-set-key (kbd "s-7") (lambda () (interactive) (elscreen-goto 7)))
-(global-set-key (kbd "s-8") (lambda () (interactive) (elscreen-goto 8)))
-
-;; super key for windows
-;(global-set-key (kbd "s-l") 'split-window-below)
-;(global-set-key (kbd "s-h") 'split-window-right)
-;(global-set-key (kbd "s-i") 'other-window)
-;(global-set-key (kbd "s-j") 'delete-other-windows)
-
-;(global-set-key (kbd "s-k") (lambda () (interactive)
-;                            (split-window-right)
-;                            (other-window 1)
-;                            (ido-find-file)))
-                               
-                             
-
-
-;(global-set-key (kbd "M-g M-w") 'other-window)
-
-
-
-;(global-set-key (kbd "C-o C-g") 'ggtags-find-file)
-;(global-set-key (kbd "C-o C-t") 'ggtags-find-tag-dwim)
-
-;(global-set-key (kbd "M-g M-g") 'magit-status)
-
-(global-set-key [f7] 'winner-undo)
-(global-set-key [C-f7] 'winner-redo)
-
-
-(defun recentf-ido-find-file ()
-  "Find a recent file using Ido."
-  (interactive)
-  (let ((file (ido-completing-read "Choose recent file: " recentf-list nil t)))
-    (when file
-      (find-file file))))
-
-
-(global-set-key "\C-s" 'isearch-forward-regexp)
-(global-set-key "\C-r" 'isearch-backward-regexp)
-
-(provide 'init-key-binding)
diff --git a/emacs.d/config/init-linum.el b/emacs.d/config/init-linum.el
deleted file mode 100644 (file)
index fd43e27..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-;; refer to https://github.com/aaronbieber/dotfiles/blob/master/configs/emacs.d/lisp/init-linum.el
-;; Stuff for line numbers.
-
-
-(custom-set-faces
- ;; custom-set-faces was added by Custom.
- ;; If you edit it by hand, you could mess it up, so be careful.
- ;; Your init file should contain only one such instance.
- ;; If there is more than one, they won't work right.
- '(highlight-current-line-face ((t (:background "gray22"))))
- '(linum ((t (:background "#000000" :foreground "gray40" :height 0.8 :slant italic :weigth light))))
- '(linum-relative-current-face ((t (:inherit linum :foreground "Yellow" :weight light :height 0.8)))))
-
-(require 'linum-relative)
-
-(defface linum-current
-;  '((t (:inherit linum :weight bold :underline "#555")))
-  '((t (:inherit linum :weight bold :foreground "Yellow")))
-  "The current line number.")
-
-(defun my-linum-get-format-string ()
- (let* ((width (max 3 (1+ (length (number-to-string
-                             (count-lines (point-min) (point-max)))))))
-         (format (concat "%" (number-to-string width) "d "))
-         (current-line-format (concat "%-" (number-to-string width) "d ")))
-    (setq my-linum-format-string format)
-;    (setq my-linum-current-line-format-string current-line-format)))
-    (setq my-linum-current-line-format-string format)))
-
-(defvar my-linum-current-line-number 0)
-
-(setq linum-format 'my-linum-relative-line-numbers)
-
-(defun my-linum-relative-line-numbers (line-number)
-  (let* ((offset (abs (- line-number my-linum-current-line-number)))
-         (linum-display-value (if (= 0 offset)
-                          my-linum-current-line-number
-                                offset))
-         (format-string (if (= my-linum-current-line-number line-number) my-linum-current-line-format-string my-linum-format-string))
-         (face (if (= my-linum-current-line-number line-number) 'linum-current 'linum)))
-    (propertize (format format-string linum-display-value) 'face face)))
-
-(defadvice linum-update (around my-linum-update)
-  (let ((my-linum-current-line-number (line-number-at-pos)))
-    ad-do-it))
-(ad-activate 'linum-update)
-
-;;; Set up relative line numbering to mimic `:set number relativenumber`.
-(global-linum-mode t)
-(add-hook 'linum-before-numbering-hook 'my-linum-get-format-string)
-
-
-
-
-
-;; enable linum-relative in programming mode
-;https://github.com/howardabrams/dot-files/blob/master/emacs.org
-(add-hook 'prog-mode-hook 'linum-mode)
-
-;; hight current line
-(require 'highlight-current-line)
-(highlight-current-line-on t)
-
-
-
-(provide 'init-linum)
diff --git a/emacs.d/config/init-magit.el b/emacs.d/config/init-magit.el
deleted file mode 100644 (file)
index 792e8ab..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-;;---------------------------------------------------------------------------------------
-;; Magit
-;;
-(require 'magit)
-(setq magit-last-seen-setup-instructions "1.4.0")
-(global-set-key (kbd "C-x g") 'magit-status)
-;(setq magit-auto-revert-mode nil)
-
-
-(provide 'init-magit)
diff --git a/emacs.d/config/init-minibuffer.el b/emacs.d/config/init-minibuffer.el
deleted file mode 100644 (file)
index 2d85b1e..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-;;; set font size of minibuffer
-;;;; http://stackoverflow.com/questions/7869429/altering-the-font-size-for-the-emacs-minibuffer-separately-from-default-emacs
-(add-hook 'minibuffer-setup-hook 'my-minibuffer-setup)
-(defun my-minibuffer-setup ()
-       (set (make-local-variable 'face-remapping-alist)
-          '((default :height 120))))
-
-
-
-(add-hook 'minibuffer-setup-hook
-          (lambda ()
-            (make-local-variable 'face-remapping-alist)
-            (add-to-list 'face-remapping-alist '(default (:background "green")))))
-
-(provide 'init-minibuffer)
diff --git a/emacs.d/config/init-mode-line.el b/emacs.d/config/init-mode-line.el
deleted file mode 100644 (file)
index be5bef1..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-
-;; maybe better to fix the size of line number rather scaled 0.8
-;; https://github.com/howardabrams/dot-files/blob/master/emacs.org
-(custom-set-faces
- '(mode-line ((t (:foreground "#030303" :background "#bdbdbd" :box nil :family "Source Code Pro for Powerline" :height 100))))
- '(mode-line-inactive ((t (:foreground "#f9f9f9" :background "#666666" :box nil :family "Source Code Pro for Powerline" :height 100)))))
-
-
-(provide 'init-mode-line)
diff --git a/emacs.d/config/init-multi-term.el b/emacs.d/config/init-multi-term.el
deleted file mode 100644 (file)
index 37dc44d..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-;; http://rawsyntax.com/blog/learn-emacs-zsh-and-multi-term/
-;; color display
-;; tic -o ~/.terminfo /usr/local/Cellar/emacs/24.5/share/emacs/24.5/etc/e/eterm-color.ti
-
-(require 'multi-term)
-
-(setq multi-term-program "/bin/zsh")
-(setq system-uses-terminfo nil)
-
-;;(add-hook 'term-mode-hook
-;;          (lambda ()
-;;         (linum-mode -1)
-;;         (highlight-current-line-on nil)))
-
-
-(add-to-list 'term-bind-key-alist '("C-c C-n" . multi-term-next))
-(add-to-list 'term-bind-key-alist '("C-c C-p" . multi-term-prev))
-(add-to-list 'term-bind-key-alist '("C-c C-j" . term-line-mode))
-(add-to-list 'term-bind-key-alist '("C-c C-k" . term-char-mode))
-
-(provide 'init-multi-term)
diff --git a/emacs.d/config/init-org.el b/emacs.d/config/init-org.el
deleted file mode 100644 (file)
index 9f14e0f..0000000
+++ /dev/null
@@ -1,134 +0,0 @@
-
-;;; org-mode init File
-
-;; refer http://doc.norang.ca/org-mode.html
-
-;(add-to-list 'load-path (expand-file-name "~/git/org-mode/lisp"))
-(add-to-list 'auto-mode-alist '("\\.\\(org\\|org_archive\\|txt\\)$" . org-mode))
-(require 'org)
-;;
-;; Standard key bindings
-(global-set-key "\C-cl" 'org-store-link)
-(global-set-key "\C-ca" 'org-agenda)
-(global-set-key "\C-cb" 'org-iswitchb)
-
-
-;;(add-hook 'org-mode-hook
-;;          (lambda ()
-;;                      (org-set-local 'yas/trigger-key [tab])
-;;                      (define-key yas/keymap [tab] 'yas/next-field-or-maybe-expand)))
-
-
-;(org-indent-mode 1)
-
-
-;; org-todo
-;; define more state of todo
-(setq org-todo-keywords
-      (quote ((sequence "TODO(t)" "STARTED(s)" "|" "DONE(d)")
-              (sequence "WAITING(w@/!)" "HOLD(h@/!)" "|" "CANCELLED(c@/!)" ))))
-
-(setq org-todo-keyword-faces
-      (quote (("TODO" :foreground "red" :weight bold)
-              ("NEXT" :foreground "blue" :weight bold)
-              ("DONE" :foreground "forest green" :weight bold)
-              ("WAITING" :foreground "orange" :weight bold)
-              ("HOLD" :foreground "magenta" :weight bold)
-              ("CANCELLED" :foreground "forest green" :weight bold)
-              ("MEETING" :foreground "forest green" :weight bold)
-              ("PHONE" :foreground "forest green" :weight bold))))
-
-(setq org-use-fast-todo-selection t)
-
-;; allow S-left/right to rotate state not set timestamp and add note
-(setq org-treat-S-cursor-todo-selection-as-state-change nil)
-
-;; trigger a tags for the task when changing state
-(setq org-todo-state-tags-triggers
-      (quote (("CANCELLED" ("CANCELLED" . t))
-              ("WAITING" ("WAITING" . t))
-              ("HOLD" ("WAITING") ("HOLD" . t))
-              (done ("WAITING") ("HOLD"))
-              ("TODO" ("WAITING") ("CANCELLED") ("HOLD"))
-              ("NEXT" ("WAITING") ("CANCELLED") ("HOLD"))
-              ("DONE" ("WAITING") ("CANCELLED") ("HOLD")))))
-
-
-;; org-capture
-(setq org-directory "~/Private/org")
-(setq org-default-notes-file (concat org-directory "/notes.org"))
-(define-key global-map "\C-cc" 'org-capture)
-
-
-(setq org-refile-targets (quote ((nil :maxlevel . 9)
-                                 (org-agenda-files :maxlevel . 9))))
-
-
-
-
-;; Capture templates for: TODO tasks, Notes, appointments, phone calls, meetings, and org-protocol
-;(setq org-capture-templates
-;      (quote (("t" "todo" entry (file "~/git/org/refile.org")
-;               "* TODO %?\n%U\n%a\n" :clock-in t :clock-resume t)
-;              ("r" "respond" entry (file "~/git/org/refile.org")
-;               "* NEXT Respond to %:from on %:subject\nSCHEDULED: %t\n%U\n%a\n" :clock-in t :clock-resume t :immediate-finish t)
-;              ("n" "note" entry (file "~/git/org/refile.org")
-;               "* %? :NOTE:\n%U\n%a\n" :clock-in t :clock-resume t)
-;              ("j" "Journal" entry (file+datetree "~/git/org/diary.org")
-;               "* %?\n%U\n" :clock-in t :clock-resume t)
-;              ("w" "org-protocol" entry (file "~/git/org/refile.org")
-;               "* TODO Review %c\n%U\n" :immediate-finish t)
-;              ("m" "Meeting" entry (file "~/git/org/refile.org")
-;               "* MEETING with %? :MEETING:\n%U" :clock-in t :clock-resume t)
-;              ("p" "Phone call" entry (file "~/git/org/refile.org")
-;               "* PHONE %? :PHONE:\n%U" :clock-in t :clock-resume t)
-;              ("h" "Habit" entry (file "~/git/org/refile.org")
-;               "* NEXT %?\n%U\n%a\nSCHEDULED: %(format-time-string \"%<<%Y-%m-%d %a .+1d/3d>>\")\n:PROPERTIES:\n:STYLE: habit\n:REPEAT_TO_STATE: NEXT\n:END:\n"))))
-
-
-;;; org-tag
-; Tags with fast selection keys
-(setq org-tag-alist (quote ((:startgroup)
-                            ("@errand" . ?e)
-                            ("@office" . ?o)
-                            ("@home" . ?H)
-                            ("@farm" . ?f)
-                            (:endgroup)
-                            ("WAITING" . ?w)
-                            ("HOLD" . ?h)
-                            ("PERSONAL" . ?P)
-                            ("WORK" . ?W)
-                            ("FARM" . ?F)
-                            ("ORG" . ?O)
-                            ("NORANG" . ?N)
-                            ("crypt" . ?E)
-                            ("NOTE" . ?n)
-                            ("CANCELLED" . ?c)
-                            ("FLAGGED" . ??))))
-
-; Allow setting single tags without the menu
-(setq org-fast-tag-selection-single-key (quote expert))
-
-; For tag searches ignore tasks with scheduled and deadline dates
-(setq org-agenda-tags-todo-honor-ignore-options t)
-
-
-;; Always hilight the current agenda line
-(add-hook 'org-agenda-mode-hook
-          '(lambda () (hl-line-mode 1))
-          'append)
-
-
-
-;; The following custom-set-faces create the highlights
-(custom-set-faces
-  ;; custom-set-faces was added by Custom.
-  ;; If you edit it by hand, you could mess it up, so be careful.
-  ;; Your init file should contain only one such instance.
-  ;; If there is more than one, they won't work right.
- '(org-mode-line-clock ((t (:background "grey75" :foreground "red" :box (:line-width -1 :style released-button)))) t))
-
-
-
-
-(provide 'init-org)
diff --git a/emacs.d/config/init-perl.el b/emacs.d/config/init-perl.el
deleted file mode 100644 (file)
index 8645bce..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-
-(custom-set-variables
- ;; custom-set-variables was added by Custom.
- ;; If you edit it by hand, you could mess it up, so be careful.
- ;; Your init file should contain only one such instance.
- ;; If there is more than one, they won't work right.
- '(fringe-mode (quote (4 . 0)) nil (fringe))
- '(ggtags-split-window-function (quote split-window-vertically))
- '(hes-mode-alist
-   (quote
-    ((c-mode . "\\(\\\\\\([0-7]\\{1,3\\}\\|x[[:xdigit:]]+\\|u[[:xdigit:]]\\{4\\}\\|U[[:xdigit:]]\\{8\\}\\|[\"'?\\abfnrtv]\\)\\)")
-     (cperl-mode . "\\(\\\\\\([0-7]\\{1,3\\}\\|x[[:xdigit:]]+\\|u[[:xdigit:]]\\{4\\}\\|U[[:xdigit:]]\\{8\\}\\|[\"'?\\abfnrtv]\\)\\)")
-     (c++-mode . "\\(\\\\\\([0-7]\\{1,3\\}\\|x[[:xdigit:]]+\\|u[[:xdigit:]]\\{4\\}\\|U[[:xdigit:]]\\{8\\}\\|[\"'?\\abfnrtv]\\)\\)")
-     (objc-mode . "\\(\\\\\\([0-7]\\{1,3\\}\\|x[[:xdigit:]]+\\|u[[:xdigit:]]\\{4\\}\\|U[[:xdigit:]]\\{8\\}\\|[\"'?\\abfnrtv]\\)\\)")
-     (java-mode . "\\(\\\\\\([0-7]\\{1,3\\}\\|u[[:xdigit:]]\\{4\\}\\|[\"'\\bfnrt]\\)\\)")
-     (js-mode . "\\(\\\\\\([0-7]\\{1,3\\}\\|x[[:xdigit:]]\\{2\\}\\|u[[:xdigit:]]\\{4\\}\\|.\\)\\)")
-     (js2-mode . "\\(\\\\\\([0-7]\\{1,3\\}\\|x[[:xdigit:]]\\{2\\}\\|u[[:xdigit:]]\\{4\\}\\|.\\)\\)")
-     (ruby-mode
-      ("\\(\\\\\\([0-7]\\{1,3\\}\\|x[[:xdigit:]]\\{1,2\\}\\|u\\(?:[[:xdigit:]]\\{4\\}\\|{[[:xdigit:]]\\{1,6\\}\\(?:[[:space:]]+[[:xdigit:]]\\{1,6\\}\\)*}\\)\\|.\\)\\)"
-       (0
-        (let*
-            ((state
-              (syntax-ppss))
-             (term
-              (nth 3 state)))
-          (when
-              (or
-               (and
-                (eq term 39)
-                (member
-                 (match-string 2)
-                 (quote
-                  ("\\" "'"))))
-               (if
-                   (fboundp
-                    (quote ruby-syntax-expansion-allowed-p))
-                   (ruby-syntax-expansion-allowed-p state)
-                 (memq term
-                       (quote
-                        (34 47 10 96 t)))))
-            (add-face-text-property
-             (match-beginning 1)
-             (match-end 1)
-             (quote hes-escape-backslash-face))
-            (add-face-text-property
-             (match-beginning 2)
-             (match-end 2)
-             (quote hes-escape-sequence-face))
-            nil))
-        prepend))))))
- '(org-agenda-files (quote ("~/Private/org/diary.org" "~/temp/org-note.org")))
- '(powerline-text-scale-factor 0.85))
-
-
-
-(defalias 'perl-mode 'cperl-mode)
-;(setq cperl-invalid-face nil)
- (setq cperl-invalid-face (quote off))
-;(add-hook 'prog-mode-hook '(lambda () 
-;        (highlight-regexp "%[[:alpha:]]\\|\\\\[[:alpha:]]")))
-
-(require 'highlight-escape-sequences)
-(hes-mode)
-;(setq cperl-font-lock t)
-(put 'hes-escape-backslash-face 'face-alias 'font-lock-builtin-face)
-(put 'hes-escape-sequence-face 'face-alias 'font-lock-builtin-face)
-
-
-(provide 'init-perl)
diff --git a/emacs.d/config/init-project.el b/emacs.d/config/init-project.el
deleted file mode 100644 (file)
index d0571cd..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-
-;; http://batsov.com/projectile/
-(setq fiplr-root-markers '(".git" ".svn" "*.DS_Store"))
-(setq fiplr-ignored-globs '((directories (".git" ".svn"))
-                            (files ("*.jpg" "*.png" "*.zip" "*~" "*.o" ".obj" "*.swp" "*.hg" ".pyc" ".*" "*.so" "*.dylib"))))
-
-(global-set-key (kbd "C-x f") 'fiplr-find-file)
-
-
-
-
-(provide 'init-project)
diff --git a/emacs.d/config/init-projectile.el b/emacs.d/config/init-projectile.el
deleted file mode 100644 (file)
index 53a11e3..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
-
-(require 'projectile)
-(require 'projectile-speedbar)
-
-
-(projectile-global-mode)
-
-(setq projectile-enable-caching t)
-;(setq projectile-indexing-method 'native)
-(setq projectile-indexing-method 'alien)
-;; with helm
-(require 'helm-projectile)
-(helm-projectile-on)
-
-
-;(setq projectile-switch-project-action 'helm-projectile-find-file)
-(setq projectile-switch-project-action 'projectile-dired)
-
-;; https://www.reddit.com/r/emacs/comments/2pvmkm/helm_projectile_now_enables_fuzzy_matching_by/
-(setq helm-projectile-fuzzy-match nil)
-
-;; with - perspective
-(persp-mode)
-(require 'persp-projectile)
-
-(provide 'init-projectile)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/emacs.d/config/init-rencentf.el b/emacs.d/config/init-rencentf.el
deleted file mode 100644 (file)
index 1d68581..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-
-(require 'recentf)
-(recentf-mode 1)
-(setq recentf-max-menu-items 100)
-
-;; http://www.emacswiki.org/emacs/RecentFiles
-(defun recentf-ido-find-file ()
-  "Find a recent file using Ido."
-  (interactive)
-  (let ((file (ido-completing-read "Choose recent file: " recentf-list nil t)))
-    (when file
-      (find-file file))))
-
-
-(require 'recentf-ext)
-
-(provide 'init-recentf)
diff --git a/emacs.d/config/init-test-minibufer.el b/emacs.d/config/init-test-minibufer.el
deleted file mode 100644 (file)
index 93e8e51..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-
-(progn
-  (defvar current-time-string "")
-  (run-with-timer
-   1 1
-   (lambda ()
-     (let ((message-log-max nil))
-       (unless (minibuffer-window-active-p (minibuffer-window))
-         (when (member (current-message)
-                       (list current-time-string nil))
-           (message "%s" (setq current-time-string
-                               (current-time-string)))))))))
-[nil 21872 33554 386400 1 (lambda nil (let (...) (if ... nil ...))) nil nil 0]
-
-
-
-
-    (with-current-buffer " *Minibuf-0*"
-      (insert (format-time-string "%H:%M")))
-
- (run-at-time
-  nil 60
-  (lambda ()
-    (with-current-buffer " *Minibuf-0*"
-      (erase-buffer)
-      (dotimes (spaces (- (frame-width) 8))
-        (insert " "))
-      (insert (format-time-string "%H:%M")))))
-
diff --git a/emacs.d/config/init-winner.el b/emacs.d/config/init-winner.el
deleted file mode 100644 (file)
index 87b3fbe..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-
-(winner-mode 1)
-
-(global-set-key (kbd "C-c C-l") 'winner-redo)
-(global-set-key (kbd "C-c C-h") 'winner-undo)
-
-(provide 'init-winner)
-
diff --git a/emacs.d/config/init-workgroup2.el b/emacs.d/config/init-workgroup2.el
deleted file mode 100644 (file)
index ebef2cb..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-
-(require 'workgroups2)
-
-
-(setq wg-prefix-key (kbd "C-c z"))
-(setq wg-session-file "~/.emacs.d/temp/.emacs_workgroups")
-(setq wg-mode-line-display-on t)          ; Default: (not (featurep 'powerline))
-(setq wg-flag-modified t)                 ; Display modified flags as well
-(setq wg-mode-line-decor-left-brace "["
-      wg-mode-line-decor-right-brace "]"  ; how to surround it
-      wg-mode-line-decor-divider ":")
-;(workgroups-mode 1)
-
-(provide 'init-workgroup2)
diff --git a/emacs.d/config/my-packages.el b/emacs.d/config/my-packages.el
deleted file mode 100644 (file)
index 025bd81..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-;;---------------------------------------------------------------------------------------
-;; package
-;; http://y.tsutsumi.io/emacs-from-scratch-part-2-package-management.html
-;;
-(require 'package)
-(add-to-list 'package-archives
-             '("melpa" . "http://melpa.milkbox.net/packages/") t)
-(package-initialize)
-
-(defvar required-packages
-  '(
-    magit
-    helm
-    ido-ubiquitous
-    yasnippet
-    evil
-    ido-vertical-mode
-    smex
-    color-theme
-    color-theme-sanityinc-tomorrow
-    key-chord
-;    powerline-evil
-    powerline
-    evil-leader
-    flx-ido
-    flx
-    auto-complete
-    fiplr
-    w3m
-    ace-jump-mode
-;    el-get
-    color-identifiers-mode
-;    elscreen
-    moe-theme
-    monokai-theme
-    molokai-theme
-    tangotango-theme
-    cyberpunk-theme
-    hydra
-    projectile-speedbar
-    ecb
-    ggtags
-    irony
-    yasnippet
-    auto-complete-c-headers
-    iedit
-    flymake-google-cpplint
-    flymake-cursor
-    google-c-style
-    recentf-ext
-    linum-relative
-    jekyll-modes
-    evil-escape
-    workgroups2
-    highlight-current-line
-    pp-c-l
-    session
-    use-package
-    helm-gtags
-    icicles
-    ace-window
-    multi-term
-    projectile
-    page-break-lines
-    helm-projectile
-    paradox
-    diff-hl
-  ) "a list of packages to ensure are installed at launch.")
-
-(require 'cl)
-(defun packages-installed-p ()
-  (loop for p in required-packages
-        when (not (package-installed-p p)) do (return nil)
-        finally (return t)))
-
-(unless (packages-installed-p)
-  (message "%s" "Emacs is now refreshing its package database...")
-  (package-refresh-contents)
-  (message "%s" " done.")
-  (dolist (p required-packages)
-    (when (not (package-installed-p p))
-      (package-install p))))
-
-
-;;---------------------------------------------------------------------------------------
-;; El-get
-;; https://github.com/dimitri/el-get
-;;
-
-(add-to-list 'load-path "~/.emacs.d/el-get/el-get")
-
-(unless (require 'el-get nil 'noerror)
-  (with-current-buffer
-      (url-retrieve-synchronously
-       "https://raw.githubusercontent.com/dimitri/el-get/master/el-get-install.el")
-    (goto-char (point-max))
-    (eval-print-last-sexp)))
-
-(add-to-list 'el-get-recipe-path "~/.emacs.d/el-get-user/recipes")
-
-
-(el-get-bundle seudut/color-theme-tangotango
-;        :features color-theme-tangotango
-;        (color-theme-tangotango)
-        )
-
-;(el-get-bundle Dewdrops/powerline)
-
-(el-get-bundle emacsmirror/sr-speedbar)
-(el-get-bundle seudut/elscreen)
-(el-get-bundle seudut/helm-cmd-t)
-
-(provide 'my-packages)
diff --git a/emacs.d/config/my-powerline.el b/emacs.d/config/my-powerline.el
deleted file mode 100644 (file)
index 65f849e..0000000
+++ /dev/null
@@ -1,129 +0,0 @@
-
-
-
-
-(setq ns-use-srgb-colorspace nil)
-
-(load-theme 'cyberpunk t)
-
-;; Powerline
-(defun arrow-right-xpm (color1 color2)
-  "Return an XPM right arrow string representing."
-  (format "/* XPM */
-static char * arrow_right[] = {
-\"12 18 2 1\",
-\". c %s\",
-\"  c %s\",
-\".           \",
-\"..          \",
-\"...         \",
-\"....        \",
-\".....       \",
-\"......      \",
-\".......     \",
-\"........    \",
-\".........   \",
-\".........   \",
-\"........    \",
-\".......     \",
-\"......      \",
-\".....       \",
-\"....        \",
-\"...         \",
-\"..          \",
-\".           \"};"  color1 color2))
-
-(defun arrow-left-xpm (color1 color2)
-  "Return an XPM right arrow string representing."
-  (format "/* XPM */
-static char * arrow_right[] = {
-\"12 18 2 1\",
-\". c %s\",
-\"  c %s\",
-\"           .\",
-\"          ..\",
-\"         ...\",
-\"        ....\",
-\"       .....\",
-\"      ......\",
-\"     .......\",
-\"    ........\",
-\"   .........\",
-\"   .........\",
-\"    ........\",
-\"     .......\",
-\"      ......\",
-\"       .....\",
-\"        ....\",
-\"         ...\",
-\"          ..\",
-\"           .\"};"  color2 color1))
-
-;;(defconst color1 "#666666") ; gray40
-;;(defconst color2 "#999999") ; gray60
-
-;;j;(defconst color1 "#4682b4")
-;;(defconst color2 "#ff6347")
-
-(defconst color1 "#6b8e23")
-(defconst color2 "#eedd82")
-
-;;(set-face-attribute 'mode-line-color-2 nil
-;;                    :foreground "#171717"
-;;                    :bold t
-;;                    :background color2)
-
-
-
-(defvar arrow-right-0 (create-image (arrow-right-xpm "None" color1) 'xpm t :ascent 'center))
-(defvar arrow-right-1 (create-image (arrow-right-xpm color1 color2) 'xpm t :ascent 'center))
-(defvar arrow-right-2 (create-image (arrow-right-xpm color2 "None") 'xpm t :ascent 'center))
-(defvar arrow-left-1  (create-image (arrow-left-xpm color2 color1) 'xpm t :ascent 'center))
-(defvar arrow-left-2  (create-image (arrow-left-xpm "None" color2) 'xpm t :ascent 'center))
-
-(display-time)
-
-(setq-default mode-line-format
-              (list
-               '("-"
-                 mode-line-mule-info
-                 mode-line-modified
-                 minor-mode-alist)
-               '(:eval (concat (propertize " " 'display arrow-right-0)))
-               '(:eval (concat (propertize " %m " 'face 'mode-line-color-1)
-                               (propertize " " 'display arrow-right-1)))
-               '(:eval (concat (propertize " %b " 'face 'mode-line-color-2)
-                               (propertize " " 'display arrow-right-2)))
-               ;; Justify right by filling with spaces to right fringe - 16
-               ;; (16 should be computed rahter than hardcoded)
-               '(:eval (propertize " " 'display '((space :align-to (- right-fringe 17)))))
-               '(:eval (concat (propertize " " 'display arrow-left-2)
-                               (propertize " %p " 'face 'mode-line-color-2)))
-               '(:eval (concat (propertize " " 'display arrow-left-1)
-                               (propertize "%4l:%2c  " 'face 'mode-line-color-1)))
-                 ))
-
-
-(make-face 'mode-line-color-1)
-(set-face-attribute 'mode-line-color-1 nil
-                    :foreground "#fffacd"
-                    :bold t
-                    :background color1)
-
-(make-face 'mode-line-color-2)
-(set-face-attribute 'mode-line-color-2 nil
-                    :foreground "#fffacd"
-                    :bold t
-                    :background color2)
-
-(set-face-attribute 'mode-line nil
-                    :foreground "#fffacd"
-                    :background "#171717"
-                    :box nil)
-(set-face-attribute 'mode-line-inactive nil
-                    :foreground "#fffacd"
-                    :background "#171717")
-
-
-
-(provide 'my-powerline)
diff --git a/emacs.d/elisp/init-base.el b/emacs.d/elisp/init-base.el
deleted file mode 100644 (file)
index e2e29f1..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-
-(setq debug-on-error t)
-(setq inhibit-startup-message t)
-
-(scroll-bar-mode -1)
-(tool-bar-mode -1)
-(menu-bar-mode -1)
-
-(defalias 'yes-or-no-p 'y-or-n-p)
-
-;;http://emacsblog.org/2007/03/17/quick-tip-set-goal-column/
-(put 'set-goal-colomn 'disabled nil)
-(setq vc-follow-symlinks t)
-(setq visible-bell 1)
-(setq ring-bell-function 'ignore)
-(setq resize-mini-windows t)
-
-(fringe-mode (quote (0 . 0)))
-(add-to-list 'auto-mode-alist '("emacs\\'" . emacs-lisp-mode))
-(show-paren-mode t)
-;(add-to-list 'default-frame-alist '(width  . 120))
-;(add-to-list 'default-frame-alist '(height . 40))
-;(add-to-list 'default-frame-alist '(font . "Source Code Pro for Powerline-12:weight:light" ))
-;(add-to-list 'default-frame-alist '(font . "Source Code Pro for Powerline-12" ))
-
-
-
-
-
-
-;(blink-cursor-mode 0)
-
-;(custom-set-variables
-; '(fringe-mode (quote (0 . 0)) nil (fringe)))
-
-
-
-
-
-;;; Set symbol for the border
-(set-display-table-slot standard-display-table
-                        'vertical-border 
-                        (make-glyph-code ?┃))
-
-;(set-face-attribute 'vertical-border nil  :foreground "gray")
-
-
-
-;(setq scroll-margin 5)
-;(setq scroll-conservatively 10000)
-
-
-
-;(add-hook 'help-mode-hook
-;        (lambda ()
-;          (linum-mode -1)))
-
-;; Dired mode
-;(require 'dired+)
-;; create new file  key map
-;(define-key dired-mode-map "c" 'find-file)
-;; ^ goto-up directory
-;(define-key dired-mode-map (kbd "C-c C-u") 'dired-up-directory)
-
-;(setq diredp-hide-details-initially-flag t)
-;(setq diredp-hide-details-propagate-flag t)
-
-;(setq term-buffer-maximum-size 10000)
-
-(provide 'init-base)
diff --git a/emacs.d/elisp/init-helm.el b/emacs.d/elisp/init-helm.el
deleted file mode 100644 (file)
index 59511f9..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-;; helm
-(use-package helm
-  :ensure t
-  :init
-  (setq helm-M-x-fuzzy-match t)
-  (setq helm-buffer-fuzzy-matching t)
-  (setq helm-recentf-fuzzy-match t)
-  (setq helm-cadidate-number-limit 20)
-  (setq helm-display-function
-      (lambda (buf)
-        (split-window-vertically)
-        (other-window 1)
-        (switch-to-buffer buf)))
-  :config
-  (helm-mode 1)
-  (helm-autoresize-mode 1)
-  :bind (("M-x" . helm-M-x)
-        ("s-j" . helm-mini)))
-
-
-
-(provide 'init-helm)
diff --git a/emacs.d/elisp/init-hydra.el b/emacs.d/elisp/init-hydra.el
deleted file mode 100644 (file)
index 2c64061..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-
-;; key mapping 
-;; TODO:
-;;    1. exec external progeam
-;;       prefix + s : eshell / term
-;;       prefix + p : package install
-;;       prefix +
-;;    2. prefix for magit
-;;
-;;    3. prefix for avy motion
-;;    4. window / buffer switch
-;;    5. file project switch
-(use-package hydra
-  :ensure t
-  :config
-  (hydra-add-font-lock))
-
-
-(defhydra hydra-external (global-map "<f2>")
-  "zoom"
-  ("g" text-scale-increase "in")
-  ("l" text-scale-decrease "out")
-  )
-
-
-;; hydra for Misc commands
-(defhydra hydra-misc (:exit t)
-  "Misc Commands" 
-  ("e" eshell "eshell" :color red)
-  ("p" (lambda ()
-        (interactive)
-        (if (pl/buffer-exist "*Packages*")
-            (switch-to-buffer "*Packages*")
-          (package-list-packages)))
-   "List-package" :color red)
-  )
-(defun pl/buffer-exist (bufname) (not (eq nil (get-buffer bufname))))
-(global-set-key (kbd "<f3>") 'hydra-misc/body)
-
-
-
-
-
-
-
-(provide 'init-hydra)
diff --git a/emacs.d/elisp/init-magit.el b/emacs.d/elisp/init-magit.el
deleted file mode 100644 (file)
index 1aa9b1d..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-(use-package magit
-  :ensure t
-  :bind (("M-g s" . magit-status)))
-  
-
-
-
-
-(provide 'init-magit)
diff --git a/emacs.d/elisp/init-org.el b/emacs.d/elisp/init-org.el
deleted file mode 100644 (file)
index b135485..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-
-
-;; http://doc.norang.ca/org-mode.html  Org Mode - Organize Your Life In Plain Text!
-
-(add-to-list 'auto-mode-alist '("\\.\\(org\\|org_archive\\|txt\\)$" . org-mode))
-
-;;; better map to M-c instead of C-c, since M-c is more easy
-;;(global-set-key "M-cqc" 'org-capture) or M-o c
-(global-set-key "\C-cl" 'org-store-link)
-(global-set-key "\C-ca" 'org-agenda)
-(global-set-key "\C-cb" 'org-iswitchb)
-
-
-;; better use hydra define these
-(global-unset-key "\M-o")
-(global-set-key (kbd "M-o a") 'org-agenda)
-(global-set-key (kbd "M-o b") 'org-iswitchb)
-(global-set-key (kbd "M-o c") 'org-capture)
-
-
-(global-set-key (kbd "<f12>") 'org-agenda)
-
-(setq org-agenda-files (quote ("~/Private/org")))
-
-(setq org-todo-keywords
-      (quote ((sequence "TODO(t)" "ONGOING(n)" "|" "DONE(d)")
-              (sequence "WAITING(w@/!)" "HOLD(h@/!)" "|" "CANCELLED(c@/!)" ))))
-
-(setq org-todo-keyword-faces
-      (quote (("TODO" :foreground "red" :weight bold)
-              ("ONGOING" :foreground "blue" :weight bold)
-              ("DONE" :foreground "forest green" :weight bold)
-              ("WAITING" :foreground "orange" :weight bold)
-              ("HOLD" :foreground "magenta" :weight bold)
-              ("CANCELLED" :foreground "forest green" :weight bold))))
-
-(setq org-todo-state-tags-triggers
-      (quote (("CANCELLED" ("CANCELLED" . t))
-              ("WAITING" ("WAITING" . t))
-              ("HOLD" ("WAITING") ("HOLD" . t))
-              (done ("WAITING") ("HOLD"))
-              ("TODO" ("WAITING") ("CANCELLED") ("HOLD"))
-              ("ONGOING" ("WAITING") ("CANCELLED") ("HOLD"))
-              ("DONE" ("WAITING") ("CANCELLED") ("HOLD")))))
-
-;; change a task state C-c C-t Key
-(setq org-use-fast-todo-selection t)
-(setq org-treat-S-cursor-todo-selection-as-state-change nil)
-
-
-
-;; Org Capture
-(setq org-directory "~/Private/org/")
-(setq org-default-notes-file (concat org-directory "refile.org"))
-(setq org-default-diary-file (concat org-directory "diary.org"))
-
-(global-set-key (kbd "C-c c") 'org-capture)
-
-;; Capture templates for: TODO tasks, Notes, appointments, phone calls, meetings, and org-protocol
-(setq org-capture-templates
-      (quote (("t" "Todo" entry (file org-default-notes-file)
-               "* TODO %?\n\n  %U\n  %a\n" :clock-in t :clock-resume t)
-              ("r" "Respond" entry (file org-default-notes-file)
-               "* NEXT Respond to %:from on %:subject\nSCHEDULED: %t\n  %U\n  %a\n" :clock-in t :clock-resume t :immediate-finish t)
-              ("n" "Note" entry (file org-default-notes-file)
-               "* %? :NOTE:\n\n  %U\n  %a\n" :clock-in t :clock-resume t)
-              ("j" "Journal" entry (file+datetree org-default-diary-file)
-               "* %?\n%U\n" :clock-in t :clock-resume t)
-              ("w" "Org-protocol" entry (file org-default-notes-file)
-               "* TODO Review %c\n%U\n" :immediate-finish t)
-              ("m" "Meeting" entry (file org-default-notes-file)
-               "* MEETING with %? :MEETING:\n%U" :clock-in t :clock-resume t)
-              ("p" "Phone call" entry (file org-default-notes-file)
-               "* PHONE %? :PHONE:\n  %U" :clock-in t :clock-resume t)
-              ("h" "Habit" entry (file org-default-notes-file)
-               "* NEXT %?\n\n  %U\n  %a\n\nSCHEDULED: %(format-time-string \"%<<%Y-%m-%d %a .+1d/3d>>\")\n:PROPERTIES:\n:STYLE: habit\n:REPEAT_TO_STATE: NEXT\n:END:\n"))))
-
-
-(provide 'init-org)
diff --git a/emacs.d/elisp/init-projectile.el b/emacs.d/elisp/init-projectile.el
deleted file mode 100644 (file)
index dff7c4d..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-;; http://batsov.com/projectile/
-;; Todo add svn repo support
-
-(use-package projectile
-  :ensure t
-  :init
-  (setq projectile-enable-caching t)
-  (setq projectile-indexing-method 'alian)
-  (setq projectile-switch-project-action 'projectile-dired)
-  :config
-  (projectile-global-mode))
-
-
-(use-package helm-projectile
-  :ensure t
-  :init
-  (setq helm-projectile-fuzzy-match nil)
-  :config
-  (helm-projectile-on)
-  :bind (("s-f" . helm-projectile-find-file)
-        ("s-b" . helm-projectile-switch-to-buffer)))
-
-(use-package perspective
-  :ensure t
-  :config
-  (persp-mode))
-
-(use-package persp-projectile
-  :ensure t
-  :config
-  (define-key projectile-mode-map (kbd "s-p") 'projectile-persp-switch-project))
-
-
-(provide 'init-projectile)
diff --git a/emacs.d/init.el b/emacs.d/init.el
deleted file mode 100644 (file)
index 9a62fa5..0000000
+++ /dev/null
@@ -1,347 +0,0 @@
-
-
-;; Added by Package.el.  This must come before configurations of
-;; installed packages.  Don't delete this line.  If you don't want it,
-;; just comment it out by adding a semicolon to the start of the line.
-;; You may delete these explanatory comments.
-;(package-initialize)
-
- (load-library "url-handlers")
-
-(setenv "PATH" (concat (getenv "PATH") ":/usr/local/bin"))
-(setq exec-path (append exec-path '("/usr/local/bin")))
-
-;; package manager
-(require 'package)
-
-(add-to-list 'package-archives
-             '("melpa" . "http://melpa.milkbox.net/packages/") t)
-(add-to-list 'package-archives
-             '("org" . "http://orgmode.org/elpa/") t)
-;(add-to-list 'package-archives
-;             '("marmalade" . "http://marmalade-repo.org/packages/") t)
-
-(package-initialize)
-
-;; use-package
-(unless (package-installed-p 'use-package)
-  (package-refresh-contents)
-  (package-install 'use-package))
-
-(require 'use-package)
-
-;;;;; load path
-(add-to-list 'load-path "~/.emacs.d/elisp")
-
-;;; load elisp config
-(require 'init-base)
-(require 'init-magit)
-(require 'init-helm)
-(require 'init-projectile)
-(require 'init-org)
-
-
-
-
-
-
-
-
-
-(use-package ido-vertical-mode
-  :ensure t)
-
-
-(use-package hydra
-  :ensure t
-  :config
-  (hydra-add-font-lock))
-
-
-;;;;;;;;;
-(use-package ace-jump-mode
-  :commands ace-jump-mode
-  :init
-  (bind-key "C-." 'ace-jump-mode))
-
-(use-package sublime-themes
-  :ensure t
-  :config
-  (load-theme 'spolsky t)
-  )
-
-(use-package avy
-  :ensure t
-  )
-
-(use-package use-package-chords
-  :ensure t
-  :config
-  (key-chord-mode 1)
-  (setq key-chord-two-keys-delay 0.5))
-
-(use-package evil
-  :ensure t
-  :config
-  (evil-mode t)
-  (defalias 'evil-insert-state 'evil-emacs-state)
-  (key-chord-define evil-insert-state-map "jj" 'evil-normal-state)
-  (key-chord-define evil-emacs-state-map "jj" 'evil-normal-state)
-;  (setq evil-emacs-state-cursor '("red" box))
-  (setq evil-emacs-state-cursor '("green" bar))
-  (setq evil-normal-state-cursor '("green" box))
-  (setq evil-visual-state-cursor '("orange" box))
-  (setq evil-insert-state-cursor '("red" bar))
-  (setq evil-replace-state-cursor '("red" bar))
-  (setq evil-operator-state-cursor '("red" hollow))
-  )
-
-(use-package multi-term
-  :ensure t
-  )
-
-
-
-;(use-package smex
-;  :ensure t
-;  :init (smex-initialize)
-;  :bind ("M-x" . smex)
-;        ("M-X" . smex-major-mode-commands))
-
-
-(add-to-list 'load-path "~/.emacs.d/pde")
-(load "pde-load")
-
-(add-to-list 'default-frame-alist '(fullscreen . maximized))
-
-
-(use-package org-bullets
-  :ensure t
-  :init
-  (add-hook 'org-mode-hook
-            (lambda ()
-              (org-bullets-mode t))))
-  
-(org-bullets-mode t)
-
-(setq org-hide-leading-stars t)
-
-(setq org-src-fontify-natively t)
-
-(font-lock-add-keywords 'org-mode
-                    '(("\\(src_\\)\\([^[{]+\\)\\(\\[:.*\\]\\){\\([^}]*\\)}"
-                       (1 '(:foreground "black" :weight 'normal :height 10)) ; src_ part
-                       (2 '(:foreground "cyan" :weight 'bold :height 75 :underline "red")) ; "lang" part.
-                       (3 '(:foreground "#555555" :height 70)) ; [:header arguments] part.
-                       (4 'org-code) ; "code..." part.
-                       )))
-
-
-
-
-;(setq lispy-mode-hooks
-;      '(clojure-mode-hook
-;        emacs-lisp-mode-hook
-;        lisp-mode-hook
-;        scheme-mode-hook))
-
-;(dolist (hook lispy-mode-hooks)
-;  (add-hook hook (lambda ()
-;                   (setq show-paren-style 'expression)
-;                   (paredit-mode)
-;                   (rainbow-delimiters-mode))))
-
-
-
-;(add-to-list 'load-path "~/.emacs.d/config")
-
-;; remove custom setting out of init.el
-;; http://emacsblog.org/2008/12/06/quick-tip-detaching-the-custom-file/
-;(setq custom-file "~/.emacs.d/custom.el")
-;(load custom-file 'noerror)
-;(require 'my-packages)
-;(require 'init-base)
-;(require 'init-font)
-
-;(require 'init-helm)
-
-;(require 'init-color-theme)
-;(require 'init-color-theme-2)
-;(require 'init-ido)
-;(require 'init-magit)
-;(require 'init-evil)
-;(require 'init-project)
-;(require 'init-ggtags)
-
-;(require 'init-projectile)
-
-;;;; conflict with C-c . in org-mode, disable it temporarily
-;;;;(require 'init-c-cpp)
-;(require 'init-key-binding)
-;(require 'init-winner)
-;(require 'init-minibuffer)
-;(require 'init-eshell)
-
-;; http://stackoverflow.com/questions/11484225/fix-an-auto-complete-mode-and-linum-mode-annoyance
-;;;(ac-linum-workaround)
-
-
-;(require 'init-mode-line)
-;(require 'init-workgroup2)
-;(require 'init-perl)
-
-;(add-to-list 'load-path "~/.emacs.d/Emacs-PDE-0.2.16/lisp/")
-;(load "pde-load")                       ;
-
-;(require 'init-linum)
-
-;(require 'auto-complete)
-;(require 'auto-complete-config)
-;(ac-config-default)
-
-
-
-
-;; page break configuration
-;(require 'pp-c-l)
-;(pretty-control-l-mode 1)
-
-;; persist command history of helm
-;(require 'session)
-;(add-hook 'after-init-hook 'session-initialize)
-
-
-;(require 'use-package)
-
-;; persist command history of helm
-;(use-package savehist
-;  :init (savehist-mode)
-;  :config
-;  (setq history-length 1000
-;        history-delete-duplicates t
-;        savehist-additional-variables '(extended-command-history))) 
-
-;;(savehist-mode)
-;;  (setq history-length 1000
-;;        history-delete-duplicates t
-;;        savehist-additional-variables '(extended-command-history)) 
-
-;    (setq split-height-threshold 0)
-
-
-
-
-
-;;;(require 'helm-gtags)
-;;;;(require 'setup-helm-gtags)
-;;;;(helm-gtags-mode 1)
-;;;;;; Enable helm-gtags-mode
-;;;(add-hook 'c-mode-hook 'helm-gtags-mode)
-;;;(add-hook 'c++-mode-hook 'helm-gtags-mode)
-;;;(add-hook 'asm-mode-hook 'helm-gtags-mode)
-;;;
-;;;;; customize
-;;;(custom-set-variables
-;;; '(helm-gtags-path-style 'relative)
-;;; '(helm-gtags-ignore-case t)
-;;; '(helm-gtags-auto-update t))
-;;;
-;;;;; key bindings
-;;;(eval-after-load "helm-gtags"
-;;;  '(progn
-;;;     (define-key helm-gtags-mode-map (kbd "M-t") 'helm-gtags-find-tag)
-;;;     (define-key helm-gtags-mode-map (kbd "M-r") 'helm-gtags-find-rtag)
-;;;     (define-key helm-gtags-mode-map (kbd "M-s") 'helm-gtags-find-symbol)
-;;;     (define-key helm-gtags-mode-map (kbd "M-g M-p") 'helm-gtags-parse-file)
-;;;     (define-key helm-gtags-mode-map (kbd "C-c <") 'helm-gtags-previous-history)
-;;;     (define-key helm-gtags-mode-map (kbd "C-c >") 'helm-gtags-next-history)
-;;;     (define-key helm-gtags-mode-map (kbd "M-,") 'helm-gtags-pop-stack)))
-
-
-;(require 'icicles)
-;(icy-mode 1)
-
-
-;;(require 'init-org)
-;(setq help-window-select t)
-
-
-
-;(require 'init-keychord)
-
-;(setq hydra-examples-verbatim t)
-;(require 'init-hydra)
-
-
-;(require 'ace-window)
-;(global-set-key (kbd "M-p") 'ace-window)
-
-
-;(require 'init-multi-term)
-;(require 'init-projectile)
-
-;(require 'page-break-lines)
-;(turn-on-page-break-lines-mode)
-;(global-page-break-lines-mode 1)
-
-;(setq projectile-completion-system 'helm)
-;(helm-projectile-on)
-
-
-;; show projectile name in mode-line
-
-
-;(if (locate-library "ediff")
-;    (progn
-;      (autoload 'ediff-files "ediff")
-;      (autoload 'ediff-buffers "ediff")
-;
-;       (eval-after-load "ediff" '(progn
-;                        (message "doing ediff customisation")
-;                        (setq diff-switches               "-u"
-;                              ediff-custom-diff-options   "-U3"
-;                              ediff-split-window-function 'split-window-horizontally
-;                              ediff-window-setup-function 'ediff-setu;p-windows-plain)
-;
-;                        (add-hook 'ediff-startup-hook 'ediff-toggle-w;ide-display)
-;                        (add-hook 'ediff-cleanup-hook 'ediff-toggle-w;ide-display)
-;                        (add-hook 'ediff-suspend-hook 'ediff-toggle-wide-display)))))
-
-
-
-;(defun update-diff-colors ()
-;  "update the colors for diff faces"
-;  (set-face-attribute 'diff-added nil
-;                      :foreground "white" :background "blue")
-;  (set-face-attribute 'diff-removed nil
-;                      :foreground "white" :background "red3")
-;  (set-face-attribute 'diff-changed nil
-;                      :foreground "white" :background "purple"))
-;(eval-after-load "diff-mode"
-;  '(update-diff-colors))
-
-
-
-;(require 'helm-ag)
-;(require 'flx)
-;(flx-ido-mode t)
-
-
-
-;(fringe-mode (quote (0 . 0)))
-
-
-(custom-set-variables
- ;; custom-set-variables was added by Custom.
- ;; If you edit it by hand, you could mess it up, so be careful.
- ;; Your init file should contain only one such instance.
- ;; If there is more than one, they won't work right.
- '(package-selected-packages
-   (quote
-    (helm yasnippet workgroups2 w3m use-package tangotango-theme tabbar smex session rich-minority relative-line-numbers recentf-ext projectile-speedbar pp-c-l powerline persp-projectile paradox page-break-lines org-cliplink org-caldav org-bullets multi-term monokai-theme molokai-theme moe-theme minibuffer-line markdown-mode magit linum-relative key-chord jekyll-modes irony iedit ido-vertical-mode ido-ubiquitous icicles hydra highlight-tail highlight-escape-sequences highlight-current-line helm-projectile helm-ls-svn helm-ls-git helm-gtags helm-ag google-c-style ggtags flyspell-lazy flymake-google-cpplint flymake-cursor flx-ido fiplr eyebrowse evil-leader evil-escape ecb dired+ diff-hl cyberpunk-theme company color-theme-sanityinc-tomorrow color-theme color-identifiers-mode auto-complete-c-headers ace-window ace-jump-mode))))
-(custom-set-faces
- ;; custom-set-faces was added by Custom.
- ;; If you edit it by hand, you could mess it up, so be careful.
- ;; Your init file should contain only one such instance.
- ;; If there is more than one, they won't work right.
- )
diff --git a/emacs.d_old/.gitignore b/emacs.d_old/.gitignore
new file mode 100644 (file)
index 0000000..439af01
--- /dev/null
@@ -0,0 +1,26 @@
+.*
+elpa/*
+games/*
+test/*
+vendor/*
+el-get/*
+auto-save-list/*
+ido.*
+smex-items
+ac-comphist.dat
+\#init.el\#
+url/*
+recentf
+projectile-bookmarks.eld
+config/init-my-theme-2.el
+config/my-color-theme.el
+\#*
+temp/*
+history
+irony/*
+projectile.cache
+site-lisp/*
+Emacs-PDE*
+helm-adaptive-history
+network-security.data
+custom.el
diff --git a/emacs.d_old/config/init-base.el b/emacs.d_old/config/init-base.el
new file mode 100644 (file)
index 0000000..8a5d6c8
--- /dev/null
@@ -0,0 +1,59 @@
+
+
+(scroll-bar-mode -1)
+(tool-bar-mode -1)
+(menu-bar-mode -1)
+(add-to-list 'default-frame-alist '(width  . 120))
+(add-to-list 'default-frame-alist '(height . 40))
+(add-to-list 'default-frame-alist '(font . "Source Code Pro for Powerline-12:weight:light" ))
+;(add-to-list 'default-frame-alist '(font . "Source Code Pro for Powerline-12" ))
+
+(setq inhibit-startup-message t)
+
+(put 'set-goal-column 'disabled nil)
+(setq vc-follow-symlinks t)
+(setq visible-bell 1)
+(setq ring-bell-function 'ignore)
+(setq resize-mini-windows t)
+(blink-cursor-mode 0)
+
+;(custom-set-variables
+; '(fringe-mode (quote (0 . 0)) nil (fringe)))
+
+(fringe-mode (quote (0 . 0)))
+
+(add-to-list 'auto-mode-alist '("emacs\\'" . emacs-lisp-mode))
+
+
+
+;;; Set symbol for the border
+(set-display-table-slot standard-display-table
+                        'vertical-border 
+                        (make-glyph-code ?┃))
+
+(set-face-attribute 'vertical-border nil  :foreground "gray")
+
+(defalias 'yes-or-no-p 'y-or-n-p)
+
+(setq scroll-margin 5)
+(setq scroll-conservatively 10000)
+(show-paren-mode t)
+
+
+(add-hook 'help-mode-hook
+         (lambda ()
+           (linum-mode -1)))
+
+;; Dired mode
+(require 'dired+)
+;; create new file  key map
+(define-key dired-mode-map "c" 'find-file)
+;; ^ goto-up directory
+(define-key dired-mode-map (kbd "C-c C-u") 'dired-up-directory)
+
+(setq diredp-hide-details-initially-flag t)
+(setq diredp-hide-details-propagate-flag t)
+
+(setq term-buffer-maximum-size 10000)
+
+(provide 'init-base)
diff --git a/emacs.d_old/config/init-c-cpp.el b/emacs.d_old/config/init-c-cpp.el
new file mode 100644 (file)
index 0000000..8f0e945
--- /dev/null
@@ -0,0 +1,87 @@
+
+
+;---------------------------------------------------------------------------------------
+;; irony-mode
+;;
+; set LD_LIBRARY_PATH 
+(setenv "LD_LIBRARY_PATH" "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/")
+; load irony-mode
+;( add-to-list 'load-path (expand-file-name "~/.emacs.d/irony-mode/elisp/"))
+(require 'irony)
+(add-hook 'c++-mode-hook 'irony-mode)
+(add-hook 'c-mode-hook 'irony-mode)
+(add-hook 'objc-mode-hook 'irony-mode)
+
+;; replace the `completion-at-point' and `complete-symbol' bindings in
+;; irony-mode's buffers by irony-mode's function
+(defun my-irony-mode-hook ()
+  (define-key irony-mode-map [remap completion-at-point]
+    'irony-completion-at-point-async)
+  (define-key irony-mode-map [remap complete-symbol]
+    'irony-completion-at-point-async))
+(add-hook 'irony-mode-hook 'my-irony-mode-hook)
+(add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options)
+
+
+;---------------------------------------------------------------------------------------
+;; auto-complete, yasnippt, auto-complete-c-headers, iedit
+;;
+;; c/c++ auto-complete, yasnippet, auto-complet-c-headers
+;;https://www.youtube.com/watch?v=HTUE03LnaXA&list=PL-mFLc7R_MJet8ItKipCtYc7PWoS5KTfM
+;; input TAB to 
+(require 'yasnippet)
+(yas-global-mode 1)
+
+;; auto-complete-c-headers
+(defun my:ac-c-header-init ()
+  (require 'auto-complete-c-headers)
+  (add-to-list 'ac-sources 'ac-source-c-headers)
+  (add-to-list 'achead:include-directories "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include")
+)
+(add-hook 'c++-mode-hook 'my:ac-c-header-init)
+(add-hook 'c-mode-hook 'my:ac-c-header-init)
+
+;;; iedit, fix iedit bug in Mac, C-c ; to trigger multiple cursor edit
+(define-key global-map (kbd "C-c ;") 'iedit-mode)
+
+
+;; flymake-google-cpplint-load
+;; define a function for flymake initialization
+;(defun my:flymake-google-init ()
+;  (require 'flymake-google-cpplint)
+;  (custom-set-variables
+;   '(flymake-google-cpplint-command "/usr/local/bin/cpplint"))
+;  (flymake-google-cpplint-load)
+;  )
+;(add-hook 'c-mode-hook 'my:flymake-google-init)
+;(add-hook 'c++-mode-hook 'my:flymake-google-init)
+
+;; start google-c-style with emacs
+;(require 'google-c-style)
+;(add-hook 'c-mode-hook 'google-set-c-style)
+;(add-hook 'c++-mode-hook 'google-make-newline-indent)
+
+
+
+;---------------------------------------------------------------------------------------
+;; cedet
+;;
+(semantic-mode 1)
+;; let's define a function which adds semantic as a suggestion backend to auto complete
+(defun my:add-semantic-to-autocomplete()
+  (add-to-list 'ac-sources 'ac-source-semantic)
+  )
+(add-hook 'c-mode-common-hook 'my:add-semantic-to-autocomplete)
+;; turn on ede mode
+(global-ede-mode 1)
+
+;(ede-cpp-root-project "my project" :file "~/demos/my_program/src/main.cpp"
+;                    :include-path '("/../my_inc"))
+;; you can use system-include-path for setting up the system header file locations.
+
+;; turn on automatic reparsing of open buffers in semantic
+(global-semantic-idle-scheduler-mode 1)
+(global-semantic-stickyfunc-mode 1)
+
+
+(provide 'init-c-cpp)
diff --git a/emacs.d_old/config/init-colo-theme2.el b/emacs.d_old/config/init-colo-theme2.el
new file mode 100644 (file)
index 0000000..3795b91
--- /dev/null
@@ -0,0 +1,7 @@
+(require 'color-theme)
+
+(color-theme-sanityinc-tomorrow-bright)
+
+
+
+(provide 'init-color-theme-2)
diff --git a/emacs.d_old/config/init-color-theme-2.el b/emacs.d_old/config/init-color-theme-2.el
new file mode 100644 (file)
index 0000000..ba4ca33
--- /dev/null
@@ -0,0 +1,6 @@
+(require 'color-theme)
+
+(load-theme 'sanityinc-tomorrow-bright t)
+
+
+(provide 'init-color-theme-2)
diff --git a/emacs.d_old/config/init-color-theme.el b/emacs.d_old/config/init-color-theme.el
new file mode 100644 (file)
index 0000000..883e802
--- /dev/null
@@ -0,0 +1,330 @@
+
+
+;(setq display-time-day-and-date t)
+;(display-time-mode t)
+
+
+(setq ns-use-srgb-colorspace nil)
+
+(require 'color-theme)
+
+(load-theme 'cyberpunk t)
+
+(require 'evil)
+(require 'powerline)
+;(require 'powerline-evil)
+
+
+
+;(set-face-attribute 'mode-line nil :font "Source Code Pro for Powerline-10")
+
+;;; this variable should equal as height in mode-line
+(custom-set-variables
+ '(powerline-height 14)
+ '(powerline-text-scale-factor 0.85)) ;; 100/140
+
+(custom-set-faces
+;;; '(mode-line ((t (:foreground "#030303" :background "#bdbdbd" :box nil :height 0.8 ))))
+;;; '(mode-line-inactive ((t (:foreground "#f9f9f9" :background "#666666" :box nil :height 0.8)))))
+ '(mode-line ((t (:foreground "#030303" :background "#bdbdbd" :box nil  :family "Source Code Pro for Powerline" :height 100))))
+;; '(mode-line ((t (:foreground "#030303" :background "#bdbdbd" :box nil  :family "Source Code Pro for Powerline" :height 80))))
+ '(mode-line-inactive ((t (:foreground "#f9f9f9" :background "#666666" :box nil :family "Source Code Pro for Powerline" :height 100)))))
+
+(defface powerline-active00 '((t (:foreground "#030303" :background "#bdbdbd" :box nil :inherit mode-line)))
+  "Powerline face 1."
+  :group 'powerline)
+
+(defface powerline-inactive00 '((t (:foreground "#f9f9f9" :background "#666666" :box nil :inherit mode-line)))
+  "Powerline face 1."
+  :group 'powerline)
+
+(defface powerline-active11 '((t (:background "grey22" :inherit mode-line)))
+  "Powerline face 1."
+  :group 'powerline)
+
+(defface powerline-active22 '((t (:background "grey40" :inherit mode-line)))
+  "Powerline face 2."
+  :group 'powerline)
+
+(defface powerline-inactive11   '((t (:background "grey11" :inherit mode-line)))
+  "Powerline face 1."
+  :group 'powerline)
+
+(defface powerline-inactive22   '((t (:background "grey20" :inherit mode-line)))
+  "Powerline face 2."
+  :group 'powerline)
+
+
+;(defface powerline-active-yel '((t (:background "yellow" :inherit mode-line)))
+(defface powerline-active-yel '((t (:background "yellow" :inherit mode-line)))
+  "Powerline face 1."
+  :group 'powerline)
+
+(defface powerline-active-blue '((t (:background "blue" :inherit mode-line)))
+  "Powerline face 1."
+  :group 'powerline)
+
+;;;---------------- evil powerline
+; https://github.com/raugturi/powerline-evil/blob/master/powerline-evil.el
+; ;https://github.com/laynor/emacs-conf/blob/master/packages/sm-package-powerline.el
+;(defface powerline-evil-base-face '((t (:foreground "white" :inherit mode-line)))
+;(defface powerline-evil-base-face '((t (:foreground "black" :weight bold )))
+(defface powerline-evil-base-face '((t (:foreground "black" :weight bold :inherit mode-line)))
+  "Base face for powerline evil faces."
+  :group 'powerline)
+
+(defface powerline-evil-normal-face '((t (:background "green" :inherit powerline-evil-base-face)))
+  "Powerline face for evil NORMAL state."
+  :group 'powerline)
+
+(defface powerline-evil-insert-face '((t (:background "blue" :inherit powerline-evil-base-face)))
+  "Powerline face for evil INSERT state."
+  :group 'powerline)
+
+(defface powerline-evil-visual-face '((t (:background "orange" :inherit powerline-evil-base-face)))
+  "Powerline face for evil VISUAL state."
+  :group 'powerline)
+
+(defface powerline-evil-operator-face   '((t (:background "cyan" :inherit powerline-evil-base-face)))
+  "Powerline face for evil OPERATOR state."
+  :group 'powerline)
+
+(defface powerline-evil-replace-face    '((t (:background "red" :inherit powerline-evil-base-face)))
+  "Powerline face for evil REPLACE state."
+  :group 'powerline)
+
+(defface powerline-evil-motion-face '((t (:background "magenta" :inherit powerline-evil-base-face)))
+  "Powerline face for evil MOTION state."
+  :group 'powerline)
+
+(defface powerline-evil-emacs-face  '((t (:background "violet" :inherit powerline-evil-base-face)))
+  "Powerline face for evil EMACS state."
+  :group 'powerline)
+
+(defun powerline-evil-face ()
+  "Function to select appropriate face based on `evil-state'."
+  (let* ((face (intern (concat "powerline-evil-" (symbol-name evil-state) "-face"))))
+    (if (facep face) face nil)))
+
+
+  (defun powerline-evil-face (active)
+    (let ((face (intern (concat "powerline-evil-" (symbol-name evil-state) "-face"))))
+      (cond ((and active (facep face))
+             face)
+            (active 'powerline-active22)
+            (t 'powerline-inactive22))))
+
+  (defun powerline-evil-face-22 (active)
+    (if (equal (symbol-name evil-state) "normal")
+
+        (let ((face (intern (concat "powerline-evil-emacs-face"))))
+          face)
+
+        (let ((face (intern (concat "powerline-evil-normal-face"))))
+          face)
+
+;;          (cond ((and active (facep face))
+;;                 face)
+;;                (active 'powerline-active22)
+;;                (t 'powerline-inactive22)))
+
+;;;;    (let ((face (intern (concat "powerline-evil-" (symbol-name evil-state) "-face"))))
+;;;;      (cond ((and active (facep face))
+;;;;             face)
+;;;;            (active 'powerline-active22)
+;;;;            (t 'powerline-inactive22)))
+    )
+    )
+
+
+
+  (defpowerline powerline-evil-tag
+    (concat " " (replace-regexp-in-string "[<> ]" "" (eval (evil-state-property evil-state :tag))) " "))
+
+
+
+
+
+;;
+;;http://emacser.com/mode-line.htm
+(defun get-lines-4-mode-line ()
+  (let ((lines (count-lines (point-min) (point-max))))
+    (concat (propertize
+             (format "%d" lines)
+             'mouse-face 'mode-line-highlight
+             'face 'mode-line-lines-face
+             'help-echo (format "%d lines" lines)) " ")))
+
+
+
+(defun powerline-simpler-vc-mode (s)
+  (if s
+      (replace-regexp-in-string "Git:" "" s)
+    s))
+
+(defun powerline-simpler-minor-display (s)
+  (replace-regexp-in-string
+   (concat " "
+           (mapconcat 'identity '("Undo-Tree" "GitGutter" "Projectile"
+                                  "Abbrev" "ColorIds" "MRev" "ElDoc" "Paredit"
+                                  "+1" "+2" "FlyC" "Fly" ;; ":1/0"
+                                  "Fill" "AC" "FIC") "\\|")) "" s))
+
+(defun powerline-format-default-directory (s)
+  (if s
+    (replace-regexp-in-string "/Users/peli3/"  "~/" s)
+    s))
+
+(defun powerline-evil-tag-new ()
+  (concat (replace-regexp-in-string "[<>]" "" (powerline-evil-tag)) " ")
+  )
+
+;; -----------------------------------------------------------------------------
+
+;; -----------------------------------------------------------------------------
+;; |evil| buffer_name | major-mode | vc |            | position | pwd | time |
+;; -----------------------------------------------------------------------------
+;;
+;; ToDo:
+;; position and pwd only shows in some mode, such as programming mode
+;; using workgroup instead of pwd
+;; some other modes such as eshell, package, help, don't need the posittion and
+;; pwd
+;;
+
+;; -----------------------------------------------------------------------------
+
+(defun powerline-ha-theme ()
+  "A powerline theme that removes many minor-modes that don't serve much purpose on the mode-line."
+  (interactive)
+  (setq-default mode-line-format
+                '("%e"
+                  (:eval
+                   (let*
+                       ((active
+                         (powerline-selected-window-active))
+                        (mode-line
+                         (if active 'powerline-active00 'powerline-inactive00))
+                        (face1
+                         (if active 'powerline-active11 'powerline-inactive11))
+                        (face2
+                         (if active 'powerline-active22 'powerline-inactive22))
+                        (face-yel
+                         (if active 'powerline-active-yel 'powerline-inactive22))
+                        (face-blue
+                         (if active 'powerline-active-blue 'powerline-inactive22))
+                        (pl-evil-face (ignore-errors (powerline-evil-face active)))
+                        (pppp-face
+                           (intern (concat "powerline-evil-" (symbol-name evil-state) "-face")))
+
+                        (face-yel22
+                         (if active 'powerline-active-yel 'powerline-inactive22))
+                        (separator-left
+                         (intern
+                          (format "powerline-%s-%s" powerline-default-separator
+                                  (car powerline-default-separator-dir))))
+                        (separator-right
+                         (intern
+                          (format "powerline-%s-%s" powerline-default-separator
+                                  (cdr powerline-default-separator-dir))))
+                        (lhs
+                            (list
+;;                                (let ((evil-face (powerline-evil-face)))
+;;                                    (if evil-mode
+;;                                            (powerline-raw (powerline-evil-tag) evil-face)
+;;                                    )
+;;
+;;                                )
+                                (if evil-mode
+                                (powerline-raw (powerline-evil-tag) pl-evil-face))
+;;;                                (and evil-mode (funcall separator-left pppp-face face-yel))
+;;;;;;                                (funcall separator-left pppp-face pppp-face)
+;;;;                                (powerline-raw (powerline-evil-tag) pppp-face face-yel)
+;;                                (funcall separator-left (powerline-evil-face) face-yel)
+
+                                (powerline-raw "%*" face-yel 'l)
+                                (powerline-buffer-id face-yel 'l)
+                                (powerline-raw " " face-yel)
+                                (funcall separator-left face-yel face-blue )
+                                               (powerline-raw " " face-blue)
+                                (powerline-major-mode face-blue 'r)
+                                (funcall separator-left face-blue mode-line)
+                                (powerline-narrow mode-line 'l)
+;                                (powerline-vc mode-line 'r)
+                                (powerline-simpler-vc-mode (powerline-vc mode-line 'r))
+                                (funcall separator-left mode-line face1)))
+;                                (powerline-simpler-vc-mode (powerline-vc face2))))
+                       
+                        (rhs
+                            (list
+                                (funcall separator-right face1 mode-line)
+                               ;;  position
+;;                             (powerline-raw (concat " [" (powerline-format-default-directory default-directory) "] ") mode-line)
+                                (powerline-raw (format " P:[%s] " (projectile-project-name))  mode-line)
+                                               (funcall separator-right mode-line face-blue)
+                               ;; pwd/workgroups
+                                (powerline-raw (concat "%3c, %l/" (format "%d" (count-lines (point-min) (point-max))) " %4p ") face-blue)
+;                                              (funcall separator-right face-blue face1)
+                                ;; date and time
+;;;                                        (powerline-raw (format-time-string " %m-%d") face1 'r)
+                                (funcall separator-right face-blue face-yel)
+                                           (powerline-raw (format-time-string " %I:%M %p %m-%d %a ") face-yel 'r)))
+                        (center
+                            (list
+                                (powerline-raw " " face1)
+                                (funcall separator-left face1 face2)
+                                (when
+                                    (boundp 'erc-modified-channels-object)
+                                (powerline-raw erc-modified-channels-object face2 'l))
+                                (powerline-major-mode face2 'l)
+                                (powerline-process face2)
+                                (powerline-raw " :" face2)
+
+                                (powerline-simpler-minor-display (powerline-minor-modes face2 'l))
+
+                                (powerline-raw " " face2)
+                                (funcall separator-right face2 face1))))
+
+
+                     (concat
+                      (powerline-render lhs)
+                      (powerline-fill face1
+                                      (powerline-width rhs))
+                      (powerline-render rhs))
+                     ); let
+                   ); :eval
+                  ); '(
+                ); setq
+  ); defun
+
+
+(powerline-ha-theme)
+
+
+
+;;(let ((faces '(mode-line
+;;               powerline-active00
+;;               powerline-active11
+;;               powerline-active22
+;;               powerline-active-yel
+;;               powerline-active-blue
+;;               mode-line-buffer-id
+;;               mode-line-emphasis
+;;               mode-line-highlight
+;;               mode-line-inactive)))
+;;     (mapc
+;;;      (lambda (face) (set-face-attribute face nil :font "Source Code Pro for Powerline-10"))
+;;      (lambda (face) (set-face-attribute face nil :font "Courier"))
+;;      faces))
+
+
+
+(provide 'init-color-theme)
+
+
+
+;; TODO
+;; 1. change color when buffer is modified
+;; 2. 
+;; show date and time in the right below minibuffer
+
diff --git a/emacs.d_old/config/init-elscreen.el b/emacs.d_old/config/init-elscreen.el
new file mode 100644 (file)
index 0000000..3edbacf
--- /dev/null
@@ -0,0 +1,78 @@
+;; this config file is based on  seudut/elscreen.git, which added two interface and one property 
+;; default directory
+
+(elscreen-set-default-directory (elscreen-get-current-screen) "~/")
+
+
+;; tab face
+
+(custom-set-faces
+ '(elscreen-tab-current-screen-face ((t (:background "Yellow" :foreground "black"))))
+ '(elscreen-tab-other-screen-face ((t (:background "gray22" :foreground "black")))))
+
+;;(add-hook 'elscreen-create-hook
+;;          (lambda ()
+;;            (elscreen-set-default-directory  
+;;              (elscreen-get-current-screen) "~/")))
+
+
+(add-hook 'elscreen-goto-hook
+          (lambda ()
+            (elscreen-cd-default-directory
+              (elscreen-get-default-directory (elscreen-get-current-screen)))))
+
+(defun sd-cd-dd (dir)
+  "Set default directory screen."
+  (interactive "sSet dir:")
+  (elscreen-set-default-directory (elscreen-get-current-screen) dir)
+  (cd dir)
+)
+
+    
+(defun sd-show-dir ()
+  "show elscreen default directory."
+  (interactive)
+  (message
+  (elscreen-get-default-directory (elscreen-get-current-screen))))
+
+(defun sd-update-elscreen-dir ()
+  "update elscreen dir as current default directory"
+  (interactive)
+  (elscreen-set-default-directory (elscreen-get-current-screen) default-directory))
+
+
+
+
+;;(add-hook 'buffer-list-update-hook
+;;          (lambda ()
+;;            (let ((el-dir (elscreen-get-default-directory (elscreen-get-current-screen))))
+;;              (if (> (length el-dir) 0)
+;;                 (cd el-dir)))))
+
+(defvar elscreen-exclude-modes '(eshell-mode magit magit-status-mode magit-commit-mode magit-diff-mode) "the major modes don't update directory")
+
+;; when major-mode is magit-*, don't change default-directory, otherwise, there is error when usingit command in magin-* mode
+(add-hook 'elscreen-screen-update-hook
+          (lambda ()
+            (let ((el-dir (elscreen-get-default-directory (elscreen-get-current-screen))))
+             (unless (member  major-mode elscreen-exclude-modes)
+                (if (> (length el-dir) 0)
+                  (cd el-dir))))))
+
+
+
+
+
+;; elscreen should be placed begin of https://github.com/knu/elscreen/issues/6
+;(elscreen-start)
+;(require 'init-elscreen)
+;(require 'elscreen)
+;(custom-set-faces
+; '(elscreen-tab-current-screen-face ((t (:background "Yellow" :foreground "black"))))
+; '(elscreen-tab-other-screen-face ((t (:background "gray22" :foreground "black")))))
+
+
+
+
+
+(provide 'init-elscreen)
diff --git a/emacs.d_old/config/init-eshell.el b/emacs.d_old/config/init-eshell.el
new file mode 100644 (file)
index 0000000..0193ee7
--- /dev/null
@@ -0,0 +1,194 @@
+
+;;(add-hook 'eshell-mode-hook
+;;       (lambda ()
+;;         (linum-mode -1)
+;;         (highlight-current-line-on nil)))
+
+(setenv "PATH"
+        (concat
+         "/usr/local/bin:/usr/local/sbin:"
+         (getenv "PATH")))
+
+(setq eshell-scroll-to-bottom-on-input t)
+
+
+;; copied from howardabrams's config
+(defun eshell/gst (&rest args)
+    (magit-status (pop args) nil)
+    (eshell/echo))  
+
+
+
+(add-hook 'eshell-mode-hook
+   (lambda ()
+      (add-to-list 'eshell-visual-commands "ssh")
+      (add-to-list 'eshell-visual-commands "tail")))
+
+; copied from howard's github
+(defun curr-dir-git-branch-string (pwd)
+  "Returns current git branch as a string, or the empty string if
+PWD is not in a git repo (or the git command is not found)."
+  (interactive)
+  (when (and (eshell-search-path "git")
+             (locate-dominating-file pwd ".git"))
+    (let ((git-output (shell-command-to-string (concat "cd " pwd " && git branch | grep '\\*' | sed -e 's/^\\* //'"))))
+      (if (> (length git-output) 0)
+          (concat " :" (substring git-output 0 -1))
+        "(no branch)"))))
+
+
+
+
+(defun pwd-replace-home (pwd)
+  "Replace home in PWD with tilde (~) character."
+  (interactive)
+  (let* ((home (expand-file-name (getenv "HOME")))
+         (home-len (length home)))
+    (if (and
+         (>= (length pwd) home-len)
+         (equal home (substring pwd 0 home-len)))
+        (concat "~" (substring pwd home-len))
+      pwd)))
+
+
+
+
+(defun pwd-shorten-dirs (pwd)
+  "Shorten all directory names in PWD except the last two."
+  (let ((p-lst (split-string pwd "/")))
+    (if (> (length p-lst) 2)
+        (concat
+         (mapconcat (lambda (elm) (if (zerop (length elm)) ""
+                               (substring elm 0 1)))
+                    (butlast p-lst 2)
+                    "/")
+         "/"
+         (mapconcat (lambda (elm) elm)
+                    (last p-lst 2)
+                    "/"))
+      pwd  ;; Otherwise, we just return the PWD
+      )))
+
+;; Turn off the default prompt.
+(setq eshell-highlight-prompt nil)
+
+
+
+
+(defun split-directory-prompt (directory)
+  (if (string-match-p ".*/.*" directory)
+      (list (file-name-directory directory) (file-name-base directory))
+    (list "" directory)))
+
+
+(setq eshell-prompt-function
+      (lambda ()
+        (let* ((directory (split-directory-prompt (pwd-shorten-dirs (pwd-replace-home (eshell/pwd)))))
+               (parent (car directory))
+               (name (cadr directory))
+               (branch (or (curr-dir-git-branch-string (eshell/pwd)) "")))
+
+          (if (eq 'dark (frame-parameter nil 'background-mode))
+              (concat   ;; Prompt for Dark Themes
+               (propertize parent 'face `(:foreground "#8888FF"))
+               (propertize name   'face `(:foreground "#8888FF" :weight bold))
+               (propertize branch 'face `(:foreground "green"))
+               (propertize " $"   'face `(:weight ultra-bold))
+               (propertize " "    'face `(:weight bold)))
+
+            (concat    ;; Prompt for Light Themes
+             (propertize parent 'face `(:foreground "blue"))
+             (propertize name   'face `(:foreground "blue" :weight bold))
+             (propertize branch 'face `(:foreground "dark green"))
+             (propertize " $"   'face `(:weight ultra-bold))
+             (propertize " "    'face `(:weight bold)))))))
+
+
+
+(setq eshell-highlight-prompt nil)
+
+
+
+(when (require 'esh-buf-stack nil t)
+  (setup-eshell-buf-stack)
+  (add-hook 'eshell-mode-hook
+            (lambda () (local-set-key (kbd "M-q") 'eshell-push-command))))
+
+(defun eshell/x ()
+  "Closes the EShell session and gets rid of the EShell window."
+  (kill-buffer)
+  (delete-window))
+
+
+(defun eshell-here ()
+  "Opens up a new shell in the directory associated with the
+current buffer's file. The eshell is renamed to match that
+directory to make multiple eshell windows easier."
+  (interactive)
+  (let* ((parent (if (buffer-file-name)
+                     (file-name-directory (buffer-file-name))
+                   default-directory))
+         (height (/ (window-total-height) 3))
+         (name   (car (last (split-string parent "/" t)))))
+    (split-window-vertically (- height))
+    (other-window 1)
+    (eshell "new")
+    (rename-buffer (concat "*eshell: " name "*"))
+
+    (insert (concat "ls"))
+    (eshell-send-input)))
+
+(global-set-key (kbd "C-!") 'eshell-here)
+
+
+
+(add-hook 'eshell-mode-hook
+     (lambda ()
+       (local-set-key (kbd "M-P") 'eshell-previous-prompt)
+       (local-set-key (kbd "M-N") 'eshell-next-prompt)
+       (local-set-key (kbd "M-R") 'eshell-list-history)
+       (local-set-key (kbd "M-r")
+              (lambda ()
+                (interactive)
+                (insert
+                 (ido-completing-read "Eshell history: "
+                                      (delete-dups
+                                       (ring-elements eshell-history-ring))))))))
+
+
+
+
+(require 'em-smart)
+(setq eshell-where-to-jump 'begin)
+(setq eshell-review-quick-commands nil)
+(setq eshell-smart-space-goes-to-end t)
+
+
+
+(defun execute-command-on-file-buffer (cmd)
+  (interactive "sCommand to execute: ")
+  (let* ((file-name (buffer-file-name))
+         (full-cmd (concat cmd " " file-name)))
+    (shell-command full-cmd)))
+
+(defun execute-command-on-file-directory (cmd)
+  (interactive "sCommand to execute: ")
+  (let* ((dir-name (file-name-directory (buffer-file-name)))
+         (full-cmd (concat "cd " dir-name "; " cmd)))
+    (shell-command full-cmd)))
+
+(global-set-key (kbd "A-1") 'execute-command-on-file-buffer)
+(global-set-key (kbd "A-!") 'execute-command-on-file-directory)
+
+
+
+
+
+;; alias
+
+(defalias 'e 'find-file)
+(defalias 'ee 'find-file-other-window)
+
+
+
+(provide 'init-eshell)
diff --git a/emacs.d_old/config/init-evil.el b/emacs.d_old/config/init-evil.el
new file mode 100644 (file)
index 0000000..3e7856e
--- /dev/null
@@ -0,0 +1,85 @@
+
+;;---------------------------------------------------------------------------------------
+;; evil
+;;
+
+(require 'evil)
+
+(defalias 'evil-insert-state 'evil-emacs-state)
+
+;;https://github.com/toumorokoshi/yt.rc/blob/master/emacs/my-evil.el
+(define-key evil-visual-state-map "\C-w" nil)
+;(define-key evil-normal-state-map (kbd "M-.") nil)
+(define-key evil-normal-state-map "\C-t" nil)
+(define-key evil-normal-state-map "\C-p" nil)
+(define-key evil-normal-state-map "\C-n" nil)
+(define-key evil-normal-state-map "\C-k" nil)
+(define-key evil-normal-state-map "\C-l" nil)
+(define-key evil-normal-state-map "\C-k" nil)
+(define-key evil-normal-state-map "\C-j" nil)
+(define-key evil-normal-state-map "\C-o" nil)
+
+
+;; M-e not works correctly in evil-normal mode, this fix it
+(define-key evil-normal-state-map "\M-e" (lambda() (interactive)
+                                          (forward-sentence 2)))
+(define-key evil-motion-state-map "\C-e" (move-end-of-line 1))
+
+
+;; most common keys in normal-mode to swith buffer, project, windows,
+;; in emacs mode, Esc + s + x, the same
+(global-evil-leader-mode)
+(evil-leader/set-leader "s")
+(evil-leader/set-key "j" 'pl-switch-buffers)
+(evil-leader/set-key "h" 'persp-switch)
+(evil-leader/set-key "k" 'helm-cmd-t)
+(evil-leader/set-key "b" 'helm-mini)
+(evil-leader/set-key "m" 'helm-mini)
+
+
+(setq key-chord-two-keys-delay 0.5)
+(key-chord-define evil-insert-state-map "jj" 'evil-normal-state)
+(key-chord-define evil-emacs-state-map "jj" 'evil-normal-state)
+
+(key-chord-define evil-normal-state-map ";s" 'split-window-below)
+(key-chord-define evil-normal-state-map ";v" 'split-window-right)
+
+(key-chord-mode 1)
+
+(define-key evil-normal-state-map [escape] 'keyboard-quit)
+(define-key evil-visual-state-map [escape] 'keyboard-quit)
+
+(setq evil-emacs-state-cursor '("red" box))
+(setq evil-normal-state-cursor '("green" box))
+(setq evil-visual-state-cursor '("orange" box))
+(setq evil-insert-state-cursor '("red" bar))
+(setq evil-replace-state-cursor '("red" bar))
+(setq evil-operator-state-cursor '("red" hollow))
+(loop for (mode . state) in '(
+                  (nrepl-mode . insert)
+                  (pylookup-mode . emacs)
+                  (comint-mode . normal)
+                  (shell-mode . emacs)
+                  (git-commit-mode . emacs)
+                  (git-rebase-mode . emacs)
+                  (term-mode . emacs)
+                  (help-mode . emacs)
+                  (helm-grep-mode . emacs)
+                  (grep-mode . emacs)
+                  (bc-menu-mode . emacs)
+                  (magit-branch-manager-mode . emacs)
+                  (magit-popup-mode . emacs)
+                  (rdictcc-buffer-mode . emacs)
+                  (dired-mode . emacs)
+                  (text-mode . emacs)
+                  (wdired-mode . normal)
+;                          (inferior-emacs-lisp-mode . emacs)
+;                          (wdired-mode . normal)
+                           (eshell-mode . emacs))
+    do (evil-set-initial-state mode state))
+
+
+;(global-evil-tabs-mode t)
+(evil-mode 1)
+
+(provide 'init-evil)
diff --git a/emacs.d_old/config/init-font.el b/emacs.d_old/config/init-font.el
new file mode 100644 (file)
index 0000000..9e41fc2
--- /dev/null
@@ -0,0 +1,74 @@
+
+;; http://coldnew.github.io/blog/2013/11/16_d2f3a.html
+(defvar emacs-english-font "Source Code Pro for Powerline:weigth:light"
+  "The font name of English.")
+
+(defvar emacs-cjk-font "Heiti SC"
+  "The font name for CJK.")
+
+
+(defvar emacs-font-size-pair '(12 . 14)
+  "Default font size pair for (english . chinese)")
+
+(defvar emacs-font-size-pair-list
+  '(( 5 .  6) (10 . 12) (12 . 14)
+    (13 . 16) (15 . 18) (17 . 20)
+    (19 . 22) (20 . 24) (21 . 26)
+    (24 . 28) (26 . 32) (28 . 34)
+    (30 . 36) (34 . 40) (36 . 44))
+  "This list is used to store matching (englis . chinese) font-size.")
+
+
+(defun font-exist-p (fontname)
+  "Test if this font is exist or not."
+  (if (or (not fontname) (string= fontname ""))
+      nil
+    (if (not (x-list-fonts fontname)) nil t)))
+
+(defun set-font (english chinese size-pair)
+  "Setup emacs English and Chinese font on x window-system."
+
+  (if (font-exist-p english)
+      (set-frame-font (format "%s:pixelsize=%d" english (car size-pair)) t))
+
+  (if (font-exist-p chinese)
+      (dolist (charset '(kana han symbol cjk-misc bopomofo))
+        (set-fontset-font (frame-parameter nil 'font) charset
+                          (font-spec :family chinese :size (cdr size-pair))))))
+
+
+;; Setup font size based on emacs-font-size-pair
+;(if (display-graphic-p)
+;    (set-font emacs-english-font emacs-cjk-font emacs-font-size-pair))
+
+
+(defun emacs-step-font-size (step)
+  "Increase/Decrease emacs's font size."
+  (let ((scale-steps emacs-font-size-pair-list))
+    (if (< step 0) (setq scale-steps (reverse scale-steps)))
+    (setq emacs-font-size-pair
+          (or (cadr (member emacs-font-size-pair scale-steps))
+              emacs-font-size-pair))
+    (when emacs-font-size-pair
+      (message "emacs font size set to %.1f" (car emacs-font-size-pair))
+      (set-font emacs-english-font emacs-cjk-font emacs-font-size-pair))))
+
+
+(defun increase-emacs-font-size ()
+  "Decrease emacs's font-size acording emacs-font-size-pair-list."
+  (interactive) (emacs-step-font-size 1))
+
+(defun decrease-emacs-font-size ()
+  "Increase emacs's font-size acording emacs-font-size-pair-list."
+  (interactive) (emacs-step-font-size -1))
+
+
+;(global-set-key (kbd "C-=") 'increase-emacs-font-size)
+;(global-set-key (kbd "C--") 'decrease-emacs-font-size)
+
+(global-set-key (kbd "C-=") 'text-scale-increase)
+(global-set-key (kbd "C--") 'text-scale-decrease)
+
+
+
+(provide 'init-font)
diff --git a/emacs.d_old/config/init-ggtags.el b/emacs.d_old/config/init-ggtags.el
new file mode 100644 (file)
index 0000000..d109e68
--- /dev/null
@@ -0,0 +1,25 @@
+
+;;;; show default directory on mode-line
+(ggtags-mode 1)
+
+;;;; using ido-completion for ggtags
+;;;; https://github.com/leoliu/ggtags/issues/56
+;;(setq ggtags-completing-read-function
+;;      (lambda (&rest args)
+;;        (apply #'ido-completing-read
+;;               (car args)
+;;               (all-completions "" ggtags-completion-table)
+;;               (cddr args))))
+
+(custom-set-variables
+ '(ggtags-split-window-function (quote split-window-vertically)))
+
+
+(setq-local imenu-create-index-function #'ggtags-build-imenu-index)
+
+
+; gnu global support
+(require 'semantic/db)
+(global-semanticdb-minor-mode 1)
+
+(provide 'init-ggtags)
diff --git a/emacs.d_old/config/init-helm.el b/emacs.d_old/config/init-helm.el
new file mode 100644 (file)
index 0000000..316aeb6
--- /dev/null
@@ -0,0 +1,61 @@
+
+(require 'helm)
+(require 'helm-config)
+
+
+
+;(require 'helm-adaptive)
+(helm-mode 1)
+
+;; helm-M-x
+(global-set-key (kbd "M-x") 'helm-M-x)
+(setq helm-M-x-fuzzy-match t) ;; optional fuzzy matching for helm-M-x
+
+;; helm-mini
+;;(global-set-key (kbd "C-x b") 'helm-mini)
+;;(global-set-key (kbd "C-o C-j") 'helm-mini)
+(setq helm-buffers-fuzzy-matching t
+      helm-recentf-fuzzy-match    t)
+
+;; helm-find-file
+;(global-set-key (kbd "C-x C-f") 'helm-find-files)
+;;(global-set-key (kbd "C-o C-f") 'helm-find-files)
+
+(setq helm-candidate-number-limit 30)
+
+;; http://stackoverflow.com/questions/9992475/how-to-show-anything-buffers-always-in-new-window
+(setq helm-display-function
+      (lambda (buf)
+        (split-window-vertically)
+        (other-window 1)
+        (switch-to-buffer buf)))
+
+
+;;;;;;; http://tuhdo.github.io/helm-intro.html
+;;;;;(setq helm-split-window-in-side-p           t ; open helm buffer inside current window, not occupy whole other window
+;;;;;      helm-move-to-line-cycle-in-source     t ; move to end or beginning of source when reaching top or bottom of source.
+;;;;;      helm-ff-search-library-in-sexp        t ; search for library in `require' and `declare-function' sexp.
+;;;;;      helm-scroll-amount                    8 ; scroll 8 lines other window using M-<next>/M-<prior>
+;;;;;      helm-ff-file-name-history-use-recentf t)
+
+
+
+(helm-autoresize-mode 1)
+(helm-adaptive-mode 1)
+(helm-adaptative-mode 1)
+(setq helm-adaptive-history 1)
+
+
+;;j;(defun helm-buffer-face-mode ()
+;;j;  "Helm buffer face"
+;;j;  (interactive)
+;;j;  (with-helm-buffer ;;j;  (setq line-spacing 2)
+;;j;  (buffer-face-set '(:family "Source Code Pro" :height 100))))
+                                                             
+
+;;;(add-hook 'helm-update-hook 'helm-buffer-face-mode)
+
+(require 'helm-cmd-t)
+(require 'helm-C-x-b)
+
+(provide 'init-helm)
diff --git a/emacs.d_old/config/init-hydra.el b/emacs.d_old/config/init-hydra.el
new file mode 100644 (file)
index 0000000..2f8e41b
--- /dev/null
@@ -0,0 +1,316 @@
+
+(require 'hydra)
+
+;; misc operation for toggle some style
+;; such as toggle line number
+;; windows layout restore / maximum
+
+
+  (defhydra hydra-zoom (global-map "<f2>")
+    "zoom"
+    ("g" text-scale-increase "in")
+    ("l" text-scale-decrease "out"))
+
+;; Misc commands
+(defhydra hydra-misc (:exit t)
+  "Misc commancs"
+  ("p" (lambda ()
+        (interactive)
+        (if (buffer-exists "*Packages*")
+            (switch-to-buffer "*Packages*")
+          (package-list-packages)))
+   "list-package" :color red)
+  ("e" eval-buffer "eval-buffer" :color red))
+
+(defun buffer-exists (bufname)   (not (eq nil (get-buffer bufname))))
+(global-set-key (kbd "M-c") 'hydra-misc/body)
+
+(global-set-key
+; (kbd "C-M-o")
+ (kbd "M-o")
+      (defhydra hydra-window ()
+       "window"
+       ("h" windmove-left)
+       ("j" windmove-down)
+       ("l" windmove-right)
+       ("k" windmove-up)
+       ("v" (lambda ()
+              (interactive)
+              (split-window-right)
+              (windmove-right))
+        "vert")
+       ("s" (lambda ()
+              (interactive)
+              (split-window-below)
+              (windmove-down))
+        "horz")
+       ("o" delete-other-windows "one" :color blue)
+       ("a" ace-window "ace")
+       ("w" ace-swap-window "swap")
+       ("d" ace-delete-window "del")
+       ("i" ace-maximize-window "ace-one" :color blue)
+       ("b" ido-switch-buffer "buf")
+       ("u" (progn (winner-undo) (setq this-command 'winner-undo)) "undo")
+       ("q" nil "cancel")))
+
+;(defun pl-last-winner ()
+  
+
+;;(defhydra hydra-launcher (:color blue :columns 2)
+;;   "Launch"
+;;   ("h" man "man")
+;;   ("r" (browse-url "http://www.reddit.com/r/emacs/") "reddit")
+;;   ("w" (browse-url "http://www.emacswiki.org/") "emacswiki")
+;;   ("s" shell "shell")
+;;   ("q" nil "cancel"))
+
+;; define C-space start mark 
+
+
+;;** Example 2: move window splitter
+
+  (defhydra hydra-splitter (global-map "C-M-s")
+    "splitter"
+    ("h" hydra-move-splitter-left)
+    ("j" hydra-move-splitter-down)
+    ("k" hydra-move-splitter-up)
+    ("l" hydra-move-splitter-right))
+
+;;** Example 3: jump to error
+
+  (defhydra hydra-error (global-map "M-g")
+    "goto-error"
+    ("h" first-error "first")
+    ("j" next-error "next")
+    ("k" previous-error "prev")
+    ("v" recenter-top-bottom "recenter")
+    ("q" nil "quit"))
+
+
+
+
+
+;;** Example 5: mini-vi
+(defun hydra-vi/pre ()
+  (set-cursor-color "#e52b50"))
+
+(defun hydra-vi/post ()
+  (set-cursor-color "#ffffff"))
+
+
+;  (global-set-key
+;   (kbd "C-z")
+;   (defhydra hydra-vi (:pre hydra-vi/pre :post hydra-vi/post :color amaranth)
+;     "vi"
+;     ("l" forward-char)
+;     ("h" backward-char)
+;     ("j" next-line)
+;     ("k" previous-line)
+;     ("m" set-mark-command "mark")
+;     ("a" move-beginning-of-line "beg")
+;     ("e" move-end-of-line "end")
+;     ("d" delete-region "del" :color blue)
+;     ("y" kill-ring-save "yank" :color blue)
+;     ("q" nil "quit")))
+
+(setq hydra-lv nil)
+
+;;** Example 6: selective global bind
+
+  (defhydra hydra-next-error (global-map "C-x")
+    "next-error"
+    ("`" next-error "next")
+    ("j" next-error "next" :bind nil)
+    ("k" previous-error "previous" :bind nil))
+
+;; This example will bind "C-x `" in `global-map', but it will not
+;; bind "C-x j" and "C-x k".
+;; You can still "C-x `jjk" though.
+
+;;** Example 7: toggle with Ruby-style docstring
+(defvar whitespace-mode nil)
+(defhydra hydra-toggle (:color pink)
+  "
+_a_ abbrev-mode:       %`abbrev-mode
+_d_ debug-on-error:    %`debug-on-error
+_f_ auto-fill-mode:    %`auto-fill-function
+_t_ truncate-lines:    %`truncate-lines
+_w_ whitespace-mode:   %`whitespace-mode
+
+"
+  ("a" abbrev-mode nil)
+  ("d" toggle-debug-on-error nil)
+  ("f" auto-fill-mode nil)
+  ("t" toggle-truncate-lines nil)
+  ("w" whitespace-mode nil)
+  ("q" nil "quit"))
+;; Recommended binding:
+;; (global-set-key (kbd "C-c C-v") 'hydra-toggle/body)
+
+;; Here, using e.g. "_a_" translates to "a" with proper face.
+;; More interestingly:
+;;
+;;     "foobar %`abbrev-mode" means roughly (format "foobar %S" abbrev-mode)
+;;
+;; This means that you actually see the state of the mode that you're changing.
+
+;;** Example 8: the whole menu for `Buffer-menu-mode'
+(defhydra hydra-buffer-menu (:color pink
+                             :hint nil)
+  "
+^Mark^             ^Unmark^           ^Actions^          ^Search
+^^^^^^^^-----------------------------------------------------------------                        (__)
+_m_: mark          _u_: unmark        _x_: execute       _R_: re-isearch                         (oo)
+_s_: save          _U_: unmark up     _b_: bury          _I_: isearch                      /------\\/
+_d_: delete        ^ ^                _g_: refresh       _O_: multi-occur                 / |    ||
+_D_: delete up     ^ ^                _T_: files only: % -28`Buffer-menu-files-only^^    *  /\\---/\\
+_~_: modified      ^ ^                ^ ^                ^^                                 ~~   ~~
+"
+  ("m" Buffer-menu-mark)
+  ("u" Buffer-menu-unmark)
+  ("U" Buffer-menu-backup-unmark)
+  ("d" Buffer-menu-delete)
+  ("D" Buffer-menu-delete-backwards)
+  ("s" Buffer-menu-save)
+  ("~" Buffer-menu-not-modified)
+  ("x" Buffer-menu-execute)
+  ("b" Buffer-menu-bury)
+  ("g" revert-buffer)
+  ("T" Buffer-menu-toggle-files-only)
+  ("O" Buffer-menu-multi-occur :color blue)
+  ("I" Buffer-menu-isearch-buffers :color blue)
+  ("R" Buffer-menu-isearch-buffers-regexp :color blue)
+  ("c" nil "cancel")
+  ("v" Buffer-menu-select "select" :color blue)
+  ("o" Buffer-menu-other-window "other-window" :color blue)
+  ("q" quit-window "quit" :color blue))
+;; Recommended binding:
+;; (define-key Buffer-menu-mode-map "." 'hydra-buffer-menu/body)
+
+;;** Example 9: s-expressions in the docstring
+;; You can inline s-expresssions into the docstring like this:
+(defvar dired-mode-map)
+(when (bound-and-true-p hydra-examples-verbatim)
+  (require 'dired)
+  (defhydra hydra-marked-items (dired-mode-map "")
+    "
+Number of marked items: %(length (dired-get-marked-files))
+"
+    ("m" dired-mark "mark")))
+
+;; This results in the following dynamic docstring:
+;;
+;;     (format "Number of marked items: %S\n"
+;;             (length (dired-get-marked-files)))
+;;
+;; You can use `format'-style width specs, e.g. % 10(length nil).
+
+;;** Example 10: apropos family
+(defhydra hydra-apropos (:color blue
+                         :hint nil)
+  "
+_a_propos        _c_ommand
+_d_ocumentation  _l_ibrary
+_v_ariable       _u_ser-option
+^ ^          valu_e_"
+  ("a" apropos)
+  ("d" apropos-documentation)
+  ("v" apropos-variable)
+  ("c" apropos-command)
+  ("l" apropos-library)
+  ("u" apropos-user-option)
+  ("e" apropos-value))
+;; Recommended binding:
+;; (global-set-key (kbd "C-c h") 'hydra-apropos/body)
+
+;;** Example 11: rectangle-mark-mode
+(defhydra hydra-rectangle (:body-pre (rectangle-mark-mode 1)
+                           :color pink
+                           :post (deactivate-mark))
+  "
+  ^_k_^     _d_elete    _s_tring
+_h_   _l_   _o_k        _y_ank
+  ^_j_^     _n_ew-copy  _r_eset
+^^^^        _e_xchange  _u_ndo
+^^^^        ^ ^         _p_aste
+"
+  ("h" backward-char nil)
+  ("l" forward-char nil)
+  ("k" previous-line nil)
+  ("j" next-line nil)
+  ("e" hydra-ex-point-mark nil)
+  ("n" copy-rectangle-as-kill nil)
+  ("d" delete-rectangle nil)
+  ("r" (if (region-active-p)
+           (deactivate-mark)
+         (rectangle-mark-mode 1)) nil)
+  ("y" yank-rectangle nil)
+  ("u" undo nil)
+  ("s" string-rectangle nil)
+  ("p" kill-rectangle nil)
+  ("o" nil nil))
+
+;; Recommended binding:
+;; (global-set-key (kbd "C-x SPC") 'hydra-rectangle/body)
+
+;;* Helpers
+(require 'windmove)
+
+(defun hydra-move-splitter-left (arg)
+  "Move window splitter left."
+  (interactive "p")
+  (if (let ((windmove-wrap-around))
+        (windmove-find-other-window 'right))
+      (shrink-window-horizontally arg)
+    (enlarge-window-horizontally arg)))
+
+(defun hydra-move-splitter-right (arg)
+  "Move window splitter right."
+  (interactive "p")
+  (if (let ((windmove-wrap-around))
+        (windmove-find-other-window 'right))
+      (enlarge-window-horizontally arg)
+    (shrink-window-horizontally arg)))
+
+(defun hydra-move-splitter-up (arg)
+  "Move window splitter up."
+  (interactive "p")
+  (if (let ((windmove-wrap-around))
+        (windmove-find-other-window 'up))
+      (enlarge-window arg)
+    (shrink-window arg)))
+
+(defun hydra-move-splitter-down (arg)
+  "Move window splitter down."
+  (interactive "p")
+  (if (let ((windmove-wrap-around))
+        (windmove-find-other-window 'up))
+      (shrink-window arg)
+    (enlarge-window arg)))
+
+(defvar rectangle-mark-mode)
+(defun hydra-ex-point-mark ()
+  "Exchange point and mark."
+  (interactive)
+  (if rectangle-mark-mode
+      (exchange-point-and-mark)
+    (let ((mk (mark)))
+      (rectangle-mark-mode 1)
+      (goto-char mk))))
+
+(provide 'init-hydra)
+
+
+;;** Example 4: toggle rarely used modes
+
+;  (defvar whitespace-mode nil)
+;  (global-set-key
+;   (kbd "C-c C-v")
+;   (defhydra hydra-toggle-simple (:color blue)
+;     "toggle"
+;     ("a" abbrev-mode "abbrev")
+;     ("d" toggle-debug-on-error "debug")
+;     ("f" auto-fill-mode "fill")
+;     ("t" toggle-truncate-lines "truncate")
+;     ("w" whitespace-mode "whitespace")
+;     ("q" nil "cancel")))
diff --git a/emacs.d_old/config/init-ido.el b/emacs.d_old/config/init-ido.el
new file mode 100644 (file)
index 0000000..0f0ca0b
--- /dev/null
@@ -0,0 +1,25 @@
+
+;---------------------------------------------------------------------------------------
+;; Ido
+;;
+(require 'ido-vertical-mode)
+(ido-vertical-mode 1)
+(require 'flx-ido)
+(ido-mode 1)
+(ido-everywhere 1)
+(flx-ido-mode 1)
+(setq ido-use-faces nil)
+
+(setq org-completion-use-ido t)
+(setq magit-completing-read-function 'magit-ido-completing-read)
+
+(require 'ido-ubiquitous)
+(ido-ubiquitous-mode 1)
+
+;; smex
+(require 'smex) 
+(global-set-key (kbd "M-x") 'smex)
+(global-set-key (kbd "M-X") 'smex-major-mode-commands)
+
+
+(provide 'init-ido)
diff --git a/emacs.d_old/config/init-key-binding.el b/emacs.d_old/config/init-key-binding.el
new file mode 100644 (file)
index 0000000..cadcf29
--- /dev/null
@@ -0,0 +1,242 @@
+;; This  file is for some global key binding
+
+
+(setq mac-command-modifier 'super) ; make cmd key do Meta
+
+(global-set-key (kbd "<s-return>") 'toggle-frame-fullscreen)
+
+;; global swith project - plugin projectile
+(global-set-key (kbd "s-t") 'helm-projectile-switch-project)
+(global-set-key (kbd "s-n") 'persp-next)
+(global-set-key (kbd "s-p") 'persp-prev)
+(global-set-key (kbd "s-h") 'persp-switch)
+(global-set-key (kbd "s-j") 'helm-projectile-switch-to-buffer)
+(global-set-key (kbd "s-k") 'helm-cmd-t)
+
+
+(defun pl-make-keymap (key bindings)
+  (setq keymap (make-sparse-keymap))
+  (dolist (binding bindings)
+    (define-key keymap (car binding) (cdr binding)))
+  (global-set-key key keymap))
+
+;; Esc s or M-s as prefix key
+(pl-make-keymap "\M-s"
+            '(("j" . pl-switch-buffers)
+             ("h" . persp-switch)
+             ("k" . helm-cmd-t)
+             ("w" . save-buffer)
+             ("q" . helm-find-files)
+             ("-" . split-window-below)
+             ("\\" . split-window-right)
+             ("o" . occur)
+             ("b" . helm-find-files)))
+
+;; if current is not a project, useing helm-mini instead
+(defun pl-switch-buffers ()
+  (interactive)
+  (if (projectile-project-p)
+      (helm-projectile-switch-to-buffer)
+    (helm-mini)))
+  
+
+;; key-chord
+(require 'key-chord)
+
+(setq key-chord-two-keys-delay 0.5)
+
+;; from emacs conference 2015 workshop
+(defun keychord-keymap (keychord bindings)
+  (setq keymap (make-sparse-keymap))
+  (dolist (binding bindings)
+    (define-key keymap (car binding) (cdr binding)))
+  (key-chord-define-global keychord keymap))
+
+(defun switch-to-previous-buffer ()
+  "Switch to previously open buffer. Repeated invocations toggle between the two most recently open buffers."
+  (interactive)
+  (switch-to-buffer (other-buffer (current-buffer) 1)))
+
+
+;; main keymap
+;n(keychord-keymap "ss"
+;                 '(("j" . helm-mini)
+;                   ("k" . find-file)
+;                 ("o" . delete-other-windows)))
+
+;; for some helm key mapping
+;(key-chord-define-global "sj" 'helm-mini)
+;(key-chord-define-global "sk" 'helm-find-files)
+
+
+;(key-chord-define-global "JJ" 'save-buffer)
+;(key-chord-define-global "HH" 'save-buffer)
+;(key-chord-define-global "KK" 'save-buffer)
+;(key-chord-define-global "LL" 'save-buffer)
+;(key-chord-define-global "LL" 'save-buffer)
+;(key-chord-define-global "UU" 'save-buffer)
+;(key-chord-define-global "II" 'save-buffer)
+;(key-chord-define-global "OO" 'save-buffer)
+;(key-chord-define-global "NN" 'save-buffer)
+;(key-chord-define-global "MM" 'save-buffer)
+;(key-chord-define-global "PP" 'save-buffer)
+;(key-chord-define-global "YY" 'save-buffer)
+
+
+
+(key-chord-define minibuffer-local-map "jj"  'keyboard-escape-quit)
+(key-chord-define minibuffer-local-ns-map "jj"  'keyboard-escape-quit)
+(key-chord-define minibuffer-local-isearch-map "jj"  'keyboard-escape-quit)
+(key-chord-define minibuffer-local-completion-map "jj"  'keyboard-escape-quit)
+(key-chord-define minibuffer-local-must-match-map "jj"  'keyboard-escape-quit)
+(key-chord-define minibuffer-local-must-match-filename-map "jj"  'keyboard-escape-quit)
+(key-chord-define minibuffer-local-filename-completion-map "jj"  'keyboard-escape-quit)
+(key-chord-define minibuffer-local-filename-must-match-map "jj"  'keyboard-escape-quit)
+
+
+(define-key minibuffer-local-map [escape]  'keyboard-escape-quit)
+(define-key minibuffer-local-ns-map [escape]  'keyboard-escape-quit)
+(define-key minibuffer-local-isearch-map [escape]  'keyboard-escape-quit)
+(define-key minibuffer-local-completion-map [escape]  'keyboard-escape-quit)
+(define-key minibuffer-local-must-match-map [escape]  'keyboard-escape-quit)
+(define-key minibuffer-local-must-match-filename-map [escape]  'keyboard-escape-quit)
+(define-key minibuffer-local-filename-completion-map [escape]  'keyboard-escape-quit)
+(define-key minibuffer-local-filename-must-match-map [escape]  'keyboard-escape-quit)
+
+
+
+(key-chord-mode 1)
+
+
+
+
+;; ESC ; j M-; add comment, 
+(pl-make-keymap "\M-;"
+            '(("v" . split-window-below)
+             ("h" . split-window-right)
+             ("b" . helm-find-files)))
+
+;; ESC c 
+;(pl-make-keymap "\M-c"
+;            '(("v" . split-window-below)
+;            ("h" . split-window-right)
+;            ("b" . helm-find-files)))
+
+
+;; Esc o - set font , can change
+;; M-l M-u low/up caps can changed
+;; M-t transpose, not used, changed
+;; M-z
+;; M-c capitialize
+
+
+;(global-set-key (kbd "M-s j") 'helm-mini)
+;(global-set-key (kbd "M-s k") 'helm-find-files)
+
+;; ESC ESC + i
+(global-set-key (kbd "ESC M-h") 'helm-mini)
+(global-set-key (kbd "ESC M-j") 'helm-mini)
+(global-set-key (kbd "ESC M-k") 'helm-mini)
+(global-set-key (kbd "ESC M-l") 'helm-mini)
+(global-set-key (kbd "ESC M-;") 'helm-mini)
+(global-set-key (kbd "ESC M-y") 'helm-mini)
+(global-set-key (kbd "ESC M-u") 'helm-mini)
+(global-set-key (kbd "ESC M-i") 'helm-mini)
+(global-set-key (kbd "ESC M-o") 'other-window)
+(global-set-key (kbd "ESC M-p") 'helm-mini)
+(global-set-key (kbd "ESC M-n") 'helm-mini)
+(global-set-key (kbd "ESC M-m") 'helm-mini)
+(global-set-key (kbd "ESC M-y") 'helm-mini)
+(global-set-key (kbd "ESC M-s") 'split-window-below)
+(global-set-key (kbd "ESC M-v") 'split-window-right)
+(global-set-key (kbd "ESC M-u") 'helm-mini)
+(global-set-key (kbd "ESC M-i") 'helm-mini)
+(global-set-key (kbd "ESC M-p") 'helm-mini)
+(global-set-key (kbd "ESC M-;") 'helm-mini)
+(global-set-key (kbd "ESC M-1") 'delete-other-windows)
+(global-set-key (kbd "ESC M-2") 'split-window-below)
+(global-set-key (kbd "ESC M-3") 'split-window-right)
+
+
+(global-set-key (kbd "C-; C-j") 'helm-mini)
+
+;(global-set-key (kbd "<escape> j") 'helm-mini)
+;(global-set-key (kbd "<escape> k") 'helm-find-files)
+;(global-set-key (kbd "<escape> l") 'find-file)
+;(global-set-key (kbd "<escape> f") 'find-file)
+;(global-set-key (kbd "<escape> M-a") 'find-file)
+;(global-set-key (kbd "<escape> M-a") 'find-file)
+;(global-set-key (kbd "<escape> M-a") 'find-file)
+;(global-set-key (kbd "<escape> M-o") 'delete-other-windows)
+;(global-set-key (kbd "<escape> M-h") 'other-window)
+;(global-set-key (kbd "<escape> M-j") 'find-file)
+;(global-set-key (kbd "<escape> M-k") 'find-file)
+;(global-set-key (kbd "<escape> M-l") 'find-file)
+
+
+
+;; project
+;(global-set-key (kbd "<escape> M-n") 'find-file)
+;(global-set-key (kbd "<escape> M-m") 'find-file)
+;(global-set-key (kbd "<escape> M-p") 'find-file)
+;(global-set-key (kbd "<escape> M-u") 'find-file)
+;(global-set-key (kbd "<escape> M-y") 'find-file)
+;(global-set-key (kbd "<escape> <escape>") 'find-file)
+
+
+
+
+
+;;(global-set-key (kbd "s-k") (lambda () (interactive) (elscreen-kill (elscreen-get-current-screen))))
+;;(global-set-key (kbd "s-d") (lambda () (interactive) (elscreen-kill (elscreen-get-current-screen))))
+;; C-c C-d
+
+(global-set-key (kbd "s-`") (lambda () (interactive) (elscreen-goto 0)))
+(global-set-key (kbd "s-1") (lambda () (interactive) (elscreen-goto 1)))
+(global-set-key (kbd "s-2") (lambda () (interactive) (elscreen-goto 2)))
+(global-set-key (kbd "s-3") (lambda () (interactive) (elscreen-goto 3)))
+(global-set-key (kbd "s-4") (lambda () (interactive) (elscreen-goto 4)))
+(global-set-key (kbd "s-5") (lambda () (interactive) (elscreen-goto 5)))
+(global-set-key (kbd "s-6") (lambda () (interactive) (elscreen-goto 6)))
+(global-set-key (kbd "s-7") (lambda () (interactive) (elscreen-goto 7)))
+(global-set-key (kbd "s-8") (lambda () (interactive) (elscreen-goto 8)))
+
+;; super key for windows
+;(global-set-key (kbd "s-l") 'split-window-below)
+;(global-set-key (kbd "s-h") 'split-window-right)
+;(global-set-key (kbd "s-i") 'other-window)
+;(global-set-key (kbd "s-j") 'delete-other-windows)
+
+;(global-set-key (kbd "s-k") (lambda () (interactive)
+;                            (split-window-right)
+;                            (other-window 1)
+;                            (ido-find-file)))
+                               
+                             
+
+
+;(global-set-key (kbd "M-g M-w") 'other-window)
+
+
+
+;(global-set-key (kbd "C-o C-g") 'ggtags-find-file)
+;(global-set-key (kbd "C-o C-t") 'ggtags-find-tag-dwim)
+
+;(global-set-key (kbd "M-g M-g") 'magit-status)
+
+(global-set-key [f7] 'winner-undo)
+(global-set-key [C-f7] 'winner-redo)
+
+
+(defun recentf-ido-find-file ()
+  "Find a recent file using Ido."
+  (interactive)
+  (let ((file (ido-completing-read "Choose recent file: " recentf-list nil t)))
+    (when file
+      (find-file file))))
+
+
+(global-set-key "\C-s" 'isearch-forward-regexp)
+(global-set-key "\C-r" 'isearch-backward-regexp)
+
+(provide 'init-key-binding)
diff --git a/emacs.d_old/config/init-linum.el b/emacs.d_old/config/init-linum.el
new file mode 100644 (file)
index 0000000..fd43e27
--- /dev/null
@@ -0,0 +1,66 @@
+;; refer to https://github.com/aaronbieber/dotfiles/blob/master/configs/emacs.d/lisp/init-linum.el
+;; Stuff for line numbers.
+
+
+(custom-set-faces
+ ;; custom-set-faces was added by Custom.
+ ;; If you edit it by hand, you could mess it up, so be careful.
+ ;; Your init file should contain only one such instance.
+ ;; If there is more than one, they won't work right.
+ '(highlight-current-line-face ((t (:background "gray22"))))
+ '(linum ((t (:background "#000000" :foreground "gray40" :height 0.8 :slant italic :weigth light))))
+ '(linum-relative-current-face ((t (:inherit linum :foreground "Yellow" :weight light :height 0.8)))))
+
+(require 'linum-relative)
+
+(defface linum-current
+;  '((t (:inherit linum :weight bold :underline "#555")))
+  '((t (:inherit linum :weight bold :foreground "Yellow")))
+  "The current line number.")
+
+(defun my-linum-get-format-string ()
+ (let* ((width (max 3 (1+ (length (number-to-string
+                             (count-lines (point-min) (point-max)))))))
+         (format (concat "%" (number-to-string width) "d "))
+         (current-line-format (concat "%-" (number-to-string width) "d ")))
+    (setq my-linum-format-string format)
+;    (setq my-linum-current-line-format-string current-line-format)))
+    (setq my-linum-current-line-format-string format)))
+
+(defvar my-linum-current-line-number 0)
+
+(setq linum-format 'my-linum-relative-line-numbers)
+
+(defun my-linum-relative-line-numbers (line-number)
+  (let* ((offset (abs (- line-number my-linum-current-line-number)))
+         (linum-display-value (if (= 0 offset)
+                          my-linum-current-line-number
+                                offset))
+         (format-string (if (= my-linum-current-line-number line-number) my-linum-current-line-format-string my-linum-format-string))
+         (face (if (= my-linum-current-line-number line-number) 'linum-current 'linum)))
+    (propertize (format format-string linum-display-value) 'face face)))
+
+(defadvice linum-update (around my-linum-update)
+  (let ((my-linum-current-line-number (line-number-at-pos)))
+    ad-do-it))
+(ad-activate 'linum-update)
+
+;;; Set up relative line numbering to mimic `:set number relativenumber`.
+(global-linum-mode t)
+(add-hook 'linum-before-numbering-hook 'my-linum-get-format-string)
+
+
+
+
+
+;; enable linum-relative in programming mode
+;https://github.com/howardabrams/dot-files/blob/master/emacs.org
+(add-hook 'prog-mode-hook 'linum-mode)
+
+;; hight current line
+(require 'highlight-current-line)
+(highlight-current-line-on t)
+
+
+
+(provide 'init-linum)
diff --git a/emacs.d_old/config/init-magit.el b/emacs.d_old/config/init-magit.el
new file mode 100644 (file)
index 0000000..792e8ab
--- /dev/null
@@ -0,0 +1,10 @@
+;;---------------------------------------------------------------------------------------
+;; Magit
+;;
+(require 'magit)
+(setq magit-last-seen-setup-instructions "1.4.0")
+(global-set-key (kbd "C-x g") 'magit-status)
+;(setq magit-auto-revert-mode nil)
+
+
+(provide 'init-magit)
diff --git a/emacs.d_old/config/init-minibuffer.el b/emacs.d_old/config/init-minibuffer.el
new file mode 100644 (file)
index 0000000..2d85b1e
--- /dev/null
@@ -0,0 +1,18 @@
+
+
+
+;;; set font size of minibuffer
+;;;; http://stackoverflow.com/questions/7869429/altering-the-font-size-for-the-emacs-minibuffer-separately-from-default-emacs
+(add-hook 'minibuffer-setup-hook 'my-minibuffer-setup)
+(defun my-minibuffer-setup ()
+       (set (make-local-variable 'face-remapping-alist)
+          '((default :height 120))))
+
+
+
+(add-hook 'minibuffer-setup-hook
+          (lambda ()
+            (make-local-variable 'face-remapping-alist)
+            (add-to-list 'face-remapping-alist '(default (:background "green")))))
+
+(provide 'init-minibuffer)
diff --git a/emacs.d_old/config/init-mode-line.el b/emacs.d_old/config/init-mode-line.el
new file mode 100644 (file)
index 0000000..be5bef1
--- /dev/null
@@ -0,0 +1,9 @@
+
+;; maybe better to fix the size of line number rather scaled 0.8
+;; https://github.com/howardabrams/dot-files/blob/master/emacs.org
+(custom-set-faces
+ '(mode-line ((t (:foreground "#030303" :background "#bdbdbd" :box nil :family "Source Code Pro for Powerline" :height 100))))
+ '(mode-line-inactive ((t (:foreground "#f9f9f9" :background "#666666" :box nil :family "Source Code Pro for Powerline" :height 100)))))
+
+
+(provide 'init-mode-line)
diff --git a/emacs.d_old/config/init-multi-term.el b/emacs.d_old/config/init-multi-term.el
new file mode 100644 (file)
index 0000000..37dc44d
--- /dev/null
@@ -0,0 +1,23 @@
+
+
+;; http://rawsyntax.com/blog/learn-emacs-zsh-and-multi-term/
+;; color display
+;; tic -o ~/.terminfo /usr/local/Cellar/emacs/24.5/share/emacs/24.5/etc/e/eterm-color.ti
+
+(require 'multi-term)
+
+(setq multi-term-program "/bin/zsh")
+(setq system-uses-terminfo nil)
+
+;;(add-hook 'term-mode-hook
+;;          (lambda ()
+;;         (linum-mode -1)
+;;         (highlight-current-line-on nil)))
+
+
+(add-to-list 'term-bind-key-alist '("C-c C-n" . multi-term-next))
+(add-to-list 'term-bind-key-alist '("C-c C-p" . multi-term-prev))
+(add-to-list 'term-bind-key-alist '("C-c C-j" . term-line-mode))
+(add-to-list 'term-bind-key-alist '("C-c C-k" . term-char-mode))
+
+(provide 'init-multi-term)
diff --git a/emacs.d_old/config/init-org.el b/emacs.d_old/config/init-org.el
new file mode 100644 (file)
index 0000000..9f14e0f
--- /dev/null
@@ -0,0 +1,134 @@
+
+;;; org-mode init File
+
+;; refer http://doc.norang.ca/org-mode.html
+
+;(add-to-list 'load-path (expand-file-name "~/git/org-mode/lisp"))
+(add-to-list 'auto-mode-alist '("\\.\\(org\\|org_archive\\|txt\\)$" . org-mode))
+(require 'org)
+;;
+;; Standard key bindings
+(global-set-key "\C-cl" 'org-store-link)
+(global-set-key "\C-ca" 'org-agenda)
+(global-set-key "\C-cb" 'org-iswitchb)
+
+
+;;(add-hook 'org-mode-hook
+;;          (lambda ()
+;;                      (org-set-local 'yas/trigger-key [tab])
+;;                      (define-key yas/keymap [tab] 'yas/next-field-or-maybe-expand)))
+
+
+;(org-indent-mode 1)
+
+
+;; org-todo
+;; define more state of todo
+(setq org-todo-keywords
+      (quote ((sequence "TODO(t)" "STARTED(s)" "|" "DONE(d)")
+              (sequence "WAITING(w@/!)" "HOLD(h@/!)" "|" "CANCELLED(c@/!)" ))))
+
+(setq org-todo-keyword-faces
+      (quote (("TODO" :foreground "red" :weight bold)
+              ("NEXT" :foreground "blue" :weight bold)
+              ("DONE" :foreground "forest green" :weight bold)
+              ("WAITING" :foreground "orange" :weight bold)
+              ("HOLD" :foreground "magenta" :weight bold)
+              ("CANCELLED" :foreground "forest green" :weight bold)
+              ("MEETING" :foreground "forest green" :weight bold)
+              ("PHONE" :foreground "forest green" :weight bold))))
+
+(setq org-use-fast-todo-selection t)
+
+;; allow S-left/right to rotate state not set timestamp and add note
+(setq org-treat-S-cursor-todo-selection-as-state-change nil)
+
+;; trigger a tags for the task when changing state
+(setq org-todo-state-tags-triggers
+      (quote (("CANCELLED" ("CANCELLED" . t))
+              ("WAITING" ("WAITING" . t))
+              ("HOLD" ("WAITING") ("HOLD" . t))
+              (done ("WAITING") ("HOLD"))
+              ("TODO" ("WAITING") ("CANCELLED") ("HOLD"))
+              ("NEXT" ("WAITING") ("CANCELLED") ("HOLD"))
+              ("DONE" ("WAITING") ("CANCELLED") ("HOLD")))))
+
+
+;; org-capture
+(setq org-directory "~/Private/org")
+(setq org-default-notes-file (concat org-directory "/notes.org"))
+(define-key global-map "\C-cc" 'org-capture)
+
+
+(setq org-refile-targets (quote ((nil :maxlevel . 9)
+                                 (org-agenda-files :maxlevel . 9))))
+
+
+
+
+;; Capture templates for: TODO tasks, Notes, appointments, phone calls, meetings, and org-protocol
+;(setq org-capture-templates
+;      (quote (("t" "todo" entry (file "~/git/org/refile.org")
+;               "* TODO %?\n%U\n%a\n" :clock-in t :clock-resume t)
+;              ("r" "respond" entry (file "~/git/org/refile.org")
+;               "* NEXT Respond to %:from on %:subject\nSCHEDULED: %t\n%U\n%a\n" :clock-in t :clock-resume t :immediate-finish t)
+;              ("n" "note" entry (file "~/git/org/refile.org")
+;               "* %? :NOTE:\n%U\n%a\n" :clock-in t :clock-resume t)
+;              ("j" "Journal" entry (file+datetree "~/git/org/diary.org")
+;               "* %?\n%U\n" :clock-in t :clock-resume t)
+;              ("w" "org-protocol" entry (file "~/git/org/refile.org")
+;               "* TODO Review %c\n%U\n" :immediate-finish t)
+;              ("m" "Meeting" entry (file "~/git/org/refile.org")
+;               "* MEETING with %? :MEETING:\n%U" :clock-in t :clock-resume t)
+;              ("p" "Phone call" entry (file "~/git/org/refile.org")
+;               "* PHONE %? :PHONE:\n%U" :clock-in t :clock-resume t)
+;              ("h" "Habit" entry (file "~/git/org/refile.org")
+;               "* NEXT %?\n%U\n%a\nSCHEDULED: %(format-time-string \"%<<%Y-%m-%d %a .+1d/3d>>\")\n:PROPERTIES:\n:STYLE: habit\n:REPEAT_TO_STATE: NEXT\n:END:\n"))))
+
+
+;;; org-tag
+; Tags with fast selection keys
+(setq org-tag-alist (quote ((:startgroup)
+                            ("@errand" . ?e)
+                            ("@office" . ?o)
+                            ("@home" . ?H)
+                            ("@farm" . ?f)
+                            (:endgroup)
+                            ("WAITING" . ?w)
+                            ("HOLD" . ?h)
+                            ("PERSONAL" . ?P)
+                            ("WORK" . ?W)
+                            ("FARM" . ?F)
+                            ("ORG" . ?O)
+                            ("NORANG" . ?N)
+                            ("crypt" . ?E)
+                            ("NOTE" . ?n)
+                            ("CANCELLED" . ?c)
+                            ("FLAGGED" . ??))))
+
+; Allow setting single tags without the menu
+(setq org-fast-tag-selection-single-key (quote expert))
+
+; For tag searches ignore tasks with scheduled and deadline dates
+(setq org-agenda-tags-todo-honor-ignore-options t)
+
+
+;; Always hilight the current agenda line
+(add-hook 'org-agenda-mode-hook
+          '(lambda () (hl-line-mode 1))
+          'append)
+
+
+
+;; The following custom-set-faces create the highlights
+(custom-set-faces
+  ;; custom-set-faces was added by Custom.
+  ;; If you edit it by hand, you could mess it up, so be careful.
+  ;; Your init file should contain only one such instance.
+  ;; If there is more than one, they won't work right.
+ '(org-mode-line-clock ((t (:background "grey75" :foreground "red" :box (:line-width -1 :style released-button)))) t))
+
+
+
+
+(provide 'init-org)
diff --git a/emacs.d_old/config/init-perl.el b/emacs.d_old/config/init-perl.el
new file mode 100644 (file)
index 0000000..8645bce
--- /dev/null
@@ -0,0 +1,69 @@
+
+(custom-set-variables
+ ;; custom-set-variables was added by Custom.
+ ;; If you edit it by hand, you could mess it up, so be careful.
+ ;; Your init file should contain only one such instance.
+ ;; If there is more than one, they won't work right.
+ '(fringe-mode (quote (4 . 0)) nil (fringe))
+ '(ggtags-split-window-function (quote split-window-vertically))
+ '(hes-mode-alist
+   (quote
+    ((c-mode . "\\(\\\\\\([0-7]\\{1,3\\}\\|x[[:xdigit:]]+\\|u[[:xdigit:]]\\{4\\}\\|U[[:xdigit:]]\\{8\\}\\|[\"'?\\abfnrtv]\\)\\)")
+     (cperl-mode . "\\(\\\\\\([0-7]\\{1,3\\}\\|x[[:xdigit:]]+\\|u[[:xdigit:]]\\{4\\}\\|U[[:xdigit:]]\\{8\\}\\|[\"'?\\abfnrtv]\\)\\)")
+     (c++-mode . "\\(\\\\\\([0-7]\\{1,3\\}\\|x[[:xdigit:]]+\\|u[[:xdigit:]]\\{4\\}\\|U[[:xdigit:]]\\{8\\}\\|[\"'?\\abfnrtv]\\)\\)")
+     (objc-mode . "\\(\\\\\\([0-7]\\{1,3\\}\\|x[[:xdigit:]]+\\|u[[:xdigit:]]\\{4\\}\\|U[[:xdigit:]]\\{8\\}\\|[\"'?\\abfnrtv]\\)\\)")
+     (java-mode . "\\(\\\\\\([0-7]\\{1,3\\}\\|u[[:xdigit:]]\\{4\\}\\|[\"'\\bfnrt]\\)\\)")
+     (js-mode . "\\(\\\\\\([0-7]\\{1,3\\}\\|x[[:xdigit:]]\\{2\\}\\|u[[:xdigit:]]\\{4\\}\\|.\\)\\)")
+     (js2-mode . "\\(\\\\\\([0-7]\\{1,3\\}\\|x[[:xdigit:]]\\{2\\}\\|u[[:xdigit:]]\\{4\\}\\|.\\)\\)")
+     (ruby-mode
+      ("\\(\\\\\\([0-7]\\{1,3\\}\\|x[[:xdigit:]]\\{1,2\\}\\|u\\(?:[[:xdigit:]]\\{4\\}\\|{[[:xdigit:]]\\{1,6\\}\\(?:[[:space:]]+[[:xdigit:]]\\{1,6\\}\\)*}\\)\\|.\\)\\)"
+       (0
+        (let*
+            ((state
+              (syntax-ppss))
+             (term
+              (nth 3 state)))
+          (when
+              (or
+               (and
+                (eq term 39)
+                (member
+                 (match-string 2)
+                 (quote
+                  ("\\" "'"))))
+               (if
+                   (fboundp
+                    (quote ruby-syntax-expansion-allowed-p))
+                   (ruby-syntax-expansion-allowed-p state)
+                 (memq term
+                       (quote
+                        (34 47 10 96 t)))))
+            (add-face-text-property
+             (match-beginning 1)
+             (match-end 1)
+             (quote hes-escape-backslash-face))
+            (add-face-text-property
+             (match-beginning 2)
+             (match-end 2)
+             (quote hes-escape-sequence-face))
+            nil))
+        prepend))))))
+ '(org-agenda-files (quote ("~/Private/org/diary.org" "~/temp/org-note.org")))
+ '(powerline-text-scale-factor 0.85))
+
+
+
+(defalias 'perl-mode 'cperl-mode)
+;(setq cperl-invalid-face nil)
+ (setq cperl-invalid-face (quote off))
+;(add-hook 'prog-mode-hook '(lambda () 
+;        (highlight-regexp "%[[:alpha:]]\\|\\\\[[:alpha:]]")))
+
+(require 'highlight-escape-sequences)
+(hes-mode)
+;(setq cperl-font-lock t)
+(put 'hes-escape-backslash-face 'face-alias 'font-lock-builtin-face)
+(put 'hes-escape-sequence-face 'face-alias 'font-lock-builtin-face)
+
+
+(provide 'init-perl)
diff --git a/emacs.d_old/config/init-project.el b/emacs.d_old/config/init-project.el
new file mode 100644 (file)
index 0000000..d0571cd
--- /dev/null
@@ -0,0 +1,12 @@
+
+;; http://batsov.com/projectile/
+(setq fiplr-root-markers '(".git" ".svn" "*.DS_Store"))
+(setq fiplr-ignored-globs '((directories (".git" ".svn"))
+                            (files ("*.jpg" "*.png" "*.zip" "*~" "*.o" ".obj" "*.swp" "*.hg" ".pyc" ".*" "*.so" "*.dylib"))))
+
+(global-set-key (kbd "C-x f") 'fiplr-find-file)
+
+
+
+
+(provide 'init-project)
diff --git a/emacs.d_old/config/init-projectile.el b/emacs.d_old/config/init-projectile.el
new file mode 100644 (file)
index 0000000..53a11e3
--- /dev/null
@@ -0,0 +1,43 @@
+
+
+
+(require 'projectile)
+(require 'projectile-speedbar)
+
+
+(projectile-global-mode)
+
+(setq projectile-enable-caching t)
+;(setq projectile-indexing-method 'native)
+(setq projectile-indexing-method 'alien)
+;; with helm
+(require 'helm-projectile)
+(helm-projectile-on)
+
+
+;(setq projectile-switch-project-action 'helm-projectile-find-file)
+(setq projectile-switch-project-action 'projectile-dired)
+
+;; https://www.reddit.com/r/emacs/comments/2pvmkm/helm_projectile_now_enables_fuzzy_matching_by/
+(setq helm-projectile-fuzzy-match nil)
+
+;; with - perspective
+(persp-mode)
+(require 'persp-projectile)
+
+(provide 'init-projectile)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/emacs.d_old/config/init-rencentf.el b/emacs.d_old/config/init-rencentf.el
new file mode 100644 (file)
index 0000000..1d68581
--- /dev/null
@@ -0,0 +1,17 @@
+
+(require 'recentf)
+(recentf-mode 1)
+(setq recentf-max-menu-items 100)
+
+;; http://www.emacswiki.org/emacs/RecentFiles
+(defun recentf-ido-find-file ()
+  "Find a recent file using Ido."
+  (interactive)
+  (let ((file (ido-completing-read "Choose recent file: " recentf-list nil t)))
+    (when file
+      (find-file file))))
+
+
+(require 'recentf-ext)
+
+(provide 'init-recentf)
diff --git a/emacs.d_old/config/init-test-minibufer.el b/emacs.d_old/config/init-test-minibufer.el
new file mode 100644 (file)
index 0000000..93e8e51
--- /dev/null
@@ -0,0 +1,29 @@
+
+(progn
+  (defvar current-time-string "")
+  (run-with-timer
+   1 1
+   (lambda ()
+     (let ((message-log-max nil))
+       (unless (minibuffer-window-active-p (minibuffer-window))
+         (when (member (current-message)
+                       (list current-time-string nil))
+           (message "%s" (setq current-time-string
+                               (current-time-string)))))))))
+[nil 21872 33554 386400 1 (lambda nil (let (...) (if ... nil ...))) nil nil 0]
+
+
+
+
+    (with-current-buffer " *Minibuf-0*"
+      (insert (format-time-string "%H:%M")))
+
+ (run-at-time
+  nil 60
+  (lambda ()
+    (with-current-buffer " *Minibuf-0*"
+      (erase-buffer)
+      (dotimes (spaces (- (frame-width) 8))
+        (insert " "))
+      (insert (format-time-string "%H:%M")))))
+
diff --git a/emacs.d_old/config/init-winner.el b/emacs.d_old/config/init-winner.el
new file mode 100644 (file)
index 0000000..87b3fbe
--- /dev/null
@@ -0,0 +1,8 @@
+
+(winner-mode 1)
+
+(global-set-key (kbd "C-c C-l") 'winner-redo)
+(global-set-key (kbd "C-c C-h") 'winner-undo)
+
+(provide 'init-winner)
+
diff --git a/emacs.d_old/config/init-workgroup2.el b/emacs.d_old/config/init-workgroup2.el
new file mode 100644 (file)
index 0000000..ebef2cb
--- /dev/null
@@ -0,0 +1,14 @@
+
+(require 'workgroups2)
+
+
+(setq wg-prefix-key (kbd "C-c z"))
+(setq wg-session-file "~/.emacs.d/temp/.emacs_workgroups")
+(setq wg-mode-line-display-on t)          ; Default: (not (featurep 'powerline))
+(setq wg-flag-modified t)                 ; Display modified flags as well
+(setq wg-mode-line-decor-left-brace "["
+      wg-mode-line-decor-right-brace "]"  ; how to surround it
+      wg-mode-line-decor-divider ":")
+;(workgroups-mode 1)
+
+(provide 'init-workgroup2)
diff --git a/emacs.d_old/config/my-packages.el b/emacs.d_old/config/my-packages.el
new file mode 100644 (file)
index 0000000..025bd81
--- /dev/null
@@ -0,0 +1,113 @@
+;;---------------------------------------------------------------------------------------
+;; package
+;; http://y.tsutsumi.io/emacs-from-scratch-part-2-package-management.html
+;;
+(require 'package)
+(add-to-list 'package-archives
+             '("melpa" . "http://melpa.milkbox.net/packages/") t)
+(package-initialize)
+
+(defvar required-packages
+  '(
+    magit
+    helm
+    ido-ubiquitous
+    yasnippet
+    evil
+    ido-vertical-mode
+    smex
+    color-theme
+    color-theme-sanityinc-tomorrow
+    key-chord
+;    powerline-evil
+    powerline
+    evil-leader
+    flx-ido
+    flx
+    auto-complete
+    fiplr
+    w3m
+    ace-jump-mode
+;    el-get
+    color-identifiers-mode
+;    elscreen
+    moe-theme
+    monokai-theme
+    molokai-theme
+    tangotango-theme
+    cyberpunk-theme
+    hydra
+    projectile-speedbar
+    ecb
+    ggtags
+    irony
+    yasnippet
+    auto-complete-c-headers
+    iedit
+    flymake-google-cpplint
+    flymake-cursor
+    google-c-style
+    recentf-ext
+    linum-relative
+    jekyll-modes
+    evil-escape
+    workgroups2
+    highlight-current-line
+    pp-c-l
+    session
+    use-package
+    helm-gtags
+    icicles
+    ace-window
+    multi-term
+    projectile
+    page-break-lines
+    helm-projectile
+    paradox
+    diff-hl
+  ) "a list of packages to ensure are installed at launch.")
+
+(require 'cl)
+(defun packages-installed-p ()
+  (loop for p in required-packages
+        when (not (package-installed-p p)) do (return nil)
+        finally (return t)))
+
+(unless (packages-installed-p)
+  (message "%s" "Emacs is now refreshing its package database...")
+  (package-refresh-contents)
+  (message "%s" " done.")
+  (dolist (p required-packages)
+    (when (not (package-installed-p p))
+      (package-install p))))
+
+
+;;---------------------------------------------------------------------------------------
+;; El-get
+;; https://github.com/dimitri/el-get
+;;
+
+(add-to-list 'load-path "~/.emacs.d/el-get/el-get")
+
+(unless (require 'el-get nil 'noerror)
+  (with-current-buffer
+      (url-retrieve-synchronously
+       "https://raw.githubusercontent.com/dimitri/el-get/master/el-get-install.el")
+    (goto-char (point-max))
+    (eval-print-last-sexp)))
+
+(add-to-list 'el-get-recipe-path "~/.emacs.d/el-get-user/recipes")
+
+
+(el-get-bundle seudut/color-theme-tangotango
+;        :features color-theme-tangotango
+;        (color-theme-tangotango)
+        )
+
+;(el-get-bundle Dewdrops/powerline)
+
+(el-get-bundle emacsmirror/sr-speedbar)
+(el-get-bundle seudut/elscreen)
+(el-get-bundle seudut/helm-cmd-t)
+
+(provide 'my-packages)
diff --git a/emacs.d_old/config/my-powerline.el b/emacs.d_old/config/my-powerline.el
new file mode 100644 (file)
index 0000000..65f849e
--- /dev/null
@@ -0,0 +1,129 @@
+
+
+
+
+(setq ns-use-srgb-colorspace nil)
+
+(load-theme 'cyberpunk t)
+
+;; Powerline
+(defun arrow-right-xpm (color1 color2)
+  "Return an XPM right arrow string representing."
+  (format "/* XPM */
+static char * arrow_right[] = {
+\"12 18 2 1\",
+\". c %s\",
+\"  c %s\",
+\".           \",
+\"..          \",
+\"...         \",
+\"....        \",
+\".....       \",
+\"......      \",
+\".......     \",
+\"........    \",
+\".........   \",
+\".........   \",
+\"........    \",
+\".......     \",
+\"......      \",
+\".....       \",
+\"....        \",
+\"...         \",
+\"..          \",
+\".           \"};"  color1 color2))
+
+(defun arrow-left-xpm (color1 color2)
+  "Return an XPM right arrow string representing."
+  (format "/* XPM */
+static char * arrow_right[] = {
+\"12 18 2 1\",
+\". c %s\",
+\"  c %s\",
+\"           .\",
+\"          ..\",
+\"         ...\",
+\"        ....\",
+\"       .....\",
+\"      ......\",
+\"     .......\",
+\"    ........\",
+\"   .........\",
+\"   .........\",
+\"    ........\",
+\"     .......\",
+\"      ......\",
+\"       .....\",
+\"        ....\",
+\"         ...\",
+\"          ..\",
+\"           .\"};"  color2 color1))
+
+;;(defconst color1 "#666666") ; gray40
+;;(defconst color2 "#999999") ; gray60
+
+;;j;(defconst color1 "#4682b4")
+;;(defconst color2 "#ff6347")
+
+(defconst color1 "#6b8e23")
+(defconst color2 "#eedd82")
+
+;;(set-face-attribute 'mode-line-color-2 nil
+;;                    :foreground "#171717"
+;;                    :bold t
+;;                    :background color2)
+
+
+
+(defvar arrow-right-0 (create-image (arrow-right-xpm "None" color1) 'xpm t :ascent 'center))
+(defvar arrow-right-1 (create-image (arrow-right-xpm color1 color2) 'xpm t :ascent 'center))
+(defvar arrow-right-2 (create-image (arrow-right-xpm color2 "None") 'xpm t :ascent 'center))
+(defvar arrow-left-1  (create-image (arrow-left-xpm color2 color1) 'xpm t :ascent 'center))
+(defvar arrow-left-2  (create-image (arrow-left-xpm "None" color2) 'xpm t :ascent 'center))
+
+(display-time)
+
+(setq-default mode-line-format
+              (list
+               '("-"
+                 mode-line-mule-info
+                 mode-line-modified
+                 minor-mode-alist)
+               '(:eval (concat (propertize " " 'display arrow-right-0)))
+               '(:eval (concat (propertize " %m " 'face 'mode-line-color-1)
+                               (propertize " " 'display arrow-right-1)))
+               '(:eval (concat (propertize " %b " 'face 'mode-line-color-2)
+                               (propertize " " 'display arrow-right-2)))
+               ;; Justify right by filling with spaces to right fringe - 16
+               ;; (16 should be computed rahter than hardcoded)
+               '(:eval (propertize " " 'display '((space :align-to (- right-fringe 17)))))
+               '(:eval (concat (propertize " " 'display arrow-left-2)
+                               (propertize " %p " 'face 'mode-line-color-2)))
+               '(:eval (concat (propertize " " 'display arrow-left-1)
+                               (propertize "%4l:%2c  " 'face 'mode-line-color-1)))
+                 ))
+
+
+(make-face 'mode-line-color-1)
+(set-face-attribute 'mode-line-color-1 nil
+                    :foreground "#fffacd"
+                    :bold t
+                    :background color1)
+
+(make-face 'mode-line-color-2)
+(set-face-attribute 'mode-line-color-2 nil
+                    :foreground "#fffacd"
+                    :bold t
+                    :background color2)
+
+(set-face-attribute 'mode-line nil
+                    :foreground "#fffacd"
+                    :background "#171717"
+                    :box nil)
+(set-face-attribute 'mode-line-inactive nil
+                    :foreground "#fffacd"
+                    :background "#171717")
+
+
+
+(provide 'my-powerline)
diff --git a/emacs.d_old/elisp/init-base.el b/emacs.d_old/elisp/init-base.el
new file mode 100644 (file)
index 0000000..e2e29f1
--- /dev/null
@@ -0,0 +1,70 @@
+
+(setq debug-on-error t)
+(setq inhibit-startup-message t)
+
+(scroll-bar-mode -1)
+(tool-bar-mode -1)
+(menu-bar-mode -1)
+
+(defalias 'yes-or-no-p 'y-or-n-p)
+
+;;http://emacsblog.org/2007/03/17/quick-tip-set-goal-column/
+(put 'set-goal-colomn 'disabled nil)
+(setq vc-follow-symlinks t)
+(setq visible-bell 1)
+(setq ring-bell-function 'ignore)
+(setq resize-mini-windows t)
+
+(fringe-mode (quote (0 . 0)))
+(add-to-list 'auto-mode-alist '("emacs\\'" . emacs-lisp-mode))
+(show-paren-mode t)
+;(add-to-list 'default-frame-alist '(width  . 120))
+;(add-to-list 'default-frame-alist '(height . 40))
+;(add-to-list 'default-frame-alist '(font . "Source Code Pro for Powerline-12:weight:light" ))
+;(add-to-list 'default-frame-alist '(font . "Source Code Pro for Powerline-12" ))
+
+
+
+
+
+
+;(blink-cursor-mode 0)
+
+;(custom-set-variables
+; '(fringe-mode (quote (0 . 0)) nil (fringe)))
+
+
+
+
+
+;;; Set symbol for the border
+(set-display-table-slot standard-display-table
+                        'vertical-border 
+                        (make-glyph-code ?┃))
+
+;(set-face-attribute 'vertical-border nil  :foreground "gray")
+
+
+
+;(setq scroll-margin 5)
+;(setq scroll-conservatively 10000)
+
+
+
+;(add-hook 'help-mode-hook
+;        (lambda ()
+;          (linum-mode -1)))
+
+;; Dired mode
+;(require 'dired+)
+;; create new file  key map
+;(define-key dired-mode-map "c" 'find-file)
+;; ^ goto-up directory
+;(define-key dired-mode-map (kbd "C-c C-u") 'dired-up-directory)
+
+;(setq diredp-hide-details-initially-flag t)
+;(setq diredp-hide-details-propagate-flag t)
+
+;(setq term-buffer-maximum-size 10000)
+
+(provide 'init-base)
diff --git a/emacs.d_old/elisp/init-helm.el b/emacs.d_old/elisp/init-helm.el
new file mode 100644 (file)
index 0000000..59511f9
--- /dev/null
@@ -0,0 +1,24 @@
+
+
+;; helm
+(use-package helm
+  :ensure t
+  :init
+  (setq helm-M-x-fuzzy-match t)
+  (setq helm-buffer-fuzzy-matching t)
+  (setq helm-recentf-fuzzy-match t)
+  (setq helm-cadidate-number-limit 20)
+  (setq helm-display-function
+      (lambda (buf)
+        (split-window-vertically)
+        (other-window 1)
+        (switch-to-buffer buf)))
+  :config
+  (helm-mode 1)
+  (helm-autoresize-mode 1)
+  :bind (("M-x" . helm-M-x)
+        ("s-j" . helm-mini)))
+
+
+
+(provide 'init-helm)
diff --git a/emacs.d_old/elisp/init-hydra.el b/emacs.d_old/elisp/init-hydra.el
new file mode 100644 (file)
index 0000000..2c64061
--- /dev/null
@@ -0,0 +1,46 @@
+
+;; key mapping 
+;; TODO:
+;;    1. exec external progeam
+;;       prefix + s : eshell / term
+;;       prefix + p : package install
+;;       prefix +
+;;    2. prefix for magit
+;;
+;;    3. prefix for avy motion
+;;    4. window / buffer switch
+;;    5. file project switch
+(use-package hydra
+  :ensure t
+  :config
+  (hydra-add-font-lock))
+
+
+(defhydra hydra-external (global-map "<f2>")
+  "zoom"
+  ("g" text-scale-increase "in")
+  ("l" text-scale-decrease "out")
+  )
+
+
+;; hydra for Misc commands
+(defhydra hydra-misc (:exit t)
+  "Misc Commands" 
+  ("e" eshell "eshell" :color red)
+  ("p" (lambda ()
+        (interactive)
+        (if (pl/buffer-exist "*Packages*")
+            (switch-to-buffer "*Packages*")
+          (package-list-packages)))
+   "List-package" :color red)
+  )
+(defun pl/buffer-exist (bufname) (not (eq nil (get-buffer bufname))))
+(global-set-key (kbd "<f3>") 'hydra-misc/body)
+
+
+
+
+
+
+
+(provide 'init-hydra)
diff --git a/emacs.d_old/elisp/init-magit.el b/emacs.d_old/elisp/init-magit.el
new file mode 100644 (file)
index 0000000..1aa9b1d
--- /dev/null
@@ -0,0 +1,11 @@
+
+
+(use-package magit
+  :ensure t
+  :bind (("M-g s" . magit-status)))
+  
+
+
+
+
+(provide 'init-magit)
diff --git a/emacs.d_old/elisp/init-org.el b/emacs.d_old/elisp/init-org.el
new file mode 100644 (file)
index 0000000..b135485
--- /dev/null
@@ -0,0 +1,79 @@
+
+
+;; http://doc.norang.ca/org-mode.html  Org Mode - Organize Your Life In Plain Text!
+
+(add-to-list 'auto-mode-alist '("\\.\\(org\\|org_archive\\|txt\\)$" . org-mode))
+
+;;; better map to M-c instead of C-c, since M-c is more easy
+;;(global-set-key "M-cqc" 'org-capture) or M-o c
+(global-set-key "\C-cl" 'org-store-link)
+(global-set-key "\C-ca" 'org-agenda)
+(global-set-key "\C-cb" 'org-iswitchb)
+
+
+;; better use hydra define these
+(global-unset-key "\M-o")
+(global-set-key (kbd "M-o a") 'org-agenda)
+(global-set-key (kbd "M-o b") 'org-iswitchb)
+(global-set-key (kbd "M-o c") 'org-capture)
+
+
+(global-set-key (kbd "<f12>") 'org-agenda)
+
+(setq org-agenda-files (quote ("~/Private/org")))
+
+(setq org-todo-keywords
+      (quote ((sequence "TODO(t)" "ONGOING(n)" "|" "DONE(d)")
+              (sequence "WAITING(w@/!)" "HOLD(h@/!)" "|" "CANCELLED(c@/!)" ))))
+
+(setq org-todo-keyword-faces
+      (quote (("TODO" :foreground "red" :weight bold)
+              ("ONGOING" :foreground "blue" :weight bold)
+              ("DONE" :foreground "forest green" :weight bold)
+              ("WAITING" :foreground "orange" :weight bold)
+              ("HOLD" :foreground "magenta" :weight bold)
+              ("CANCELLED" :foreground "forest green" :weight bold))))
+
+(setq org-todo-state-tags-triggers
+      (quote (("CANCELLED" ("CANCELLED" . t))
+              ("WAITING" ("WAITING" . t))
+              ("HOLD" ("WAITING") ("HOLD" . t))
+              (done ("WAITING") ("HOLD"))
+              ("TODO" ("WAITING") ("CANCELLED") ("HOLD"))
+              ("ONGOING" ("WAITING") ("CANCELLED") ("HOLD"))
+              ("DONE" ("WAITING") ("CANCELLED") ("HOLD")))))
+
+;; change a task state C-c C-t Key
+(setq org-use-fast-todo-selection t)
+(setq org-treat-S-cursor-todo-selection-as-state-change nil)
+
+
+
+;; Org Capture
+(setq org-directory "~/Private/org/")
+(setq org-default-notes-file (concat org-directory "refile.org"))
+(setq org-default-diary-file (concat org-directory "diary.org"))
+
+(global-set-key (kbd "C-c c") 'org-capture)
+
+;; Capture templates for: TODO tasks, Notes, appointments, phone calls, meetings, and org-protocol
+(setq org-capture-templates
+      (quote (("t" "Todo" entry (file org-default-notes-file)
+               "* TODO %?\n\n  %U\n  %a\n" :clock-in t :clock-resume t)
+              ("r" "Respond" entry (file org-default-notes-file)
+               "* NEXT Respond to %:from on %:subject\nSCHEDULED: %t\n  %U\n  %a\n" :clock-in t :clock-resume t :immediate-finish t)
+              ("n" "Note" entry (file org-default-notes-file)
+               "* %? :NOTE:\n\n  %U\n  %a\n" :clock-in t :clock-resume t)
+              ("j" "Journal" entry (file+datetree org-default-diary-file)
+               "* %?\n%U\n" :clock-in t :clock-resume t)
+              ("w" "Org-protocol" entry (file org-default-notes-file)
+               "* TODO Review %c\n%U\n" :immediate-finish t)
+              ("m" "Meeting" entry (file org-default-notes-file)
+               "* MEETING with %? :MEETING:\n%U" :clock-in t :clock-resume t)
+              ("p" "Phone call" entry (file org-default-notes-file)
+               "* PHONE %? :PHONE:\n  %U" :clock-in t :clock-resume t)
+              ("h" "Habit" entry (file org-default-notes-file)
+               "* NEXT %?\n\n  %U\n  %a\n\nSCHEDULED: %(format-time-string \"%<<%Y-%m-%d %a .+1d/3d>>\")\n:PROPERTIES:\n:STYLE: habit\n:REPEAT_TO_STATE: NEXT\n:END:\n"))))
+
+
+(provide 'init-org)
diff --git a/emacs.d_old/elisp/init-projectile.el b/emacs.d_old/elisp/init-projectile.el
new file mode 100644 (file)
index 0000000..dff7c4d
--- /dev/null
@@ -0,0 +1,36 @@
+
+
+;; http://batsov.com/projectile/
+;; Todo add svn repo support
+
+(use-package projectile
+  :ensure t
+  :init
+  (setq projectile-enable-caching t)
+  (setq projectile-indexing-method 'alian)
+  (setq projectile-switch-project-action 'projectile-dired)
+  :config
+  (projectile-global-mode))
+
+
+(use-package helm-projectile
+  :ensure t
+  :init
+  (setq helm-projectile-fuzzy-match nil)
+  :config
+  (helm-projectile-on)
+  :bind (("s-f" . helm-projectile-find-file)
+        ("s-b" . helm-projectile-switch-to-buffer)))
+
+(use-package perspective
+  :ensure t
+  :config
+  (persp-mode))
+
+(use-package persp-projectile
+  :ensure t
+  :config
+  (define-key projectile-mode-map (kbd "s-p") 'projectile-persp-switch-project))
+
+
+(provide 'init-projectile)
diff --git a/emacs.d_old/init.el b/emacs.d_old/init.el
new file mode 100644 (file)
index 0000000..9a62fa5
--- /dev/null
@@ -0,0 +1,347 @@
+
+
+;; Added by Package.el.  This must come before configurations of
+;; installed packages.  Don't delete this line.  If you don't want it,
+;; just comment it out by adding a semicolon to the start of the line.
+;; You may delete these explanatory comments.
+;(package-initialize)
+
+ (load-library "url-handlers")
+
+(setenv "PATH" (concat (getenv "PATH") ":/usr/local/bin"))
+(setq exec-path (append exec-path '("/usr/local/bin")))
+
+;; package manager
+(require 'package)
+
+(add-to-list 'package-archives
+             '("melpa" . "http://melpa.milkbox.net/packages/") t)
+(add-to-list 'package-archives
+             '("org" . "http://orgmode.org/elpa/") t)
+;(add-to-list 'package-archives
+;             '("marmalade" . "http://marmalade-repo.org/packages/") t)
+
+(package-initialize)
+
+;; use-package
+(unless (package-installed-p 'use-package)
+  (package-refresh-contents)
+  (package-install 'use-package))
+
+(require 'use-package)
+
+;;;;; load path
+(add-to-list 'load-path "~/.emacs.d/elisp")
+
+;;; load elisp config
+(require 'init-base)
+(require 'init-magit)
+(require 'init-helm)
+(require 'init-projectile)
+(require 'init-org)
+
+
+
+
+
+
+
+
+
+(use-package ido-vertical-mode
+  :ensure t)
+
+
+(use-package hydra
+  :ensure t
+  :config
+  (hydra-add-font-lock))
+
+
+;;;;;;;;;
+(use-package ace-jump-mode
+  :commands ace-jump-mode
+  :init
+  (bind-key "C-." 'ace-jump-mode))
+
+(use-package sublime-themes
+  :ensure t
+  :config
+  (load-theme 'spolsky t)
+  )
+
+(use-package avy
+  :ensure t
+  )
+
+(use-package use-package-chords
+  :ensure t
+  :config
+  (key-chord-mode 1)
+  (setq key-chord-two-keys-delay 0.5))
+
+(use-package evil
+  :ensure t
+  :config
+  (evil-mode t)
+  (defalias 'evil-insert-state 'evil-emacs-state)
+  (key-chord-define evil-insert-state-map "jj" 'evil-normal-state)
+  (key-chord-define evil-emacs-state-map "jj" 'evil-normal-state)
+;  (setq evil-emacs-state-cursor '("red" box))
+  (setq evil-emacs-state-cursor '("green" bar))
+  (setq evil-normal-state-cursor '("green" box))
+  (setq evil-visual-state-cursor '("orange" box))
+  (setq evil-insert-state-cursor '("red" bar))
+  (setq evil-replace-state-cursor '("red" bar))
+  (setq evil-operator-state-cursor '("red" hollow))
+  )
+
+(use-package multi-term
+  :ensure t
+  )
+
+
+
+;(use-package smex
+;  :ensure t
+;  :init (smex-initialize)
+;  :bind ("M-x" . smex)
+;        ("M-X" . smex-major-mode-commands))
+
+
+(add-to-list 'load-path "~/.emacs.d/pde")
+(load "pde-load")
+
+(add-to-list 'default-frame-alist '(fullscreen . maximized))
+
+
+(use-package org-bullets
+  :ensure t
+  :init
+  (add-hook 'org-mode-hook
+            (lambda ()
+              (org-bullets-mode t))))
+  
+(org-bullets-mode t)
+
+(setq org-hide-leading-stars t)
+
+(setq org-src-fontify-natively t)
+
+(font-lock-add-keywords 'org-mode
+                    '(("\\(src_\\)\\([^[{]+\\)\\(\\[:.*\\]\\){\\([^}]*\\)}"
+                       (1 '(:foreground "black" :weight 'normal :height 10)) ; src_ part
+                       (2 '(:foreground "cyan" :weight 'bold :height 75 :underline "red")) ; "lang" part.
+                       (3 '(:foreground "#555555" :height 70)) ; [:header arguments] part.
+                       (4 'org-code) ; "code..." part.
+                       )))
+
+
+
+
+;(setq lispy-mode-hooks
+;      '(clojure-mode-hook
+;        emacs-lisp-mode-hook
+;        lisp-mode-hook
+;        scheme-mode-hook))
+
+;(dolist (hook lispy-mode-hooks)
+;  (add-hook hook (lambda ()
+;                   (setq show-paren-style 'expression)
+;                   (paredit-mode)
+;                   (rainbow-delimiters-mode))))
+
+
+
+;(add-to-list 'load-path "~/.emacs.d/config")
+
+;; remove custom setting out of init.el
+;; http://emacsblog.org/2008/12/06/quick-tip-detaching-the-custom-file/
+;(setq custom-file "~/.emacs.d/custom.el")
+;(load custom-file 'noerror)
+;(require 'my-packages)
+;(require 'init-base)
+;(require 'init-font)
+
+;(require 'init-helm)
+
+;(require 'init-color-theme)
+;(require 'init-color-theme-2)
+;(require 'init-ido)
+;(require 'init-magit)
+;(require 'init-evil)
+;(require 'init-project)
+;(require 'init-ggtags)
+
+;(require 'init-projectile)
+
+;;;; conflict with C-c . in org-mode, disable it temporarily
+;;;;(require 'init-c-cpp)
+;(require 'init-key-binding)
+;(require 'init-winner)
+;(require 'init-minibuffer)
+;(require 'init-eshell)
+
+;; http://stackoverflow.com/questions/11484225/fix-an-auto-complete-mode-and-linum-mode-annoyance
+;;;(ac-linum-workaround)
+
+
+;(require 'init-mode-line)
+;(require 'init-workgroup2)
+;(require 'init-perl)
+
+;(add-to-list 'load-path "~/.emacs.d/Emacs-PDE-0.2.16/lisp/")
+;(load "pde-load")                       ;
+
+;(require 'init-linum)
+
+;(require 'auto-complete)
+;(require 'auto-complete-config)
+;(ac-config-default)
+
+
+
+
+;; page break configuration
+;(require 'pp-c-l)
+;(pretty-control-l-mode 1)
+
+;; persist command history of helm
+;(require 'session)
+;(add-hook 'after-init-hook 'session-initialize)
+
+
+;(require 'use-package)
+
+;; persist command history of helm
+;(use-package savehist
+;  :init (savehist-mode)
+;  :config
+;  (setq history-length 1000
+;        history-delete-duplicates t
+;        savehist-additional-variables '(extended-command-history))) 
+
+;;(savehist-mode)
+;;  (setq history-length 1000
+;;        history-delete-duplicates t
+;;        savehist-additional-variables '(extended-command-history)) 
+
+;    (setq split-height-threshold 0)
+
+
+
+
+
+;;;(require 'helm-gtags)
+;;;;(require 'setup-helm-gtags)
+;;;;(helm-gtags-mode 1)
+;;;;;; Enable helm-gtags-mode
+;;;(add-hook 'c-mode-hook 'helm-gtags-mode)
+;;;(add-hook 'c++-mode-hook 'helm-gtags-mode)
+;;;(add-hook 'asm-mode-hook 'helm-gtags-mode)
+;;;
+;;;;; customize
+;;;(custom-set-variables
+;;; '(helm-gtags-path-style 'relative)
+;;; '(helm-gtags-ignore-case t)
+;;; '(helm-gtags-auto-update t))
+;;;
+;;;;; key bindings
+;;;(eval-after-load "helm-gtags"
+;;;  '(progn
+;;;     (define-key helm-gtags-mode-map (kbd "M-t") 'helm-gtags-find-tag)
+;;;     (define-key helm-gtags-mode-map (kbd "M-r") 'helm-gtags-find-rtag)
+;;;     (define-key helm-gtags-mode-map (kbd "M-s") 'helm-gtags-find-symbol)
+;;;     (define-key helm-gtags-mode-map (kbd "M-g M-p") 'helm-gtags-parse-file)
+;;;     (define-key helm-gtags-mode-map (kbd "C-c <") 'helm-gtags-previous-history)
+;;;     (define-key helm-gtags-mode-map (kbd "C-c >") 'helm-gtags-next-history)
+;;;     (define-key helm-gtags-mode-map (kbd "M-,") 'helm-gtags-pop-stack)))
+
+
+;(require 'icicles)
+;(icy-mode 1)
+
+
+;;(require 'init-org)
+;(setq help-window-select t)
+
+
+
+;(require 'init-keychord)
+
+;(setq hydra-examples-verbatim t)
+;(require 'init-hydra)
+
+
+;(require 'ace-window)
+;(global-set-key (kbd "M-p") 'ace-window)
+
+
+;(require 'init-multi-term)
+;(require 'init-projectile)
+
+;(require 'page-break-lines)
+;(turn-on-page-break-lines-mode)
+;(global-page-break-lines-mode 1)
+
+;(setq projectile-completion-system 'helm)
+;(helm-projectile-on)
+
+
+;; show projectile name in mode-line
+
+
+;(if (locate-library "ediff")
+;    (progn
+;      (autoload 'ediff-files "ediff")
+;      (autoload 'ediff-buffers "ediff")
+;
+;       (eval-after-load "ediff" '(progn
+;                        (message "doing ediff customisation")
+;                        (setq diff-switches               "-u"
+;                              ediff-custom-diff-options   "-U3"
+;                              ediff-split-window-function 'split-window-horizontally
+;                              ediff-window-setup-function 'ediff-setu;p-windows-plain)
+;
+;                        (add-hook 'ediff-startup-hook 'ediff-toggle-w;ide-display)
+;                        (add-hook 'ediff-cleanup-hook 'ediff-toggle-w;ide-display)
+;                        (add-hook 'ediff-suspend-hook 'ediff-toggle-wide-display)))))
+
+
+
+;(defun update-diff-colors ()
+;  "update the colors for diff faces"
+;  (set-face-attribute 'diff-added nil
+;                      :foreground "white" :background "blue")
+;  (set-face-attribute 'diff-removed nil
+;                      :foreground "white" :background "red3")
+;  (set-face-attribute 'diff-changed nil
+;                      :foreground "white" :background "purple"))
+;(eval-after-load "diff-mode"
+;  '(update-diff-colors))
+
+
+
+;(require 'helm-ag)
+;(require 'flx)
+;(flx-ido-mode t)
+
+
+
+;(fringe-mode (quote (0 . 0)))
+
+
+(custom-set-variables
+ ;; custom-set-variables was added by Custom.
+ ;; If you edit it by hand, you could mess it up, so be careful.
+ ;; Your init file should contain only one such instance.
+ ;; If there is more than one, they won't work right.
+ '(package-selected-packages
+   (quote
+    (helm yasnippet workgroups2 w3m use-package tangotango-theme tabbar smex session rich-minority relative-line-numbers recentf-ext projectile-speedbar pp-c-l powerline persp-projectile paradox page-break-lines org-cliplink org-caldav org-bullets multi-term monokai-theme molokai-theme moe-theme minibuffer-line markdown-mode magit linum-relative key-chord jekyll-modes irony iedit ido-vertical-mode ido-ubiquitous icicles hydra highlight-tail highlight-escape-sequences highlight-current-line helm-projectile helm-ls-svn helm-ls-git helm-gtags helm-ag google-c-style ggtags flyspell-lazy flymake-google-cpplint flymake-cursor flx-ido fiplr eyebrowse evil-leader evil-escape ecb dired+ diff-hl cyberpunk-theme company color-theme-sanityinc-tomorrow color-theme color-identifiers-mode auto-complete-c-headers ace-window ace-jump-mode))))
+(custom-set-faces
+ ;; custom-set-faces was added by Custom.
+ ;; If you edit it by hand, you could mess it up, so be careful.
+ ;; Your init file should contain only one such instance.
+ ;; If there is more than one, they won't work right.
+ )