【问题标题】:How to open Command window in light table while in editor?如何在编辑器中打开灯表中的命令窗口?
【发布时间】:2014-11-26 21:03:38
【问题描述】:

我正在使用 light table 进行 python 开发。如果我想使用 ctrl-space 打开命令窗口,在编辑器中输入时,它不起作用。我必须先按 Alt-V 从顶部的菜单栏中打开命令窗口。在编辑器中键入时,是否有其他方法可以使用键盘快捷键打开命令窗口?

请注意,我已经在 light table 中激活了 emacs-keybindings。

另请注意,Alt-V 是一个键绑定,必须由 light table 和 emacs 以不同方式处理。虽然在编辑器中 light table 似乎正在处理它,但它在 emacs 中的操作(向上滚动)被忽略了。

从这个意义上说,我实际上想问我如何处理由 emacs 和 light table 处理的键绑定?

【问题讨论】:

    标签: python-2.7 emacs24 lighttable


    【解决方案1】:

    当我开始使用 LT 时,我分享了这种挫败感。来自http://docs.lighttable.com/

    更改键绑定?

    键绑定在 Light 中的 .keymap 文件中定义 桌子。要打开用户键盘映射,请执行设置:用户键盘映射 命令。要查看默认键绑定,您可以执行设置: 默认键盘映射命令。键是基于上下文(标签)绑定的,它 允许您创建上下文命令方案。

    配置键绑定

    要向您的 user.keymap 文件添加键绑定,请在 格式 [:TAG "KEYBINDING" :COMMAND] 例如[:编辑“alt-w” :editor.watch.watch-selection]。如果命令接受参数包装 括号中的命令及其参数,例如[:编辑器“alt-(” (:paredit.select.parent "(")]。默认设置的键绑定可以 通过在键前面加上“-”来减去/删除,例如[:应用程序 "-ctrl-shift-d" :docs.search.show].

    考虑到emacs plugin 在中间搞砸了所有这些东西。我运行 MAC OS,我喜欢大多数开箱即用的 emacs 键绑定,我不知道为什么,但我不太在意 所以我终于没有真正使用emacs plugin,我只是定义了我在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)]
        ]
    

    请注意,LT 上没有真正的kill-ring。我还注释掉了default.keymap 上的一些键绑定,如

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

    它会隐藏默认的delete 操作,您需要禁用 emacs 插件或根据需要注释掉隐藏命令窗口切换的ctrl-space。您可以在 http://docs.lighttable.com/#plugins-directory

    找到您的本地版本

    【讨论】:

      猜你喜欢
      • 2015-10-22
      • 1970-01-01
      • 1970-01-01
      • 2022-01-04
      • 1970-01-01
      • 2019-05-06
      • 1970-01-01
      • 2013-08-17
      • 2016-12-30
      相关资源
      最近更新 更多