Skip to content

Instantly share code, notes, and snippets.

@kernelp4nic
Last active August 29, 2015 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kernelp4nic/e79208f3ecfe196721aa to your computer and use it in GitHub Desktop.
Save kernelp4nic/e79208f3ecfe196721aa to your computer and use it in GitHub Desktop.
lighttable-user-behaviors.clj
;; User behaviors
;; -----------------------------
;; Behaviors are stored as a set of diffs that are merged together
;; to create the final set of functionality that makes up Light Table. You can
;; modify these diffs to either add or subtract functionality.
;;
;; Behaviors are added to tags, objects with those tags then automatically gain
;; whatever logic the behavior imparts. To see a list of user-level behaviors,
;; start typing a word related to the functionality you want in between the square
;; brackets (e.g. "theme").
[
;; The app tag is kind of like global scope. You assign behaviors that affect
;; all of Light Table to it.
[:app :lt.objs.style/set-skin "dark"]
[:app :lt.objs.plugins/load-js "user_compiled.js"]
;; The editor tag is applied to all editors
[:editor :lt.objs.editor/no-wrap]
[:editor :lt.objs.style/set-theme "default"]
;; Here we can add behaviors to just clojure editors
[:editor.clojure :lt.plugins.clojure/print-length 1000]
;; Behaviors specific to a user-defined object
[:user.hello :lt.plugins.user/on-close-destroy]
[:editor :lt.objs.style/set-theme "base16-eighties-dark"]
[:editor :lt.objs.style/font-settings "Monaco" 10.5 1.5]
[:app :lt.objs.settings/pair-keymap-diffs]
[:editor :lt.plugins.trail-whitespace/show-trailing-whitespace]
[:editor :lt.objs.editor/line-numbers]
;; To subtract a behavior, prefix the name with '-' e.g.
;; [:app :-lt.objs.intro/show-intro]
]
;; User keymap
;; -----------------------------
;; Keymaps are stored as a set of diffs that are merged together to create
;; the final set of keys. You can modify these diffs to either add or
;; subtract bindings.
;;
;; Like behaviors, keys are bound by tag. When objects with those tags are active
;; the key bindings are live. Keys can be bound to any number of Light Table commands,
;; allowing you the flexibility to execute multiple operations together. To see a list
;; of all the commands you can execute, start typing a word related to the thing you
;; want to do in between the square brackets (e.g. type "editor").
[
[:editor "alt-shift-w" :editor.watch.unwatch]
[:editor "pmeta-shift-d" :editor.sublime.duplicateLine]
[:editor "pmeta-." :editor.sublime.selectNextOccurrence]
[:editor "pmeta-shift-0" :toggle-console]
[:editor "pmeta-/" :paredit.select.parent]
[:editor "alt-s" :paredit.unwrap.parent]
[:editor "pmeta-shift-e" :smart-indent-selection]
[:editor "pmeta-shift-l" :instarepl.toggle-live]
[:editor "ctrl-enter" :eval-editor-form]
[:editor "ctrl-enter" :editor.codemirror.command ""]
[:editor.html :lt.objs.editor/tab-settings true 2 2]
[:editor "alt+up" :editor.line-up]
[:editor "alt+down" :editor.line-down]
[:editor "pmeta-alt-k" :toggle-comment-selection]
[:tabs "pmeta-alt-left" :tabs.prev]
[:tabs "pmeta-alt-right" :tabs.next]
[:app "pmeta-shift-p" :show-commandbar-transient]
[:app "pmeta-t" :navigate-workspace-transient]
[:editor.keys.hinting.active "enter" :auto-complete]
;; To subtract a binding, prefix the key with '-' e.g.
;; [:app "-ctrl-shift-d" :docs.search.show]
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment