2014-11-04 88 views
3

我使用光表进行python开发。如果我想使用ctrl-space打开命令窗口,在编辑器中输入时,它不起作用。我必须先按Alt-V从顶部菜单栏打开命令窗口。有没有另一种方法来在编辑器中输入时使用键盘快捷键打开命令窗口?如何在编辑器中打开光表中的命令窗口?

请注意,我已激活光表中的emacs-keybindings。

另请注意,Alt-V是一个必须通过轻量表和emacs进行不同处理的键绑定。在编辑器中,light表似乎在处理它,而在emacs中的操作(向上滚动)却被忽略。

从这个意义上说,我真的想问我如何处理由emacs和light table处理不同的keybindings?

回答

2

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

更改键盘绑定?

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

配置键绑定

要将键绑定添加到user.keymap文件,在 格式添加一个向量[:TAG “键绑定”:COMMAND]例如[:editor“alt-w” :editor.watch.watch-selection]。如果一个命令带有参数,则将 命令及其参数放在括号中,例如[:editor“alt-(” (:paredit.select.parent“(”)]。默认情况下设置的键绑定可以通过以' - '为前缀来减去/删除,例如[:app “-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

相关问题