I can't find a light table cheat sheet

后端 未结 4 1356
一整个雨季
一整个雨季 2020-12-24 04:17

Does anyone have a cheatsheet for LightTable, even better for the paredit plugin, it seems my google-fu is not up to finding one?

相关标签:
4条回答
  • 2020-12-24 04:59

    Only because the others have not said it yet. You can bind multiple actions to one shortcut as the actions are stored in a list:

    :editor {"ctrl-shift-up" [:paredit.grow.right :paredit.shrink.right]
             "ctrl-right-down" [:paredit.shrink.left :paredit.grow.left]}
    
    0 讨论(0)
  • 2020-12-24 05:04

    I don't think a general cheat sheet for LightTable exists yet! But for the paredit plugin...I hope the following helps

    Paredit Commands

    • :paredit.unwrap.parent (a b (c | d) e) => (a b c | d e)
    • :paredit.grow.left (a b (c | d) e) => (a (b c | d))
    • :paredit.grow.right (a b (c | d) e) => (a b (c | d e))
    • :paredit.shrink.left (a b (c | d) e) => (a b c | (d) e)
    • :paredit.shrink.right (a b (c | d) e) => (a b (c) | d e)
    • :paredit.move.up.forward (a b (c | d) e) => (a b (c d)| e)
    • :paredit.move.up.backward (a b (c | d) e) => (a b |(c d) e)
    • :paredit.move.down.forward (a b | (c d) e) => (a b (|c d) e)
    • :paredit.move.down.backward (a b (c d) | e) => (a b (c d|) e)

    Binding the keys

    To bind the keys, first open user keymap (Settings: User Keymap), and then add binding entries in for the editors in which you want paredit bindings.

    e.g. I have them bound in all editors, so the relevant bit of my keymap is:

    {:+ {:app { ...}
         :editor { ...
                  "ctrl-shift-right" [:paredit.grow.right]
                  "ctrl-shift-left" [:paredit.shrink.right]
                  "ctrl-right" [:paredit.shrink.left]
                  "ctrl-left" [:paredit.grow.left]}}
     :- {}}
    
    0 讨论(0)
  • 2020-12-24 05:21

    Most of the action happens, when you hit CTRL + Space so you get all commands in there. Just type a keyword and you get all options for it.

    I think you want to bind the "usual" keyboard bindings from paredit into lighttable. That's very easy:

    1. Hit CTRL + Space
    2. Type Settings
    3. You get a list of actually 5 items. Choose "Default Keymap" (or "User keymap")
    4. You get a hash-map with the keybindings set up so far

    Here you can edit your paredit plugin and bind the commands you would like to use. For paredit I added to my default keymap:

    :editor {"ctrl-left"  [:paredit.shrink.right]
             "ctrl-right" [:paredit.grow.right]
             "ctrl-s"     [:paredit.unwrap.parent]}
    

    Values like paredit.shrink.right can be found if you hit CTRL + Space and type paredit. As you have 3 examples above, you can just think of how the other commands would look like:

    "Paredit: Shrink right" is the keyword :paredit.shrink.right

    I am pretty sure that I found a list in the internet where those commands were written down, but I can't find it at this moment. But if you know how to "convert" it to keywords, you can just use CTRL + Space to find all commands you need.

    When you correctly bound a keyword on a keybinding you can see this binding in the command list CTRL + Space.

    With this in your mind, you actually have something like a Cheatsheet printed as a map of bindings and actions. Hope this helps ;-)

    0 讨论(0)
  • 2020-12-24 05:22

    I found this page while searching for a cheat sheet of the default keybindings, but the existing answers only focused on paredit. I kept searching and eventually discovered the command "Settings: Default keymap" in the command pane. This command shows all the default keybindings for tasks like inline evaluation, navigating through matches during find & replace, and navigating through tabs. Here are the default keybindings as of April 2017:

     [:app "pmeta-shift-f" :searcher.show]
     [:app "ctrl-space" :show-commandbar-transient]
     [:app "pmeta-shift-n" :window.new]
     [:app "pmeta-shift-o" :open-file]
     [:app "pmeta--" :window.zoom-out]
     [:app "pmeta-n" :new-file]
     [:app "ctrl-shift-d" :docs.search.show]
     [:app "pmeta-o" :navigate-workspace-transient]
     [:app "pmeta-shift-=" :window.zoom-in]
     [:app "pmeta-=" :window.zoom-in]
     [:app "pmeta-0" :window.zoom-reset]
     [:app "pmeta-r" :refresh-connected-browser]
     [:app "f11" :window.fullscreen]
    
     [:browser "pmeta-l" :browser.url-bar.focus]
    
     [:browser.url-bar "esc" :browser.focus-content]
     [:browser.url-bar "enter" :browser.url-bar.navigate!]
    
     [:editor "pmeta-enter" :eval-editor-form]
     [:editor "ctrl-d" :editor.doc.toggle]
     [:editor "ctrl-," :editor.unjump]
     [:editor "ctrl-." :editor.jump-to-definition-at-cursor]
     [:editor "pmeta-shift-s" :save-as]
     [:editor "pmeta-l" :goto-line]
     [:editor "pmeta-shift-enter" :eval-editor]
     [:editor "ctrl-=" :editor.fold-code]
     [:editor "pmeta-s" :save]
     [:editor "pmeta-/" :toggle-comment-selection]
    
     [:editor.keys.hinting.active "enter" :passthrough]
    
     [:editor.keys.normal "pmeta-shift-g" :find.prev]
     [:editor.keys.normal "pmeta-f" :find.fill-selection :find.show]
     [:editor.keys.normal "pmeta-g" :find.next]
     [:editor.keys.normal "tab" :auto-complete]
     [:editor.keys.normal "backspace" :passthrough :editor.backspace-indent]
    
     [:filter-list.input "down" (:filter-list.input.move-selection 1)]
     [:filter-list.input "esc" (:filter-list.input.escape! :force)]
     [:filter-list.input "enter" :filter-list.input.select!]
     [:filter-list.input "up" (:filter-list.input.move-selection -1)]
    
     [:find-bar "pmeta-shift-g" :find.prev]
     [:find-bar "shift-enter" :find.prev]
     [:find-bar "pmeta-g" :find.next]
     [:find-bar "esc" :find.clear :find.hide]
     [:find-bar "enter" :find.next]
    
     [:find-bar.replace "pmeta-enter" :find.replace-all]
     [:find-bar.replace "pmeta-shift-g" :find.prev]
     [:find-bar.replace "pmeta-g" :find.next]
     [:find-bar.replace "esc" :find.clear :find.hide]
     [:find-bar.replace "enter" :find.replace]
    
     [:options-input "esc" :options-input.escape!]
     [:options-input "enter" :options-input.select!]
    
     [:plugin-manager.search "enter" :plugin-manager.search]
    
     [:popup "left" (:popup.move-active 1)]
     [:popup "shift-tab" (:popup.move-active -1)]
     [:popup "esc" (:popup.escape)]
     [:popup "tab" (:popup.move-active 1)]
     [:popup "enter" (:popup.exec-active)]
     [:popup "right" (:popup.move-active -1)]
    
     [:popup.input "left" :passthrough]
     [:popup.input "right" :passthrough]
    
     [:searcher.location "enter" :searcher.search]
    
     [:searcher.replace "pmeta-enter" :searcher.replace-all]
    
     [:searcher.search "enter" :searcher.search]
    
     [:sidebar.clients "esc" :show-connect]
    
     [:sidebar.doc.search.input "esc" :docs.search.hide]
     [:sidebar.doc.search.input "enter" :docs.search.exec]
    
     [:tabs "pmeta-8" (:tabs.goto 7)]
     [:tabs "pmeta-9" (:tabs.goto :last)]
     [:tabs "ctrl-shift-tab" :tabs.prev]
     [:tabs "ctrl-tab" :tabs.next]
     [:tabs "pmeta-shift-[" :tabs.prev]
     [:tabs "pmeta-1" (:tabs.goto 0)]
     [:tabs "pmeta-shift-]" :tabs.next]
     [:tabs "pmeta-2" (:tabs.goto 1)]
     [:tabs "pmeta-3" (:tabs.goto 2)]
     [:tabs "pmeta-4" (:tabs.goto 3)]
     [:tabs "pmeta-5" (:tabs.goto 4)]
     [:tabs "pmeta-6" (:tabs.goto 5)]
     [:tabs "pmeta-7" (:tabs.goto 6)]
     [:tabs "pmeta-w" :tabs.close]
    
     [:tree.rename "esc" :workspace.rename.cancel!]
     [:tree.rename "enter" :workspace.rename.submit!]
    

    Hope this helps someone.

    0 讨论(0)
提交回复
热议问题