Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I set Vim mode in Light Table?

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 []}}
like image 468
jeemar Avatar asked Jan 11 '14 00:01

jeemar


2 Answers

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.

like image 189
stehem Avatar answered Sep 22 '22 02:09

stehem


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

like image 43
leontalbot Avatar answered Sep 23 '22 02:09

leontalbot