ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

lispindent

by odyssomay ST2/ST3

sublime-lispindent is a plugin for sublime text 2/3 that properly indents lisp code.

Details

  • 2014.07.19.20.27.05
  • github.​com
  • github.​com
  • 3 years ago
  • 2 hours ago
  • 5 years ago

Installs

  • Total 12K
  • Win 4K
  • OS X 6K
  • Linux 3K
Oct 19 Oct 18 Oct 17 Oct 16 Oct 15 Oct 14 Oct 13 Oct 12 Oct 11 Oct 10 Oct 9 Oct 8 Oct 7 Oct 6 Oct 5 Oct 4 Oct 3 Oct 2 Oct 1 Sep 30 Sep 29 Sep 28 Sep 27 Sep 26 Sep 25 Sep 24 Sep 23 Sep 22 Sep 21 Sep 20 Sep 19 Sep 18 Sep 17 Sep 16 Sep 15 Sep 14 Sep 13 Sep 12 Sep 11 Sep 10 Sep 9 Sep 8 Sep 7 Sep 6 Sep 5 Sep 4
Windows 3 1 3 0 1 3 1 1 2 1 0 2 1 0 2 2 1 4 1 0 3 4 2 3 1 2 3 2 8 3 21 23 3 4 3 0 4 0 2 0 2 1 3 3 1 1
OS X 0 0 2 5 1 1 5 5 1 2 2 1 3 2 2 0 7 2 2 2 2 1 3 3 1 4 3 3 5 4 4 0 0 2 5 9 4 2 0 4 1 1 3 3 3 6
Linux 0 3 0 2 1 3 3 2 1 3 1 0 2 6 4 2 5 3 1 0 1 0 2 6 1 2 3 2 1 7 1 4 4 8 2 2 1 2 0 0 0 1 1 0 1 0

Readme

Source
raw.​githubusercontent.​com

sublime-lispindent is a plugin for sublime text 2 that properly indents lisp code.

Installation

With package control (recommended)

Use Sublime Package Control, the package is called lispindent.

Manually

  1. Clone the repository or download the zipfile.
  2. The resulting folder - either from cloning or unzipping - should be moved to Installed Packages inside your data folder.

The location of the data folder varies between systems:

  • Linux - ~/.config/sublime-text-2
  • OSX - ~/Library/Application Support/Sublime Text 2
  • Windows - %APPDATA%\Sublime Text 2

Supported languages

clojure.clj, .cljs, .edn
common lisp.lsp, .lisp
hy.hy
racket.rkt, .rktd, .rktl
scheme.ss, .scm, .sch

If your language is not one of the above, open an issue or contact me to get it included.

You can also add your own language or change the existing configurations in the menu Preferences->Package Settings->Lispindent->Settings.

For a minimal configuration that should work fine for most languages, I recommend the following:

"<language-name>": {
    "detect": ".*\\.(<file-endings>)$",
    "default_indent": "two_space",
    "regex": "$"
}

Replace <language-name> with the name of your language. It does not matter what you write here, as long as it is distinct from the other languages.

Replace <file-endings> with the possible file endings for your language. Note: without the dot! Delimit endings with |. Example: lsp|lisp for common lisp.

Key bindings

enter Insert a new line with indentation
ctrl+i or
cmd+i (osx)
Indent selected lines (or the current line, if there is no selection).

To change key bindings, open the menu Preferences->Package Settings->Lispindent. Select Key Bindings – Default for windows/linux, or Key Bindings – OSX for mac.

License

sublime-lispindent is licensed under the zlib license:


Copyright © 2012 Jonathan Fischer Friberg

This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.

Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

  2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

  3. This notice may not be removed or altered from any source distribution.