mirror of
https://github.com/sstent/sublime-text-3.git
synced 2026-01-26 07:01:47 +00:00
backing up sublime settings
This commit is contained in:
153
Packages/SublimeREPL/doc/Makefile
Normal file
153
Packages/SublimeREPL/doc/Makefile
Normal file
@@ -0,0 +1,153 @@
|
||||
# Makefile for Sphinx documentation
|
||||
#
|
||||
|
||||
# You can set these variables from the command line.
|
||||
SPHINXOPTS =
|
||||
SPHINXBUILD = sphinx-build
|
||||
PAPER =
|
||||
BUILDDIR = _build
|
||||
|
||||
# Internal variables.
|
||||
PAPEROPT_a4 = -D latex_paper_size=a4
|
||||
PAPEROPT_letter = -D latex_paper_size=letter
|
||||
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
|
||||
# the i18n builder cannot share the environment and doctrees with the others
|
||||
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
|
||||
|
||||
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
|
||||
|
||||
help:
|
||||
@echo "Please use \`make <target>' where <target> is one of"
|
||||
@echo " html to make standalone HTML files"
|
||||
@echo " dirhtml to make HTML files named index.html in directories"
|
||||
@echo " singlehtml to make a single large HTML file"
|
||||
@echo " pickle to make pickle files"
|
||||
@echo " json to make JSON files"
|
||||
@echo " htmlhelp to make HTML files and a HTML help project"
|
||||
@echo " qthelp to make HTML files and a qthelp project"
|
||||
@echo " devhelp to make HTML files and a Devhelp project"
|
||||
@echo " epub to make an epub"
|
||||
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
|
||||
@echo " latexpdf to make LaTeX files and run them through pdflatex"
|
||||
@echo " text to make text files"
|
||||
@echo " man to make manual pages"
|
||||
@echo " texinfo to make Texinfo files"
|
||||
@echo " info to make Texinfo files and run them through makeinfo"
|
||||
@echo " gettext to make PO message catalogs"
|
||||
@echo " changes to make an overview of all changed/added/deprecated items"
|
||||
@echo " linkcheck to check all external links for integrity"
|
||||
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
|
||||
|
||||
clean:
|
||||
-rm -rf $(BUILDDIR)/*
|
||||
|
||||
html:
|
||||
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
|
||||
@echo
|
||||
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
|
||||
|
||||
dirhtml:
|
||||
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
|
||||
@echo
|
||||
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
|
||||
|
||||
singlehtml:
|
||||
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
|
||||
@echo
|
||||
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
|
||||
|
||||
pickle:
|
||||
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
|
||||
@echo
|
||||
@echo "Build finished; now you can process the pickle files."
|
||||
|
||||
json:
|
||||
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
|
||||
@echo
|
||||
@echo "Build finished; now you can process the JSON files."
|
||||
|
||||
htmlhelp:
|
||||
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
|
||||
@echo
|
||||
@echo "Build finished; now you can run HTML Help Workshop with the" \
|
||||
".hhp project file in $(BUILDDIR)/htmlhelp."
|
||||
|
||||
qthelp:
|
||||
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
|
||||
@echo
|
||||
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
|
||||
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
|
||||
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/SublimeREPL.qhcp"
|
||||
@echo "To view the help file:"
|
||||
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/SublimeREPL.qhc"
|
||||
|
||||
devhelp:
|
||||
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
|
||||
@echo
|
||||
@echo "Build finished."
|
||||
@echo "To view the help file:"
|
||||
@echo "# mkdir -p $$HOME/.local/share/devhelp/SublimeREPL"
|
||||
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/SublimeREPL"
|
||||
@echo "# devhelp"
|
||||
|
||||
epub:
|
||||
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
|
||||
@echo
|
||||
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
|
||||
|
||||
latex:
|
||||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
||||
@echo
|
||||
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
|
||||
@echo "Run \`make' in that directory to run these through (pdf)latex" \
|
||||
"(use \`make latexpdf' here to do that automatically)."
|
||||
|
||||
latexpdf:
|
||||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
||||
@echo "Running LaTeX files through pdflatex..."
|
||||
$(MAKE) -C $(BUILDDIR)/latex all-pdf
|
||||
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
|
||||
|
||||
text:
|
||||
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
|
||||
@echo
|
||||
@echo "Build finished. The text files are in $(BUILDDIR)/text."
|
||||
|
||||
man:
|
||||
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
|
||||
@echo
|
||||
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
|
||||
|
||||
texinfo:
|
||||
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
|
||||
@echo
|
||||
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
|
||||
@echo "Run \`make' in that directory to run these through makeinfo" \
|
||||
"(use \`make info' here to do that automatically)."
|
||||
|
||||
info:
|
||||
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
|
||||
@echo "Running Texinfo files through makeinfo..."
|
||||
make -C $(BUILDDIR)/texinfo info
|
||||
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
|
||||
|
||||
gettext:
|
||||
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
|
||||
@echo
|
||||
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
|
||||
|
||||
changes:
|
||||
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
|
||||
@echo
|
||||
@echo "The overview file is in $(BUILDDIR)/changes."
|
||||
|
||||
linkcheck:
|
||||
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
|
||||
@echo
|
||||
@echo "Link check complete; look for any errors in the above output " \
|
||||
"or in $(BUILDDIR)/linkcheck/output.txt."
|
||||
|
||||
doctest:
|
||||
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
|
||||
@echo "Testing of doctests in the sources finished, look at the " \
|
||||
"results in $(BUILDDIR)/doctest/output.txt."
|
||||
BIN
Packages/SublimeREPL/doc/_static/menu.png
vendored
Normal file
BIN
Packages/SublimeREPL/doc/_static/menu.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 25 KiB |
BIN
Packages/SublimeREPL/doc/_static/palette.png
vendored
Normal file
BIN
Packages/SublimeREPL/doc/_static/palette.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 28 KiB |
242
Packages/SublimeREPL/doc/conf.py
Normal file
242
Packages/SublimeREPL/doc/conf.py
Normal file
@@ -0,0 +1,242 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# SublimeREPL documentation build configuration file, created by
|
||||
# sphinx-quickstart on Sun Feb 26 16:38:41 2012.
|
||||
#
|
||||
# This file is execfile()d with the current directory set to its containing dir.
|
||||
#
|
||||
# Note that not all possible configuration values are present in this
|
||||
# autogenerated file.
|
||||
#
|
||||
# All configuration values have a default; values that are commented out
|
||||
# serve to show the default.
|
||||
|
||||
import sys, os
|
||||
|
||||
# If extensions (or modules to document with autodoc) are in another directory,
|
||||
# add these directories to sys.path here. If the directory is relative to the
|
||||
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
||||
#sys.path.insert(0, os.path.abspath('.'))
|
||||
|
||||
# -- General configuration -----------------------------------------------------
|
||||
|
||||
# If your documentation needs a minimal Sphinx version, state it here.
|
||||
#needs_sphinx = '1.0'
|
||||
|
||||
# Add any Sphinx extension module names here, as strings. They can be extensions
|
||||
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
|
||||
extensions = []
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
templates_path = ['_templates']
|
||||
|
||||
# The suffix of source filenames.
|
||||
source_suffix = '.rst'
|
||||
|
||||
# The encoding of source files.
|
||||
#source_encoding = 'utf-8-sig'
|
||||
|
||||
# The master toctree document.
|
||||
master_doc = 'index'
|
||||
|
||||
# General information about the project.
|
||||
project = 'SublimeREPL'
|
||||
copyright = '2012, Wojciech Bederski'
|
||||
|
||||
# The version info for the project you're documenting, acts as replacement for
|
||||
# |version| and |release|, also used in various other places throughout the
|
||||
# built documents.
|
||||
#
|
||||
# The short X.Y version.
|
||||
version = '1.0'
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
release = '1.0.30'
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
#language = None
|
||||
|
||||
# There are two options for replacing |today|: either, you set today to some
|
||||
# non-false value, then it is used:
|
||||
#today = ''
|
||||
# Else, today_fmt is used as the format for a strftime call.
|
||||
#today_fmt = '%B %d, %Y'
|
||||
|
||||
# List of patterns, relative to source directory, that match files and
|
||||
# directories to ignore when looking for source files.
|
||||
exclude_patterns = ['_build']
|
||||
|
||||
# The reST default role (used for this markup: `text`) to use for all documents.
|
||||
#default_role = None
|
||||
|
||||
# If true, '()' will be appended to :func: etc. cross-reference text.
|
||||
#add_function_parentheses = True
|
||||
|
||||
# If true, the current module name will be prepended to all description
|
||||
# unit titles (such as .. function::).
|
||||
#add_module_names = True
|
||||
|
||||
# If true, sectionauthor and moduleauthor directives will be shown in the
|
||||
# output. They are ignored by default.
|
||||
#show_authors = False
|
||||
|
||||
# The name of the Pygments (syntax highlighting) style to use.
|
||||
pygments_style = 'sphinx'
|
||||
|
||||
# A list of ignored prefixes for module index sorting.
|
||||
#modindex_common_prefix = []
|
||||
|
||||
|
||||
# -- Options for HTML output ---------------------------------------------------
|
||||
|
||||
# The theme to use for HTML and HTML Help pages. See the documentation for
|
||||
# a list of builtin themes.
|
||||
html_theme = 'default'
|
||||
|
||||
# Theme options are theme-specific and customize the look and feel of a theme
|
||||
# further. For a list of options available for each theme, see the
|
||||
# documentation.
|
||||
#html_theme_options = {}
|
||||
|
||||
# Add any paths that contain custom themes here, relative to this directory.
|
||||
#html_theme_path = []
|
||||
|
||||
# The name for this set of Sphinx documents. If None, it defaults to
|
||||
# "<project> v<release> documentation".
|
||||
#html_title = None
|
||||
|
||||
# A shorter title for the navigation bar. Default is the same as html_title.
|
||||
#html_short_title = None
|
||||
|
||||
# The name of an image file (relative to this directory) to place at the top
|
||||
# of the sidebar.
|
||||
#html_logo = None
|
||||
|
||||
# The name of an image file (within the static path) to use as favicon of the
|
||||
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
|
||||
# pixels large.
|
||||
#html_favicon = None
|
||||
|
||||
# Add any paths that contain custom static files (such as style sheets) here,
|
||||
# relative to this directory. They are copied after the builtin static files,
|
||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||
html_static_path = ['_static']
|
||||
|
||||
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
|
||||
# using the given strftime format.
|
||||
#html_last_updated_fmt = '%b %d, %Y'
|
||||
|
||||
# If true, SmartyPants will be used to convert quotes and dashes to
|
||||
# typographically correct entities.
|
||||
#html_use_smartypants = True
|
||||
|
||||
# Custom sidebar templates, maps document names to template names.
|
||||
#html_sidebars = {}
|
||||
|
||||
# Additional templates that should be rendered to pages, maps page names to
|
||||
# template names.
|
||||
#html_additional_pages = {}
|
||||
|
||||
# If false, no module index is generated.
|
||||
#html_domain_indices = True
|
||||
|
||||
# If false, no index is generated.
|
||||
#html_use_index = True
|
||||
|
||||
# If true, the index is split into individual pages for each letter.
|
||||
#html_split_index = False
|
||||
|
||||
# If true, links to the reST sources are added to the pages.
|
||||
#html_show_sourcelink = True
|
||||
|
||||
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
|
||||
#html_show_sphinx = True
|
||||
|
||||
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
|
||||
#html_show_copyright = True
|
||||
|
||||
# If true, an OpenSearch description file will be output, and all pages will
|
||||
# contain a <link> tag referring to it. The value of this option must be the
|
||||
# base URL from which the finished HTML is served.
|
||||
#html_use_opensearch = ''
|
||||
|
||||
# This is the file name suffix for HTML files (e.g. ".xhtml").
|
||||
#html_file_suffix = None
|
||||
|
||||
# Output file base name for HTML help builder.
|
||||
htmlhelp_basename = 'SublimeREPLdoc'
|
||||
|
||||
|
||||
# -- Options for LaTeX output --------------------------------------------------
|
||||
|
||||
latex_elements = {
|
||||
# The paper size ('letterpaper' or 'a4paper').
|
||||
#'papersize': 'letterpaper',
|
||||
|
||||
# The font size ('10pt', '11pt' or '12pt').
|
||||
#'pointsize': '10pt',
|
||||
|
||||
# Additional stuff for the LaTeX preamble.
|
||||
#'preamble': '',
|
||||
}
|
||||
|
||||
# Grouping the document tree into LaTeX files. List of tuples
|
||||
# (source start file, target name, title, author, documentclass [howto/manual]).
|
||||
latex_documents = [
|
||||
('index', 'SublimeREPL.tex', 'SublimeREPL Documentation',
|
||||
'Wojciech Bederski', 'manual'),
|
||||
]
|
||||
|
||||
# The name of an image file (relative to this directory) to place at the top of
|
||||
# the title page.
|
||||
#latex_logo = None
|
||||
|
||||
# For "manual" documents, if this is true, then toplevel headings are parts,
|
||||
# not chapters.
|
||||
#latex_use_parts = False
|
||||
|
||||
# If true, show page references after internal links.
|
||||
#latex_show_pagerefs = False
|
||||
|
||||
# If true, show URL addresses after external links.
|
||||
#latex_show_urls = False
|
||||
|
||||
# Documents to append as an appendix to all manuals.
|
||||
#latex_appendices = []
|
||||
|
||||
# If false, no module index is generated.
|
||||
#latex_domain_indices = True
|
||||
|
||||
|
||||
# -- Options for manual page output --------------------------------------------
|
||||
|
||||
# One entry per manual page. List of tuples
|
||||
# (source start file, name, description, authors, manual section).
|
||||
man_pages = [
|
||||
('index', 'sublimerepl', 'SublimeREPL Documentation',
|
||||
['Wojciech Bederski'], 1)
|
||||
]
|
||||
|
||||
# If true, show URL addresses after external links.
|
||||
#man_show_urls = False
|
||||
|
||||
|
||||
# -- Options for Texinfo output ------------------------------------------------
|
||||
|
||||
# Grouping the document tree into Texinfo files. List of tuples
|
||||
# (source start file, target name, title, author,
|
||||
# dir menu entry, description, category)
|
||||
texinfo_documents = [
|
||||
('index', 'SublimeREPL', 'SublimeREPL Documentation',
|
||||
'Wojciech Bederski', 'SublimeREPL', 'One line description of project.',
|
||||
'Miscellaneous'),
|
||||
]
|
||||
|
||||
# Documents to append as an appendix to all manuals.
|
||||
#texinfo_appendices = []
|
||||
|
||||
# If false, no module index is generated.
|
||||
#texinfo_domain_indices = True
|
||||
|
||||
# How to display URL addresses: 'footnote', 'no', or 'inline'.
|
||||
#texinfo_show_urls = 'footnote'
|
||||
398
Packages/SublimeREPL/doc/index.rst
Normal file
398
Packages/SublimeREPL/doc/index.rst
Normal file
@@ -0,0 +1,398 @@
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
SublimeREPL
|
||||
===========
|
||||
|
||||
SublimeREPL is a plugin for Sublime Text 2 that lets you run interactive
|
||||
interpreters of several languages within a normal editor tab. It also allows
|
||||
connecting to a running remote interpreter (e.g. Clojure/Lein) though a telnet
|
||||
port.
|
||||
|
||||
SublimeREPL has a built-in support for command history and transferring code
|
||||
from open buffers to the interpreters for evaluation, enabling interactive
|
||||
programming.
|
||||
|
||||
.. note::
|
||||
This documentation is work in progress. Details on language integrations are
|
||||
sorely missing. Please contribute!
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
Download `Package Control`__, select Install Package and pick SublimeREPL from the list of
|
||||
available packages. You should have Package Control anyway.
|
||||
|
||||
__ http://wbond.net/sublime_packages/package_control
|
||||
|
||||
|
||||
Quick Start
|
||||
-----------
|
||||
|
||||
SublimeREPL adds itself as a submenu in Tools. You can choose any one of the
|
||||
preconfigured REPLs and if it's available in your SYSTEM PATH [#]_, it will
|
||||
be launched immediately.
|
||||
|
||||
.. image:: _static/menu.png
|
||||
|
||||
Second and more user friendly way to launch any given REPL is through Command
|
||||
Palette. Bring up Command Palette and type "repl". You will be presented with
|
||||
all preconfigured REPLs. Running REPL through Command Palette has exactly the
|
||||
same result as picking it from *Tools > SublimeREPL* menu.
|
||||
|
||||
.. image:: _static/palette.png
|
||||
|
||||
.. [#] One of the most frequently reported errors is SublimeREPL not being able
|
||||
to find interpreter executable, even if it's visible in your shell. There are several way to fix this problem that we'll discuss in FAQ.
|
||||
|
||||
You may now use a source buffer to either evaluate text from the buffer in
|
||||
the REPL or copy text over to the REPL without evaluation. For this to work,
|
||||
ensure that the language syntax definition for your source buffer matches
|
||||
the REPL.
|
||||
|
||||
Keyboard shortcuts
|
||||
------------------
|
||||
|
||||
The default shortcuts shipped with SublimeREPL are listed below. If you are
|
||||
accustomed to another REPL keymap, or if you intend to work in REPL a lot
|
||||
(lispers pay attention!) you may want to rebind the keys more to your liking.
|
||||
|
||||
REPL keys
|
||||
^^^^^^^^^
|
||||
|
||||
.. NOTE::
|
||||
The list below omits the trivial text editing keybindings (e.g. left, right
|
||||
etc). They are nevertheless configurable in keymap files.
|
||||
|
||||
+---------------+---------------+----------------+----------------------------------+-------------------------------------------------+
|
||||
| Linux | OS X | Windows | Command used | Meaning |
|
||||
+===============+===============+================+==================================+=================================================+
|
||||
| Up | Up | Up | repl_view_previous | Walk back to previous input, with autocomplete |
|
||||
+---------------+---------------+----------------+----------------------------------+-------------------------------------------------+
|
||||
| Alt+p | Ctrl+p | Alt+p | repl_view_previous | Walk back to previous input, no autocomplete |
|
||||
+---------------+---------------+----------------+----------------------------------+-------------------------------------------------+
|
||||
| Down | Down | Down | repl_view_next | Walk back to next input, with autocomplete |
|
||||
+---------------+---------------+----------------+----------------------------------+-------------------------------------------------+
|
||||
| Alt+n | Ctrl+n | Alt+n | repl_view_next | Walk back to next input, no autocomplete |
|
||||
+---------------+---------------+----------------+----------------------------------+-------------------------------------------------+
|
||||
| Enter | Enter | Enter | repl_enter | Send current line to REPL |
|
||||
+---------------+---------------+----------------+----------------------------------+-------------------------------------------------+
|
||||
| Esc | Esc | Esc | repl_escape | Clear REPL input |
|
||||
+---------------+---------------+----------------+----------------------------------+-------------------------------------------------+
|
||||
| Ctrl+l | Ctrl+l | Shift+Ctrl+c | repl_clear | Clear REPL screen |
|
||||
+---------------+---------------+----------------+----------------------------------+-------------------------------------------------+
|
||||
| Shift+Ctrl+c | Shift+Ctrl+c | *Unsupported* | subprocess_repl_send_signal | Send SIGINT to REPL |
|
||||
+---------------+---------------+----------------+----------------------------------+-------------------------------------------------+
|
||||
|
||||
Source buffer keys
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. important::
|
||||
The keybindings here use Ctrl+, as a prefix (C-, in emacs notation), meaning press Ctrl, press comma, release both. Pressing the
|
||||
prefix combination and then the letter will immediately send the target text into the REPL and *evaluate* it as if you pressed enter.
|
||||
If you want to prevent evaluation and send the text for *editing* in the REPL, press Shift with the prefix combination.
|
||||
|
||||
.. note::
|
||||
Default source buffer keys are identical on all platforms.
|
||||
|
||||
+---------------+--------------------------------------------------------------------------------------------------------------------+
|
||||
| Key | Meaning |
|
||||
+===============+====================================================================================================================+
|
||||
| Ctrl+, b | Send the current "block" to REPL. Currently Clojure-only. |
|
||||
+---------------+--------------------------------------------------------------------------------------------------------------------+
|
||||
| Ctrl+, s | Send the selection to REPL |
|
||||
+---------------+--------------------------------------------------------------------------------------------------------------------+
|
||||
| Ctrl+, f | Send the current file to REPL |
|
||||
+---------------+--------------------------------------------------------------------------------------------------------------------+
|
||||
| Ctrl+, l | Send the current line to REPL |
|
||||
+---------------+--------------------------------------------------------------------------------------------------------------------+
|
||||
|
||||
Language specific information
|
||||
-----------------------------
|
||||
|
||||
SublimeREPL's integration with a specific language includes language-specific
|
||||
main menu and palette options for REPL startup, keymaps, and special REPL
|
||||
extensions unique to the target language. An integration may contain several
|
||||
different REPL modes which are based on different underlying classes.
|
||||
|
||||
Clojure
|
||||
^^^^^^^
|
||||
|
||||
The Clojure integration supports Leiningen projects.
|
||||
You must install Leiningen to use Clojure integration.
|
||||
|
||||
If your Leiningen installation is not system-global, you may need to tweak
|
||||
SublimeREPL configuration (via Preferences > Package Settings > SublimeREPL >
|
||||
Settings - User) so that we can find your lein binary::
|
||||
|
||||
"default_extend_env": {"PATH": "{PATH}:/home/myusername/bin"}
|
||||
|
||||
To start a REPL subprocess with Leiningen project environment, open your `project.clj`
|
||||
and, while it is the current file, use the menu or the command palette to start the REPL.
|
||||
|
||||
* In subprocess REPL mode, the REPL is launched as a subprocess of the editor.
|
||||
This is the mode you should use right now.
|
||||
* The telnet mode no longer works because of the changes in Leiningen and nrepl.
|
||||
|
||||
The source buffer "send block" command (Ctrl+, b) deserves a special mention.
|
||||
Performing this command while the cursor is within the body of a definition
|
||||
will select this (current, top-level) definition and send it to the REPL for
|
||||
evaluation. This means that the latest version of the function you're
|
||||
currently working on will be installed in the live environment so that you
|
||||
can immediately start playing with it in the REPL. This is similar to [slime
|
||||
-]eval-defun in emacs.
|
||||
|
||||
Additional keybindings are available for Clojure:
|
||||
|
||||
+---------------+--------------------------------------------------------------------------------------------------------------------+
|
||||
| Key | Meaning |
|
||||
+===============+====================================================================================================================+
|
||||
| Ctrl+F12 c s | Launch a subprocess Clojure REPL |
|
||||
+---------------+--------------------------------------------------------------------------------------------------------------------+
|
||||
| Ctrl+F12 c t | Connect to a running Clojure REPL |
|
||||
+---------------+--------------------------------------------------------------------------------------------------------------------+
|
||||
|
||||
Python
|
||||
^^^^^^
|
||||
|
||||
Both stock Python and Execnet integrations support virtualenv. Various ways to work with Python, including PDB and IPython, are supported.
|
||||
|
||||
Documentation contributions from a Python specialist are welcome.
|
||||
|
||||
Configuration
|
||||
-------------
|
||||
|
||||
The default SublimeREPL configuration documents all available configuration settings.
|
||||
|
||||
Frequently Asked Questions
|
||||
--------------------------
|
||||
|
||||
**SublimeREPL can't launch the REPL process - OSError(2, 'No such file or directory'), how do I fix that?**
|
||||
|
||||
Sublime is unable to locate the binary that is needed to launch your REPL in the search paths available to it. This is
|
||||
because the subprocess REPLs are launched, as, well, subprocesses of Sublime environment, which may be different from
|
||||
your interactive environment, especially if your REPL is installed in a directory that is not in a system-wide path (e.g
|
||||
`/usr/local/bin` or '/home/myusername` on Linux, `My Documents` on Windows etc)
|
||||
|
||||
If the binary is not in your system path and you can't or won't change that, tweak SublimeREPL configuration::
|
||||
|
||||
{
|
||||
...
|
||||
"default_extend_env": {"PATH": "{PATH}:/home/myusername/bin"}
|
||||
...
|
||||
}
|
||||
|
||||
**I'd like an interactive REPL for Foo and it is not supported, what do?**
|
||||
|
||||
Chances are, you only need a minimal amount of work to add an integration, and necessary steps are described
|
||||
here briefly.
|
||||
|
||||
If you already have an interactive shell for Foo, you can use the subprocess
|
||||
REPL. For an example, see PHP or Lua integration in `config/PHP`.
|
||||
|
||||
If Foo provides an interactive environment over TCP, you can use the telnet
|
||||
REPL. For an example, see MozRepl integration
|
||||
|
||||
Supported languages
|
||||
-------------------
|
||||
|
||||
SublimeREPL currently ships with support for the following languages:
|
||||
|
||||
* Clisp
|
||||
* Clojure
|
||||
* CoffeeScript
|
||||
* Elixir
|
||||
* Execnet Python
|
||||
* Erlang
|
||||
* F#
|
||||
* Groovy
|
||||
* Haskell
|
||||
* Lua
|
||||
* Matlab
|
||||
* MozRepl
|
||||
* NodeJS
|
||||
* Octave
|
||||
* Perl
|
||||
* PHP interactive mode
|
||||
* PowerShell
|
||||
* Python
|
||||
* R
|
||||
* Racket
|
||||
* Ruby
|
||||
* Scala
|
||||
* Scheme
|
||||
* Shell (Windows, Linux and OS X)
|
||||
* SML
|
||||
* Sublime internal REPL (?)
|
||||
* Tower (CoffeeScript)
|
||||
|
||||
Structure of SublimeREPL
|
||||
------------------------
|
||||
|
||||
.. NOTE::
|
||||
If this is your first time dealing with Sublime plugins, you may find it a bit too magical. Basically,
|
||||
Sublime automatically scans plugin directories loads configuration files and plugin code without manual
|
||||
intervention, and reloads them dynamically as soon as they change. The entry points to a plugin's code are its commands,
|
||||
which are Python objects that extend Sublime's standard command class. Sublime calls them when needed. There
|
||||
is no initialization entry point or a "plugin loaded" callback or somesuch.
|
||||
|
||||
Basics of language integration: configuration and launch commands
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
A language integration in SublimeREPL consists of configuration files and,
|
||||
where needed, Python code. The configuration consists of:
|
||||
|
||||
* Menu configuration files which specify the actual REPL object configuration
|
||||
* Command palette `configuration files <http://docs.sublimetext.info/en/latest/reference/command_palette.html>`_
|
||||
* Optional `keybinding configuration files <http://docs.sublimetext.info/en/latest/reference/key_bindings.html>`_
|
||||
|
||||
REPLs are started by SublimeREPL command `repl_open`. The command and its
|
||||
arguments is usually specified in the menu configuration file, and the other
|
||||
places refer to that configuration item by file name and ID using the
|
||||
`run_existing_window_command` command.
|
||||
|
||||
Simple language integrations use an existing REPL class (see below) without
|
||||
modification. For these integrations, no additional Python code is needed.
|
||||
They use one of the standard REPL classes as the base, as documented below. In
|
||||
most cases, this will be the subprocess based REPL class. An example of such
|
||||
an integration is Lua.
|
||||
|
||||
The menu configuration file `config/Lua/Menu.sublime-menu` contains::
|
||||
|
||||
[
|
||||
{
|
||||
"id": "tools",
|
||||
"children":
|
||||
[{
|
||||
"caption": "SublimeREPL",
|
||||
"mnemonic": "r",
|
||||
"id": "SublimeREPL",
|
||||
"children":
|
||||
[
|
||||
{"command": "repl_open",
|
||||
"caption": "Lua",
|
||||
"id": "repl_lua",
|
||||
"mnemonic": "l",
|
||||
"args": {
|
||||
"type": "subprocess",
|
||||
"encoding": "utf8",
|
||||
"cmd": ["lua", "-i"],
|
||||
"cwd": "$file_path",
|
||||
"external_id": "lua",
|
||||
"syntax": "Packages/Lua/Lua.tmLanguage"
|
||||
}
|
||||
}
|
||||
]
|
||||
}]
|
||||
}
|
||||
]
|
||||
|
||||
This adds a "Lua" menu item to "Tools > SublimeREPL" which creates a Lua REPL
|
||||
via SublimeREPL command `repl_open`. The important part to take note of here
|
||||
is the `id` attribute (`repl_lua`). This is the ID by which the command
|
||||
palette configuration file refers to Lua REPL configuration.
|
||||
|
||||
As you can see, the main way to launch a new REPL is the SublimeREPL command
|
||||
`repl_open` (class :class:`ReplOpenCommand`). The menu configuration file (see
|
||||
above) specifies the arguments for the command that are used to locate the
|
||||
desired REPL class and the settings for it so that it can be spawned.
|
||||
|
||||
The command configuration file `config/Lua/Default.sublime-commands` looks like this::
|
||||
|
||||
[
|
||||
{
|
||||
"caption": "SublimeREPL: Lua",
|
||||
"command": "run_existing_window_command", "args":
|
||||
{
|
||||
/* Note that both these arguments are used to identify the file above and
|
||||
load the REPL configuration from it
|
||||
*/
|
||||
"id": "repl_lua",
|
||||
"file": "config/Lua/Main.sublime-menu"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
It is obvious that the REPL configuration is concentrated in the menu files,
|
||||
and the palette configuration only refers to those by ID and file name. The
|
||||
latter is achieved by the command `run_existing_window_command` (class
|
||||
:class:`RunExistingWindowCommandCommand`)
|
||||
|
||||
This command is a wrapper that is used in the *command palette* configuration.
|
||||
Its function is to execute another command. It takes an ID of a configuration
|
||||
item and the name of a file where the configuration is stored, and scans the
|
||||
available Sublime configuration folders for the file and within the file for
|
||||
the configuration item until one is found. This allows the command palette
|
||||
configuration to specify a reference to the REPL configuration command instead
|
||||
of replicating it. For this reason, actual REPL configuration is *concentrated
|
||||
in the menu files*.
|
||||
|
||||
|
||||
REPL classes
|
||||
^^^^^^^^^^^^
|
||||
|
||||
All REPL instances are descendants of :class:`Repl`. New integrations can
|
||||
either provide their own class, or use one of the base classes that ship with
|
||||
SublimeREPL:
|
||||
|
||||
* Class :class:`SubprocessRepl` for subprocess-based REPLs. The process
|
||||
running in the REPL is a subprocess of the editor. The input and output of
|
||||
the process is connected to the output and the input of the REPL
|
||||
|
||||
* Class :class:`TelnetRepl`. The process runs outside of the editor,
|
||||
presumably having been spawned externally, and the REPL connects to it over
|
||||
TCP via Python `telnetlib`.
|
||||
|
||||
There are three integrations that provide their own classes:
|
||||
|
||||
* Class :class:`PowershellRepl`. This is only used by PowerShell integration.
|
||||
* Class :class:`ExecnetRepl`. This is only used by Execnet Python integration
|
||||
* Class :class:`SublimePythonRepl`. A REPL over SublimeText's internal Python interpreter.
|
||||
|
||||
All these can be found in the plugin's `repl/` subdirectory.
|
||||
|
||||
A REPL class is expected to provide a standard interface for SublimeREPL integration:
|
||||
|
||||
.. py:method:: read_bytes()
|
||||
|
||||
Read and return some bytes from REPL's incoming stream, blocking as
|
||||
necessary. :class:`ReplManager` will set up a separate thread with a
|
||||
:class:`ReplReader` pump that keeps polling this method.
|
||||
|
||||
.. py:method:: write_bytes(bytes)
|
||||
|
||||
Write some bytes to REPL's outgoing stream. User input in the REPL view's
|
||||
command line will be delivered here.
|
||||
|
||||
REPL initialization sequence
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
* User interaction causes the execution of `repl_open` command. Its arguments are usually taken
|
||||
from a menu configuration file.
|
||||
* The open() method of ReplManager is called, where a Repl instance and a ReplView instance get created
|
||||
* Within the ReplView constructor, the read and write loops get started. The REPL is now alive.
|
||||
|
||||
REPL manager
|
||||
^^^^^^^^^^^^
|
||||
|
||||
Class :class:`ReplManager` is responsible for managing REPL instances
|
||||
(subclasses of :class:`Repl`). It initializes new REPLs by:
|
||||
|
||||
* Creating REPL instances
|
||||
* Providing an instance of the Sublime view associated with the REPL by reusing an existing one, or creating a new one
|
||||
* Creating and remembering a named :class:`ReplView` instance that couples between the two.
|
||||
|
||||
REPL views
|
||||
^^^^^^^^^^
|
||||
|
||||
A :class:`ReplView` instance is a coupling between a REPL instance and a
|
||||
Sublime view. Its main responsibility is to create Sublime views and maintain
|
||||
the loops that read from, and write to, the REPL.
|
||||
|
||||
* The incoming data *from* the REPL is read in a separate thread using
|
||||
:class:`ReplReader`, because read operations are assumed to be blocking
|
||||
* The outgoing data is written into the REPL by ReplView's method
|
||||
py:method:`update_view_loop`. This method is called by ReplView's constructor
|
||||
at the very end and, as long as the associated REPL object is alive, will reschedule
|
||||
itself with Sublime's py:method:`set_timeout`.
|
||||
|
||||
190
Packages/SublimeREPL/doc/make.bat
Normal file
190
Packages/SublimeREPL/doc/make.bat
Normal file
@@ -0,0 +1,190 @@
|
||||
@ECHO OFF
|
||||
|
||||
REM Command file for Sphinx documentation
|
||||
|
||||
if "%SPHINXBUILD%" == "" (
|
||||
set SPHINXBUILD=sphinx-build
|
||||
)
|
||||
set BUILDDIR=_build
|
||||
set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
|
||||
set I18NSPHINXOPTS=%SPHINXOPTS% .
|
||||
if NOT "%PAPER%" == "" (
|
||||
set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
|
||||
set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS%
|
||||
)
|
||||
|
||||
if "%1" == "" goto help
|
||||
|
||||
if "%1" == "help" (
|
||||
:help
|
||||
echo.Please use `make ^<target^>` where ^<target^> is one of
|
||||
echo. html to make standalone HTML files
|
||||
echo. dirhtml to make HTML files named index.html in directories
|
||||
echo. singlehtml to make a single large HTML file
|
||||
echo. pickle to make pickle files
|
||||
echo. json to make JSON files
|
||||
echo. htmlhelp to make HTML files and a HTML help project
|
||||
echo. qthelp to make HTML files and a qthelp project
|
||||
echo. devhelp to make HTML files and a Devhelp project
|
||||
echo. epub to make an epub
|
||||
echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter
|
||||
echo. text to make text files
|
||||
echo. man to make manual pages
|
||||
echo. texinfo to make Texinfo files
|
||||
echo. gettext to make PO message catalogs
|
||||
echo. changes to make an overview over all changed/added/deprecated items
|
||||
echo. linkcheck to check all external links for integrity
|
||||
echo. doctest to run all doctests embedded in the documentation if enabled
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "clean" (
|
||||
for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
|
||||
del /q /s %BUILDDIR%\*
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "html" (
|
||||
%SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The HTML pages are in %BUILDDIR%/html.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "dirhtml" (
|
||||
%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "singlehtml" (
|
||||
%SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "pickle" (
|
||||
%SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished; now you can process the pickle files.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "json" (
|
||||
%SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished; now you can process the JSON files.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "htmlhelp" (
|
||||
%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished; now you can run HTML Help Workshop with the ^
|
||||
.hhp project file in %BUILDDIR%/htmlhelp.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "qthelp" (
|
||||
%SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished; now you can run "qcollectiongenerator" with the ^
|
||||
.qhcp project file in %BUILDDIR%/qthelp, like this:
|
||||
echo.^> qcollectiongenerator %BUILDDIR%\qthelp\SublimeREPL.qhcp
|
||||
echo.To view the help file:
|
||||
echo.^> assistant -collectionFile %BUILDDIR%\qthelp\SublimeREPL.ghc
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "devhelp" (
|
||||
%SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "epub" (
|
||||
%SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The epub file is in %BUILDDIR%/epub.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "latex" (
|
||||
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "text" (
|
||||
%SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The text files are in %BUILDDIR%/text.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "man" (
|
||||
%SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The manual pages are in %BUILDDIR%/man.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "texinfo" (
|
||||
%SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "gettext" (
|
||||
%SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The message catalogs are in %BUILDDIR%/locale.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "changes" (
|
||||
%SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.The overview file is in %BUILDDIR%/changes.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "linkcheck" (
|
||||
%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Link check complete; look for any errors in the above output ^
|
||||
or in %BUILDDIR%/linkcheck/output.txt.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "doctest" (
|
||||
%SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Testing of doctests in the sources finished, look at the ^
|
||||
results in %BUILDDIR%/doctest/output.txt.
|
||||
goto end
|
||||
)
|
||||
|
||||
:end
|
||||
Reference in New Issue
Block a user