My Avatar

LanternD's Castle

PhD Student in ECE @ MSU

Spacemacs Rocks Note Day 2


A series of notes that I learn Emacs hacking. Change variable globally, disabling auto-save and auto-backup; `require` keyword, enabling recent files opening, enabling delete selection mode; code block and example block fast typing; initializing Emacs with full screen; showing matching parenthesis, highlighting current line; package management system configuration; adding a new theme, hundgry delete mode, swiper, smartparens; customize-group; ordered list in org-mode; JavaScript IDE in Emacs; setting schedule in org-mode.

setq vs. setq-default

Disable auto-save / auto-backup


Deal with the recent files

Delete the selection words

shortkey for entering SRC block

start Emacs with full screen

Show matched Parenthesis

Highlight the current line

Configurate the Package Management system

;; Add the package source
(when (>= emacs-major-version 24)
  (require 'package)
  (add-to-list 'package-archives '("melpa" . "") t)

(require 'cl)
;; Add whatever packages you want here
(defvar LanternD/packages '(
			    ) "Default packages")

(defun LanternD/packages-installed-p ()
  (loop for pkg in LanternD/packages
	when(not (package-installed-p pkg)) do (return nil)
	finally (return t)))

(unless (LanternD/packages-installed-p)
  (message "%s" "Refreshing package database...")
  (dolist (pkg LanternD/packages))
  (when (not (package-installed-p pkg))
    (package-install pkg))
(require 'package) ;; You might already have this line
(let* ((no-ssl (and (memq system-type '(windows-nt ms-dos))
		    (not (gnutls-available-p))))
       (url (concat (if no-ssl "http" "https") "://")))
  (add-to-list 'package-archives (cons "melpa" url) t))
(when (< emacs-major-version 24)
  ;; For important compatibility libraries like cl-lib
  (add-to-list 'package-archives '("gnu" . "")))
(package-initialize) ;; You might already have this line

Add a new theme

Install hungry-delete-mode

Package management advanced

About smex package

About swiper package

About smartparens package

Customize group

Tips on order list in org-mode

Be careful, M-<return> will match the previous format.

About JavaScript IDE

(setq auto-mode-alist
    '(("\\.js\\'" . js2-mode))

TODO Reading recommendation

Use org to set schedule

(setq org-agenda-files '("~/org"))
(global-set-key (kbd "C-c a") 'org-agenda)

Disqus Comment 0