The only reason I am using Emacs is because of its powerful Org-Mode for managing life. I have been going through a number of applications for managing my to-do list, but I think Emacs with Org-Mode still reigns the top spot. Why? Because it is like a plain-text system on steroid.
When in doubt, plain text is always the way to go. It makes everything easier to manage and audit. Here is my
~/.emacs on a Ubuntu linux. There is another
~/.emacs for Windows. The only notable difference is that
~/.emacs on Windows resides in a weird location.
The philosophy of my
~/.emacs is that readability trumps everything. That means it is okay to have high LOC count than unreadable mess of spaghetti code.
.emacs on linux/unix
;; disable splash screen (setq inhibit-splash-screen t) ;; enable transient mark mode (transient-mark-mode 1) ;; org-mode config (require 'org) (add-to-list 'auto-mode-alist '("\\.org$" . org-mode)) ;; activate Evil mode (require 'evil) (evil-mode 1) ;; activate spacemacs-dark theme (add-to-list 'custom-theme-load-path "~/.emacs.d/themes") (load-theme 'spacemacs-dark t) ;; enable variable-pitch mode for mixed-font rendering (add-hook 'text-mode-hook (lambda () (variable-pitch-mode 1) ) ) ;; use unicode bullets instead of headline markers (require 'org-bullets) (add-hook 'org-mode-hook (lambda () (org-bullets-mode 1) ) ) ;; suppress the creation of backup file (setq make-backup-files nil) ;; custom color for org keywords (setq org-todo-keyword-faces '( ("TODO" . "orange") ("NEXT" . "red") ("AXED" . "blue") ("BACK" . "pink") ) ) ;; custom keyboard shortcuts (global-set-key (kbd "C-q") 'org-archive-subtree-default) ; Ctrl-q
.emacs on Windows
Mostly similar with the
~/.emacs on linux, except:
;; set directory to $HOME on Windows (setq default-directory "C:/Users/aixnr/")
As for the location, on my Windows 10 the
~/.emacs is located at:
Here is a list of important plugin
- Evil, for emulating vim
- spacemacs-theme, makes it look better
- fzf, for fuzzy search (linux/mac only)
FUC is an acronym for frequently-used commands. I know it sounds a little pungent, but bear with me on this one.
Most commands here related to the Org-Mode. Normal operations like saving file, quitting emacs, copying (yanking) and pasting use the Vim command (in Normal Mode), thanks to the Evil plugin.
# Updating checkbox count C-c C-c # Folding (Evil) z-r # to open all z-m # to close all # Archive items C-c C-x C-a # Insert deadline C-c c-d # Insert schedule C-c C-s
To update the checkbox count, the cursor must be placed at the location of the checkbox count. If not, it will invoke Org-Mode tagging feature.
As for archiving, Org-Mode's default is quite unsightly. Refer to my
~/.emacs, where I configured a shortcut
C-q to archive items.
When adding schedule or deadline in Org-Mode, hold SHIFT key and then move using the CURSOR keys.
Here are some commands to manage Emacs
# Installing package M-x package-install RET # Removing package M-x package-delete RET # Toggle line number M-x linum-mode RET