Skip to content

makuke1234/femto

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

femto

Fully Equipped Minimal Text editOr - basically atto on steroids

Release version Total downloads C version Tests wakatime

It is a bigger more feature-rich version of my other console text editor atto. It is also written in vanilla C & Win32 Console API - it's designed to be used solely on Microsoft Windows. It has been compiled with MinGW GCC.

Currently, my other tool slocWin32 reports ~7400 source code lines (excluding whitespace, comments, language keywords & jsonlite2 library):

SLOC

Obtaining

64-bit (x64) Windows binaries can be obtained here.

Features

  • Built-in copy-pasting support
  • All saved files use CRLF line-ending format by default, LF and CR are also supported
    • Editing text files is sublime
  • The femto editor utilizes the whole command prompt window, window is as big as your console currently is
    • As big as you like
  • The last line of the window is dedicated to status, for example showing success or failure when an attempting to save a file
    • You can see exactly what's going on
  • Warns about any unsaved work
    • Never lose your edits again
  • Search support & result highlighting
    • Use F2 & F3 to go backwards or forwards between results
  • Syntax highlighting
    • Every token configurable
    • Configurable color palette
    • Foreground and background
  • Mouse scrolling, also horizontal scrolling
    • Ever used a laptop's touchpad in the terminal properly?
  • Mouse operated text cursor
    • Click anywhere and it just works!
  • Proper tab support, optional tabs-to-spaces, tab width adjustment
    • Tabs are 4 spaces by default
  • Automatic indentation, on by default
    • The single best feature to speed up coding
  • All settings can be given by command line arguments
    • No settings file necessary
  • Optional settings JSON file, can be named either femto.json, femto-settings.json, femto_settings.json or settings.json
    • If multiple files exist with any of the names above, the settings file will be selected following this exact priority
    • Settings file modifies already given arguments only and only if they (settings from file) don't match the defaults
    • Settings file can be also given by command line arguments
  • Multi-file support
  • Optionally "visible" whitespace
    • Never dismiss another 'tab'
    • Configurable color
  • Keyboard shortcuts:
    Key Action
    ESC Exit editor, ask to save any unsaved changes
    Ctrl+Q Same as above
    Shift+ESC Force exit editor
    Ctrl+Shift+Q Same as above
    Ctrl+X Cut
    Ctrl+C Copy
    Ctrl+V Paste
    Ctrl+N Create new blank file
    Ctrl+O Open file
    Ctrl+S Save file
    Ctrl+Shift+S Save file as...
    Ctrl+Tab Switch forwards between open files
    Ctrl+Shift+Tab Switch backwards between open files
    Ctrl+W Close current tab, ask to save any changes
    Ctrl+Shift+W Force close current tab
    Ctrl+R Reload current file, ask to save changes
    Ctrl+Shift+R Force reload current file
    Ctrl+F Find a phrase from cursor forward
    F2 Highlight another phrase backward
    F3 Highlight another phrase forward
    Shift+ARROW Highlight text
    Ctrl+E F Switch to CRLF EOL sequence
    Ctrl+E L Switch to LF EOL sequence
    Ctrl+E C Switch to CR EOL sequence
    Shift+DEL Delete whole line
    Alt+DEL Delete whole line
    PgUp Scroll whole screen-buffer worth of text up
    PgDown Scroll whole screen-buffer worth of text down
    Home Move to the begginning of the line
    End Move to the end of the line
    Alt+Up Move current line up
    Alt+Down Move current line down
  • Ways to start the editor:
    Syntax Action
    femto [options] Starts editor with empty file
    femto [options] [file] Starts editor with the specified file,
    does not have to exist
    where [file] is the file's name
    femto [options] --file=[file] Same as above, just a different syntax
    femto --help Shows help
    help image
    femto --version Shows version info
    version image
  • Command-line options:
    • Basic option syntax:
      • Syntax Description
        --[option] Just selects the flag
        -[option] Same as above
        /[option] Same as above
    • Option arguments (note that the -- before option can be replaced following the pattern in the above table):
      • --[option]=[argument 1],[argument 2],[argument 3]
    • Also note that the number of arguments to be passed is variable, depending on the option
    • There is also an alternate syntax for passing arguments:
      • --[option]=[argument 1];[argument 2];[argument 3]
    • A question mark can also be used as a separator:
      • --[option]=[argument 1]?[argument 2]?[argument 3]
  • Option list:
    • In this table, only a bare minimum of the possible argument strings is written, any argument can contain any number of extra characters at the end for example --h shows help but so does --help or --hasdhhfsdfugsdfgj. Another example would be --set=settings.json, so is valid --setsas_d_j-hdakjgasd123123AAAfjahsdf=settings.json.
    • Option Description
      --h Shows help
      --? Same as above
      --h=[keyword] Shows help according to the specified keyword
      --ver Shows version info
      --f=[file] Specifies file name to open
      [file] Same as above, must be given as the last argument
      --set=[file] Specifies custom settings file explicitly
      --tabsS=[value] Toggles tabs to spaces. Either true/false or 1/0
      --tabsToS=[value] Same as above
      --tabw=[value] Specifies tab width. Any number from 1-32 (inclusive)
      --autoI=[value] Toggles auto-indentation. Either true/false or 1/0
      --aIndent=[value] Same as above
      --whitespaceVis=[value] Whitespace visibility. Either true/false or 1/0
      --wsVis=[value] Same as above
      --vis=[value] Same as above
      --whitespaceCh=[value] Specifies "visible" whitespace character to be used
      --wsCh=[value] Same as above
      --whitespaceCol=[value] Specifies whitespace color, number between 0-255
      --wsCol=[value] Same as above
      --lineNumRel=[value] Toggles relative line numbers. Either true/false or 1/0
      --lineNumCol=[value] Specifies line number color, number between 0-255
      --log=[value] Toggles loggin mode. Either true/false or 1/0
  • List of settings:
    Setting Type
    tabsToSpaces boolean
    tabWidth number
    autoIndent boolean
    whitespaceVisible boolean
    whitespaceCh string
    whitespaceColor number
    lineNumRelative boolean
    lineNumColor number
    logging boolean
    palette object
    highlighting object

