Emacs

2013/03/07 Linux

License: (CC 3.0) BY-NC-SA

Reference

steven purcell’s emacs.d

someone says his emacs.d is the world wide best, so i just try it, however, i couldn’t use it.

  1. git clone from purcell/emacs.d.git
  2. rm ~/.emacs && cd ~/.emacs.d
  3. git submodule update –init
  4. emacs &

the first step is use org as my gtd tool, i already use emacs org mode for gtd for almost one year, i know how to set it directly through some *.el file, but i don’t know how to config it gracefully via purcell’s emacs.d, which means, i don’t want to change it, just want edit some extra files in the .emacs.d dir.

any idea?

here comes a bad idea:

i insert a line in emacs.d/init-org.el

(setq org-agenda-files (quote ("~/private/gtd/")))

ugly…

Hot Keys

File operate

  • c-x c-r m-x find-file-read-only
  • c-x i m-x insert-file
  • c-x s m-x save-some-buffers
  • c-x c-w m-x write-file
  • c-x d m-x dired directory mode
  • c-x c-d m-x list-directory get directory list

Cursor

  • char c-f/c-b c-n/c-p
  • word m-f/m-b
  • sentence m-a/m-e
  • line c-a/c-e
  • paragrah m-{/m-}
  • page c-v/m-v
  • buffer m-</m->
  • m-g g (goto-line)
  • m-x (goto-char)

Edit

deletion

  • char c-d/DEL
  • word m-d m-DEL
  • line c-k ;; cut till line end
  • line c-s-backspace ;; cut whole line
  • reg c-m-k
  • block c-w
  • blank m-x delete-horizontal-space

copy & paste

  • c-@ begin block selection, move cursor to select
  • you can use m-y after c-y to recall content of kill-ring

undo & redo

  • undo: c-/ (every 20 chars are treated as an undo unit)
  • redo: you can use c-g c-/ to redo after undo operation

Window

  • c-x 0 delete-window
  • c-x 1 delete-other-window
  • c-x 2 split-window-vertically
  • c-x 3 split-window-horizontally
  • c-x 4 0 kill-buffer-and-window
  • c-x o other-window
  • c-m-v scroll-other-window

Buffer

  • c-x c-b list-buffers
  • c-x b switch-to-buffer
  • c-x k kill-buffer

Search & replace

  • c-s search string
  • c-s c-s
  • c-r

Bash

  • c-@ m-x indent-region

Org-mode

  • C-c C-x C-i start timing
  • C-c C-x C-o stop timing
  • C-c C-q set a tag
  • type R on agenda view to see time report

Emacs as IDE

Reference

Code Reading

  1. sudo apt-get install exuberant-ctags
  2. ctags-exuberant -e -R –languages=python
  • M-. (find-tag)
  • M-* (pop-tag-mark)

Search

    Table of Contents