Giter Site home page Giter Site logo

modulexcite / suplemon Goto Github PK

View Code? Open in Web Editor NEW

This project forked from richrd/suplemon

0.0 1.0 0.0 621 KB

Console text editor with multi cursor support. Suplemon replicates Sublime Text like functionality in the terminal. Try it out, give feedback, fork it!

License: MIT License

Shell 0.60% Python 99.40%

suplemon's Introduction

Suplemon ๐Ÿ‹

Build Status Join the chat at https://gitter.im/richrd/suplemon

      ___________   _________  ___     ______________________________   ___
     /  _____/  /  /  /  _   \/  /\   /  ______/        /  ___   /   | /  /\
    /  /____/  /  /  /  /_/  /  / /  /  /_____/  /  /  /  /  /  /    |/  / /
   /____   /  /  /  /  _____/  / /  /  ______/  /  /  /  /  /  /  /|    / /
  _____/  /  /__/  /  /\___/  /____/  /_____/  /  /  /  /__/  /  / |   / /
 /_______/\_______/__/ /  /_______/________/__/__/__/________/__/ /|__/ /
 \_______\ \______\__\/   \_______\________\__\__\__\________\__\/ \__\/

          Remedying the pain of command line editing since 2014

Suplemon is a modern, powerful and intuitive console text editor with multi cursor support. Suplemon replicates Sublime Text style functionality in the terminal with the ease of use of Nano. http://github.com/richrd/suplemon

Suplemon in action

Try it!

You can just clone the repo, and try Suplemon, or also install it system wide.

git clone https://github.com/richrd/suplemon.git
cd suplemon
python3 suplemon.py

Installation

Install the latest version from PIP:

sudo pip3 install suplemon

To install Suplemon from the repo run the setup script:

sudo python3 setup.py install

Notes

  • Must use Python 3.3 or higher for proper character encoding support.
  • Python2.7 (and maybe lower) versions work, but aren't officially supported (some special characters won't work etc).
  • The master branch is considered stable.
  • Tested on Unix.

Dev Branch Status: Build Status

No dependencies outside the Python Standard Library required.

Optional dependencies

  • Pygments

For support for syntax highlighting over 300 languages.

  • Flake8

For showing linting for Python files.

  • xsel

For system clipboard support on X Window (Linux).

See docs/optional-dependencies.md for installation instructions.

Usage

suplemon # New file in the current directory
suplemon [filename]... # Open one or more files

Description

Suplemon is an intuitive command line text editor. It supports multiple cursors out of the box. It is as easy as nano, and has much of the power of Sublime Text. It also supports extensions to allow all kinds of customizations. To get more help hit Ctrl + H in the editor. Suplemon is licensed under the MIT license.

Features

  • Terminal text editing with style
  • Proper multi cursor editing, Sublime Text style.
  • Syntax highlighting
  • Autocomplete
  • Easy Undo/Redo
  • Copy & Paste, with multi line support (and native clipboard support on X11 / Unix)
  • Multiple files in tabs
  • Powerful Go To feature for jumping to files and lines
  • Find and Find next
  • Custom keyboard shortcuts
  • Mouse support
  • Extensions (easy to write your own)
  • Lots more...

Goals

  1. Create a command line text editor with built in multi cursor support. It's awesome!
  2. Usability should be even better and easier than nano. It's on par with desktop editors.
  3. Multi cursor should be comparable to Sublime Text.
  4. Develop Suplemon with Suplemon!!! I've used Suplemon for a long time as my main editor (replacing ST and nano) for all developement, Git commits and everything else.

Configuration

Main Config

The suplemon config file is stored at ~/.config/suplemon/suplemon-config.json.

The best way to edit it is to run the config command (Run commands via Ctrl+E). That way Suplemon will automatically reload the configuration when you save the file. To view the default configuration and see what options are available run config defaults via Ctrl+E.

Keymap Config

Below are the default key mappings used in suplemon. They can be edited by running the keymap command. To view the default keymap file run keymap default

  • Ctrl + Q

    Exit

  • Ctrl + C

    Copy line(s) to buffer

  • Ctrl + X

    Cut line(s) to buffer

  • Ctrl + V

    Insert buffer

  • Ctrl + K

    Duplicate line

  • Ctrl + G

    Go to line number or file (type the beginning of a filename to switch to it). You can also use 'filena:42' to go to line 42 in filename.py etc.

  • Ctrl + F

    Search for a string or regular expression (configurable)

  • Ctrl + D

    Search for next occurrence or find the word the cursor is on. Adds a new cursor at each new occurrence.

  • Alt + Arrow Key

    Add new cursor in arrow direction

  • Ctrl + Left / Right

    Jump to previous or next word or line

  • ESC

    Revert to a single cursor / Cancel input prompt

  • Alt + Page Up

    Move line(s) up

  • Alt + Page Down

    Move line(s) down

  • Ctrl + S

    Save current file

  • F1

    Save file with new name

  • F2

    Reload current file

  • Ctrl + O

    Open file

  • Ctrl + W

    Close file

  • Ctrl + Page Up

    Switch to next file

  • Ctrl + Page Down

    Switch to previous file

  • Ctrl + E

    Run a command.

  • Ctrl + Z and F5

    Undo

  • Ctrl + Y and F6

    Redo

  • F7

    Toggle visible whitespace

  • F8

    Toggle mouse mode

  • F9

    Toggle line numbers

  • F11

    Toggle full screen

Mouse shortcuts

  • Left Click

    Set cursor at mouse position. Reverts to a single cursor.

  • Right Click

    Add a cursor at mouse position.

  • Scroll Wheel Up / Down

    Scroll up & down.

Support

If you experience problems, please submit a new issue. If you have a question, need help, or just want to chat head over to the IRC channel #suplemon @ Freenode. I'll be happy to chat with you, see you there!

Development

If you are interested in contributing to Suplemon, development dependencies can be installed via:

# For OS cleanliness, we recommend using `virtualenv` to prevent global contamination
pip install -r requirements-dev.txt

After those are installed, tests can be run via:

./test.sh

PRs are very welcome and appreciated. When making PRs make sure to set the target branch to dev. I only push to master when releasing new versions.

Todo

  • Design proper API for plugins/extensions/macros
  • Documentation for v 1.0.0

Wishlist (Stuff that would be nice, but not planning to do yet. Maybe for 2.0.0)

  • Core
    • Setting for enabling/disabling undo for cursor changes
    • Selections
    • List of recent files
    • Optionally Remember cursor positions in files (and restore when opened again)
    • Read only viewer
      • And disable editing Don't disable editing. Instead enable save as.
  • Extensions:
    • Peer to peer colaborative editing. Could be implemented as an extension.
    • Auto backup. Activate on n changes or every n seconds
    • File selector, kind of like what nano has
      • This should be implemented as an extension
      • Could be triggered with a key binding (and/or override open file)
      • Need to refactor App class to support views instead of just files
      • A view could be an editor or an extension ui
      • Extensions should be able to control both status bars and key legend

Rationale

For many the command line is a different environment for text editing. Most coders are familiar with GUI text editors and for many vi and emacs have a too steep learning curve. For them (like for me) nano was the weapon of choice. But nano feels clunky and it has its limitations. That's why I wrote my own editor with built in multi cursor support to fix the situation. Another reason is that developing Suplemon is simply fun to do.

suplemon's People

Contributors

gnewbee avatar richrd avatar severin31 avatar trylle avatar twolfson avatar

Watchers

 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.