Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More info about cider-nrepl setup in README? #399

Open
mars0i opened this issue Mar 10, 2022 · 6 comments
Open

More info about cider-nrepl setup in README? #399

mars0i opened this issue Mar 10, 2022 · 6 comments

Comments

@mars0i
Copy link

mars0i commented Mar 10, 2022

Hi, I'm completely new to vim-fireplace. I've been using Clojure for many years, and vim for many more years, but I've gone without this kind of tool for a very long time. I'm a little confused about how to set up cider-nrepl for vim-fireplace. So this is a personal help request, but I'm submitting an issue because it might also be a request for an addition to the README file..

The README says:

First, set up cider-nrepl. (If you skip this step, only a subset of functionality will be available.)

I want all the functionality! The cider-nrepl README says:

Please refer to the documentation site for information on how to setup cider-nrepl or how to leverage its nREPL API.

The cider-nrepl documentation site gives information about how to use cider-nrepl inside Clojure (via Leiningen, Boot, and using deps.edn, for example). There's also a Makefile in the cider-nrepl repo, though nothing suggested I should run it, and after I got it to run--an env var needed to be set--the make process hung.

Is that what you mean by setting up cider-nrepl to use with vim-fireplace? Get Leiningen (for example) to pull down the cider-nrepl jar and pom? I've done that, but I'm not sure whether or not I've done what's needed for vim-fireplace to use cider-nrepl.

Apologies for my cluelessness. Since I've never (OK, rarely) used this kind of tool, I don't know what to expect it to do.

For example, if I highlight a function name and type K, I get the docstring--ok, good. If I highlight the definition and type [d, I get "E388: Couldn't find definition". I don't know whether that's because I haven't set up cider-nrepl properly, or whether maybe something in my existing vim config is interfering.

Thanks!

@tpope tpope closed this as completed in 49f2132 Mar 11, 2022
@tpope
Copy link
Owner

tpope commented Mar 11, 2022

You're not alone; this is a common pain point. I'm updating the README to point directly to the usage documentation.

For example, if I highlight a function name and type K, I get the docstring--ok, good. If I highlight the definition and type [d, I get "E388: Couldn't find definition". I don't know whether that's because I haven't set up cider-nrepl properly, or whether maybe something in my existing vim config is interfering.

This is definitely your config. My guess would be you have 'timeout' set too low.

@tpope tpope reopened this Mar 11, 2022
@mars0i
Copy link
Author

mars0i commented Mar 11, 2022

Thanks very much. Thanks for updating the README. I had already found a version of that page when I submitted the issue, but I appreciate that the link now goes directly there.

About [d, I don't think it's a timeout (assume you mean timeoutlen in vim--finally figured that out--but it doesn't help). There's something more fundamental I don't understand about using fireplace. You don't need to answer here. I'll probably figure it out. ([d works with names that don't include a hyphen. When there's a hyphen, [d reads only up until it. Highlighting the whole name let's K read it and return the docstring, but that doesn't work with [d, and I get the E388 error. This is true both for my own definitions and for clojure.core.)

@mars0i
Copy link
Author

mars0i commented Mar 11, 2022

Oh, and to followup on my initial question and README suggestion: Is it necessary to include something like :plugins [[cider/cider-nrepl "0.28.3"]] in project.clj or profiles.clj (for Leiningen) all of the time? i.e. by "set up cider-nrepl', you mean configure it to load the plugin repeatedly via Leiningen or deps.edn or Boot or whatever? I'm sure this seems obvious to many people, but someone starting out with fireplace might not have any idea about plugins or what cider-nrepl does. (That the cider-nrepl docs are oriented toward Emacs doesn't help.)

Thanks again! (And in general, thank you for fireplace.)

@tpope
Copy link
Owner

tpope commented Mar 11, 2022

When there's a hyphen, [d reads only up until it.

That's 'iskeyword', which should be set correctly by the ftplugin. Make sure :filetype reports plugin:ON and check :verbose set iskeyword?.

Is it necessary to include something like :plugins [[cider/cider-nrepl "0.28.3"]] in project.clj or profiles.clj (for Leiningen) all of the time?

For full functionality yes. Notably it is required for ClojureScript support. We try to make do without it when we can, because as you note, setting it up can be challenging for rookies and veterans alike.

@mars0i
Copy link
Author

mars0i commented Mar 11, 2022

OK--thanks very much!

I'll check iskeyword? [Over the years I gradually built up a confused/confusing vim configuration, and I'm in the process of switching to a more rational system, but that means that I've intentionally disabled some things until I figure out what they do. And need to enable some things I never did before.]

OK, good--thanks for the exaplanation about the plugin. That kind of all makes sense to me. I'm not using Clojurescript at the moment, so I might not notice the difference. It's clear to me that my vim is talking to nrepl, which confused me. I'll add the plugin. Can't hurt.

@mars0i
Copy link
Author

mars0i commented Mar 12, 2022

Adding filetype plugin on did the trick. Thanks, and sorry about that. I spend a lot of time using vim but not a log of time understanding its config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants