Skip to content

A lightweight, terminal-based text editor for Linux written in Python with TOML configuration. Fast, customizable, and optimized for Sway/i3wm environments.

License

Notifications You must be signed in to change notification settings

SSobol77/sway-pad

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

swaypadm2

License: GPL v3 Python Version Linux FreeBSD Windows PRs Welcome



Important

๐Ÿšซ Ethical Restrictions

My works cannot be used in:

  • Military applications or systems
  • Surveillance technologies
  • Any activity violating human rights




๐ŸŒŠ Sway-pad

Cross-Platform Terminal Text Editor



๐Ÿš€ Features

Category Details
Core Engine โšก Multithreaded Architecture โ€ข ๐Ÿ•’ Low Latency (<5ms) โ€ข ๐Ÿ“ฆ 2MB Memory Footprint
Syntax Support 40+ Languages (Python, Rust, Go, etc.) โ€ข ๐ŸŽจ Theme Engine โ€ข ๐Ÿ” Regex Parsing
Workflow ๐Ÿ–ฑ๏ธ i3wm Integration โ€ข ๐Ÿ“‹ X11 Clipboard (via xclip) โ€ข ๐Ÿ’ป TMux Compatible โ€ข ๐Ÿงฉ Plugin System
Customization ๐Ÿ”ง TOML Configuration โ€ข โŒจ๏ธ Keybind Profiles โ€ข ๐ŸŒ“ Dark/Light Themes
Performance ๐Ÿš€ <0.1s Startup โ€ข ๐Ÿ“ˆ 100k LOC Handling โ€ข ๐Ÿ”„ Auto-Reload Changed Files



โšก Quick Start

Installation

# Linux (PyPI) - Required First Step:
sudo apt-get install xclip || sudo apt-get install xsel  # Must choose one
pip install sway-pad --user

# FreeBSD
sudo pkg install xclip sway-pad

# Development Build
git clone https://github.com/SSobol77/Sway-pad.git && cd Sway-pad
python3 -m pip install -e .

Basic Usage

# Open single file
sway-pad example.py

# Project mode (multi-tab)
sway-pad src/ tests/ config.toml

Warning

System Requirements:

Linux
Editor requires either xclip or xsel

FreeBSD
Editor requires xclip only (xsel removed from repositories)

All Systems:
โ€ข Install required clipboard utility before first use
โ€ข Restart terminal after installation


Custom keybindings

sway-pad --config ~/.config/swaypad/keybinds.toml


๐Ÿ›  Configuration

~/.config/swaypad/config.toml

[editor]
theme = "nord"
font_family = "Fira Code"
tab_size = 4
auto_indent = true

[keybindings]
save = "ctrl+s"
quit = "ctrl+shift+q"
split_pane = "ctrl+alt+enter"

[plugins]
lsp_enabled = true
git_diff = { enabled = true, hotkey = "f5" }



๐Ÿ“š Supported Formats (40+)

Language Extensions Icon
Python .py ๐Ÿ
JavaScript .js .mjs .cjs .jsx ๐ŸŒ
TypeScript .ts .tsx ๐Ÿ“˜
Java .java โ˜•
C/C++ .c .h .cpp .hpp ๐Ÿ–ฅ๏ธ
Rust .rs ๐Ÿฆ€
Go .go ๐Ÿน
Ruby .rb .erb .rake ๐Ÿ’Ž
PHP .php .phtml .php3 .php4 .php5 ๐Ÿ˜
Swift .swift ๐Ÿ•Š๏ธ
Kotlin .kt .kts ๐Ÿ”ถ
SQL .sql ๐Ÿ—ƒ๏ธ
YAML .yaml .yml โš™๏ธ
TOML .toml .tml ๐Ÿ› ๏ธ
JSON .json ๐Ÿ“ฆ
XML .xml ๐Ÿ“„
HTML .html .htm ๐ŸŒ
CSS .css ๐ŸŽจ
Markdown .md ๐Ÿ“
Shell .sh .bash .zsh ๐Ÿš
PowerShell .ps1 โšก
Docker Dockerfile ๐Ÿณ
Terraform .tf โ˜๏ธ
Git .gitignore .gitconfig ๐Ÿ”€
Lua .lua ๐ŸŒ™
Perl .pl .pm ๐Ÿช
R .r .R ๐Ÿ“Š
Julia .jl โ—ฐ
Dart .dart ๐ŸŽฏ
Scala .scala ๐ŸŒ€
Fortran .f .F .f90 .F90 .for ๐Ÿงฎ
Makefile Makefile ๐Ÿ› ๏ธ
INI .ini โš™๏ธ
CSV .csv ๐Ÿ“Š
Diff .diff .patch ๐Ÿ”„
GraphQL .graphql ๐Ÿ“ก
Jupyter .ipynb ๐Ÿ““



๐Ÿ— Architecture

Sway-pad/
โ”œโ”€โ”€ core/               # Editor Engine
โ”‚   โ”œโ”€โ”€ renderer/       # Curses-based UI
โ”‚   โ”œโ”€โ”€ syntax/         # Language Parsers
โ”‚   โ””โ”€โ”€ plugins/        # LSP/Git Integration
โ”œโ”€โ”€ themes/             # Color Schemes
โ”‚   โ”œโ”€โ”€ nord.toml
โ”‚   โ””โ”€โ”€ solarized_dark.toml
โ”œโ”€โ”€ docs/               # Configuration Guides
โ”œโ”€โ”€ tests/              # Benchmark Suite
โ””โ”€โ”€ swaypad.py          # CLI Entry Point


๐Ÿงช Development

Testing Matrix

# Run Core Tests
pytest tests/core --cov --cov-report=html

# Performance Benchmark
python3 -m tests.benchmarks scroll_through_10k_lines

# Linting
flake8 . --count --max-complexity=10 --statistics
Metric Result
Test Coverage 92% Core Modules
Max File Size 2GB (Compressed)
Concurrent Sessions 8+ Tabs Stable


๐Ÿค Contributing

  1. Fork & Clone Repository
  2. Create Feature Branch: git checkout -b feat/your-feature
  3. Commit Changes: git commit -m 'feat: add your feature'
  4. Push to Branch: git push origin feat/your-feature
  5. Open Pull Request

Contribution Guidelines:

  • Follow PEP8 Style Guide
  • Add Type Hints for New Code
  • Include Benchmark Results for Performance Changes


๐Ÿ“œ License

GNU General Public License v3.0
Commercial use requires explicit permission.
Full text available in LICENSE.



๐Ÿ“ฌ Contact

Sergey Sobolewski

Email

GitHub

Website

Discussions

Issues


About

A lightweight, terminal-based text editor for Linux written in Python with TOML configuration. Fast, customizable, and optimized for Sway/i3wm environments.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages