emacs note

Đang cập nhật TODO

  • minibuffer
  • compress
  • shell trên mac chạy không giống terminal (lỗi unicode khi build octopress, không tìm thấy ipython, …)

Giới thiệu

  • Emacs là một chương trình hỗ trợ nhiều tác vụ: quản lý thư mục tập tin, chỉnh sửa tập tin, lịch, máy tính, …
  • Buffer - Khi người dùng thực hiện 1 hành động, emacs sẽ tạo 1 buffer đại diện cho hành động đó. Ví dụ: người dùng đang xem 1 thư mục x, đang sửa nội dung 1 tập tin y, đang xem lịch thì emacs đang tạo ra 3 buffer đại diện cho 3 hành động đó.
  • Window là màn hình hiển thị của buffer. Trong emacs, tại một thời điểm, màn hình chính (window) có thể được chia làm nhiều màn hình con (windows)
    • Một buffer có thể được hiển thị cùng lúc bởi nhiều màn hình
    • Một màn hình chỉ hiển thị 1 buffer
    • Mỗi màn hình có con trỏ, vị trí của riêng nó. Ví dụ: 2 màn hình cùng hiển thị hành động chỉnh sửa tập tin x, nhưng màn hình 1 có thể đang ở đầu tập tin và màn hình 2 ở cuối tập tin
  • Frame là màn hình giao diện của emacs khi bắt đầu trên một hệ điều hành. Một frame có menu, thanh công cụ, và 1 màn hình. Màn hình đó có thể được chia thành nhiều windows. Bạn có thể tạo thêm frame khi cần. Nhiều frame được tạo trong cùng 1 phiên làm việc của Emacs sẽ dùng chung các buffers và dữ liệu.
  • Windows
  • Emacs

Cài đặt

Windows

  • Emacs: http://www.gnu.org/software/emacs/
  • Cấu hình:
  • Cấu hình
    • .emacs => ~/.emacs
    • .emacs.d => ~/.emacs.d

Mac

  • Aquamacs: http://aquamacs.org/
  • Cấu hình
    • .emacs => ~/Library/Preferences/Aquamacs Emacs/Preferences.el
    • .emacs.d => ~/Library/Preferences/Aquamacs Emacs/Packages

Các hình thức/chương trình/mode trong emacs

  • Viết tắt:
    • C tương đương Ctrl
    • M tương đương Alt
    • S tương đương Shìft
    • RET tương đương enter
  • Dired
  • Editor
    • Fundamental
    • PHP mode
    • Java mode
    • Markdown
  • Calc
  • Schedule
  • git
  • eshell/shell

Một số cấu hình cần chỉnh trước khi sử dụng

  • Thay đổi một số cấu hình (Options - sau khi chỉnh phải nhấn lưu lại)
    • Menu Options => chọn Highlight Matching Parenthese
    • Menu Options => chọn Use CUA keys (Cut/Paste …)
    • Menu Options => Multilingual Environment => set Language environment => UTF-8
    • Menu Options => show/hide => bỏ chọn tool-bar
    • Menu Options => show/hide => chọn line numbers
    • Menu Options => show/hide => chọn column numbers
    • Menu Options => Customize Emacs => Custom themes => tango-dark => lưu
  • Thay đổi phím mặc định
    • Tắt màn hình hiện hành mà không phải xác nhận
      • Mở tập tin .emacs: Alt-x dired => Ctrl-c Ctrl-f ~/.emacs
      • Dán nội dung sau vào: (global-set-key [(control x) (k)] ‘kill-this-buffer)
      • Lưu lại
  • Fullscreen khi bắt đầu - Mac:
