Multiple cursor key-bindings

279 views
Skip to first unread message

Andrew Stebbing

unread,
Jul 6, 2014, 6:43:24 PM7/6/14
to light-table...@googlegroups.com
Hello,

I am new to Light Table having come to it in recent weeks to assist with my attempts to learn clojure/clojurescript.

I am trying to understand how to activate the new multiple cursor functionality. I see there is a key-binding for clearing multiple cursors but how do you activate them in the first place? As a former Sublime Text user I was expecting something similar to that editor. There it's the equivalent of  pmeta-alt + (wherever I click the mouse).  Is there something similar I can set up in Light Table?

Many thanks for any assistance.

James Trunk

unread,
Jul 7, 2014, 3:50:57 AM7/7/14
to light-table...@googlegroups.com
Here is my user.keymap, you can see the Sublime key mappings near the bottom.

It's worth noting that I use a Dvorak keyboard layout out, so some bindings might need changing to work well with qwerty e.g.
the paredit keys are mapped to my home-row, but should be changed to J,K,L & M for qwerty.

;; User keymap
;; -----------------------------
;; Keymaps are stored as a set of diffs that are merged together together
;; to create the final set of keys. You can modify these diffs to either add
;; or subtract bindings.
;;
;; Like behaviors, keys are bound by tag. When objects with those tags are active
;; the key bindings are live. Keys can be bound to any number of Light Table commands,
;; allowing you the flexibility to execute multiple operations together. To see a list
;; of all the commands you can execute, start typing a word related to the thing you
;; want to do in between the square brackets (e.g. type "editor").
 
{:+ {:app { "pmeta-shift-w" [:workspace.show]
"pmeta-shift-c" [:toggle-console]
"pmeta-shift-r" [:clear-console]
"pmeta-shift-t" [:show-connect]
"pmeta-shift-n" [:new-file :set-syntax]
 
"pmeta-=" [:window.zoom-in]
"pmeta--" [:window.zoom-out]
"pmeta-0" [:window.zoom-reset]
 
"pmeta-shift-s" [:save-all]}
 
:editor {"pmeta-;" [:toggle-comment-selection]
"pmeta-shift-d" [:editor.doc.toggle]
"pmeta-l" [:goto-line]
"pmeta-d" [:editor.jump-to-definition-at-cursor]
 
"pmeta-shift-e" [:lt.plugins.lt-expectations/run-expectations-curr-file]
 
"pmeta-shift-backspace" [:clear-inline-results]
 
"alt-h" [:paredit.grow.left]
"alt-t" [:paredit.shrink.left]
"alt-n" [:paredit.shrink.right]
"alt-s" [:paredit.grow.right]
"shift-ctrl-space" [:paredit.select.parent]
 
"ctrl-w" [:editor.watch.watch-selection]
"alt-w" [:rolex.watch.values-over-time]
"ctrl-shift-w" [:editor.watch.unwatch]
 
"ctrl-shift-up" [:editor.sublime.selectLinesUpward]
"ctrl-shift-down" [:editor.sublime.selectLinesDownward]
"ctrl-b" [:editor.sublime.goToBracket]
"ctrl-shift-b" [:editor.sublime.selectBetweenBrackets]
"ctrl-n" [:editor.sublime.selectNextOccurrence]
"ctrl-pmeta-up" [:editor.sublime.swapLineUp]
"ctrl-pmeta-down" [:editor.sublime.swapLineDown]
"shift-pmeta-l" [:editor.sublime.splitSelectionByLine]
"pmeta-j" [:editor.sublime.joinLines]
"shift-pmeta-d" [:editor.sublime.duplicateLine]}}
 
:- {:editor {"pmeta-shift-s" [:save-as]}}}

Andrew Stebbing

unread,
Jul 7, 2014, 6:08:51 AM7/7/14
to light-table...@googlegroups.com
Thank you very much James. I have already used some of your key-bindings which you demonstrated in a couple of your video tutorials. Those tutorials were very helpful by the way.

I'm still a little puzzled over exactly how to get multiple cursors in Light Table working properly though. And here's a mystery.

I have a copy of a clojurescript tutorial by Mimmo Cosneza from https://github.com/magomimmo/modern-cljs
and David Nolen's clojure tutorial for Light Table https://github.com/swannodette/lt-cljs-tutorial

For all the files in David Nolan's tutorial and most of the files in Mimmo Cosneza's tutorial (not project.clj though) I can get multiple cursors to work exactly like in Sublime using just the cmd key (pmeta) and clicking. The esc key then clears them.

I have tried to replicate this in my own files by changing the syntax. I've had success with markdown files but not with .clj or .cljs files.

I've also tried this with files from Light Tables own internal files. It works with lt/src/utils/object.cljs but not with lt/src/utils/macros.clj. Is it possible this is a bug or is there some other key-binding I need set?

Regards

James Trunk

unread,
Jul 7, 2014, 6:00:38 PM7/7/14
to light-table...@googlegroups.com
Hi Andrew,

It does sound like you might have found a bug, so I'd recommend filing an issue in the Light Table GitHub project. Make sure you include the relevant part of your user.keymap, and the steps needed to reproduce the issue.

Sorry I couldn't be more help.

Cheers,
James
Reply all
Reply to author
Forward
0 new messages