Giter Site home page Giter Site logo

slap's Introduction

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
$ 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
  • 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. A mostly empty configuration file with some useful comments is created in ~/.slap/config 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. 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.

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!

Slow on single cores, Raspberry Pi

slap is based on Github's 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 = false

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

slap's People

Contributors

dbkaplun avatar greenkeeperio-bot avatar blackwolf12333 avatar xenuser avatar subnomo avatar infernozeus avatar jelmerdemaat avatar m1so avatar

Stargazers

Michael Anthony avatar

Watchers

Michael Anthony avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.