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

Support changing/configuring the text in the REPL prompt #1236

Closed
blueberry opened this issue Aug 4, 2015 · 3 comments
Closed

Support changing/configuring the text in the REPL prompt #1236

blueberry opened this issue Aug 4, 2015 · 3 comments
Assignees

Comments

@blueberry
Copy link

When I have a long nested namespace, it takes a lot of the screen width... So, instead of something.something.something.something.something.myns> i would like it to just display the last part, myns>

I asked on slack clojurians whether this is possible now, and Bozidar says it is not, so I assume he should know. He also said it should not be complicated to support, and seems reasonable, so I have hopes :)

Thanks for the great development environment!

@cichli
Copy link
Member

cichli commented Aug 4, 2015

You can accomplish this using cider-repl-prompt-function:

(setq cider-repl-prompt-function (lambda (ns)
                                   (format "%s> " (car (last (split-string ns "\\."))))))

I'll keep this open as a reminder to myself to add this to the README :-).

@cichli cichli self-assigned this Aug 4, 2015
@Malabarba
Copy link
Member

I think it would be nice to have some more functions available for this, for the users who don't know how to write them.
I'll open a PR with a couple options.

bbatsov added a commit that referenced this issue Aug 5, 2015
[#1236] Add two more functions for use in cider-repl-prompt-function
@Malabarba
Copy link
Member

@blueberry The behaviour you wanted is now available with

(setq cider-repl-prompt-function #'cider-repl-prompt-lastname)

But you may or may not prefer this one:

(setq cider-repl-prompt-function #'cider-repl-prompt-abbreviated)

@bbatsov bbatsov closed this as completed Aug 5, 2015
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

4 participants