http://docs.lighttable.com/
https://github.com/LightTable/LightTable/wiki/FAQ
http://docs.lighttable.com/tutorials/full/
在view->commands,可以查看一些命令。 输入Settings: User behaviors, 打开一个user.behavior的文档。
有一行[:app :lt.objs.style/font-settings "Courier New" "11"], 在这里可以改。
[:editor :lt.objs.editor/line-numbers] 显示行数
[:app :lt.objs.style/font-settings "Courier New" "12"]
[:app :lt.objs.app/set-default-zoom-level 2] 窗口放大二倍
命令 settings: default key里可以设置相关快捷键,我把打开commands的命令设置为了ctrl+z,默认的与切换输入法冲突.
其他设置:
How do I load custom javascript files on startup?
Add a :lt.objs.plugins/load-js
behavior to your user.behaviors
to load javascript files. For example:
[:app :lt.objs.plugins/load-js "/Users/me/full/path/to/my.js"]
Argument for behavior might be a string or a vector of strings.
How do I load custom css files at startup?
Put your css in a file and insert the :lt.objs.plugins/load-css
into your user.behaviors:
[:app :lt.objs.plugins/load-css "/full/path/to/my.css"]
Argument for behavior must be a string.
How do I define a custom file type?
Add a :lt.objs.files/file-types
behavior to your user.behaviors
. For example, to define a filetype.foo
:
[:files :lt.objs.files/file-types [{:name "foo" :exts [:foo] :mime "text/x-foo" :tags [:editor.foo]}] ]
:exts
also works for filenames. For example, a Ruby plugin could have:exts [:Rakefile :Gemfile :config.ru :rb]
where the first three are filenames.
How do I turn off LT's autopolling?
To use LightTable offline, add the following behaviors to respective sections in youruser.behaviors
:
[:app :lt.objs.metrics/disable-metrics]
[:app :-lt.objs.deploy/check-version]
How do I configure Paredit with Vim mode?
Add the following snippet to Settings: User keymap
.
[:editor.keys.vim.normal ">" :paredit.grow.right]
[:editor.keys.vim.normal "<" :paredit.shrink.right]
[:editor.keys.vim.normal "cmd-shift-," :paredit.shrink.left]
[:editor.keys.vim.normal "cmd-shift-." :paredit.grow.left]
How do I hide the intro page?
Add the following to Settings: User behaviors
.
[:app :-lt.objs.intro/show-intro]
How do I get rid of the menubar at the top?
Add the following to Settings: User behaviors
.
[:app :-lt.objs.menu/create-menu]
[:app :-lt.objs.menu/set-menu]
[:window :-lt.objs.menu/set-menu]
How do I run a command automatically when LightTable starts up?
Add the following to Settings: User behaviors
to cause LightTable to go full screen at startup:
[:app :lt.objs.app/run-on-init [:window.fullscreen]]
Add the following to Settings: User behaviors
to open the console as a tab automatically at startup:
[:app :lt.objs.app/run-post-init [:console-tab]]
Note that some commands can be added to the run-on-init
behavior but other commands are sensitive to start up order and will only work in therun-post-init
behavior -:console-tab
is an example of such a command.
How do I customize my font?
Add the following snippet to Settings: User behaviors
.
[:app :lt.objs.style/font-settings "Courier New" "11"]
How do I change the default font size or zoom level?
[:app :lt.objs.app/set-default-zoom-level 2]
How do I change my tab or indent settings?
Add the following snippet to Settings: User behaviors
.
;; 2 2 is tab size in spaces and spaces per indent
[:editor :lt.objs.editor/tab-settings false 2 2]
How do I display print margin/column ruler?
If you use 0.8.0-alpha or greater add this:
;; Draw a ruler at 80 chars
[:editor :lt.objs.editor/set-rulers]
;; Or specify multiple rulers
[:editor :lt.objs.editor/set-rulers [{:lineStyle "dashed" :color "#aff" :column 80}
{:lineStyle "dashed" :color "#aff" :column 120}]]
How do I add pair keybindings?
To have the following characters {[("
auto pair, add the following snippet toSettings: User behaviors
.
[:app :lt.objs.settings/pair-keymap-diffs]
How do I call a command every time a file is saved?
For example, to eval the whole file when a clojurescript file is saved, add the following snippet toSettings: User behaviors
.
[:editor.clojurescript :lt.objs.editor.file/on-save :eval-editor]
How can I configure my proxy?
Set the $http_proxy
and $https_proxy
environment variables. Support for this was added in#1451.
Miscellaneous
How do I set the default Clojure version when running Instarepl outside of the context of a Clojure project?
Update plugins/clojure/runner/resources/project.clj
by adding/changing:dependencies \[\[org.clojure/clojure "x.x.x" ]]
wherex.x.x
is of course the Clojure version you want to use by default in your Instarepl sessions whenever LightTable doesn't run in the context of a Clojure project (i.e. double clicking on a shortcut on the desktop to run LightTable).
How do I connect to an external lein repl?
- Add
lein-light-nrepl
as a dependency to your project (See Clojure README section for more). -
Start your lein repl:
$ lein repl :headless nREPL server started on port 59305 on host 127.0.0.1
- Using the command bar, execute the command
Connect: Add Connection
. Select theClojure (remote nREPL)
connection and specify the port from your repl session. For the above example this would belocalhost:59305
.
How do I show inline docs for current word?
Right click it and choose Show docs
. Alternatively, use Ctrl-d
which is bound to toggle docs.
How do I inspect any html element in Light Table?
Run the Dev: Open Developer Tools
command, also known as :dev-inspector command. More infohere
How do I style any element?
Let's say you want to customize the console fonts. If you look for the console ui,you'll see its selector is $('ul.console')
. If you pull up the dev-inspector command, you can inspect the element and try some styles on it. Once you're satisfied with how it looks, transfer those styles to a css file andload the css file at startup.
How do I inspect the html of a page within a browser tab?
Open the dev-inspector. Click the console button in the lower left and typeinspect($('#browser iframe').contentDocument)
. This will open up the inspector right to the element containing a page's html.
How do I install a custom version of a plugin i.e. an unreleased or old version?
cd
to your plugins directory. If you don't know your plugins directory, execute the commandApp: Light Table version
. From there, rm the current plugin,git clone https://github.com/USER/PLUGIN
andgit checkout
to a specific version if desired.
What are the hotkeys on OSX?
Many (though not all) of the OS X hotkeys mentioned in the Light Table documentation use the cmd key instead of ctrl.
How do I find the keybinding for a command?
When in doubt, you can look up the key sequence by name by pressing ctrl-space (yes, it's really ctrl on this one) and then typing part of the name of the command you want to use. If a key is mapped to the command, it will be printed right below the command name in the command bar.
How do I open a new file I've created outside Light Table?
If you create a new file outside Light Table, you need to refresh your folder in order to open it with the navigator. To do this, open your workspace pane, right click on the folder that needs refreshing and selectRefresh folder
. Now you can open the new file with the navigator.
How do I auto-repeat keys on OSX?
If you want to press and repeatedly fire a key e.g. hjkl
in Vim, execute this command in a shelldefaults write com.kodowa.LightTable ApplePressAndHoldEnabled -bool false
. If this doesn't work for your OSX version, you will need to globally enable itdefaults write -g ApplePressAndHoldEnabled -bool false
.
What are the names for keys in the keymap files?
Light Table uses Mousetrap for key-bindings. From that page:
For modifier keys you can use
shift
,ctrl
,alt
, ormeta
.You can substitute
option
foralt
andcommand
formeta
.Other special keys are
backspace
,tab
,enter
,return
,capslock
,esc
,escape
,space
,pageup
,pagedown
,end
,home
,left
,up
,right
,down
,ins
,del
, andplus
.Any other key you should be able to reference by name like
a
,/
,$
,*
, or=
.
Are there limitations to copy and paste?
On OSX yes. If you open any program with tmux or screen, there will be issues with the Pasteboard. This link also offers a solution in the form ofbrew install reattach-to-user-namespace
and following install instructions
How do I use CodeMirror addons?
LightTable uses CodeMirror for the underlying text editor. CodeMirror provides anextensive set of addons that can provide additional features. To use a particular addon, add a:lt.objs.editor/load-addon
behavior to your user.behaviors
. For example, to use the matchtags.js addon which highlights a matching tag, add:
[:app :lt.objs.editor/load-addon "edit/matchtags.js"]
Note that the addon path is relative to this directory where LightTable stores CodeMirror addons. Also note that LightTable lags some behind CodeMirror so the addons you see on the CodeMirror website may not be available in LightTable yet. It's possible to download an addon and use it with the:lt.objs.plugins/load-js
behavior but only if the addon can use the CodeMirror version that ships with LightTable.