How do I set Vim mode in Light Table?

6.3k views Asked by At

How do I activate vim mode in Light Table 0.6.0. The docs say in the editor mode just type "vim" and it will auto complete, but now it doesn't? What do I add to my user behaviours?

{:+ {
 ;; 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

There are 2 answers

0
stehem On BEST ANSWER

Had the same issue, from 0.6.0 changelog :

CHANGE: Emacs and Vim are now both plugins to be downloaded via the plugin manager

Download it, restart, and now it autocompletes when you type vim.

0
leontalbot On

For default setting:

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

To customize it:

: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"})]

For all Vim mode keybindings see: https://github.com/marijnh/CodeMirror/blob/master/keymap/vim.js