-;;---------------------------------------------------------------------------------------
-;; 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)
-
-
-
-
-;; c/c++ auto-complete, yasnippet, auto-complet-c-headers
-;;https://www.youtube.com/watch?v=HTUE03LnaXA&list=PL-mFLc7R_MJet8ItKipCtYc7PWoS5KTfM
-(require 'auto-complete)
-(require 'auto-complete-config)
-(ac-config-default)
-;; 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")
-)
-;; call this function from c/c++ hooks
-(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)
+; (run-at-time
+; nil 30
+; (lambda ()
+; (with-current-buffer " *Minibuf-0*"
+; (erase-buffer)
+; (dotimes (spaces (- (frame-width) 20))
+; (insert " "))
+; (insert (format-time-string "%m-%d %I:%M %p %a ")))))
+
+
+
+
+;;; 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")))))
+
+
+
+
+(require 'evil-escape)
+;(setq-default evil-escape-delay 0.2)
+;(setq evil-escape-excluded-major-modes '(dired-mode))
+;(setq-default evil-escape-key-sequence "jj")
+;(evil-escape-mode 1)
+
+
+;; ---------------
+;; recent file
+(require 'recentf)
+(recentf-mode)
+;(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))))
+
+
+
+;; http://stackoverflow.com/questions/11484225/fix-an-auto-complete-mode-and-linum-mode-annoyance
+(ac-linum-workaround)
+
+
+;; ---------------------------------
+;; linum-relative
+
+(require 'linum-relative)
+
+(custom-set-variables
+ '(fringe-mode (quote (4 . 0)) nil (fringe)))
+
+;; 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
+ '(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)))))
+
+
+;; 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)
+
+
+
+;(defun pl-fringe-mode ()
+; "jfoewoif"
+; (if linum-mode
+; (fringe-mode '(4 . 0))
+; (fringe-mode '(0 . 0))))
+
+
+;(add-hook 'eshell-mode-hook 'pl-fringe-mode)
+;(add-hook 'prog-mode-hook 'pl-fringe-mode)
+
+
+
+
+
+(require 'workgroups2)
+
+
+(setq wg-prefix-key (kbd "C-c z"))
+(setq wg-session-file "~/.emacs.d/.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)