21

如何在 Light Table 0.6.0 中激活 vim 模式。文档说在编辑器模式下只需输入“vim”,它就会自动完成,但现在不是了吗?我要为我的用户行为添加什么?

{:+ {
 ;; The app tag is kind of like global scope. You assign behaviors that affect
 ;; all of Light Table here
 :app [(:lt.objs.style/set-skin "dark")]

 ;; The editor tag is applied to all editors
 :editor [:lt.objs.editor/no-wrap
          (:lt.objs.style/set-theme "default")]

 ;; Here we can add behaviors to just clojure editors
 :editor.clojure [(:lt.objs.langs.clj/print-length 1000)]}

 ;; You can use the subtract key to remove behavior that may get added by
 ;; another diff
 :- {:app []}}
4

2 回答 2

29

从 0.6.0 changelog 有同样的问题:

变化:Emacs 和 Vim 现在都是插件,可以通过插件管理器下载

下载它,重新启动,现在它会在您键入 vim 时自动完成。

于 2014-01-11T12:03:23.483 回答
10

默认设置:

:editor [:lt.objs.editor/no-wrap
         (:lt.objs.style/set-theme "default")
         :lt.plugins.vim/activate-vim]

要自定义它:

:editor [:lt.objs.editor/no-wrap
         (:lt.objs.style/set-theme "default")
         :lt.plugins.vim/activate-vim
         (:lt.plugins.vim/map-keys {"K" "{",
                                    "J" "}",
                                    "L" "$",
                                    "H" "^",
                                    "-" "$",
                                    "0" "^",
                                    "<BS>" "<PageUp>",
                                    "<Space>" "<PageDown>",
                                    "jj" "jj",
                                    "j" "gj",
                                    "k" "gk"})]

对于所有 Vim 模式键绑定,请参见:https ://github.com/marijnh/CodeMirror/blob/master/keymap/vim.js

于 2014-01-11T03:24:21.847 回答