Giter Site home page Giter Site logo

fiflo's Introduction

fiflo

Edit a text on Linux using Windows keyboard shortcuts.

image

Abstract

Learn C. Create a text editor for Linux without any dependencies. Started as the C pointers and memory management exercise. The goal is to create an editor that mixes the Atom's rich functionality and Windows-like keyboard bindings with the Nano's minimalism.

Features

  • Windows-like keyboard shortcuts,
  • terminal-based,
  • up to 4 files simultaneous editing,
  • tabs/spaces recognition/selection,
  • syntax highlighting,
  • Git branch display,
  • punched card, that inverts the e.g. 80th char color,
  • easily configurable,
  • dependency-free compilation.

Usage

Check the requirements for the GNU/Linux:

  • git,
  • make,
  • gcc >= 4.9 or clang >= 3.6,
  • gzip (only for the installation),
  • sudo (only for the installation, for Debian as root too).

It's also recommended to use a modern terminal emulator to avoid blinking.

Clone on a desktop, compile from source and run

git clone https://gitlab.com/mattmaniak/fiflo.git &&
cd fiflo &&
make &&
bin/fiflo

Install

sudo make install

Then use it directly from a disk...

fiflo

or better, read the manual...

man fiflo

and it's configuration guide.

man fiflorc

Optional cleanup - remove bin/ and obj/ directories after a compilation

make clean

Uninstall

sudo make uninstall

Development

Read the "CONTRIBUTING.md" and check the "doc/" directory. The planning is done spontaneously so differences between commits may be big due the experiments.

Source files (submodules):

  • args - passed command-line arguments handling,

  • v_file - an implementation of the virtual file structure.

  • keys - stuff that happens after click,

  • config - configuration file parser and values setter,

  • edit - more complex text editing operations that happens after the keypress,

  • extension - file extension recognition,

  • fiflo - the main file, just "main" and the execution loop,

  • file_io - read/save the file, filename live editing,

  • filename - pathname, basename setting from an arg,

  • input - get the key and parse it,

  • memory - real-time automatic memory management for the text buffer,

  • modes - possible states of the editor, e.g. lower bar expanded,

  • options - "--help" and friends parameters,

  • punched_card - vertical line (sometimes called wrap guide) implementation.

  • print - various magic that prints the text,

  • syntax - syntax highlighting,

  • ui - user interface components like bars,

  • window - window rendering and flushing.

Tools required for a debugging:

  • AddressSanitizer (included in gcc and clang),
  • gcov,
  • valgrind.

Checkout the develop branch for new, unstable features.

git clone https://gitlab.com/mattmaniak/fiflo.git -b develop &&
git checkout develop

Debugging

Link the AddressSanitizer and add support for the gcov (code coverage checker). Causes slowdown and huge memory usage.

make debug

After that and the fiflo execution, there is possibility to check the code coverage. It will create the cov/ dir and put the every source file with codecov marked after the previous execution The program must be compiled using the "debug" option previously. Possible only with the gcc.

make coverage

Use the valgrind.

valgrind -v ./fiflo [optional arg(s) for the editor]

Remark: fiflo must be compiled without ASan and MSan.

Install only the binary with AddressSanitizer linked for debugging.

sudo make install_debug

FAQ

Will you port it to the Windows?

  • No.

fiflo's People

Contributors

mattmaniak avatar

Stargazers

 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.