(irony-mode . "")
(page-break-lines-mode . "")
(yas-minor-mode . "y")
+ ;; default jj
+ (evil-escape-mode . "")
;; Major modes
(lisp-interaction-mode . "λ")
(hi-lock-mode . "")
))
(center (list (powerline-raw " " face1)
(funcall separator-left face1 face2)
+ (powerline-raw (when (and (boundp 'evil-mode) evil-mode) evil-mode-line-tag) face2)
(when (and (boundp 'erc-track-minor-mode) erc-track-minor-mode)
(powerline-raw erc-modified-channels-object face2 'l))
(powerline-major-mode face2 'l)
(use-package org-bullets
:ensure t
:init
- (add-hook 'org-mode-hook
- (lambda ()
- (org-bullets-mode t))))
+ (add-hook 'org-mode-hook (apply-partially #'org-bullets-mode t)))
(setq org-bullets-bullet-list '("⦿" "✪" "◉" "○" "►" "◆"))
(set-face-attribute 'variable-pitch nil :font "Source Sans Pro" :height 160)
(set-face-attribute 'fixed-pitch nil :font "Source Code Pro" :height (face-attribute 'default :height))
- (add-hook 'text-mode-hook 'variable-pitch-mode)
+ ;; (add-hook 'text-mode-hook 'variable-pitch-mode)
;; Install Ubuntu Mono fonts and apply it in org-table to align Chinese fonts
(with-eval-after-load "org"
*** Org-head face
#+BEGIN_SRC emacs-lisp :tangle yes :results silent
- (with-eval-after-load "org"
- (let* ((base-height (face-attribute 'variable-pitch :height))
- (base-font-color (face-foreground 'default nil 'default)))
- (set-face-attribute 'org-document-title nil :weight 'bold :height (+ 60 base-height))
- (set-face-attribute 'org-level-1 nil :weight 'bold :height (+ 40 base-height))
- (set-face-attribute 'org-level-2 nil :weight 'bold :height (+ 30 base-height))
- (set-face-attribute 'org-level-3 nil :weight 'bold :height (+ 20 base-height))
- (set-face-attribute 'org-level-4 nil :weight 'bold :height (+ 10 base-height))
- (set-face-attribute 'org-level-5 nil :weight 'bold)
- (set-face-attribute 'org-level-6 nil :weight 'bold)
- (set-face-attribute 'org-level-7 nil :weight 'bold)
- (set-face-attribute 'org-level-8 nil :weight 'bold)))
+ ;; (with-eval-after-load "org"
+ ;; (let* ((base-height (face-attribute 'variable-pitch :height))
+ ;; (base-font-color (face-foreground 'default nil 'default)))
+ ;; (set-face-attribute 'org-document-title nil :weight 'bold :height (+ 60 base-height))
+ ;; (set-face-attribute 'org-level-1 nil :weight 'bold :height (+ 40 base-height))
+ ;; (set-face-attribute 'org-level-2 nil :weight 'bold :height (+ 30 base-height))
+ ;; (set-face-attribute 'org-level-3 nil :weight 'bold :height (+ 20 base-height))
+ ;; (set-face-attribute 'org-level-4 nil :weight 'bold :height (+ 10 base-height))
+ ;; (set-face-attribute 'org-level-5 nil :weight 'bold)
+ ;; (set-face-attribute 'org-level-6 nil :weight 'bold)
+ ;; (set-face-attribute 'org-level-7 nil :weight 'bold)
+ ;; (set-face-attribute 'org-level-8 nil :weight 'bold)))
#+END_SRC
** Org Blog
#+BEGIN_SRC emacs-lisp :tangle yes :results silent
(require 'utilities)
- (add-hook 'eshell-mode-hook (lambda ()
- (local-set-key (kbd "C-l") 'sd/eshell-clear-buffer)))
+ ;; (add-hook 'eshell-mode-hook (lambda ()
+ ;; (local-set-key (kbd "C-l") 'sd/eshell-clear-buffer)))
+ (add-hook 'eshell-mode-hook (apply-partially #'local-set-key (kbd "C-l") 'sd/eshell-clear-buffer))
#+END_SRC
** Toggle Eshell
** Which key
[[https://github.com/justbur/emacs-which-key][which-key]] show the key bindings
#+BEGIN_SRC emacs-lisp :tangle yes :results silent
- (use-package which-key
- :ensure t
- :config
- (which-key-mode))
+ ;; (use-package which-key
+ ;; :ensure t
+ ;; :config
+ ;; (which-key-mode))
#+END_SRC
** View only for some directory
(define-key lispy-mode-map (kbd "G") 'special-lispy-goto)
(define-key lispy-mode-map (kbd "M-m") 'back-to-indentation))
:config
- (add-hook 'emacs-lisp-mode-hook (lambda () (lispy-mode 1))))
-
-
+ (add-hook 'emacs-lisp-mode-hook (apply-partially #'lispy-mode 1)))
#+END_SRC
** Perl
(setq cperl-tab-always-indent t)
;(setq cperl-brace-offset 0)
- (add-hook 'cperl-mode-hook
- '(lambda ()
- (cperl-set-style "C++")))
+ (add-hook 'cperl-mode-hook (apply-partially #'cperl-set-style "C++"))
(defalias 'perldoc 'cperl-perldoc)
#+END_SRC
#+END_SRC
#+BEGIN_SRC sh
- cmake -DLIBCLANG_LIBRARY\=/usr/local/Cellar/llvm/3.6.2/lib/libclang.dylib \
- -DLIBCLANG_INCLUDE_DIR=/usr/local/Cellar/llvm/3.6.2/include \
- -DCMAKE_INSTALL_PREFIX\=/Users/peli3/.emacs.d/irony/ \
- /Users/peli3/.emacs.d/elpa/irony-20160713.1245/server && cmake --build . --use-stderr --config Release --target install
+ cmake -DLIBCLANG_LIBRARY\=/usr/local/Cellar/llvm/4.0.1/lib/libclang.dylib \
+ -DLIBCLANG_INCLUDE_DIR=/usr/local/Cellar/llvm/4.0.1/include \
+ -DCMAKE_INSTALL_PREFIX\=/Users/peng/.emacs.d/irony/ \
+ /Users/peng/.emacs.d/elpa/irony-20160713.1245/server && cmake --build . --use-stderr --config Release --target install
#+END_SRC
**** irony config
(use-package company-c-headers
:ensure t
:config
- (add-to-list 'company-c-headers-path-system "/usr/include/c++/4.2.1/"))
+ (add-to-list 'company-c-headers-path-system "/usr/include/c++/4.2.1/")
+ (add-to-list 'company-c-headers-path-system "/usr/local/include/"))
;; (with-eval-after-load 'company
;; (add-to-list 'company-backends 'company-irony)
*** google C style
#+BEGIN_SRC emacs-lisp :tangle yes :results silent
- (use-package google-c-style
- :ensure t
- :config
- (add-hook 'c-mode-hook 'google-set-c-style)
- (add-hook 'c++-mode-hook 'google-set-c-style))
+ ;; (use-package google-c-style
+ ;; :ensure t
+ ;; :config
+ ;; (add-hook 'c-mode-hook 'google-set-c-style)
+ ;; (add-hook 'c++-mode-hook 'google-set-c-style))
+#+END_SRC
+
+*** Compile and Run the C file
+#+BEGIN_SRC emacs-lisp :tangle yes :results silent
+ (defun my-cpp-hook ()
+ (let* ((current-file-name)
+ (a-dot-out-file))
+ (when buffer-file-name
+ (setq current-file-name (shell-quote-argument buffer-file-name))
+ (setq a-dot-out-file (concat (file-name-directory buffer-file-name) "a.out")))
+ (setq-local compilation-read-command t)
+ (set (make-local-variable 'compile-command)
+ (concat "g++ -Wall "
+ current-file-name
+ " && "
+ a-dot-out-file))
+ (local-set-key (kbd "s-r") 'compile)))
+
+ (add-hook 'c-mode-hook 'my-cpp-hook)
+ (add-hook 'c++-mode-hook 'my-cpp-hook)
#+END_SRC
** Lua
;; (with-eval-after-load 'gnus-summary-mode
;; (define-key gnus-summary-mode-map (kbd "C-o") 'sd/hydra-window/body))
- (add-hook 'gnus-summary-mode-hook (lambda ()
- (define-key gnus-summary-mode-map (kbd "C-o") nil)))
+ ;; (add-hook 'gnus-summary-mode-hook (lambda ()
+ ;; (define-key gnus-summary-mode-map (kbd "C-o") nil)))
+ ;(add-hook 'gnus-summary-mode-hook (apply-partially #'define-key gnus-summary-mode-map (kbd "C-o") nil))
#+END_SRC
(define-key perspeen-mode-map (kbd "s-t") 'perspeen-tab-create-tab)
(define-key perspeen-mode-map (kbd "s-t") 'perspeen-tab-create-tab))
#+END_SRC
+* Evil Mode
+#+BEGIN_SRC emacs-lisp :tangle yes :results silent
+ (org-babel-load-file "~/.emacs.d/emacs-evil.org")
+#+END_SRC
+
* Note
** Check if emacs is in terminal of graphic mode