2014-11-04 90 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

相關問題