子龙山人Learn Emacs in 21 Days: day 7 学习笔记

子龙山人Learn Emacs in 21 Days: day 7 学习笔记
Youtube
youku

1. others

使C-w可以删除一个单词

(global-set-key (kbd "C-w") 'backward-kill-word)

2. evil

setting

安装 evil 这个package

(evil-mode 1)
(setcdr evil-insert-state-map nil)
(define-key evil-insert-state-map [escape] 'evil-normal-state)
M-x customize-group
可以使用C-u向上翻页
scroll相关选项
C-z
emacs state和evil state之前切换

evil manul

evil leader

(global-evil-leader-mode)
(evil-leader/set-key
  "e" 'find-file
  "b" 'switch-to-buffer
  "k" 'kill-buffer
  "0" 'select-window-0
  "1" 'select-window-1
  "2" 'select-window-2
  "3" 'select-window-3
  "w/" 'split-window-right
  "w-" 'split-window-below
  )
M-x customize-group
中可以选择leader key为SPC

windownumbering

可以方便切换窗口

(window-numbering-mode 1)

evil surround

(require 'evil-surround)
(global-evil-surround-mode 1)
v-i-w
选中

S
可以把选中的单字两边加上""或者''

cs
可以选择上述的""''或者()

evil-nerd-commenter

快速注释

(global-set-key (kbd "M-;") 'evilnc-comment-or-uncomment-lines)
(evilnc-default-hotkeys)
gv
重新选中

powerline-evil

(require 'powerline-evil)

ocur mode

ocur mode下使用evil按键


  (add-hook 'occur-mode-hook
            (lambda ()
              (evil-add-hjkl-bindings occur-mode-map 'emacs
                (kbd "/")       'evil-search-forward
                (kbd "n")       'evil-search-next
                (kbd "N")       'evil-search-previous
                (kbd "C-d")     'evil-scroll-down
                (kbd "C-u")     'evil-scroll-up
                )))


which key

给leader加上注释

(which-key-mode 1)

让某些模式使用evil

(dolist (mode '(ag-mode
        flycheck-error-list-mode
        occur-mode
        git-rebase-mode))
  (add-to-list 'evil-emacs-state-modes mode))

key bindings

3. org

搜索org

C-c s
搜索

你可能感兴趣的:(emacs)