|
137 | 137 | (message (cider-random-words-of-inspiration))) |
138 | 138 |
|
139 | 139 | (defvar cider-tips |
140 | | - '("Press <\\[cider-connect]> to connect to a running nREPL server." |
| 140 | + '(;; Connection / session |
| 141 | + "Press <\\[cider-connect]> to connect to a running nREPL server." |
141 | 142 | "Press <\\[cider-quit]> to quit the current connection." |
| 143 | + "Press <\\[cider-restart]> to restart the active nREPL connection." |
| 144 | + "Use <M-x cider-jack-in-universal RET> (or M-1..5 prefix) to start any supported project type from a single command." |
| 145 | + "Use <M-x cider-connect-sibling-clj RET> to spawn another Clojure REPL on the same nREPL server (handy for parallel evaluations)." |
| 146 | + "Press <\\[cider-describe-connection]> to view information about the connection." |
| 147 | + "Use <M-x cider-set-default-session RET> to pin a default session and bypass sesman's project-based dispatch." |
| 148 | + ;; Help / docs / discoverability |
142 | 149 | "Press <\\[cider-view-manual]> to view CIDER's manual." |
143 | 150 | "Press <\\[cider-view-refcard]> to view CIDER's refcard." |
144 | 151 | "Press <\\[describe-mode]> to see a list of the keybindings available (this will work in every Emacs buffer)." |
145 | 152 | "Press <\\[cider-repl-handle-shortcut]> to quickly invoke some REPL command." |
146 | 153 | "Press <\\[cider-switch-to-last-clojure-buffer]> to switch between the REPL and a Clojure source buffer." |
147 | 154 | "Press <\\[cider-doc]> to view the documentation for something (e.g. a var, a Java method)." |
| 155 | + "Press <\\[cider-clojuredocs]> to look up a symbol in ClojureDocs (community-curated Clojure examples and notes)." |
| 156 | + "Use <M-x cider-cheatsheet RET> to browse the Clojure cheatsheet from inside Emacs." |
| 157 | + "Exploring CIDER's menu-bar entries is a great way to discover features." |
| 158 | + "Keep in mind that some commands don't have a keybinding by default. Explore CIDER!" |
| 159 | + ;; Find / navigation |
148 | 160 | "Press <\\[cider-find-resource]> to find a resource on the classpath." |
149 | 161 | "Press <\\[cider-find-var]> to jump to the source of something (e.g. a var, a Java method)." |
| 162 | + "Press <\\[cider-find-dwim]> to jump to the definition or resource at point - does the right thing for vars, keywords, and resources." |
| 163 | + "Press <\\[cider-find-keyword]> to jump to the namespace where a Clojure keyword originates." |
150 | 164 | "Press <\\[cider-selector]> to quickly select a CIDER buffer." |
| 165 | + ;; Tests |
151 | 166 | "Press <\\[cider-test-run-ns-tests]> to run the tests for the current namespace." |
152 | 167 | "Press <\\[cider-test-run-loaded-tests]> to run all loaded tests." |
153 | 168 | "Press <\\[cider-test-run-project-tests]> to run all tests for the current project." |
| 169 | + ;; Apropos |
154 | 170 | "Press <\\[cider-apropos]> to look for a symbol by some search string." |
155 | 171 | "Press <\\[cider-apropos-documentation]> to look for a symbol that has some string in its docstring." |
| 172 | + ;; Eval |
156 | 173 | "Press <\\[cider-eval-defun-at-point]> to eval the top-level form at point." |
157 | | - "Press <\\[cider-eval-dwim]> to eval to run cider-eval-region if a region is active, and cider-eval-defun-at-point otherwise." |
| 174 | + "Press <\\[cider-eval-dwim]> to run cider-eval-region if a region is active, and cider-eval-defun-at-point otherwise." |
| 175 | + "Press <\\[cider-eval-region]> to evaluate the selected region." |
158 | 176 | "Press <\\[cider-eval-defun-up-to-point]> to eval the top-level form up to the point." |
159 | 177 | "Press <\\[cider-eval-sexp-up-to-point]> to eval the current form up to the point." |
160 | 178 | "Press <\\[cider-eval-sexp-at-point]> to eval the current form around the point." |
161 | 179 | "Press <\\[cider-eval-sexp-at-point-in-context]> to eval the current form around the point in a user-provided context." |
162 | 180 | "Press <\\[cider-eval-buffer]> to eval the entire source buffer." |
| 181 | + "Press <\\[cider-pprint-eval-last-sexp]> to evaluate the preceding form and pretty-print the result." |
| 182 | + "Press <\\[cider-pprint-eval-defun-at-point]> to evaluate the top-level form at point and pretty-print the result." |
| 183 | + "Press <\\[cider-load-file]> to load an arbitrary Clojure file into the REPL." |
163 | 184 | "Press <\\[cider-scratch]> to create a Clojure scratchpad. Pretty handy for prototyping." |
164 | 185 | "Press <\\[cider-read-and-eval]> to evaluate some Clojure expression directly in the minibuffer." |
165 | | - "Press <\\[cider-drink-a-sip]> to get more CIDER tips." |
166 | | - "Press <\\[cider-browse-ns-all]> to start CIDER's namespace browser." |
167 | | - "Press <\\[cider-classpath]> to start CIDER's classpath browser." |
168 | | - "Press <\\[cider-repl-history]> to start CIDER's REPL input history browser." |
169 | | - "Press <\\[cider-macroexpand-1]> to expand the preceding macro." |
| 186 | + "Press <\\[cider-interrupt]> to interrupt an ongoing evaluation." |
| 187 | + "Press <\\[cider-undef]> to undefine a symbol in the current namespace." |
| 188 | + "Press <\\[cider-load-buffer-and-switch-to-repl-buffer]> to load the current buffer and switch to the REPL buffer afterwards." |
| 189 | + ;; Macroexpansion |
| 190 | + "Press <\\[cider-macroexpand-1]> to expand the preceding macro one level." |
| 191 | + "Press <\\[cider-macroexpand-all]> to fully expand the preceding macro (recursively, not just one level)." |
| 192 | + ;; Inspect / debug |
170 | 193 | "Press <\\[cider-inspect]> to inspect the preceding expression's result." |
171 | 194 | "Press <C-u \\[cider-inspect]> to inspect the defun at point's result." |
172 | 195 | "Press <C-u C-u \\[cider-inspect]> to read Clojure code from the minibuffer and inspect its result." |
| 196 | + "Press <\\[cider-inspect-last-result]> to inspect the last evaluation result." |
| 197 | + "Press <\\[cider-inspect-defun-at-point]> to inspect the result of the top-level form at point." |
| 198 | + "Press <\\[cider-debug-defun-at-point]> to instrument the top-level form and step through it interactively in the debugger." |
| 199 | + ;; Xref |
| 200 | + "Press <\\[cider-xref-fn-refs]> to find all references to a function." |
| 201 | + "Press <\\[cider-xref-fn-deps]> to list the functions a given function depends on." |
| 202 | + ;; Browse |
| 203 | + "Press <\\[cider-browse-ns-all]> to start CIDER's namespace browser." |
| 204 | + "Use <M-x cider-browse-spec-all RET> to browse all registered Clojure specs." |
| 205 | + "Press <\\[cider-classpath]> to start CIDER's classpath browser." |
| 206 | + "Press <\\[cider-repl-history]> to start CIDER's REPL input history browser." |
| 207 | + ;; Format |
| 208 | + "Press <\\[cider-format-buffer]> to format the entire buffer using cljfmt." |
| 209 | + "Press <\\[cider-format-defun]> to format the top-level form at point using cljfmt." |
| 210 | + "Use <M-x cider-format-edn-buffer RET> to pretty-print the current EDN buffer." |
| 211 | + ;; Namespace ops |
173 | 212 | "Press <\\[cider-ns-refresh]> to reload modified and unloaded namespaces." |
174 | | - "You can define Clojure functions to be called before and after `cider-ns-refresh' (see `cider-ns-refresh-before-fn' and `cider-ns-refresh-after-fn'." |
175 | | - "Press <\\[cider-describe-connection]> to view information about the connection." |
176 | | - "Press <\\[cider-undef]> to undefine a symbol in the current namespace." |
177 | | - "Press <\\[cider-interrupt]> to interrupt an ongoing evaluation." |
| 213 | + "You can define Clojure functions to be called before and after `cider-ns-refresh' (see `cider-ns-refresh-before-fn' and `cider-ns-refresh-after-fn')." |
| 214 | + "For no-middleware, low-tech, reliable namespace reloading use <\\[cider-ns-reload]>." |
| 215 | + ;; Profile / trace / log |
| 216 | + "Use <M-x cider-profile-toggle RET> to toggle profiling for a var; <M-x cider-profile-summary RET> to view results." |
| 217 | + "Use <M-x cider-toggle-trace-var RET> to trace calls to a Clojure var (or `cider-toggle-trace-ns' for an entire namespace)." |
| 218 | + "Use <M-x cider-log-show RET> to open CIDER's log inspector for navigating logged events." |
| 219 | + ;; Configuration / modes |
178 | 220 | "Use <M-x customize-group RET cider RET> to see every possible setting you can customize." |
179 | 221 | "Use <M-x customize-group RET cider-repl RET> to see every possible REPL setting you can customize." |
180 | 222 | "Enable `eldoc-mode' to display function & method signatures in the minibuffer." |
181 | 223 | "Enable `cider-enlighten-mode' to display the locals of a function when it's executed." |
182 | | - "Use <\\[cider-close-ancillary-buffers]> to close all ancillary buffers created by CIDER (e.g. *cider-doc*)." |
183 | | - "Exploring CIDER's menu-bar entries is a great way to discover features." |
184 | | - "Keep in mind that some commands don't have a keybinding by default. Explore CIDER!" |
185 | 224 | "Tweak `cider-repl-prompt-function' to customize your REPL prompt." |
186 | 225 | "Tweak `cider-eldoc-ns-function' to customize the way namespaces are displayed by eldoc." |
187 | | - "For no middleware, low-tech and reliable namespace reloading use <\\[cider-ns-reload]>." |
188 | | - "Press <\\[cider-load-buffer-and-switch-to-repl-buffer]> to load the current buffer and switch to the REPL buffer afterwards.") |
189 | | - "Some handy CIDER tips." |
190 | | - ) |
| 226 | + "Customize `cider-jack-in-dependencies' to inject extra deps at jack-in time." |
| 227 | + "Customize `cider-clojure-cli-aliases' to enable specific deps.edn aliases automatically when jacking in." |
| 228 | + ;; Self |
| 229 | + "Use <\\[cider-close-ancillary-buffers]> to close all ancillary buffers created by CIDER (e.g. *cider-doc*)." |
| 230 | + "Press <\\[cider-drink-a-sip]> to get more CIDER tips.") |
| 231 | + "Some handy CIDER tips.") |
191 | 232 |
|
192 | 233 | (defun cider-random-tip () |
193 | 234 | "Select a random tip from `cider-tips'." |
|
0 commit comments