Được TopGit lập chỉ mục từ metadata GitHub: tonsky/Clojure-Sublimed có 398 sao, viết chủ yếu bằng Clojure. Clojure support for Sublime Text 4
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
Indent will fix indentation, but will not create new lines. To format a completely unformatted source, use Pretty-print selection command:
Toggle comment command
There are three types of comment in Clojure:
Line comments ;; are intended for textual / unstructured comments about code
Reader discard form #_ is intended for temporarily disabling parts of code
comment form for coding snippets for future use
By default, Sublime will try to use ;; because it’s most similar to other languages and is simple to implement. One can argue, however, that we disable/enable parts of the code way more often than write textual comments about them. Therefore, #_ might work better.
Clojure Sublimed offer Toggle Comment command that can be used instead of Sublime provided one in Clojure sources. See Keymap on how to enable.
Align cursors command
If you select multiple cursors on different lines and run Align cursors command, Clojure Sublimed will align them in a column. Works with multiple columns, too:
REPL clients
Clojure Sublimed REPL clients enable interactive development from the comfort of your editor.
Run Clojure Sublimed: Connect to Socket REPL command.
For Shadow-cljs apps:
Run shadow-cljs watch app. (This starts a HTTP server and an nREPL)
If you are building a web-app, open the http-server url (from step 1) in the browser. This connects the shadow server to JS runtime.
Run Clojure Sublimed: Connect shadow-cljs command.
For other nREPL apps:
Run nREPL server.
Run Clojure Sublimed: Connect to raw nREPL command.
Evaluating code from buffer
From here you have three options:
Clojure Sublimed: Evaluate without selection evaluates topmost form around your cursor:
Clojure Sublimed: Evaluate with selection evaluates selected text:
Clojure Sublimed: Evaluate Buffer will evaluate the entire file:
You don’t have to wait for one form to finish evaluating to evaluate something else. Multiple things can be executed in parallel:
By default, Clojure Sublimed will also print evaluation time if it takes more than 100 ms:
Copying evaluation results
Sometimes you want to copy evaluation result. It is recommended to rebind Cmd+C/Ctrl+C from copy to sublime_clojure_copy. This will copy evaluation result if inside evaluated region and fallback to default copy otherwise.
Interrupting
If your evaluation runs too long and you want to interrupt it, run Clojure Sublimed: Interrupt Pending Evaluations:
Opening stacktrace
If your evaluation failed, put your cursor inside failed region and run Clojure Sublimed: Toggle Stacktrace:
Clojure Sublimed will display stacktraces in a Clojure-friendly way. Compare with the default REPL:
Watches
Watches are great alternative to debug prints: they allow you to monitor intermediate values during function execution right in the editor.
This is how they work:
Select a right-hand expression
Run Clojure Sublimed: Add Watch command
Now every time function is executed, for any reason, watched expressions will display values they evaluate to, in real time.
Watches are only supported in Socket REPL.
Looking up symbol
To show symbol info, run Clojure Sublimed: Toggle Symbol Info:
Universal Clojure Sublimed: Toggle Info command acts as either Toggle Stacktrace or Toggle Symbol Info, depending on context.
Binding keys to eval custom code
Every project is different, and sometimes it’s convenient to run a piece of code so often you’d want it on a shortcut. It might be a namespace reload, test execution, database reconnect, linter, formatter — possibilities are endless.
To support such use cases, Clojure Sublimed allows you to bind arbitrary piece of code to a keyboard shortcut. Run Preferences: Clojure Sublimed Key Bindings and add something like this:
Inside transform you can also use %ns (current ns) and %symbol (if selected form is def-something, it will be replaced with defined name, otherwise nil).
This allows us to implement “run test under cursor”:
Clojure Sublimed comes with no keybindings enabled by default to guarantee they won’t conflict with any other extension (Sublime Text’s limitation).
This is the recommended keymap:
Command
macOS
Windows/Linux
Mnemonic
Evaluate
CtrlEnter
CtrlAltEnter
Evaluate Buffer
CtrlB
CtrlAltB
[B]uffer
Interrupt Pending Evaluations
CtrlC
CtrlAltC
[C]ancel
Toggle Info
CtrlI
CtrlAltI
[I]nfo
Clear Evaluation Results
CtrlL
CtrlAltL
c[L]ear
Copy Evaluation Results
CommandC
CtrlC
[C]opy
Reindent Lines
CtrlF
CtrlAltF
[F]ormat
Reindent Buffer
CtrlShiftF
CtrlAltShiftF
Capital [F]ormat
Toggle Comment
Command/
Ctrl/
Comment [/]
To set it up, run Preferences: Clojure Sublimed Key Bindings command and copy example keybindings to your local Key Bindings file.
stdout/stderr
Clojure Sublimed does things a little different when it comes to stdout. Normally REPL would show you all stdout/stderr that originated from your session. I find it confusing, because it doesn’t always work and you have to check two places for output. Moreover, there’s no output panel, so there’s no place to show stdout anyway.
So instead, Clojure Sublimed does not redirect neither stdout nor stderr. Check original console to see what was printed there.
Frequently Asked Questions
Q: REPL/eval doesn’t work
A: Make sure you are using nREPL 0.9 or later.
A: Also check console (Cmd`) for errors
Q: How to connect to a Babashka REPL?
A: Use Raw nREPL.
Credits
Made by Niki Tonsky.
With contributions by Jaihindh Reddy and KgOfHedgehogs.
See also
Writer Color Scheme: A color scheme optimized for long-form writing.
Alabaster Color Scheme: Minimal color scheme for coding.
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/tonsky/Clojure-Sublimed là nguồn chính thức.
tonsky/Clojure-Sublimed có bao nhiêu sao?
tonsky/Clojure-Sublimed có 398 sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/tonsky/Clojure-Sublimed. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
tonsky/Clojure-Sublimed có những chủ đề gì?
GitHub topics của tonsky/Clojure-Sublimed: "clojure", "nrepl", "repl", "sublime-text", "syntax-highlighting". TopGit xếp repo vào nhóm mã nguồn mở.
tonsky/Clojure-Sublimed có phải mã nguồn mở không?
Có — tonsky/Clojure-Sublimed phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/tonsky/Clojure-Sublimed.
tonsky/Clojure-Sublimed có website riêng không?
TopGit chưa ghi nhận URL trang chủ cho tonsky/Clojure-Sublimed. Phần README ở tab phía trên thường có link demo, hoặc xem mô tả GitHub của repo.
tonsky/Clojure-Sublimed còn đang phát triển không?
Commit gần nhất trên tonsky/Clojure-Sublimed là 1 tháng trước (theo timestamp GitHub). Repo có 26 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
Đọc đầy đủ README ở tab phía trên.
Vẫn đang phân vân về Clojure-Sublimed?
Một cú bấm sẽ gửi câu hỏi kèm trang này cho AI — xem AI nói gì về Clojure-Sublimed.