Giter Site home page Giter Site logo

med's Introduction

med - text editor

med is a minimal ncurses based text editor written in C++.

Philosophy

Before I created a simple text editor called hacked in Scheme (Lisp). This is essentially a more minimalistic version of the same but written in C++.

This editor contains minimal functionality currently and is only suitable for some quick-n-dirty editing of small files in the terminal. It could be used as a replacement for nano or vim for example, but only if you are comfortable with the ASCII character set.

On the other hand, it is very lightweight and should run well on older systems with limited resources. The executable is currently only around 50 KiB when compiled on my machine.

Compiling

Make sure you have a standard build environment installed to compile C++ programs (GCC, Make, and so on). The only external dependency is ncurses (the ncurses.h header file).

Simply type make to compile it. Then copy the resulting binary med into some directory that is in your $PATH (for example: ~/bin).

Usage

Type med followed by filenames to run it:

$ med readme.txt other.txt

Keys

The default keybindings are set according to my own personal preferences. Any other user is encouraged to change the keybindings to their own preferences in key.cpp before compiling. A description of my default keys follows.

The editor has two modes, similar to vim: command mode and edit mode. Use f to enter edit mode and Alt-j to enter command mode.

Use n and p to switch to next and previous buffer respectively in command mode.

Use i, j, k and l to move around in command mode. When combined with Alt, they move one word or paragraph at a time. Use v to scroll down and Alt-v to scroll up. Use r to scroll the current line in the middle of the screen. Use a and e to move to the beginning and end of current line respectively. When combined with Alt, a and e move to the beginning and end of the whole file. Use b to move to the first character after indentation.

Use d and h to delete characters forward and backward respectively. Combine them with Alt to delete a whole word. Use t to delete the whole line starting from the cursor position.

Use q to exit the editor. If any of the buffers have been modified, it will ask if you want to save changes.

License

MIT

med's People

Contributors

peklaiho 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.