Skip to content

Instantly share code, notes, and snippets.

@toastal
Last active October 18, 2021 08:14
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 toastal/3d4f548b0c6a64e45c11 to your computer and use it in GitHub Desktop.
Save toastal/3d4f548b0c6a64e45c11 to your computer and use it in GitHub Desktop.
;; 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.app/set-default-zoom-level 2.5]
[:app :lt.objs.style/set-skin "dark"]
[:app :lt.objs.plugins/load-js "user_compiled.js"]
[:app :lt.objs.settings/pair-keymap-diffs]
;; The editor tag is applied to all editors
[:editor :lt.objs.editor/no-wrap]
[:editor :lt.objs.editor/line-numbers]
[:editor :lt.objs.style/set-theme "default"]
[:editor :lt.objs.style/font-settings "Fantasque Sans Mono" "13" ""]
[:editor :lt.plugins.vim/activate-vim]
[:editor :lt.plugins.vim/map-keys {">)" ":ltexec paredit.grow.right",
"<)" ":ltexec paredit.shrink.right",
">(" ":ltexec paredit.shrink.left",
"<(" ":ltexec paredit.grow.left"}]
;; 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]
;; To subtract a behavior, prefix the name with '-' e.g.
;; [:app :-lt.objs.intro/show-intro]
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment