调查下有多少哥们在使用light table?

217 views
Skip to first unread message

Randy Chiu

unread,
Jun 2, 2014, 7:49:28 AM6/2/14
to cn-cl...@googlegroups.com
Hi all,
请问各位clojure 极客们,有多少在使用light table进行clojure coding呢?
我现在在尝试使用这个新工具,我想知道,在一个比较庞大项目里面,如何查看(并跳转到)定义在别的文件中的函数呢?
没有这个功能的话,阅读源代码很费劲啊。
比如说,我有一个项目使用ring,那我要怎么能看到ring中的函数定义?

Seth Yuan

unread,
Jun 24, 2014, 3:43:01 AM6/24/14
to cn-cl...@googlegroups.com
Light table貌似没这个功能。

我的开发环境是VIM + clojure_static + fireplace + rainbow_parentheses,很好用。fireplace可以查看函数定义和帮助。

Tao Zhou

unread,
Sep 14, 2014, 4:45:43 AM9/14/14
to cn-cl...@googlegroups.com
https://cursiveclojure.com/
跳转代码还是用这个好。

在 2014年6月2日星期一UTC+8下午7时49分28秒,Randy Chiu写道:

Isaac Zeng

unread,
Sep 14, 2014, 8:57:28 AM9/14/14
to cn-cl...@googlegroups.com
如果你用 Emacs 的话, 推荐使用 Emacs + Cider + Paredit。
或者使用 LaClojure, Idea 的一个插件。


On Monday, June 2, 2014 7:49:28 PM UTC+8, Randy Chiu wrote:

ivan...@foxmail.com

unread,
Sep 19, 2014, 9:46:39 AM9/19/14
to cn-cl...@googlegroups.com
light table 通过ctrl-. 来跳转.不过跳转到的函数需要先eval

对于第三方的库,可以通过它的doc搜索来查询文档
--
中文社区博客:http://blog.clojure.cn/
中文问答网站:http://ask.clojure.cn/
中文邮件列表:https://groups.google.com/d/forum/cn-clojure?hl=zh-CN
---
您收到此邮件是因为您订阅了Google网上论坛中的“CN-Clojure”论坛。
要退订此论坛并停止接收此论坛的电子邮件,请发送电子邮件到cn-clojure+...@googlegroups.com
要发帖到此论坛,请发送电子邮件至cn-cl...@googlegroups.com
通过http://groups.google.com/group/cn-clojure访 问此论坛。
要查看更多选项,请访问https://groups.google.com/d/optout

Robert Luo

unread,
Sep 29, 2014, 10:20:15 AM9/29/14
to cn-cl...@googlegroups.com
多次试用 LightTable。尽管思路很先进,但实现目前还没有达到日常使用的地步。

我推荐 Idea + Cursive 。据我所知,这应该也是 Rich Hickey 使用的环境。


On Monday, June 2, 2014 7:49:28 PM UTC+8, Randy Chiu wrote:

MOY

unread,
Sep 30, 2014, 12:35:40 AM9/30/14
to cn-cl...@googlegroups.com
la clojure + vim


On Monday, June 2, 2014 7:49:28 PM UTC+8, Randy Chiu wrote:

Frank_Xu

unread,
Sep 30, 2014, 3:20:52 AM9/30/14
to cn-cl...@googlegroups.com
我今天也装了 Cursive。请教下,现在配置里能否做到:只在光标移动到函数里面时,才使得当前函数用彩虹括号方式高亮?目前只要一开启彩虹括号,整个文件都高亮了……过于色彩斑斓

--

Robert Luo

unread,
Oct 1, 2014, 4:29:21 AM10/1/14
to cn-cl...@googlegroups.com
用 Darcula (深灰色)的配色方案会不刺眼些。


On Tuesday, September 30, 2014 3:20:52 PM UTC+8, Frank Xu wrote:
我今天也装了 Cursive。请教下,现在配置里能否做到:只在光标移动到函数里面时,才使得当前函数用彩虹括号方式高亮?目前只要一开启彩虹括号,整个文件都高亮了……过于色彩斑斓
在 2014年9月29日 下午10:20,Robert Luo <l...@basecity.com>写道:
多次试用 LightTable。尽管思路很先进,但实现目前还没有达到日常使用的地步。

我推荐 Idea + Cursive 。据我所知,这应该也是 Rich Hickey 使用的环境。

On Monday, June 2, 2014 7:49:28 PM UTC+8, Randy Chiu wrote:
Hi all,
请问各位clojure 极客们,有多少在使用light table进行clojure coding呢?
我现在在尝试使用这个新工具,我想知道,在一个比较庞大项目里面,如何查看(并跳转到)定义在别的文件中的函数呢?
没有这个功能的话,阅读源代码很费劲啊。
比如说,我有一个项目使用ring,那我要怎么能看到ring中的函数定义?

--
中文社区博客:http://blog.clojure.cn/
中文问答网站:http://ask.clojure.cn/
中文邮件列表:https://groups.google.com/d/forum/cn-clojure?hl=zh-CN
---
您收到此邮件是因为您订阅了Google网上论坛中的“CN-Clojure”论坛。
要退订此论坛并停止接收此论坛的电子邮件,请发送电子邮件到cn-clojure+unsubscribe@googlegroups.com

tao.zhou2009

unread,
Oct 22, 2014, 11:09:20 PM10/22/14
to cn-cl...@googlegroups.com
今天发现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个链接认真看看来,应该已经够日常的开发需要了。


另外分享一下我自己基于Prelude(http://batsov.com/prelude/)的配置,放到~/.emacs.d/init.el的最后面。

(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))


关于Source Code Pro字体,可以看这里:https://github.com/adobe/source-code-pro
运行./build.sh后,字体文件会在target文件夹下面。

-- 
tao.zhou2009
Sent with Sparrow

tao.zhou2009

unread,
Oct 23, 2014, 1:35:37 AM10/23/14
to cn-cl...@googlegroups.com
关于Emacs的函数跳转补充两点:
1. Emacs里面必须用cider(https://github.com/clojure-emacs/cider)打开一个REPL,然后用C-c C-k把当前buffer的代码编译过后,才能够用M-.和M-,来跳转。
2. cider需要和cider-nrepl(https://github.com/clojure-emacs/cider-nrepl)一起用,而且它们的版本必须是一样的,参见cider-nrepl的ReadMe里面的一段话:
Note that you should use a cider-nrepl version compatible with your CIDER. Generally, if you're using CIDER 0.x.y you should be using cider-nrepl 0.x.y, if you're using CIDER 0.x.y-SNAPSHOT, you should be using cider-nrepl 0.x.y-SNAPSHOT, etc.

版本不一样的话,通过cider-jack-in启动REPL的时候,就会提示:Please, install (or update) cider-nrepl 0.8.0-snapshot and restart CIDE。可以看这个issue:https://github.com/clojure-emacs/cider/issues/722

可以把cider-nrepl放到~/.emacs.d/profiles.clj里面去。比如通过Emacs的package-install安装的cider版本是:0.8.0-SNAPSHOT,那么cider-nrepl的版本也是0.8.0-SNAPSHOT。
{:user {:plugins [[cider/cider-nrepl "0.8.0-SNAPSHOT"]]}}

PS:本人算是刚开始用Emacs,刚才发现一个开源项目跳转的时候提示需要tag,我通过cider提供的快捷键编译过后就可以了。

-- 
tao.zhou2009
Sent with Sparrow

Reply all
Reply to author
Forward
0 new messages