如何在Light Table中设置Vim模式?

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 []}}
2个回答

29

我曾经遇到过同样的问题,从0.6.0的更新日志中可以看到:

变更:Emacs和Vim现在都是要通过插件管理器下载的插件

下载安装它,重启之后,现在当你输入vim时就可以自动补全了。


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


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接