SpaceEmacs Rock Day6 学习笔记

SpaceEmacs Rock Day6 学习笔记

SpaceEmacs Rock Day6 学习笔记

1 SpaceEmacs Day 6

1.1 Bonus Time

  1. Use org-capture to take notes
  (setq org-capture-templates
        '(("t" "todo" entry (file+headline "~/.emacs.d/gtd.org" "工作安排")
           "* TODO [#B] %?\n %i\n"
           :empty-lines 1)))
(global-set-key (kbd "C-c r") 'org-capture)

1.2 Batch rename files

  1. press "C-x C-q in dired mode"
  2. use expand-region and iedit to batch change files

1.3 Search and replace

1.3.1 install helm-ag

  1. at first, you should install ag
    • search speed: ag > pt > ack > grep
sudo pacman -S install the_silber_searcher
  1. binding keys and replace all results
;; helm-ag search
(global-set-key (kbd "C-c p s") 'helm-do-ag-project-root)
  1. "C-c C-e" is helm-ag-edit and you can repalce the result by using iedit

1.4 Show javascript errors with flycheck

  1. flycheck-checkers
  2. eslint
  3. install eslint
sudo npm install -g eslint
  1. use eslint in js2-mode
(add-hook 'js2-mode-hook 'flycheck-mode)

(provide 'init-flycheck)

1.5 Code completion

  1. yasnippet in prog-mode
(yas-reload-all)
(add-hook 'js2-mode #'yas-minor-mode)
  1. auto-yasnippet, use ~ to define a template
(global-set-key (kbd "M-<f2>") #'aya-create)
(global-set-key (kbd "M-<f3>") #'aya-expand)
  1. self define snippet of cnblogs
#+TITLE: $1
#+CATEGORIES: ${2:Emacs}
#+DESCRIPTION: ${3:}
#+KEYWORDS: $4
#+DATE: `(format-time-string "%Y-%m-%d %H:%M")`

Date: 2018-10-23 16:36

Author: devinkin

Created: 2018-10-23 二 16:49

Validate

posted @ 2018-10-23 16:37  EmacsDevinkin  阅读(290)  评论(0编辑  收藏  举报