emacs.d

My emacs configuration, done in a literate programming fashion using org-mode

git clone git://git.shimmy1996.com/emacs.d.git
commit 1a820de4b3fb57b1b09eb11941b5719feacdd749
parent ea016ad0cc44655344776caef1b249e69d776938
Author: Shimmy Xu <shimmy.xu@shimmy1996.com>
Date:   Thu, 19 Oct 2017 23:11:07 -0500

Formatting changes. Added remove trailing whitespace upon save and proper global truncate line.

Diffstat:
MREADME.org | 154++++++++++++++++++++++++++++++++++++++++---------------------------------------
1 file changed, 78 insertions(+), 76 deletions(-)
diff --git a/README.org b/README.org
@@ -1,16 +1,15 @@
 #+TITLE: My Emacs Config
-#+AUTHOR: Shimmy Xu 
+#+AUTHOR: Shimmy Xu
 
 * Introduction
-
-This is my humble collection of Emacs config, modeled after [[https://github.com/admiralakber/simplemacs][simplemacs]], documented in an hopefully understandable manner. I went from using multiple =.org= files back to a single one because =org-mode= is just fantastic and my config is not too complicated for a single file to handle (yet). 
+This is my humble collection of Emacs config, modeled after [[https://github.com/admiralakber/simplemacs][simplemacs]], documented in an hopefully understandable manner. I went from using multiple =.org= files back to a single one because =org-mode= is just fantastic and my config is not too complicated for a single file to handle (yet).
 
 After installation, you may need to run =M-x list-packages= and reload =init.el~.
 
 ** Module Descriptions
-
-| Module         | Notes                 |
-|----------------+-----------------------|
+Here's a short description for each module.
+| Module     | Notes                 |
+|------------+-----------------------|
 | [[Packages]]   | Package management.   |
 | [[Aesthetics]] | UI and theme configs. |
 | [[Org-mode]]   | Org-mode settings.    |
@@ -18,13 +17,12 @@ After installation, you may need to run =M-x list-packages= and reload =init.el~
 | [[Auctex]]     | Latex settings.       |
 | [[Ox-hugo]]    | =hugo= Exporter       |
 | [[Magit]]      | Git interface.        |
-#+TBLFM: $2=hugo= Exporter
 
 * Packages
-Manage my package settings. 
-** Package Repositories
+Manage my package settings.
 
-Initialize Emacs Package Manager and add repositories (only melpa for now). 
+** Package Repositories
+Initialize Emacs Package Manager and add repositories (only melpa for now).
 
 #+BEGIN_SRC emacs-lisp
 (package-initialize) ;; You might already have this line
@@ -40,7 +38,6 @@ Initialize Emacs Package Manager and add repositories (only melpa for now).
 #+END_SRC
 
 ** Base packages to install
-
 List the base packages I would like to install here. Mostly just the core packages for each subtree.
 
 #+BEGIN_SRC emacs-lisp
@@ -52,68 +49,48 @@ List the base packages I would like to install here. Mostly just the core packag
 #+END_SRC
 
 ** Install base packages
-
-Makes sure all packages listed above are installed. 
+Makes sure all packages listed above are installed.
 
 #+BEGIN_SRC emacs-lisp
   (mapc #'package-install my-package-list)
 #+END_SRC
 
 * Aesthetics
-Mostly aesthetics and quality of life changes. 
-
-** UI Settings
-Hide menu, scrollbar and toolbars. 
-
-#+BEGIN_SRC emacs-lisp
-  (menu-bar-mode -1)
-  (toggle-scroll-bar -1)
-  (tool-bar-mode -1)
-#+END_SRC
+Mostly aesthetics and quality of life changes.
 
-Remove scrollbar for any new frames as well, useful for =emacsclient~.
+** Color Themes
+Solarized light or monokai.
 
 #+BEGIN_SRC emacs-lisp
-  (add-to-list 'default-frame-alist
-               '(vertical-scroll-bars . nil))
+  (load-theme 'base16-monokai t)
 #+END_SRC
 
-Fills up gap in the border when tiling emacs to half-screen. 
-
+** Customize Settings
+Save customized settings in a seperate file than =init.el=.
 #+BEGIN_SRC emacs-lisp
-(setq frame-resize-pixelwise t)
+  (setq custom-file (expand-file-name "custom.el" user-emacs-directory))
+  (load custom-file)
 #+END_SRC
 
-Use Source Code Pro as the default font. 
+** Fcitx
+Install fcitx support.
 
 #+BEGIN_SRC emacs-lisp
-  (setq default-frame-alist '((font . "Source Code Pro-12")))
+  (package-install 'fcitx)
+  (require 'fcitx)
+  (fcitx-aggressive-setup)
+  (setq fcitx-use-dbus t)
 #+END_SRC
 
-** Line Wrapping
-Enable line wrapping by default.
-#+BEGIN_SRC emacs-lisp
-  (toggle-truncate-lines)
-#+end_SRC
-
 ** Highlight Lines Over 80
-Highlight portions of line over 80 characters. 
+Highlight portions of line over 80 characters.
 #+BEGIN_SRC emacs-lisp
  (require 'whitespace)
  (setq whitespace-style '(face empty tabs lines-tail trailing))
  (global-whitespace-mode t)
 #+END_SRC
 
-** Color Themes
-
-Solarized light or monokai.
-
-#+BEGIN_SRC emacs-lisp
-  (load-theme 'base16-monokai t)
-#+END_SRC
-
 ** Line Highlighting
-
 Enable line highlighting.
 
 #+BEGIN_SRC emacs-lisp
@@ -121,8 +98,7 @@ Enable line highlighting.
 #+END_SRC
 
 ** Line Numbering
-
-Enable line numbering. 
+Enable line numbering.
 
 #+BEGIN_SRC emacs-lisp
   (linum-mode)
@@ -141,33 +117,57 @@ Enable relative mode, and display current line number instead of 0.
   (setq linum-relative-current-symbol "")
 #+END_SRC
 
-Force width of line numbering bar to 3 digit wide. 
+Force width of line numbering bar to 3 digit wide.
 
 #+BEGIN_SRC emacs-lisp
   (setq linum-format "%3d ")
 #+END_SRC
 
-** Fcitx
+** Line Wrapping
+Enable line wrapping by default.
+#+BEGIN_SRC emacs-lisp
+  (global-visual-line-mode t)
+#+end_SRC
+
+** Remove Trailing Whitespace
+Remove trailing whitespace upon saving.
+#+BEGIN_SRC emacs-lisp
+  (add-hook 'before-save-hook 'delete-trailing-whitespace)
+#+END_SRC
 
-Install fcitx support. 
+** UI Settings
+Hide menu, scrollbar and toolbars.
 
-#+BEGIN_SRC emacs-lisp 
-  (package-install 'fcitx)
-  (require 'fcitx)         
-  (fcitx-aggressive-setup) 
-  (setq fcitx-use-dbus t)  
+#+BEGIN_SRC emacs-lisp
+  (menu-bar-mode -1)
+  (toggle-scroll-bar -1)
+  (tool-bar-mode -1)
 #+END_SRC
 
-** Customize Settings
-Save customized settings in a seperate file than =init.el=.
+Remove scrollbar for any new frames as well, useful for =emacsclient~.
+
 #+BEGIN_SRC emacs-lisp
-  (setq custom-file (expand-file-name "custom.el" user-emacs-directory))
-  (load custom-file)
+  (add-to-list 'default-frame-alist
+               '(vertical-scroll-bars . nil))
+#+END_SRC
+
+Fills up gap in the border when tiling emacs to half-screen.
+
+#+BEGIN_SRC emacs-lisp
+(setq frame-resize-pixelwise t)
+#+END_SRC
+
+Use Source Code Pro as the default font.
+
+#+BEGIN_SRC emacs-lisp
+  (setq default-frame-alist '((font . "Source Code Pro-12")))
 #+END_SRC
 
 * Org-mode
+Mostly formatting settings in =org-mode=.
+
 ** Set Link Format
-Do not collapse the links. 
+Do not collapse the links.
 #+BEGIN_SRC emacs-lisp
   (org-toggle-link-display)
 #+END_SRC
@@ -178,11 +178,16 @@ Do not change text indention when promoting/demoting subtrees.
   (setq org-adapt-indentation nil)
 #+END_SRC
 
+** Truncate Lines by Default
+Automantically enable truncated lines when starting =org-mode=.
+#+BEGIN_SRC emacs-lisp
+  (setq-default org-startup-truncated t)
+#+END_SRC
+
 * Helm
 Stolen from Admiral Akber's config.
 
 ** Info
-
 Helm is incredible, it really supercharges emacs. It's a framework for
 incremental searching / completion / narrowing down options. Sounds
 simple, and it is in application, and it's so worth it.
@@ -196,7 +201,6 @@ Git: [[https://github.com/emacs-helm/helm]]
 #+END_SRC
 
 ** Visual customization
-
 I want helm to automatically resize and appear in the current buffer
 only.
 
@@ -206,10 +210,9 @@ only.
 #+END_SRC
 
 ** Fuzzy matching
-
 Fuzzy matching works most of the time, it does seem to have the issue
 of only matching forward i.e. "machine snow" will not match with "snow
-machine". 
+machine".
 
 It does make it a lot easier to search through emacs functions though
 as you only need to remember one part of the function name.
@@ -230,7 +233,6 @@ as you only need to remember one part of the function name.
 Above defaults overides such as =M-x= these are custom bindings.
 
 *** Self help
-
 The emacs culture is to have great documentation with your functions,
 all searchable via =apropos~. Helm provides a nice interface to this,
 use it often.
@@ -241,7 +243,6 @@ use it often.
 #+END_SRC
 
 *** Buffers and files
-
 Buffers and files are an obvious case where helm is very useful.
 
 #+BEGIN_SRC emacs-lisp
@@ -254,7 +255,6 @@ Buffers and files are an obvious case where helm is very useful.
 #+END_SRC
 
 *** Advanced editing
-
 Kill ring memory, grepping, etc, all gorgeous with helm.
 
 #+BEGIN_SRC emacs-lisp
@@ -264,7 +264,6 @@ Kill ring memory, grepping, etc, all gorgeous with helm.
 #+END_SRC
 
 *** The overloaded tab key
-
 The good ol' =TAB= key is used for a lot, in this case I want to make
 sure that when used in helm that it completes in helm, not attempting
 to insert a snippet or something.
@@ -290,7 +289,7 @@ This requires fixing the select other actions which IIRC is set to
 * Auctex
 
 ** Latex Mode Settings
-Placeholder for now. 
+Placeholder for now.
 
 #+BEGIN_SRC
   (setq TeX-auto-save t)
@@ -301,10 +300,11 @@ Placeholder for now.
   (add-hook 'LaTeX-mode-hook 'LaTeX-math-mode)
   (add-hook 'LaTeX-mode-hook 'turn-on-reftex)
   (setq reftex-plug-into-AUCTeX t)
-#+END_SRC 
+#+END_SRC
 
 * Ox-hugo
 Exporter from =org-mode= to =hugo~.
+
 ** Installation
 Enable =ox-hugo= as an option for exporting.
 
@@ -314,7 +314,7 @@ Enable =ox-hugo= as an option for exporting.
 #+END_SRC
 
 ** Auto Set Export Parameters
-
+Auto sets export parameters when using =org-capture=.
 #+BEGIN_SRC
 (with-eval-after-load 'org-capture
   (defun org-hugo-new-subtree-post-capture-template ()
@@ -344,16 +344,18 @@ See `org-capture-templates' for more information."
                  (file+olp "all-posts.org" "Blog Ideas")
                  (function org-hugo-new-subtree-post-capture-template))))
 #+END_SRC
+
 * Magit
 Great git interface.
-** Installation
 
+** Installation
+Install =magit=.
 #+BEGIN_SRC emacs-lisp
   (require 'magit)
 #+END_SRC
+
 ** Key Binding
 Set hot key for =magit-status=.
-#+BEGIN_SRC emacs-lisp 
+#+BEGIN_SRC emacs-lisp
   (global-set-key (kbd "C-c g") 'magit-status)
 #+END_SRC
-