1
2
(custom-set-variables
 '(initial-frame-alist (quote ((fullscreen . maximized)))))
  • Fullscreen khi bắt đầu - windows:
1
(w32-send-sys-command 61488)
  • Khởi tạo font chữ default
1
(set-frame-font "Courier New-16" nil t)
  • Tắt màn hình giới thiệu khi bắt đầu
1
(setq inhibit-startup-message t)        ; Disable startup message

Một số phím thông dụng

  • Alt-X: gọi thực thi lệnh
    • dired: quản lý thư mục tập tin
    • calc: máy tính
    • calendar: lịch => thoát thì gõ q
    • shell: thực thi các lệnh command
    • set-input-method: vietnamese-telex/british
  • Ctrl-h: help
    • Ctrl-h v: biến
    • Ctrl-h c:
  • Alt-`: sử dụng menu
  • Alt-;: ghi chú hoặc bỏ ghi chú các dòng được chọn
  • Ctrl-g: hủy thao tác đang làm
  • Ctrl-s: tìm kiếm
  • Ctrl-space: bắt đầu chọn
  • Thông tin cấu hình
    • Hầu hết cấu hình được lưu trong biến, tham khảo danh sach biến
    • Alt-x customize: thay đổi cấu hình tham khảo
    • Thay đổi phím tắt (tham khảo)
      • Ghi trực tiếp vào tập tin cấu hình => Ctrl-c Ctrl-f => gõ ~/.emacs - Điền nội dung vào và lưu lại. Ví dụ: (global-set-key [(control x) (k)] ‘kill-this-buffer)
  • C-h k C-x i – describe-key
  • C-h f function-name – describe function
  • C-h m – show key bindings for major and minor mode
  • C-h – show all keys w/ that prefix
  • C-h C-h – list all functions

Các bước cài đặt Package

### Sử dụng ELPA, MELPA, Marmalade - Alt-x list-packages - Một số thao tác - Enter: xem mô tả package - i: đánh dấu để cài đặt - u: bỏ đánh dấu - d: đánh dấu để xóa (các packages đã cài đặt) - r: refresh lại danh sách - U: cập nhật tất cả packages nếu có bản cập nhật - x: thực thi hành động - Các repos lưu trữ package - http://elpa.gnu.org/ Default. Official GNU Emacs package repository. This repository contains the minimal set, and are FSF signed. - HTTP://TROMEY.COM/ELPA/ ELPA (BEING PHASED OUT AS OF 2012-07-03). - HTTP://MARMALADE-REPO.ORG/ MARMALADE. MORE EXTENSIVE NUMBER OF PACKAGES. - HTTP://MELPA.MILKBOX.NET/ MELPA. AS OF 2012-10-18, MELPA has most packages, and updated daily - Để thêm vào danh sách, ghi vào tập tin khởi tạo

1
2
3
4
5
(setq package-archives '(("gnu" . "http://elpa.gnu.org/packages/")
			 ("marmalade" . "http://marmalade-repo.org/packages/")
			 ("ELPA" . "http://tromey.com/elpa/")
			 ("melpa" . "http://melpa.milkbox.net/packages/")
			 ("SC"   . "http://joseito.republika.pl/sunrise-commander/")))
  • Tham khảo ### Sử dụng gói cài đặt TODO TPL?
  • Đọc và sử dụng trong phiên làm việc đó
  • Đọc khi bắt đầu
  • Tham khảo

Xóa package

  • Vào danh sách package: Alt-x list-packages
  • Chọn package cần xoá bằng phím d
  • Alt-x package-menu-execute
  • yes

Quản lý màn hình - window management

  • Nhân đôi màn hình
    • Ctrl-x 2: bên dưới
    • Ctrl-x 3: bên phải
    • Ctrl-x 1: tắt hết các màn hình
    • Ctrl-x 0: tắt màn hình hiện hành
    • : chuyển đổi các màn hình
    • Ctrl-x o: di chuyển giữa các màn hình (trên xuống dưới, trái qua phải)
  • Alt-x: so sánh màn hình, tìm chỗ kế tiếp nơi mà chuỗi trong màn hình hiện hành không giống vơi chuỗi trong màn hình kế tiếp

Quản lý thư mục - file management

  • ^: thư mục cha
  • Enter: mở tập tin
  • m: đánh dấu 1 tập tin - mark a file
  • %m: đánh dấu dựa vào từ khóa (. là toàn bộ thư mục tập tin)
  • **: đánh dấu tất cả tập tin
  • */: đánh dấu tất cả thư mục
  • u: bỏ đánh dấu một tập tin - unmark
  • U: bỏ đánh dấu tất cả tập tin - unmark all marked
  • i: hiển thị danh sách thư mục
  • A: tìm kiếm tập tin - search Files %m: đánh dấu dựa vào mẫu - mark by pattern
  • q: đóng thư mục - close the dir
  • g: cập nhật danh sách thư mục/tập tin con - refresh list
  • C: copy tập tin - copy file
  • R: đổi tên/di chuyển tập tin - Rename/move file
  • D: xoá tập tin - Delete file => x: xác nhận
  • +: tạo thư mục mới - create a new dir
  • Z: nén/giải nén tập tin bởi zip - compress/decompress the file by gzip
  • !: shell command
  • S: Symlink to …
  • H: Hardlink to …
  • T: thay đổi Timestamp …
  • M: thay đổi Mode …
  • G: thay đổi Group …
  • O: thay đổi Owner …
  • Ctrl-c Ctrl-f: tìm tập tin
  • Ctrl-c Ctrl-v: mở tập tin/thư mục
  • ! 7z a zipfilename * RET: nén tập tin sử dụng 7zip
  • ! 7z e * RET: giải nén tập tin
  • ! 7za x a.zip -o* (sử dụng trên mac os)
  • ! unrar -pSECRET -y -ad x
    • -pSECRET: SECRET là mật khẩu
    • -y: trả lời -y tất cả câu hỏi
    • -ad: tạo thư mục riêng
  • Alt-x grep:
  • Alt-x grep-find:
  • Alt-x find-name-dired:
  • Mở tập tin bằng ứng dụng ngoài: thêm vào tập tin cấu hình
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
;;Open File in External App
(defun xah-open-in-external-app (&optional file)
  "Open the current file or dired marked files in external app. The app is chosen from your OS's preference."
  (interactive)
  (let ( doIt
         (myFileList
          (cond
           ((string-equal major-mode "dired-mode") (dired-get-marked-files))
           ((not file) (list (buffer-file-name)))
           (file (list file)))))
    
    (setq doIt (if (<= (length myFileList) 5)
                   t
                 (y-or-n-p "Open more than 5 files? ") ) )
    
    (when doIt
      (cond
       ((string-equal system-type "windows-nt")
        (mapc (lambda (fPath) (w32-shell-execute "open" (replace-regexp-in-string "/" "\\" fPath t t)) ) myFileList))
       ((string-equal system-type "darwin")
        (mapc (lambda (fPath) (shell-command (format "open \"%s\"" fPath)) )  myFileList) )
       ((string-equal system-type "gnu/linux")
        (mapc (lambda (fPath) (let ((process-connection-type nil)) (start-process "" nil "xdg-open" fPath)) ) myFileList) ) ) ) ) )

;; define key for dired mode
	(require 'dired )
(define-key dired-mode-map (kbd "C-c a") 'xah-open-in-external-app)
  • Mở thư mục trong explorer: thêm vào tập tin cấu hình
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
;;Open File in Desktop
(defun xah-open-in-desktop ()
  "Show current file in desktop (OS's file manager)."
  (interactive)
  (cond
   ((string-equal system-type "windows-nt")
    (w32-shell-execute "explore" (replace-regexp-in-string "/" "\\" default-directory t t)))
   ((string-equal system-type "darwin") (shell-command "open ."))
   ((string-equal system-type "gnu/linux")
    (let ((process-connection-type nil)) (start-process "" nil "xdg-open" "."))
    ;; (shell-command "xdg-open .") ;; 2013-02-10 this sometimes froze emacs till the folder is closed. ⁖ with nautilus
    ) ))

;; define key for dired mode
(define-key dired-mode-map (kbd "C-c d") 'xah-open-in-desktop)

Buffer management

  • Ctrl-x Ctrl-b: hiển thị danh sách buffer
  • Ctrl-x b: chuyển buffer (switch to buffer …)
  • Ctrl-x Left/Right: di chuyển tới buffer trước hoặc sau
  • Ctrl-x k: tắt buffer, ko lưu
  • Ctrl-x s: tắt và lưu
  • iBuffer
    • Cấu hình phím C-x C-b sử dụng ibuffer
      • (global-set-key (kbd “C-x C-b”) ‘ibuffer)
    • h: hướng dẫn sử dụng
    • D: kill các buffers đang được chọn

Frame management

  • Ctrl-x 5 2: tạo frame mới
  • Ctrl-x 5 b bufname : chọn buffer trong frame mới, tương đương: switch-to-buffer-other-frame
  • Ctrl-x 5 f filename : mở tập tin trong frame mới, tương đương: find-file-other-frame
  • Ctrl-x 5 d directory : mở thư mục trong frame mới, tương đương: dired-other-frame
  • Tham khảo

Chỉnh sửa tập tin - Editor

  • Ctrl-x Ctrl-f: mở (tìm) tập tin
  • Ctrl-x Ctrl-s: lưu tập tin hiện hành
  • Ctrl-x Ctrl-w: save-as
  • Ctrl-x s: lưu tất cả tập tin chưa lưu
  • Ctrl-x u: quay lại (undo)
  • Ctrl-w: copy
  • Atl-w: cut
  • Ctrl-y: paste
  • Ctrl-s: tìm chuỗi
  • Ctrl-f/b/n/p: di chuyển trước 1 ký tự/sau 1 ký tự/dòng tiếp theo/dòng phía trước
  • Alt-f/b: di chuyển trước 1 từ/sau 1 từ
  • Ctrl-a/e: di chuyển đầu dòng/cuối dòng
  • Alt-a/e: di chuyển đầu đoạn văn/cuối đoạn văn
  • Ctrl-d: xóa ký tự
  • Alt-d: xóa từ
  • Ctrl-v/Alt-v: page down/page up
  • Alt-</>: di chuyển bắt đầu tập tin/kết thúc tập tin
  • Alt-x replace-string: thay thế chuỗi (replact) - Alt-%

Soạn thảo tập tin với quyền root

  • Copy đoạn mã sau vào tập tin cấu hình
1
2
3
4
5
6
7
8
9
10
11
12
13
14
;; editor as root
(defun sudo-edit (&optional arg)
  "Edit currently visited file as root.

With a prefix ARG prompt for a file to visit.
Will also prompt for a file to visit if current
buffer is not visiting a file."
  (interactive "P")
  (if (or arg (not buffer-file-name))
      (find-file (concat "/sudo:root@localhost:"
                         (ido-read-file-name "Find file(as root): ")))
    (find-alternate-file (concat "/sudo:root@localhost:" buffer-file-name))))

(global-set-key (kbd "C-x C-r") 'sudo-edit)
  • Mở tập tin => gõ lệnh Ctrl-x Ctrl-r

Cài đặt và sử dụng elscreen

  • Alt-x => list-package => elscreen => install
  • Cấu hình: thêm các dòng sau vào tập tin .emacs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
;; ============================================================
  ;; keeping related buffers together with elscreen
  ;; Ref:
  ;;   http://emacs-fu.blogspot.com/2009/07/keeping-related-buffers-together-with.html

  (load "elscreen" "ElScreen" )

  ;; Windowskey+F9 creates a new elscreen, Windowskey+F10 kills it
  (global-set-key (kbd "<s-f9>"    ) 'elscreen-create)
  (global-set-key (kbd "<s-f10>"  ) 'elscreen-kill)


  ;; Windowskey+PgUP/PgDown switches between elscreens
  (global-set-key (kbd "<s-prior>") 'elscreen-previous)
  (global-set-key (kbd "<s-next>")  'elscreen-next)
  (global-set-key (kbd "M-0") '(lambda() (interactive) (hajime-startup)))


  (defvar is-hajime-startup nil
  "Indicate if the hajime-startup process has been activated or not.")

  (defun hajime-startup ()
  "Doing some customization at startup time."
  (interactive)
  (unless is-hajime-startup
    (setq is-hajime-startup t)
    (hajime-elscreen))
  )

  ;; ;; startup settings
  (defun hajime-elscreen ()
  (interactive)
  (elscreen-start)
  (elscreen-create)
  (elscreen-screen-nickname "box")
  (elscreen-create)
  (elscreen-screen-nickname "box")
  (elscreen-create)
  (elscreen-screen-nickname "box")
  (elscreen-create)
  (elscreen-screen-nickname "box")
  (elscreen-create)
  (elscreen-screen-nickname "shell")
  (elscreen-create)
  (elscreen-screen-nickname "dired")
  (elscreen-create)
  (elscreen-screen-nickname "...")
  (elscreen-create)
  (elscreen-screen-nickname "...")
  (elscreen-create)
  (elscreen-screen-nickname "...")

  (elscreen-goto 0)
  (elscreen-kill)

  ;; keybinding for switching workspaces
  (global-set-key "\M-1" '(lambda () (interactive) (elscreen-goto 1)))
  (global-set-key "\M-2" '(lambda () (interactive) (elscreen-goto 2)))
  (global-set-key "\M-3" '(lambda () (interactive) (elscreen-goto 3)))
  (global-set-key "\M-4" '(lambda () (interactive) (elscreen-goto 4)))
  (global-set-key "\M-5" '(lambda () (interactive) (elscreen-goto 5)))
  (global-set-key "\M-6" '(lambda () (interactive) (elscreen-goto 6)))
  (global-set-key "\M-7" '(lambda () (interactive) (elscreen-goto 7)))
  (global-set-key "\M-8" '(lambda () (interactive) (elscreen-goto 8)))
  (global-set-key "\M-9" '(lambda () (interactive) (elscreen-goto 9)))

  ;; keybinding for moving a buffer to a specific workspace
  (global-set-key (kbd "<M-S-f1>") '(lambda () (interactive) (hajime-move-buffer-to-elscreen 1)))
  (global-set-key (kbd "<M-S-f2>") '(lambda () (interactive) (hajime-move-buffer-to-elscreen 2)))
  (global-set-key (kbd "<M-S-f3>") '(lambda () (interactive) (hajime-move-buffer-to-elscreen 3)))
  (global-set-key (kbd "<M-S-f4>") '(lambda () (interactive) (hajime-move-buffer-to-elscreen 4)))
  (global-set-key (kbd "<M-S-f5>") '(lambda () (interactive) (hajime-move-buffer-to-elscreen 5)))
  (global-set-key (kbd "<M-S-f6>") '(lambda () (interactive) (hajime-move-buffer-to-elscreen 6)))
  (global-set-key (kbd "<M-S-f7>") '(lambda () (interactive) (hajime-move-buffer-to-elscreen 7)))
  (global-set-key (kbd "<M-S-f8>") '(lambda () (interactive) (hajime-move-buffer-to-elscreen 8)))
  (global-set-key (kbd "<M-S-f9>") '(lambda () (interactive) (hajime-move-buffer-to-elscreen 9)))
  )

Network

Sử dụng bundle

  • Cài đặt package: rvm
  • Trước khi sử dụng: Alt-x rvm-use-default

Projectile package

TODO TPL - Sử dụng - Loại bỏ 1 project nào đó? - Tham khảo

Helm-swoop package

TODO TPL - Tham khảo

ace-jump-mode package

  • Sử dụng:
    • ace-jump-word-mode: enter first character of a word, select the highlighted key to move to it.
    • ace-jump-char-mode: enter a character for query, select the highlighted key to move to it. (Ctrl-c SPC)
    • ace-jump-line-mode: each non-empty line will be marked, select the highlighted key to move to it.
  • Cấu hình: gán key mặc định cho hành động ace-jump-char-mode

    ’’’ (define-key global-map (kbd “C-c SPC”) ‘ace-jump-char-mode) ‘’’

  • Tham khảo

Bookmark

  • C-x r m : thêm bookmark
  • C-x r b: chuyển bookmark
  • C-x r l: hiển thị danh sách bookmarks

Shell

  • C-c C-u: xóa toàn bộ lệnh
  • C-c C-w: xóa 1 từ phía trước
  • C-c C-c: ngắt lệnh đang thực thi
  • C-c C-z: dừng lệnh đang thực thi
  • M-p hoặc M-n: lệnh trước đó

Multiple cursors

  • Hiện nhiều con trỏ trên màn hình cùng lúc: thay đổi nhiều vị trí
  • Cài đặt: M-x package-install multiple-cursors
  • Cấu hình để emacs khởi động multiple-cursors khi khởi động. Thêm đoạn code sau vào tập tin cấu hình .emacs
1
(require 'multiple-cursors)

hoặc

1
2
3
4
5
6
7
8
9
(require 'multiple-cursors-core "~/.emacs.d/elpa/multiple-cursors-20141003.551/multiple-cursors-core.el")
(require 'mc-hide-unmatched-lines-mode "~/.emacs.d/elpa/multiple-cursors-20141003.551/mc-hide-unmatched-lines-mode.el")
(require 'rectangular-region-mode "~/.emacs.d/elpa/multiple-cursors-20141003.551/rectangular-region-mode.el")
(require 'mc-separate-operations "~/.emacs.d/elpa/multiple-cursors-20141003.551/mc-separate-operations.el")
(require 'mc-mark-pop "~/.emacs.d/elpa/multiple-cursors-20141003.551/mc-mark-pop.el")
(require 'mc-mark-more "~/.emacs.d/elpa/multiple-cursors-20141003.551/mc-mark-more.el")
(require 'mc-cycle-cursors "~/.emacs.d/elpa/multiple-cursors-20141003.551/mc-cycle-cursors.el")
(require 'mc-edit-lines "~/.emacs.d/elpa/multiple-cursors-20141003.551/mc-edit-lines.el")
(require 'multiple-cursors "~/.emacs.d/elpa/multiple-cursors-20141003.551/multiple-cursors.el")
  • Cầu hình phím tắt
1
2
3
4
5
6
7
;; thêm con trỏ tới từng dòng
(global-set-key (kbd "C-c C-l") 'mc/edit-lines)

;; thêm con trỏ dựa trên từ khóa (vùng đang được chọn)
(global-set-key (kbd "C->") 'mc/mark-next-like-this)
(global-set-key (kbd "C-<") 'mc/mark-previous-like-this)
(global-set-key (kbd "C-c C-<") 'mc/mark-all-like-this)
  • Chức năng:
    • mc/mark-next-like-this: tìm phần giống phần đang chọn ở phía sau và thêm con trỏ vào.
    • mc/mark-next-word-like-this: giống mc/mark-next-like-this nhưng cho toàn bộ từ.
    • mc/mark-next-symbol-like-this: giống mc/mark-next-like-this nhưng cho ký hiệu.
    • mc/mark-previous-like-this: tìm phần giống phần đang chọn ở phía trước và thêm con trỏ vào.
    • mc/mark-previous-word-like-this: giống mc/mark-previous-like-this nhưng cho toàn bộ từ.
    • mc/mark-previous-symbol-like-this: …
    • mc/mark-more-like-this-extended: …
    • mc/add-cursor-on-click: …
    • mc/mark-pop: …
  • Tham khảo: https://github.com/emacsmirror/multiple-cursors

Magit

  • Danh sách thao tác
    • M-x magit-status hoặc M-x gst => chuyển qua mode git để thực hiện các thao tác
    • g => đọc lại danh sách thay đổi
    • M-1, 2, 3, 4 (hoặc 1, 2, 3, 4) => xem chi tiết các thay đổi
    • i (hoặc C-u i) thêm vào .gitignore
    • s hoặc S => chuyển trạng thái một/tất cả tập tin tới stage
    • u hoặc U => chuyển trạng thái một/tất cả tập tin tới unstage
    • k => hủy các thay đổi
    • c => chuẩn bị commit: hiển thị thông tin và viết ghi chú/lịch sử/log
    • C-c C-c => thực thi lệnh commit
    • C-c C-a => thêm vào lệnh commit cũ
    • l (hoặc L hoặc C-u l) => lịch sử
    • a hoặc A => stage hoặc commit trên nhánh hiện hành (current branch)
    • d hoặc D => hiển thị sự thay đổi giữa thư mục làm việc và HEAD
    • b hoặc B => chuyển hoặc tạo mới và chuyển tới nhánh mới
    • m hoặc M => merge nhánh vào nhánh hiện hành
    • P => push
    • F => pull
  • Tài liệu tham khảo:
    • http://magit.github.io/master/magit.html
    • http://daemianmack.com/magit-cheatsheet.html

Recent files

  • Mặc định trong emacs 21 hoặc download tại trang: http://www.emacswiki.org/RecentFiles
  • Để kích hoạt thêm đoạn cấu hình sau vào tập tin ~/.emacs
1
2
3
4
(require 'recentf)
(recentf-mode 1)
(setq recentf-max-menu-items 25)
(global-set-key "\C-x\ \C-r" 'recentf-open-files)
  • Sử dụng: nhấn tổ hợp phím C-x và C-r để hiển thị danh sách

Highlight-symbol

  • Cài đặt trong list-packages
  • Cấu hình
1
2
3
4
5
;; Highlight-symbol
(require 'highlight-symbol)
(global-set-key (kbd "C-x C-a") 'highlight-symbol-at-point)
(global-set-key (kbd "C-x M-a") 'highlight-symbol-query-replace)
(global-set-key (kbd "C-x a") 'highlight-symbol-remove-all)

Remote server

  • http://blog.habnab.it/blog/2013/06/25/emacsclient-and-tramp/
  • https://andy.wordpress.com/2013/01/03/automatic-emacsclient/