This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-12-16
Channels
- # adventofcode (24)
- # announcements (3)
- # aws (3)
- # babashka (16)
- # beginners (88)
- # biff (5)
- # calva (27)
- # cider (15)
- # cljs-dev (70)
- # clojure (87)
- # clojure-austin (3)
- # clojure-belgium (6)
- # clojure-europe (59)
- # clojure-nl (1)
- # clojure-norway (14)
- # clojure-uk (3)
- # clojurescript (37)
- # data-science (2)
- # datalevin (40)
- # datomic (1)
- # emacs (23)
- # events (2)
- # graalvm (13)
- # graphql (7)
- # gratitude (1)
- # holy-lambda (193)
- # inf-clojure (15)
- # lsp (27)
- # malli (9)
- # off-topic (20)
- # polylith (6)
- # reitit (29)
- # releases (2)
- # scittle (13)
- # shadow-cljs (51)
- # transit (15)
- # xtdb (29)
How do people manage windows/panes/tabs in VS Code? I like to have an implementation ns on the top left, its test na on the top right, and the REPL on the bottom. It takes a lot of mousing to set that up and switch between them.
That's basically what I do. Mouse a lot. 😃 You can drag terminals in among the editors too, btw.
There are commands for moving panels and groups, and for moving between them. Some of these commands lack hotkeys by default. Searching the Command Palette for "move editor" and "focus editor" covers most of the relevant commands.
Use the panel opened by Preferences: Open Keyboard Shortcuts
to set shortcuts, but search for command names in the Command Palette to view cleaner search results.
Cool. I was secretly hoping some ex-emacs or tmux wizard would say, “here’s what you wanna do…” 😆
Here’s what I did, installed the neovim extension and use the vim commands for splits and editor navigation. I think since those are implemented in the vscode extension there’s definitely enough API to do it. A joyride script might help too :)
I have a hotkey for Move Editor Into Right Group and I use the keyboard for switching groups (`ctrl+0` for explorer/git etc, ctrl+1
, ctrl+2
-- on Windows at least). I'm working on a setup with Joyride to automate opening Portal, moving it to the right group, and switching focus back into the left group (amongst other things). Blog post on this to follow (it's been in draft state for two weeks so far).
I almost never touch the mouse when I'm in VS Code -- even when working with the Atlassian extension for Jira and BitBucket: I create and work on tickets, branches, and pull requests all within VS Code with the keyboard.
Also, I no longer have my REPL visible at all -- I use Portal to show results (with its nREPL middleware). But I also typically only have one code editor visible, as I have a hotkey to run tests for the current implementation ns without needing to switch back and forth (not sure if Calva has a built-in test runner for that -- but I use my own test running code, wired into Portal).
https://github.com/seancorfield/vscode-calva-setup has my full setup.
@U04V70XH6 portal is great and I use it all the time but I can't quite get rid of the REPL. Sometimes I miss some error in source that's easily visible in REPL if I save the file (eval on save - Perhaps I shouldnt do it). And sometimes I just want to type something into the repl just to see how a function works.
I can’t remember if I asked about this: practicalli mentions https://practical.li/clojure/clojure-editors/editor-user-guides/vspacecode-calva.html#structural-editing---paredit, but I would like to be able to enter a structural editing mode, so I can do a few of these commands without hitting the two leader keys first for every one. Is that possible? I don’t know if VSCode can really do “modal style”
Structural editing in Calva doesn't use a leader key (unless you remap the hotkeys as "key chords", where the first of 2 hotkeys acts like a leader). https://calva.io/paredit/
I'm pretty sure https://marketplace.visualstudio.com/items?itemName=vscodevim.vim provides edit/insert modes. So there must be a way to do modal editing. I imagine most of the magic happens in when
conditions on shortcuts; and it probably get pretty complicated to do ad hoc.
I did the thing where as soon as I started the editor I tried adding things to make it like the last one... I better figure out, was it VSSpaceCode that vimified me, or another plugin I forgot..
Does your vim mode provide for an edit mode command altering shortcuts? You could have a command that toggles on/off a leaderless variant of the relevant shortcuts. If not, you could do the same with a Joyride script to add/remove a set of hotkeys.
I don’t know anything about leader keys so I’m probably not understanding the question. Anyway, you can give yourself modes without #C03DPCLCV9N by using kennings to set extension context via the vscode command for this and then use that context in other keybindings. With Joyride you can go more sophisticated.
A leader key is roughly equivalent to what VS Code does with key chords, except with only a single leading key, instead of a handful of leading keys. So for Calva, Ctrl-Alt-C
acts like a leader that makes Ctrl-Alt-J
available as a shortcut to run Jack in.
In Vim-like environments, you have a separate Edit Mode where the entire keyboard becomes available for single-key shortcuts, instead of inserting text. You can assign one key to the name "leader" in your config, but like with Code's chords, the leader behavior is not limited to that one key.
@U0E9KE222 is using VSpaceCode to get Vim-like modes in VS Code, and by following the Practicalli guide, has set up Paredit to be done using leader-key based shortcuts in Edit Mode.
I'm learning I have a bad installation of all this, so I'm repeating that path to Paredit
I’m an old vi use for decades so I know about editing modes. The leader key is still unclear to me after that explanation, though. But it’s not important. What I wanted to say is that you can create modes using context.
Hmm. I wonder what is still confusing about it when compared against VS Code's chords. :thinking_face:
It is a keyboard shortcut that does not have any effect on its own, but instead directs what the next shortcut will do. Like in vi Edit Mode, you can press J
to go down. But if you press a leader key, it says that if the next key you press is J
it will do some other assigned thing instead of moving the cursor down.
And the request (which I think you answered with "create modes using context") is to instead switch into a mode where J
will do that some other thing repeatedly until the mode is exited.