Have a look at the provided settings file to get a better understanding of the different settings.

Screenshots

Unicode support, CRLF end-of-line sequences

Unicode Support

Last key shown on status bar with respective repeat count

Key frequency

Saving was successful, file size is now 151 bytes

Saving success

Syntax highlighting, solarized theme, included in settings.json

C

C syntax

C++

C++ syntax

Rust

Rust syntax

Go (Golang)

Go syntax

ECMAScript (JavaScript)

JS syntax

Python

PY syntax

Markdown

MD syntax

XML

XML syntax

HTML

HTML syntax

JSON

JSON syntax

CSS

CSS syntax

Changelog

  • 2.3 (planned)

    • More advanced program help, supports keywords
    • Version info
    • Lets to move between multiple search results on the same line
    • Shows more information about search result in the status
    • Actually displays correct line number on mouse clicks
    • Shows current line & column when typing/moving cursor around
    • Shows current tab number and number of tabs on the title bar
    • Correct relative line number rendering
    • Advanced theming support, load themes from separate files
    • Advanced undo/redo, choose which way to redo
  • 2.2.1

    • Fix bug that tabs' system doesn't work
    • Dropped 32-bit (x86) support, you can still compile it yourself :)
  • 2.2

    • Fix bug that editor sometimes crashes on Shift+Tab
    • Document winarr structure implementation & enforce restrict pointers
    • Add logging mode as a command-line option + setting in settings.json
    • Change logging destination file to femto.log
    • Better logging in debug mode
  • 2.1

    • Pointer checking in every function
    • Text highlighting using keyboard & mouse
    • Proper text copying/pasting support
    • Port codebase to use universal integer sizes size_t & ssize_t (signed)
    • Properly fixed search functionality
  • 2.0

    • More common C++ keywords
    • Support for raw editing/saving later to a file
    • Proper new tab creation with Ctrl+N
    • Now titlebar name also changes while switching between tabs
    • Search support, also search result highlighting
  • 1.9

    • Fix immediate empty file creation if file doesn't exist
    • Add Go syntax support
    • Add Rust syntax highlighting support
    • Fix weird syntax highlighting with numbers
    • Notify about unknown key combination
    • Another way to specify RGB values -> e.g #1234ff
    • Background color customization support
    • Fix lag on status-bar input
  • 1.8

    • Add horizontal scrolling support while holding the Shift key
    • Practical multi-file support, tabs' system
    • Switching between tabs
    • Application signature (file meta-info)
    • Unique icon
  • 1.7.1

    • More syntax highlighting
      • Python
      • ECMAScript (JavaScript)
      • CSS
      • XML-like
        • HTML
  • 1.7

    • Syntax highlighting customisable
    • More language support
      • JSON
      • XML-like
        • XML
        • SVG
    • Custom color palette
    • Possibility to delete last line
    • Fix crash when deleting first line
  • 1.6

    • Fix indentation bug
    • Save-as support
    • Allow multiple sequential file opens
    • Syntax highlighting, supported languages:
      • C
      • C++
      • Markdown
    • Asynchronous drawing
    • Micro-optimisations in codebase
  • 1.5

    • Asks for user input on open & save as
    • User input support on the last line of the editor
    • Fix auto-indentation bug, inserts too many tabs
    • Fix backwards tabbing (space removal)
  • 1.4

    • Line numbers, absolute & relative mode
    • Warning about any unsaved work
    • Optionally "visible" whitespace
    • Configurable whitespace color
  • 1.3

    • Primitive tab support
    • Proper tab support
    • Tab support for cursor selection with mouse
    • Tab support when scrolling horizontally
  • 1.2

    • Proper setting loading from file
    • Built-in hashmap support
    • Built-in JSON support
    • Tweak key behaviour, Ctrl+E doesn't have to be immediately released anymore
    • Add placeholders for planned keyboard shortcuts
  • 1.1

    • Automatic indentation, turned on by default, new settings
    • Command line argument parsing support
    • Proper command line argument handling
    • Optional settings file
    • Optional tabs-to-spaces, tab width adjustment
    • Tweak keypress status messages
    • Refactor/optimise codebase using same optimisations applied to atto
    • Optimise screen buffer updating frequency on keyboard/mouse input
    • Only update the line that's being edited
    • Refactor, check all pointers in debug mode
    • Tweak status messages, optimise for clarity, minimise redundant punctuation
  • 1.0

    • Theoretical multi-file support
    • Mouse scrolling support
    • Horizontal scrolling support
    • Mouse support for controlling the cursor
    • Color rendering support
      • Changed the foreground color to cyan
    • Scrolling whole screen worth of text with page up & page down
    • Moving cursor to the beggining/end of line with home/end
    • Whole line deletion
    • Line moving
    • Better cursor movement when using left/right arrows between lines
    • Better cursor movement when using up/down arrows between lines
  • 0.1

    • Initial release, basically a copy of atto

Contributing

This project is by no means perfect. Feel free to report any bugs, that you may find, under Issues. Also feel free to make any feature requests that come into your mind. Currently our end goal is to achieve an editor that's comfortable to use. Please be patient though because my first priorities are bug fixing and implementing pre-planned features. For more savvy users, the changelog may be more useful to keep track of the progress.

License

This project is using the MIT license.

Text editor icons created by Noor Hakim - Flaticon