{"id":302,"date":"2014-07-03T09:41:03","date_gmt":"2014-07-03T06:41:03","guid":{"rendered":"http:\/\/mednis.info\/wp\/?p=302"},"modified":"2014-07-03T10:50:31","modified_gmt":"2014-07-03T07:50:31","slug":"configure-lighttable-editor-so-it-behaves-more-like-sublimetext","status":"publish","type":"post","link":"http:\/\/mednis.info\/wp\/?p=302","title":{"rendered":"Configure LightTable editor so it behaves more like SublimeText"},"content":{"rendered":"<p>In LightTable press Ctrl-Space to open Commands pane. Type &#8220;settings&#8221; and choose &#8220;Settings: User keymap&#8221;.<br \/>\nIt will open keymap configuration. The following configuration adds PageUP and PageDown keyboard shortcuts to switch between opened files and Ctrl-\/ shortcut to comment\/uncomment current line.<\/p>\n<pre>;; User keymap\r\n;; -----------------------------\r\n;; Keymaps are stored as a set of diffs that are merged together together\r\n;; to create the final set of keys. You can modify these diffs to either add\r\n;; or subtract bindings.\r\n;;\r\n;; Like behaviors, keys are bound by tag. When objects with those tags are active\r\n;; the key bindings are live. Keys can be bound to any number of Light Table commands,\r\n;; allowing you the flexibility to execute multiple operations together. To see a list\r\n;; of all the commands you can execute, start typing a word related to the thing you\r\n;; want to do in between the square brackets (e.g. type \"editor\").\r\n\r\n{:+ {:app {}\r\n\r\n     :editor {\"alt-w\" [:editor.watch.watch-selection]\r\n              \"alt-shift-w\" [:editor.watch.unwatch]\r\n              \"pmeta-\/\" [:toggle-comment-selection]}\r\n     :tabs {\"pmeta-pageup\" [:tabs.prev]\r\n            \"pmeta-pagedown\" [:tabs.next]\r\n            }\r\n     }}\r\n<\/pre>\n<p>To add line numbers or change color theme, you need to configure &#8220;User behaviors&#8221;.  Press Ctrl-Space to open Commands pane, type &#8220;settings&#8221; and choose &#8220;Settings: User behaviors&#8221;.<br \/>\nHere is my configuration:<\/p>\n<pre>;; User behaviors\r\n;; -----------------------------\r\n;; Behaviors are stored as a set of diffs that are merged together\r\n;; to create the final set of functionality that makes up Light Table. You can\r\n;; modify these diffs to either add or subtract functionality.\r\n;;\r\n;; Behaviors are added to tags, objects with those tags then automatically gain\r\n;; whatever logic the behavior imparts. To see a list of user-level behaviors,\r\n;; start typing a word related to the functionality you want in between the square\r\n;; brackets (e.g. \"theme\").\r\n\r\n{:+ {\r\n     ;; The app tag is kind of like global scope. You assign behaviors that affect\r\n     ;; all of Light Table here\r\n     :app [(:lt.objs.style\/set-skin \"dark\")]\r\n\r\n     ;; The editor tag is applied to all editors\r\n     :editor [:lt.objs.editor\/wrap\r\n              :lt.objs.editor\/line-numbers\r\n              (:lt.objs.style\/font-settings \"\" \"12\" \"1.2\")\r\n              (:lt.objs.style\/set-theme \"monokai\")]\r\n\r\n     ;; Here we can add behaviors to just clojure editors\r\n     :editor.clojure [(:lt.objs.langs.clj\/print-length 1000)]}\r\n\r\n ;; You can use the subtract key to remove behavior that may get added by\r\n ;; another diff\r\n :- {:app []}}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>In LightTable press Ctrl-Space to open Commands pane. Type &#8220;settings&#8221; and choose &#8220;Settings: User keymap&#8221;. It will open keymap configuration. The following configuration adds PageUP and PageDown keyboard shortcuts to switch between opened files and Ctrl-\/ shortcut to comment\/uncomment current line. ;; User keymap ;; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; ;; Keymaps are stored as a set of diffs &hellip; <a href=\"http:\/\/mednis.info\/wp\/?p=302\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Configure LightTable editor so it behaves more like SublimeText<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[33,15,6],"tags":[34],"_links":{"self":[{"href":"http:\/\/mednis.info\/wp\/index.php?rest_route=\/wp\/v2\/posts\/302"}],"collection":[{"href":"http:\/\/mednis.info\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/mednis.info\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/mednis.info\/wp\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/mednis.info\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=302"}],"version-history":[{"count":6,"href":"http:\/\/mednis.info\/wp\/index.php?rest_route=\/wp\/v2\/posts\/302\/revisions"}],"predecessor-version":[{"id":309,"href":"http:\/\/mednis.info\/wp\/index.php?rest_route=\/wp\/v2\/posts\/302\/revisions\/309"}],"wp:attachment":[{"href":"http:\/\/mednis.info\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=302"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/mednis.info\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=302"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/mednis.info\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=302"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}