我正在使用 light table 进行 python 开发。在编辑器中键入时,如果我想使用 ctrl-space 打开命令窗口,它不起作用。我必须先按 Alt-V 从顶部的菜单栏打开命令窗口。在编辑器中键入时,是否有另一种方法可以使用键盘快捷键打开命令窗口?
请注意,我已经在 light table 中激活了 emacs-keybindings。
另请注意,Alt-V 是一个键绑定(bind),light table 和 emacs 必须以不同方式处理它。虽然在编辑器中 light table 似乎正在处理它,但它在 emacs 中的操作(向上滚动)被忽略了。
从这个意义上说,我实际上想问我如何处理 emacs 和 light table 处理不同的键绑定(bind)?
最佳答案
当我开始使用 LT 时,我也有过这种挫败感。来自 http://docs.lighttable.com/
更改键绑定(bind)?
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.
配置快捷键
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].
考虑到 emacs plugin在中间搞砸了所有这些东西。我运行 MAC OS,我喜欢开箱即用的大部分 emacs 键绑定(bind),我不知道为什么,但我不太在意
所以我最终没有真正使用 emacs 插件
,我只是定义了我在 user.keymap
上遗漏的键绑定(bind)
;; 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
上注释掉了一些键绑定(bind),如
;; [:editor "ctrl-d" :editor.doc.toggle]
隐藏默认的 delete
操作,您需要禁用 emacs 插件或注释掉根据需要隐藏命令窗口切换的 ctrl-space
.您可以在 http://docs.lighttable.com/#plugins-directory 找到本地版本
关于python-2.7 - 如何在编辑器中打开光台中的命令窗口?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26728393/