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

[Feature] Command for switching back and forth between the REPL window and editor #339

Closed
PEZ opened this issue Sep 22, 2019 · 5 comments
Closed

Comments

@PEZ
Copy link
Collaborator

PEZ commented Sep 22, 2019

Slightly related to #337

I'd like a command that allows for switching back and forth between the editor and the REPL window. Like so:

  • If I am editing a file, the command will
    1. Open the REPL Window.
    2. Switch it to the namespace of the file.
    3. Give it focus.
  • If the REPL window has focus, the command will:
    1. Open the file corresponding to the current namespace of the REPL window.
    2. Give it focus.

Clojure files should open the CLJ REPL Window. ClojureScript files should open the CLJS REPL Window. CLJC files should open whatever REPL window corresponds to the current mode backing the file.

It might need to be implemented using several commands with the same keyboard shortcut and intelligent enablement and when clauses.

@cfehse
Copy link
Contributor

cfehse commented Sep 23, 2019

@PEZ Now I understand what you mean. gg

@slipset
Copy link
Contributor

slipset commented Sep 23, 2019

C-c C-z in Cider, FFIW
When you're in the REPL-window, this keybinding calls cider-switch-to-last-clojure-buffer, when you're in a clj/cljs buffer, it calls (cider-switch-to-repl-buffer &optional SET-NAMESPACE)

@nima-flipp
Copy link

Can't believe this hasn't been implemented... Do you guys click back and forth between REPL and Editor with a mouse?

@bpringe
Copy link
Member

bpringe commented Nov 18, 2022

@CasualGitEnjoyer Speaking for myself, I very rarely type in the repl/output window. Most of my repl workflow happens from the editor.

However, this can actually be achieved at least somewhat by using the command for opening the repl window (which focuses it), and using the Go Back command to go back to the last editor.

@PEZ
Copy link
Collaborator Author

PEZ commented Mar 18, 2023

This is actually mostly implemented since long. Bound to ctrl+alt+o o by default. But VS Code's API makes it impossible to implement the reverse (from REPL window to the file) in a very nice way (very often we just open a new editor with the file instead).

@PEZ PEZ closed this as completed Mar 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants