Cider有像Cursive(IntelliJ IDEA)这样的实时模板吗?

时间:2017-02-06 16:04:33

标签: emacs clojure lisp clojurescript cider

对于Clojure开发我是emacs / cider的新手。我无法像在IntelliJ IDEA(Cursive插件)中那样在Cider中创建live templates

2 个答案:

答案 0 :(得分:1)

yasnippet是emacs中用于提供&#34;模板化&#34;的模式的一般方法。并不是很多我认识的人整天都在使用它,而我知道他们中的大多数人通过var FileTransfer = require('react-native-file-transfer-android'); const UPLOAD_URI = "http://< IP / Domain>/index.php" makeUuid() { var text = ""; var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; for( var i=0; i < 5; i++ ) text += possible.charAt(Math.floor(Math.random() * possible.length)); return text; } sendImageToServer(data){ var uuid = this.makeUuid(); FileTransfer.upload({ uri: data, uploadUrl: UPLOAD_URI, fileName: 'temp.jpg', mimeType: 'image/jpg', headers: { 'Accept': 'application/json' }, data: { name:uuid } }, (err, res) => { if(err) { console.error(err); } else { console.log(res); } }); } saveImage(imgDate){ let states = {camera:false}; states[this.state.ActiveImage] = imgDate.path; this.sendImageToServer(imgDate.path); this.setState({ ...states }); } emacs包使用它

https://github.com/clojure-emacs/clj-refactor.el

答案 1 :(得分:0)

如果您要使用代码段,请使用https://github.com/mpenet/clojure-snippets

David Nolen不再维护这个包:https://github.com/swannodette/clojure-snippets#warning

另外,请注意yasnippet中用于clojure的片段已过时。有人试图更新它们,请参见此处:https://github.com/AndreaCrotti/yasnippet-snippets/issues/162

为了安全起见,请使用https://github.com/mpenet/clojure-snippets