Giter VIP home page Giter VIP logo

getan's Introduction

Getan - a modern text editor

Project state: HEAVY DEVELOPMENT (core architecture is -almost- done)

  1. What is this?

Getan is a modern text editor for programmers. With the main goals of being fast, lightweight and highly customizable, this text editor was made to appeal both new and old programmers around the world. The main inspiration is the superb ViM text editor, but I took some inspirations from other text editors like Sublime Text Editor and (even) Emacs.

getan (/ɡəˈtaːn/) - ppart. tun.
tun (/tuːn/) - tut, tat, hat getan
    I v/t
      1. to do;
      2. eine Äußerung tun: make a remark;
      ...
      (http://www.wordreference.com/deen/tun)

So, getan is (almost) German for done; to get something done. ;-)

  1. Why?

You may ask yourself: why creating another text editor? See, NONE of them completely satisfy me as a programmer. The one that I use regularly is Vim; but Vim is only a layer upon Vi, that is a layer upon Ex. It's too much abstractions, creating a kind of slow environment. Start using more plugins (at least 5) and you will know what I'm talking about. Besides, I think VimScript is slow and a bit counter intuitive. In other hand, Vim has a lot of power tools to make coding a lot fast!
Emacs does not need more plugins to be slow (at least in the startup): it's slow from the very beginning. But, the same way as Vim, it has a lot of tools to make coding something fun. The LaTeX integration is great and I don't know better software kit to develop LISP than SLIME.
Sublime Text is fine; it has only one problem: it's NOT FOSS (Free Open Source Software)!
There's Atom, from GitHub group. But there's at least 2 peculiarities with it: it aims on web developers and depends on Node.js. That's not bad at all, but I don't need Node.js support if I write most of my code in C!
I think I can't even talk about NetBeans or Eclipse. They have a polluted UI and don't even think on running them on an older PC.
Who uses Anjuta nowadays? I don't know. It has an interesting interface... But there isn't any "terminal" mode!
So, for a more comfortable development environment, lightweight and fast, to really get things DONE, I'm creating my own text editor.

  1. Project Goals

These are things we NEED to keep in mind every time we develop a new feature on Getan:

  • Lightweight and fast (run even on older PC's);
  • Highly customization (we can be fancy too!);
  • Run both in terminal mode or with a GUI;
  • Support true colors (24 bits) even on terminal;
  • Be portable (run on Windows, Linux or MacOS X);
  • Carefully organized keyboard shortcuts;
  • Better organized CODE;
  • Easy to hack on to.
  1. Dependencies

For now, these are the project dependencies:

  • ncurses;
  • wxWidgets (for the graphical interface) [future];
  • Lua 5.2 and liblua5.2-dev (to run plugins) [future].
  1. A bit about coding style

This is a small project and (at this time) has only one developer: me. But I hope that someday there will be a lot more developers and enthusiastics. So let's talk a little bit about coding standards. In fact, I just make use of the Kernel coding style as presented here: https://www.kernel.org/doc/Documentation/CodingStyle

I have only added one thing to the standard. Instead of declaring:

if (conditional) {
    ...
}

I prefer to declare this way:

if ( conditional ) {
    ...
}

Note the spaces inside the parenthesis. At least for me, it makes more clear the conditionals inside the parenthesis. So, if I have more than one conditional in the 'if' statement, I can easily see all of them and where they finish:

if ( (conditional1) || (conditional2) ) {
    ...
}

This rule applies also to switch-case, while and for statements.

Oh! And, by the way, DON'T YOU EVER, EVER use TABs! As a friend of mine used to say, TABs are evil! Indenting is done with 4 SPACEs! The Kernel coding style establishes TABs 8 characters long to indent code. I'm Ok with that, but if you try to keep your code aligned in the maximum of 80 characters, the 80th column can change depending on your indenting level. One thing that is said in the Kernel coding style applies here also: if you need more than 3 indenting levels, you should really consider refactoring your code.

That's it! Now you are able to contribute to my project. ;-)

  1. High-level code organization

  +-----------+    +-----------+
  | Graphical |    |  Terminal |
  | Interface |    | Interface |
  +-----------+    +-----------+
        |                |
        +----------------+
            |        |
            |        V
            |   +----------+
            |   |  Plugin  |
            |   |   Core   |
            |   +----------+
            |        |
            V        V
+-------------------------------+
|        Getan API Core         |
|  +------------+------------+  |
|  |   Editor   |  Shortcut  |  |
|  |  Commands  |  Wrapper   |  |
|  +------------+------------+  |
|  |   Buffers  |    Files   |  |
|  |            |            |  |
|  +------------+------------+  |
+-------------------------------+

getan's People

Contributors

bgarber avatar

Stargazers

 avatar Kevin Pho avatar Ethan Chan avatar Augustinas K avatar Camille Scholtz avatar Nicolas Bases avatar Tanami avatar  avatar

Watchers

Tanami avatar James Cloos avatar  avatar Camille Scholtz avatar Marian Dziubiak avatar

getan's Issues

Finish file buffers

  • Read file chars with mmap();
  • Get file info from "struct stat", from libc;
  • !! Research strategy to save memory when viewing large files. !!

Editor CLI

Create the buffer and the commands for the editor's CLI.

Status Line

Add a status line below (or above) the panel to display info about the file being currently edited.

Improve on line reading

The functions for reading lines from the char buffer created by mmap seems sub-optimal and bug-prone.

Valgrind accuses this file of 6663 errors, so I have to fix it:

==31464== 1 errors in context 1 of 4:
==31464== Syscall param munmap(length) contains uninitialised byte(s)
==31464== at 0x556CAF7: munmap (syscall-template.S:81)
==31464== by 0x401C66: file_read (file.c:144)
==31464== by 0x401DD2: buffer_data_setup (buffer_data.c:52)
==31464== by 0x40147B: create_buffers (main.c:79)
==31464== by 0x40189A: main (main.c:247)
==31464==
==31464==
==31464== 1 errors in context 2 of 4:
==31464== Syscall param mmap(length) contains uninitialised byte(s)
==31464== at 0x556CACA: mmap (syscall-template.S:81)
==31464== by 0x401AFA: file_read (file.c:107)
==31464== by 0x401DD2: buffer_data_setup (buffer_data.c:52)
==31464== by 0x40147B: create_buffers (main.c:79)
==31464== by 0x40189A: main (main.c:247)
==31464==
==31464==
==31464== 80 errors in context 3 of 4:
==31464== Conditional jump or move depends on uninitialised value(s)
==31464== at 0x4019DA: readln (file.c:45)
==31464== by 0x401B46: file_read (file.c:118)
==31464== by 0x401DD2: buffer_data_setup (buffer_data.c:52)
==31464== by 0x40147B: create_buffers (main.c:79)
==31464== by 0x40189A: main (main.c:247)
==31464==
==31464==
==31464== 6581 errors in context 4 of 4:
==31464== Conditional jump or move depends on uninitialised value(s)
==31464== at 0x4019DA: readln (file.c:45)
==31464== by 0x401C3B: file_read (file.c:139)
==31464== by 0x401DD2: buffer_data_setup (buffer_data.c:52)
==31464== by 0x40147B: create_buffers (main.c:79)
==31464== by 0x40189A: main (main.c:247)
==31464==
==31464== ERROR SUMMARY: 6663 errors from 4 contexts (suppressed: 0 from 0)

Large files feature

There's a known problem with Vim while opening large files. The problem is that the entire file is stored in memory, the same way I'm doing now (sort of). Getan needs to fix this, and be optimized to edit large files with (almost) the same efficiency of editing "small" ones.

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.