Fork me on GitHub
#emacs
<
2017-11-24
>
jazzytomato11:11:29

Hi, I’m new to emacs and I’ve installed prelude + cider. I’m looking for the “go to definition” command, i.e. when the point is on a function name, I’d like to jump to that fn. I’ve searched online and I found that it should be M-. but this triggers “visit tags table”

jumar15:11:49

you might want to try spacemacs - really helpful especially for beginners

solf13:11:43

M-. is the standard shortcut to "go to definition", by default it's binded to the command xref-find-definitions which is the one that prompts you to "visit tags table"

solf13:11:28

However when you're on a clojure file and have cider-mode active, cider remaps M-. to cider-find-var

solf13:11:20

@jazzytomato You can check out what command is binded to a key using C-h k, so in your case C-h k M-.

solf13:11:02

Ah, being on a clojure file (so in clojure-mode) is not enough, you need to jack in (`C-c M-j`) to actually activate cider-mode

jazzytomato13:11:32

:thinking_face: it’s a bit annoying if you just want to go around in projects without starting a REPL though

solf13:11:13

Yeah but I imagine you don't have a choice, since it's CIDER that brings the "go to definition" feature, and I imagine through the REPL

solf13:11:52

(I'm a beginner on clojure so I might be wrong, not a beginner on emacs though)

jazzytomato13:11:50

as a workaround I’ve installed dumb-jump

jazzytomato13:11:56

thanks for your help

solf13:11:23

I've heard good things about dumb-jump, I'll have to try it

qqq18:11:59

projectile-replace has dramatically improved the quality of my code

qqq18:11:53

easy to replace all foo -> bar ===> when a name no longer makes sense, more likely to rename it to a better name