Metadata-Version: 2.4
Name: femto-editor
Version: 0.0.2
Summary: Femto - a tiny nano-style terminal text editor in pure Python
Author: Femto Contributors
License: MIT License
        
        Copyright (c) 2024 Femto Contributors
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/codewithzaqar/femto
Keywords: editor,terminal,curses,nano,text-editor,tui
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console :: Curses
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Text Editors :: Text Processing
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: windows-curses; sys_platform == "win32"
Dynamic: license-file

# Femto v0.0.2
     
Femto is a tiny, nano-style terminal text editor written in **pure Python**.
It ships with zero runtime dependencies on POSIX system (standard-library `curses` only) and automatically pulls `windows-curses` on Windows.

Femto supports multi-buffer editing, soft line wrapping, syntax highlighting, regex search & replace, mouse support, and is fully Unicode (CJK/Emoji) aware.

## Install

```bash
# From PyPI (Recommended)
pipx install femto-editor
# or
pip install femto-editor

# From source
git clone https://github.com/codewithzaqar/femto.git
cd femto
pip install .
```

After installation, the `femto` command is available globally.

## Usage
```bash
femto [file ...]        # open one or multiple files
femto --line-numbers a.py x.py
femto --tab-size 2 --regex x.py
femto --version
```

## Keybindings

|Key|Action|Key|Action|
|---|---|---|---|
|`Ctrl+X`|Exit (asks to save)|`Ctrl+W`|Search / find next|
|`Ctrl+S`|Save (Save-As if unnamed)|`Ctrl+T`|Go to line|
|`Ctrl+Z`/`Ctrl+Y`|Undo / Redo|`Ctrl+G`/`Esc`|Cancel prompt|
|`Arrows`|Move|`Ctrl+<-/->`|Word jump|
|`Home/End`, `Ctrl+A/E`|Line start/end|`PgUp/PgDn`|Page scroll|
|`Tab`/`Shift+Tab`|Indent / unindent|`Enter`|New line|
|`Ctrl+B`|Set / clear mark|`Ctrl+K`|Cut line or selection|
|`Ctrl+P`|Copy line or selection|`Ctrl+U`|Paste clipboard|
|`Ctrl+\`|Replace (search -> with -> Y/N/A/C)|`Ctrl+O`|Toggle case-insensitive (in search prompt)|
|`Ctrl+R`|Toggle regex mode (in search prompt)|||
|`Ctrl+N`|Toggle line numbers|||
|`Ctrl+D`|Toggle mouse support|Mouse wheel|Scroll viewport|
|`Ctrl+F` / `Ctrl+L`|Next / previous buffer|||
|`Mouse click`|Move cursor to click point|||

## Configuration (`~/.femtorc` or `./.femtorc`)

Femto is highly customizable via a simple `key = value` configuration file.

```ini
# Indentation
tab_size = 4

# Viewport
smooth_scroll_margin = 3
soft_wrap = true
show_line_numbers = false
syntax_highlight = true

# Search
ignore_case = false
regex_search = false

# Input & I/O
mouse = false
make_backup = false
```

## Running the tests

Femto includes a comprehensive `unittest` regression suite that runs headlessely (no terminal required).

```bash
python -m unittest discover -s tests -v
```

## Building a release

```bash
pip install build twine
python -m build          # creates dist/femto_editor-0.0.1-*.whl
python -m twine upload dist/* # publish to PyPI
```

## License

MIT - see [LICENSE](LICENSE).
