A guide for using Sublime Text for project development.
Sublime Text is a free text editor for code, markup, and prose and is available for use on Linux, MacOS, and Windows.
Pre-built binaries are available for download on the Sublime Text homepage. We recommend installing Sublime Text 3.
To use Sublime Text as a command-line utility, you may need to create a symbolic link to the Sublime Text command-line tool. For example, on MacOS, assuming that Sublime Text is installed in the applications folder,
$ ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl
To test the command-line utility,
$ subl --help
To open a project in Sublime Text,
$ cd ./path/to/project
$ subl .
Included in this directory are snippets and completions for automating various boilerplate tasks. To install them, determine the location where Sublime Text packages are installed. For example, on MacOS,
/Users/<user>/Library/Application Support/Sublime Text 3/Packages
where <user>
is your user name. Navigate to the package installation folder,
$ cd ./path/to/package/installation/folder
and create a stdlib
directory
$ mkdir stdlib
Copy the completions/*.sublime-completions
and snippets/*.sublime-snippet
files to the newly created directory such that all files reside within the top-level stdlib
directory (i.e., do not copy over the completions
and snippets
folders). Once copied to the directory, Sublime Text will automatically install them for use within the editor.
-
Package Control: package manager which helps in finding, installing, and keeping installed packages up-to-date. This should be installed prior to installing any of the packages subsequently listed here.
-
EditorConfig: package for using EditorConfig, which helps define and maintain consistent coding styles between different editors and IDEs.
-
Pretty JSON: package for pretty printing and minifying JSON.
-
Sidebar Enhancements: package which provides enhancements for working with files and folders in the Sublime Text sidebar.
-
UnicodeMath: package for inserting Unicode math and emoji.
-
Julia: package which provides syntax highlighting for Julia.
-
Fortran: package which provides syntax highlighting for Fortran. Once installed, configure Sublime Text to always open files having the file extension
*.f
asFortran (modern)
. -
TypeScript: package which provides an IO wrapper around TypeScript language services.
-
MarkdownEditing: package which provides syntax highlighting (including for fenced code blocks) and editing features for Markdown. Once installed, configure the package settings as follows:
{ "extensions": [ "md" ], "mde.match_header_hashes": false, "mde.list_indent_auto_switch_bullet": true, "mde.list_indent_bullets": ["-", "-", "-"], "mde.auto_increment_ordered_list_number": true, "mde.keep_centered": false, "mde.lint": { "disable": [ "md013" ], "md003": "atx", "md004": "-", "md007": 0, "md013": 0, "md026": ".,;:!?", "md029": "any", "md030": { "ul_single": 2, "ol_single": 2, "ul_multi": 2, "ol_multi": 2 } }, }
-
SublimeLinter3: package which provides an interactive linting framework for Sublime Text 3. The framework does not contain any built-in linters. Instead, you must install plugins which provide interfaces to lint executables.
-
SublimeLinter-eslint: plugin which provides an interface to ESLint. Once installed, you need to configure SublimeLinter3 to use the project ESLint configuration files and to set the
NODE_PATH
environment variable upon invoking ESLint:... "linters": { "eslint": { "@disable": false, "args": [ "--ignore-path", "/absolute/file/path/to/stdlib/etc/eslint/.eslintignore", "--config", "/absolute/file/path/to/stdlib/.eslintrc.js" ], "excludes": [], "env": { "NODE_PATH": "${folder}/lib/node_modules" } } ...
and to search the top-level
node_modules
directory for locally installed linter executables. For example, on MacOS,... "paths": { "linux": [], "osx": [ "/path/to/stdlib/node_modules/.bin/" ], "windows": [] } ... },
-
SublimeLinter-annotations: plugin which marks annotations such as
TODO
,FIXME
, etc. Once installed, you need to configure SublimeLinter3 to mark project annotations.... "linters": { "annotations": { "@disable": false, "args": [], "errors": [ "FIXME", "HACK" ], "excludes": [], "warnings": [ "NOTE", "OPTIMIZE", "TODO", "WARNING" ] } ...
-
SublimeLinter-json: plugin which lints JSON.
-
SublimeLinter-shellcheck: plugin which provides an interface to shellcheck for linting files having "Shell-Unix-Generic" syntax (aka Shell Script).
If shellcheck was installed as a local project dependency (e.g.,
make install-deps
on non-MacOS platforms per the project development guide), you need to configure SublimeLinter3 to search the top-leveldeps
directory for locally installed linter executables. For example, on Linux,... "paths": { "linux": [ "/path/to/stdlib/deps/build/shellcheck_0_5_0/" ], "osx": [], "windows": [] } ... },
-