今天发现Emacs下面的代码跳转非常的方便快捷。
按照上面的链接走一遍就好了,你会发现最下面有这样一段话:
If instead you want to jump to the source of the function you can use M-.
, which is awesome. This works on your own functions as well as those which come from third-party libraries. Use M-,
to pop the stack and return to where you were. For all the definitions in a single file you can use M-x imenu
to list them and jump to one.
上面这个链接重点讲解的是用Emacs写Clojure的开发流程。如果对Emacs的用法很陌生,可以看一下这两个链接:
链接里面没有讲到的两个有用的快捷键:
全选:C-x h
缩进:C-M \
这3个链接认真看看来,应该已经够日常的开发需要了。
(defvar my-packages '(color-theme-solarized
clojure-mode
cider))
(dolist (p my-packages)
(unless (package-installed-p p)
(package-install p)))
(menu-bar-mode -1)
(tool-bar-mode -1)
(scroll-bar-mode -1)
(set-frame-parameter nil 'fullscreen 'fullboth)
(global-linum-mode t)
(setq prelude-flyspell nil)
(disable-theme 'zenburn)
(load-theme 'solarized-light)
(set-face-attribute 'default nil :family "Source Code Pro" :height 140)
;; font size (height / 10)
(add-hook 'clojure-mode-hook 'subword-mode)
(add-hook 'clojure-mode-hook 'paredit-mode)
(add-hook 'clojure-mode-hook 'rainbow-delimiters-mode)
(require 'clojure-mode)
(define-clojure-indent
(defroutes 'defun)
(defroutes* 'defun)
(GET 2)
(GET* 2)
(POST 2)
(POST* 2)
(PUT 2)
(PUT* 2)
(DELETE 2)
(DELETE* 2)
(HEAD 2)
(HEAD* 2)
(ANY 2)
(ANY* 2)
(context 2))