From b45b52e1ca67335884a55bb41147f6dc9c123f95 Mon Sep 17 00:00:00 2001 From: Peng Li Date: Sun, 16 Aug 2015 04:06:03 +0800 Subject: [PATCH] emacs - disable evil mode, add helm mode --- emacs.d/config/init-c-cpp.el | 3 --- emacs.d/config/init-color-theme.el | 3 ++- emacs.d/config/init-helm.el | 26 +++++++++++++++++++++++++ emacs.d/config/my-packages.el | 3 +++ emacs.d/init.el | 40 ++++++++++++++++++++++++++++++++++++-- 5 files changed, 69 insertions(+), 6 deletions(-) create mode 100644 emacs.d/config/init-helm.el diff --git a/emacs.d/config/init-c-cpp.el b/emacs.d/config/init-c-cpp.el index 5c6ba6c..8f0e945 100644 --- a/emacs.d/config/init-c-cpp.el +++ b/emacs.d/config/init-c-cpp.el @@ -28,9 +28,6 @@ ;; ;; 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) diff --git a/emacs.d/config/init-color-theme.el b/emacs.d/config/init-color-theme.el index 0f45336..65b5460 100644 --- a/emacs.d/config/init-color-theme.el +++ b/emacs.d/config/init-color-theme.el @@ -234,7 +234,8 @@ ;; ) ;; ;; ) - (powerline-raw (powerline-evil-tag) pl-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) diff --git a/emacs.d/config/init-helm.el b/emacs.d/config/init-helm.el new file mode 100644 index 0000000..1b423b5 --- /dev/null +++ b/emacs.d/config/init-helm.el @@ -0,0 +1,26 @@ + +(require 'helm) +(require 'helm-config) +(require 'helm-adaptive) +(helm-mode 1) + +(global-set-key (kbd "M-x") 'helm-M-x) +;; http://tuhdo.github.io/helm-intro.html +(global-set-key (kbd "C-x b") 'helm-mini) +(setq helm-buffers-fuzzy-matching t + helm-recentf-fuzzy-match t) + +;; 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))) + + +(helm-autoresize-mode 1) +(helm-adaptive-mode 1) +(helm-adaptative-mode 1) +(setq helm-adaptive-history 1) + +(provide 'init-helm) diff --git a/emacs.d/config/my-packages.el b/emacs.d/config/my-packages.el index 5977545..e953b74 100644 --- a/emacs.d/config/my-packages.el +++ b/emacs.d/config/my-packages.el @@ -54,6 +54,9 @@ evil-escape workgroups2 highlight-current-line + pp-c-l + session + use-package ) "a list of packages to ensure are installed at launch.") (require 'cl) diff --git a/emacs.d/init.el b/emacs.d/init.el index 99e760a..9005a3a 100644 --- a/emacs.d/init.el +++ b/emacs.d/init.el @@ -12,14 +12,17 @@ (add-to-list 'load-path "~/.emacs.d/config") +(global-set-key "\C-s" 'isearch-forward-regexp) +(global-set-key "\C-r" 'isearch-backward-regexp) + (require 'init-base) (require 'my-packages) (require 'init-color-theme) -(require 'init-ido) +;(require 'init-ido) (require 'init-magit) -(require 'init-evil) +;(require 'init-evil) (require 'init-project) (require 'init-ggtags) @@ -47,3 +50,36 @@ ;(load "pde-load") ; (require 'init-linum) + +(require 'auto-complete) +(require 'auto-complete-config) +(ac-config-default) + + +(require 'init-helm) + +;; 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) -- 2.11.0