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

Add more SPC m bindings for Clojure #5667

Closed
gilch opened this issue Apr 4, 2016 · 12 comments
Closed

Add more SPC m bindings for Clojure #5667

gilch opened this issue Apr 4, 2016 · 12 comments
Labels

Comments

@gilch
Copy link
Contributor

gilch commented Apr 4, 2016

If you look through the menus in a Clojure buffer or Clojure REPL, you can see that a lot of the functions with Ctrl bindings in insert mode have no SPC bindings in normal mode. Is there some reason for leaving these out? There are plenty of letters left on the keyboard. Maybe CIDER has evolved since its layer was written.

@kalouantonis
Copy link
Contributor

If you have more specific examples, I'd be happy to add them

@gilch
Copy link
Contributor Author

gilch commented Aug 22, 2016

I've added all extra cider commands that my version supports (0.14.0snapshot). These include:
cider-classpath
cider-browse-ns
cider-browse-ns-all
cider-auto-test-mode
cider-enlighten-mode

There are dozens more in the menus. They change a bit with context. I think you have to have a Clojure REPL running to see them. Use SPC m s i to jack in (some configuration/installation may be required).

In the Clojure major mode, hit F10 and look through the Clojure, CIDER, CIDER Eval, and CIDER Interactions menus. Then hit SPC m s s to switch to the running Clojure REPL and hit F10 and look through the REPL menus. Anything with a C- binding is probably important enough to have a SPC m binding in normal mode too.

@gilch
Copy link
Contributor Author

gilch commented Aug 22, 2016

@TheBB hold it!

The PR from @kalouantonis was incomplete. This is not fixed in develop. I just said there are dozens of other bindings not covered:

Missing SPC bindings for Clojure mode with CIDER minor mode

key             binding
---             -------

C-:             clojure-toggle-keyword-string

C-M-q           prog-indent-sexp
C-M-i           complete-symbol

C-c C-r a       clojure-unwind-all
C-c C-r f       clojure-thread-first-all
C-c C-r i       clojure-cycle-if
C-c C-r l       clojure-thread-last-all
C-c C-r p       clojure-cycle-privacy
C-c C-r t       clojure-thread
C-c C-r u       clojure-unwind

