diff --git a/README.md b/README.md index df86a67..c3b21a8 100644 --- a/README.md +++ b/README.md @@ -204,6 +204,7 @@ configurations are also dependent on them). multiple-cursors ; Multiple cursors for Emacs. org ; Outline-based notes management and organizer paredit ; minor mode for editing parentheses + powerline ; Rewrite of Powerline pretty-lambdada ; the word `lambda' as the Greek letter. smex)) ; M-x interface with Ido-style fuzzy matching. (upgrade-or-install-package package)) @@ -389,8 +390,39 @@ Change the color-theme to `monokai` (downloaded using `package`). Use the [Inconsolata](http://www.levien.com/type/myfonts/inconsolata.html) font if it's installed on the system. ```lisp -(when (member "Inconsolata" (font-family-list)) - (set-face-attribute 'default nil :font "Inconsolata-13")) +(when (member "Inconsolata-g" (font-family-list)) + (set-face-attribute 'default nil :font "Inconsolata-g-11")) +``` + +[Powerline](https://github.com/milkypostman/powerline) is an extension to customize the mode line. This is modified +version `powerline-nano-theme`. This is what it looks like: + +![img](./powerline.png) + +```lisp +(setq-default + mode-line-format + '("%e" + (:eval + (let* ((active (powerline-selected-window-active)) + ;; left hand side displays Read only or Modified. + (lhs (list (powerline-raw + (cond (buffer-read-only "Read only") + ((buffer-modified-p) "Modified") + (t "")) nil 'l))) + ;; right side hand displays (line,column). + (rhs (list + (powerline-raw + (concat + "(" (number-to-string (line-number-at-pos)) + "," (number-to-string (current-column)) ")") nil 'r))) + ;; center displays buffer name. + (center (list (powerline-raw "%b" nil)))) + (concat (powerline-render lhs) + (powerline-fill-center nil (/ (powerline-width center) 2.0)) + (powerline-render center) + (powerline-fill nil (powerline-width rhs)) + (powerline-render rhs)))))) ``` ## Ido @@ -836,6 +868,9 @@ using `C-c C-c` (instead of `M-x compile`), a habit from `latex-mode`. (defun c-setup () (local-set-key (kbd "C-c C-c") 'compile)) +(require 'auto-complete-c-headers) +(add-to-list 'ac-sources 'ac-source-c-headers) + (add-hook 'c-mode-common-hook 'c-setup) ``` diff --git a/init.el b/init.el index 8e3c387..82cd58f 100644 --- a/init.el +++ b/init.el @@ -90,6 +90,7 @@ PACKAGE is installed and the current version is deleted." multiple-cursors ; Multiple cursors for Emacs. org ; Outline-based notes management and organizer paredit ; minor mode for editing parentheses + powerline ; Rewrite of Powerline pretty-lambdada ; the word `lambda' as the Greek letter. smex)) ; M-x interface with Ido-style fuzzy matching. (upgrade-or-install-package package)) @@ -179,8 +180,32 @@ PACKAGE is installed and the current version is deleted." (load-theme 'monokai t) -(when (member "Inconsolata" (font-family-list)) - (set-face-attribute 'default nil :font "Inconsolata-13")) +(when (member "Inconsolata-g" (font-family-list)) + (set-face-attribute 'default nil :font "Inconsolata-g-11")) + +(setq-default + mode-line-format + '("%e" + (:eval + (let* ((active (powerline-selected-window-active)) + ;; left hand side displays Read only or Modified. + (lhs (list (powerline-raw + (cond (buffer-read-only "Read only") + ((buffer-modified-p) "Modified") + (t "")) nil 'l))) + ;; right side hand displays (line,column). + (rhs (list + (powerline-raw + (concat + "(" (number-to-string (line-number-at-pos)) + "," (number-to-string (current-column)) ")") nil 'r))) + ;; center displays buffer name. + (center (list (powerline-raw "%b" nil)))) + (concat (powerline-render lhs) + (powerline-fill-center nil (/ (powerline-width center) 2.0)) + (powerline-render center) + (powerline-fill nil (powerline-width rhs)) + (powerline-render rhs)))))) (dolist (mode '(ido-mode ; Interactivly do. @@ -407,6 +432,9 @@ LANGUAGES (cyclic) list." (defun c-setup () (local-set-key (kbd "C-c C-c") 'compile)) +(require 'auto-complete-c-headers) +(add-to-list 'ac-sources 'ac-source-c-headers) + (add-hook 'c-mode-common-hook 'c-setup) (define-abbrev-table 'java-mode-abbrev-table diff --git a/init.org b/init.org index 7408a4f..b15c074 100644 --- a/init.org +++ b/init.org @@ -139,7 +139,7 @@ (when (and do-package-update-on-init (y-or-n-p "Update all packages?")) (package-refresh-contents) - + (dolist (package '(ac-geiser ; Auto-complete backend for geiser ac-slime ; An auto-complete source using slime completions @@ -161,6 +161,7 @@ multiple-cursors ; Multiple cursors for Emacs. org ; Outline-based notes management and organizer paredit ; minor mode for editing parentheses + powerline ; Rewrite of Powerline pretty-lambdada ; the word `lambda' as the Greek letter. smex)) ; M-x interface with Ido-style fuzzy matching. (upgrade-or-install-package package)) @@ -346,8 +347,39 @@ Use the [[http://www.levien.com/type/myfonts/inconsolata.html][Inconsolata]] font if it's installed on the system. #+BEGIN_SRC emacs-lisp :tangle yes - (when (member "Inconsolata" (font-family-list)) - (set-face-attribute 'default nil :font "Inconsolata-13")) + (when (member "Inconsolata-g" (font-family-list)) + (set-face-attribute 'default nil :font "Inconsolata-g-11")) + #+END_SRC + + [[https://github.com/milkypostman/powerline][Powerline]] is an extension to customize the mode line. This is modified + version =powerline-nano-theme=. This is what it looks like: + + [[./powerline.png]] + + #+BEGIN_SRC emacs-lisp :tangle yes + (setq-default + mode-line-format + '("%e" + (:eval + (let* ((active (powerline-selected-window-active)) + ;; left hand side displays Read only or Modified. + (lhs (list (powerline-raw + (cond (buffer-read-only "Read only") + ((buffer-modified-p) "Modified") + (t "")) nil 'l))) + ;; right side hand displays (line,column). + (rhs (list + (powerline-raw + (concat + "(" (number-to-string (line-number-at-pos)) + "," (number-to-string (current-column)) ")") nil 'r))) + ;; center displays buffer name. + (center (list (powerline-raw "%b" nil)))) + (concat (powerline-render lhs) + (powerline-fill-center nil (/ (powerline-width center) 2.0)) + (powerline-render center) + (powerline-fill nil (powerline-width rhs)) + (powerline-render rhs)))))) #+END_SRC ** Ido @@ -790,7 +822,10 @@ #+BEGIN_SRC emacs-lisp :tangle yes (defun c-setup () (local-set-key (kbd "C-c C-c") 'compile)) - + + (require 'auto-complete-c-headers) + (add-to-list 'ac-sources 'ac-source-c-headers) + (add-hook 'c-mode-common-hook 'c-setup) #+END_SRC diff --git a/init.pdf b/init.pdf index d13a8b4..3e52486 100644 Binary files a/init.pdf and b/init.pdf differ diff --git a/powerline.png b/powerline.png new file mode 100644 index 0000000..161eda7 Binary files /dev/null and b/powerline.png differ