Sublime-like terminal-based text editor
Go to file
2015-09-29 21:22:41 -04:00
lib Use lodash.escapeRegExp 2015-07-10 16:02:26 -04:00
misc feat(logo): add logo 2015-09-29 21:22:41 -04:00
spec fix(tests): detach pane on quit instead of child editor 2015-06-26 00:26:57 -04:00
.gitignore Initial commit 2014-04-20 20:39:14 -07:00
.npmignore feat(rep): Featured in Linux Magazine Sept. 2015 issue 👊 2015-08-08 20:55:30 -04:00
.travis.yml fix(support): support Node 4.0.0 2015-09-23 16:27:04 -04:00
default-config.ini fix(config): invalid URL 2015-07-30 16:12:01 -04:00
install.sh Add warning messages and error out if wget/curl available when needed. 2015-07-28 12:08:10 +02:00
LICENSE Initial commit 2014-04-20 20:39:14 -07:00
package.json 0.1.50 2015-09-23 16:28:47 -04:00
README.md style(readme): fix alt text for donate link 2015-08-04 11:22:53 -04:00
screenshot.png feat(readme): update screenshot 2015-08-03 09:36:16 -04:00
slap.ini fix(config): move fullUnicode to [screenOpts] 2015-08-05 09:48:13 -04:00
slap.js fix(cmd): bin/slap.js -> slap.js 2015-06-02 22:14:51 -04:00

Screenshot

slap 👋 Build Status Donate

slap is a Sublime-like terminal-based text editor that strives to make editing from the terminal easier. It has:

  • first-class mouse support (even over an SSH connection)
  • a Sublime-like file sidebar
  • double-click to select word, highlight other occurrences
  • configurable Sublime-like keybindings* (Ctrl+S save, Ctrl+Z undo, etc.)
  • copying/pasting with OS clipboard support
  • infinite undo/redo
  • syntax highlighting for 100+ languages
  • bracket matching
  • autoindentation
  • heavily customizeable via plugins
  • ... many other features that will make you leave nano, vim, and emacs behind

Installation

$ curl -sL https://raw.githubusercontent.com/slap-editor/slap/master/install.sh | sh

If you already have NodeJS installed:

$ sudo npm install -g slap@latest

Usage

$ slap fish.c
$ slap fish1.c fish2.c
$ slap redfish/ # open dir in browser
$ slap # new file in current dir

Configuration

Use ~/.slap/config to override the defaults in slap/slap.ini:

[header.style]
bg = "red"

Alternatively, pass options in via command line:

$ slap --header.style.bg red file.c

Plugins

Slap is fully customizeable and supports plugins written in JS. You can place single JS files, or NodeJS packages, into ~/.slap/plugins/.

To write your own plugin, a good starting point is slap-clipboard-plugin. Please note that plugin packages must have "keywords": ["slap-plugin"] in package.json.

OS support

OSX

iTerm2 supports the mouse and most keybindings out of the box. For optimal Terminal.app usage, see slap-Terminal.app-profile.

Linux

If you are using X.Org, ensure xclip is installed for OS clipboard support.

Windows

Most terminal emulators in Windows do not support mouse events, PuTTY being a notable exception. In Cygwin, slap crashes on startup due to joyent/node#6459.

Issues

Join us in #slap on Freenode for troubleshooting, theme/plugin/core development, or palm strike discussion of any nature.

Some keys don't work!

Unfortunately most terminal emulators do not support certain keystrokes and as such there is no way to handle them. These include C-backspace, S-home/end, and S-pageup/down. Most of these actions have alternate keybindings, inspired by emacs and other editors, but if you find one that doesn't work, please submit an issue!

Too slow!

Try --editor.highlight false or adding the following to ~/.slap/config:

[editor]
highlight = false

If that doesn't improve performance, please run with --perf.profile true and submit an issue with the newly-created v8.log file.