Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ajstrand/slap
Sublime-like terminal-based text editor
https://github.com/ajstrand/slap
Last synced: 4 months ago
JSON representation
Sublime-like terminal-based text editor
- Host: GitHub
- URL: https://github.com/ajstrand/slap
- Owner: ajstrand
- License: mit
- Fork: true (cancerberoSgx/slap)
- Created: 2022-02-11T03:22:58.000Z (about 3 years ago)
- Default Branch: safe-update-es6-path
- Last Pushed: 2022-09-23T04:22:20.000Z (over 2 years ago)
- Last Synced: 2024-08-01T13:33:57.439Z (7 months ago)
- Language: JavaScript
- Homepage:
- Size: 1.62 MB
- Stars: 11
- Watchers: 5
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# The branch *safe update es6 path* is currently the *stable* branch.
## Main had accumulated too many changes and wasnt working right.
### Path forward should probably be moving to mono-repo, so changes are easier### The original author passed away in 2018, so various folks have forked the project.
#### AFAIK this is the only fork that works under Node v16.## The version I have running works on a recent linux distro, Pop OS, so it should run on Macs.
### I plan to fully support Windows as well.
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](#default-keybindings)[*](#some-keys-dont-work) (Ctrl+S save, Ctrl+Z undo, etc.)
* copying/pasting with OS clipboard support
* infinite undo/redo
* syntax highlighting for [100+ languages](https://github.com/isagalaev/highlight.js/tree/master/src/languages)
* bracket matching
* autoindentation
* heavily customizeable via [plugins](#plugins)
* ... many other features that will make you leave nano, vim, and emacs behindInstallation
------------//TODO: create new install info
Usage
-----$ slap fish.c
$ slap fish1.c fish2.c
$ slap redfish/ # open dir
$ slap # new file### Default keybindings
* **Quit**: Ctrl+Q
* **Movement**: mouse or arrow keys and PageUp/Down/Home/End
* Shift or click+drag to select, Ctrl/Alt to move faster
* **Save**: Ctrl+S
* **Undo**: Ctrl+Z, **redo**: Ctrl+Y
* **List open tabs**: Ctrl+L
* **Next/previous tab**: Ctrl+Alt+PageUp/Down
* **Close tab**: Ctrl+W
* **Find**: Ctrl+F
* **Go to line**: Ctrl+G
* **Go to matching bracket**: Ctrl+]
* **Open**: Ctrl+O (or click the filebrowser)
* **New file**: Ctrl+N### Configuration
slap supports INI or JSON config files. You can put configuration [wherever rc can find it](https://github.com/dominictarr/rc#standards).
A mostly empty configuration file with some useful comments is created in [`~/.slap/config`](default-config.ini)
if an existing file isn't found.Pass configuration 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](https://github.com/slap-editor/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](https://github.com/slap-editor/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](https://github.com/joyent/node/issues/6459).[Issues](../../issues/new)
--------### Some keys don't work!
*NOTE: if you are using Terminal.app, see [slap-Terminal.app-profile](https://github.com/slap-editor/slap-Terminal.app-profile).*
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](../../issues/new)!### Slow on single cores, Raspberry Pi
slap is based on Github's [atom/text-buffer](https://github.com/atom/text-buffer),
and as such should be very performant, even with very large files.Try `--editor.highlight false` or adding the following to `~/.slap/config`:
[editor]
highlight = falseIf that doesn't improve performance, please run with `--perf.profile true` and
[submit an issue](../../issues/new) with the newly-created `v8.log` file.