C-c C-r #       clojure-convert-collection-to-set
C-c C-r '       clojure-convert-collection-to-quoted-list
C-c C-r (       clojure-convert-collection-to-list
C-c C-r [       clojure-convert-collection-to-vector
C-c C-r {       clojure-convert-collection-to-map

C-c C-r n h     clojure-insert-ns-form-at-point
C-c C-r n i     clojure-insert-ns-form
C-c C-r n s     clojure-sort-ns
C-c C-r n u     clojure-update-ns

C-c C-b         cider-interrupt
C-c C-d         cider-doc-map
C-c C-f         cider-pprint-eval-defun-at-point
C-c C-l         cider-load-file
C-c RET         cider-macroexpand-1
C-c C-o         cider-find-and-clear-repl-output
C-c C-p         cider-pprint-eval-last-sexp
C-c C-t         cider-test-commands-map
C-c C-u         cider-undef
C-c C-v         cider-eval-commands-map
C-c C-z         cider-switch-to-repl-buffer
C-c ,           cider-test-commands-map
C-c C-.         cider-find-ns

C-c C-v .       cider-read-and-eval-defun-at-point
C-c C-v n       cider-eval-ns-form
C-c C-v v       cider-eval-sexp-at-point

C-c M-.         cider-find-resource
C-c M-:         cider-read-and-eval
C-c M-;         cider-eval-defun-to-comment
C-c M-d         cider-display-connection-info
C-c M-e         cider-eval-last-sexp-to-repl
C-c M-m         cider-macroexpand-all
C-c M-n         cider-repl-set-ns
C-c M-p         cider-insert-last-sexp-in-repl
C-c M-r         cider-rotate-default-connection
C-c M-s         cider-selector
C-c M-z         cider-load-buffer-and-switch-to-repl-buffer
C-c M-t n       cider-toggle-trace-ns
C-c M-t v       cider-toggle-trace-var

C-c C-d e       cider-apropos-documentation-select
C-c C-d f       cider-apropos-documentation
C-c C-d s       cider-apropos-select
C-c C-d w       cider-grimoire-web

Missing cider-repl bindings

C-c C-d C-a cider-apropos
C-c C-d C-e cider-apropos-documentation-select
C-c C-d C-f cider-apropos-documentation
C-c C-d C-s cider-apropos-select
C-c C-d C-w cider-grimoire-web

C-c C-n     cider-repl-next-prompt
C-c C-o     cider-repl-clear-output
C-c C-p     cider-repl-previous-prompt
C-c C-u     cider-repl-kill-input
C-c M-o     cider-repl-switch-to-other

C-c C-t b   cider-test-show-report
C-c C-t l   cider-test-run-loaded-tests
C-c C-t n   cider-test-run-ns-tests
C-c C-t p   cider-test-run-project-tests
C-c C-t r   cider-test-rerun-tests
C-c C-t t   cider-test-run-test

C-c M-m     cider-macroexpand-all
C-c RET     cider-macroexpand-1

C-c M-t n   cider-toggle-trace-ns
C-c M-t v   cider-toggle-trace-var

C-c M-.     cider-find-resource
M-,         cider-pop-back
C-c M-d     cider-display-connection-info
C-c M-s     cider-selector
C-M-i       complete-symbol

@TheBB
Copy link
Collaborator

TheBB commented Aug 22, 2016

I mean, you're welcome to add them yourself.

@gilch
Copy link
Contributor Author

gilch commented Aug 22, 2016

Ah, yes, well, I might get around to that. I'm not certain what half of these even do, so I'm not sure how to categorize them properly. My elisp skills are still limited (working on it), but adding bindings doesn't look that difficult.

@TheBB
Copy link
Collaborator

TheBB commented Aug 22, 2016

I'm not certain what half of these even do, so I'm not sure how to categorize them properly.

I daresay we shouldn't be adding bindings to functions that we have no idea are even useful, just because they happen to exist.

In any case #6848 is a good example of a PR that adds bindings.

@gilch
Copy link
Contributor Author

gilch commented Aug 22, 2016

On that I disagree. They don't just "happen to exist". The authors of cider and clojure-mode wrote functions precisely because they thought they were useful, and furthermore, added bindings to those they expected to be used most often. Our ignorance of their reasons does not make them any less useful to those who use them. Or even to us if we learn them. But we Spacemacs users are unlikely to even notice many major mode features exist until there's a SPC binding for them.

@kalouantonis
Copy link
Contributor

kalouantonis commented Aug 24, 2016

I went through the key bindings and I've found that most are indeed unimplemented. I'm just marking the ones that are already done.

key            spacemacs-key       binding
---            -------------       --------
C-c C-r a      SPC-m-r-u-a         clojure-unwind-all
C-c C-r f      SPC-m-r-t-f         clojure-thread-first-all
C-c C-r i      SPC-m-r-c-i         clojure-cycle-if
C-c C-r l      SPC-m-r-t-l         clojure-thread-last-all
C-c C-r p      SPC-m-r-c-p         clojure-cycle-privacy
C-c C-r t      SPC-m-r-t-h         clojure-thread
C-c C-r u      SPC-m-r-u-w         clojure-unwind

C-c C-z        SPC-m-s-s    cider-switch-to-repl-buffer

I'm working on adding the rest.

@gilch
Copy link
Contributor Author

gilch commented Aug 28, 2016

The major mode prefix command above should be SPC m r, not SPC-r, to avoid conflicts.

@kalouantonis
Copy link
Contributor

Yea, you're right. I updated my mistake

@kommen
Copy link
Contributor

kommen commented Oct 13, 2018

Are there any more concrete bindings somebody is missing for the clojure layer? While I'm at it... #11431

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!

@github-actions github-actions bot added the stale marked as a stale issue/pr (usually by a bot) label Feb 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants