3

I am using light table for python development. While typing in the editor if I want to open the command window using ctrl-space, it doesn't work. I have to first press Alt-V to open the command window from the menubar at the top. Is there another way to open command window using a keyboard shortcut while typing in the editor?

Note that I have activated emacs-keybindings in light table.

Also note that Alt-V is a keybinding that has to be handled differently by light table and emacs. While in editor light table seems to be handling it whereas its operation in emacs (scroll up) is disregarded.

In this sense I would actually like to ask how can I handle keybindings that are handled differently by emacs and light table?

Shaun
  • 313
  • 3
  • 9

1 Answers1

2

I shared this frustration when I started with LT. From http://docs.lighttable.com/

Change keybindings?

Keybindings are defined in .keymap files in Light Table. To open the user keymap, execute the Settings: User keymap command. To see the default keybindings you can execute the Settings: Default keymap command. Keys are bound based on context (tag), which allows you to create contextual command schemes.

Configure keybindings

To add a keybinding to your user.keymap file, add a vector in the format [:TAG "KEYBINDING" :COMMAND] e.g. [:editor "alt-w" :editor.watch.watch-selection]. If a command takes arguments wrap the command and its arguments in a parentheses e.g. [:editor "alt-(" (:paredit.select.parent "(")]. Keybindings that are set by default can be subtracted/removed by prefixing the key with '-' e.g. [:app "-ctrl-shift-d" :docs.search.show].

Take into account that the emacs plugin is messing up all these stuff in the middle. I run MAC OS and I enjoy most of the emacs keybindings out of the box, I don't know exactly why but I don't care very much so I finally don't really use the emacs plugin and I just defined the keybindings I missed on my user.keymap

    ;; Your file has been converted to the new flat format.
    ;; Conversion does not preserve comments or indentation.
    ;; File is backed up at /Users/jaime/Library/Application Support/LightTable/User/user.keymap.bak
    [
     [:editor "ctrl-g" :goto-line]
     [:editor "ctrl-l" :lt.plugins.openurl/open-url "http://google.com"]

     [:editor "ctrl-i" :smart-indent-selection]
     [:editor "ctrl-o" :editor.doc.toggle]
     [:editor "ctrl-s" :editor.sublime.splitSelectionByLine]
     ;;  [:editor "alt-w" :editor.watch.watch-selection]
     ;;  [:editor "alt-shift-w" :editor.watch.unwatch]

     ;; ;; lt floating bars
     [:editor "ctrl-u" :toggle-comment-selection]
     [:editor "ctrl-c" :toggle-console]
     [:editor "ctrl-w" :workspace.show]


     ;; ;; emacs inheritance
     [:editor "ctrl-k" :editor.cut]
     [:editor "ctrl-y" :editor.paste]
     [:filter-list.input "ctrl-n" (:filter-list.input.move-selection 1)]
     [:filter-list.input "ctrl-p" (:filter-list.input.move-selection -1)]
    ]

Notice that there is no real kill-ring on LT. I also commented out some keybindings on the default.keymap, as

;;  [:editor "ctrl-d" :editor.doc.toggle]

Which shadows the default delete operation, You'll need to disable the emacs plugin or comment out the ctrl-space which is shadowing the command window toggle as you need. You'll find your local version at http://docs.lighttable.com/#plugins-directory

Jaime Agudo
  • 8,076
  • 4
  • 30
  • 35