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

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

1. org-mode

建立模板

init-org.el中加入

(setq org-capture-templates
      '(("t" "Todo" entry (file+headline "~/.emacs.d/gtd.org" "工作安排")
     "* TODO [#B] %?\n  %i\n"
     :empty-lines 1)))

可以新建模板

M-x org-capture
后按t可以建立org模板

模板会保存在~/.emacs.d/gtd.org

设置快捷键打开模板

(global-set-key (kbd "C-c r") 'org-capture)

org-pomodora

安装

(require 'org-pomodoro)

custumize-group中可以设置long break和short break,具体也不知道有什么用- -

C-a a
打开org后
M-x org-pomodoro
可以启用番茄工作时间

获取chrome当前链接


(defun sandwich/insert-chrome-current-tab-url()
  "Get the URL of the active tab of the first window"
  (interactive)
  (insert (sandwich/retrieve-chrome-current-tab-url)))

(defun sandwich/retrieve-chrome-current-tab-url()
  "Get the URL of the active tab of the first window"
  (interactive)
  (let ((result (do-applescript (concat "set frontmostApplication to path to frontmost application\n" "tell application \"Google Chrome\"\n" " set theUrl to get URL of active tab of first window\n" " set theResult to (get theUrl) \n" "end tell\n" "activate application (frontmostApplication as text)\n" "set links to {}\n" "copy theResult to the end of links\n" "return links as string\n"))))
    (format "%s" (s-chop-suffix "\"" (s-chop-prefix "\"" result)))))

(setq org-capture-templates
      '(("t" "Todo" entry (file+headline "~/.emacs.d/gtd.org" "工作安排")
     "* TODO [#B] %?\n  %i\n"
     :empty-lines 1)
    ("c" "Chrome" entry (file+headline "~/.emacs.d/gtd.org" "Quick notes")
               "* TODO [#C] %?\n %(sandwich/retrieve-chrome-current-tab-url)\n %i\n %U"
               :empty-lines 1)
    ))
C-c r c
可以创建chrome相关的模板 

2. others

company中可以通过C-n C-p选择补全选项

stackexchange

(with-eval-after-load 'company
  (define-key company-active-map (kbd "M-n") nil)
  (define-key company-active-map (kbd "M-p") nil)
  (define-key company-active-map (kbd "C-n") #'company-select-next)
  (define-key company-active-map (kbd "C-p") #'company-select-previous))

dir rename

C-x C-q

3. ag

ag > pt > ack > grep

install

brew install the_silver_searcher

install package helm-ag

(global-set-key (kbd "C-c p s") 'helm-do-ag-project-root)

编辑ag的搜索结果

“`
C-c C-e
打开搜索buffer

C-c C-c
保存结果

C-c C-k
取消
“`

4. flycheck & snippet

python中使用flycheck

install pip

wget https://bootstrap.pypa.io/get-pip.py
sudo python get-pip.py

pip install

pip install pylint

other

M-x flycheck-verify-setup

yasnippet & anto-yasnippet

(require 'yasnippet)
(yas-reload-all)
(add-hook 'prog-mode-hook #'yas-minor-mode)
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值