Txtmax is a modern, powerful, lightweight, fast, completely free, open-source advanced text editor designed for Linux. It features syntax highlighting and various file management capabilities. This program allows you to create, view, edit, delete, and get information about text files and more from the command line with ease.
- Create Files: Create new text files and save them locally.
- View Files: View the contents of text files with syntax highlighting for keywords, strings, and comments.
- Edit Files: Edit specific lines in existing text files.
- List Files: List all regular files in the current directory.
- Delete Files: Delete specified text files.
- Search Files: Search for files by name.
- Get File Info: Retrieve detailed information about a file, including its name, extension, creation time, modification time, and version control.
- Line Numbering and Jumping to Specific Lines: Navigate quickly through code with line numbers and jump to specific lines.
- Search and Replace: Find and replace text within files.
- Compiling and Running Code: Compile and execute code seamlessly.
- Move Multiple Files to a Folder: Organize files by moving them to specified folders.
- Copy Multiple Files to a Folder: Duplicate files and copy them to designated folders.
- Pattern-Matching AI for Helping Users Use Txtmax: Utilize AI to assist with pattern matching.
- Rename a File: Change the name of files easily.
- Test and Fetch Data from RESTful APIs: Interact with APIs to test and retrieve data.
- Debug and Warn C Files: Identify and resolve issues in C files.
- Built-in Terminal: Access a terminal directly within the editor.
- Edit LaTeX Files: Work with LaTeX documents.
- Convert Files to Tarball: Archive files into tarball format.
- Package and Dependencies Management: Handle packages and dependencies efficiently.
- Build and Test a Project with Make: Automate the build and test process for projects using Make.
- Build and Test a Java Project with Gradle: Manage Java projects with Gradle.
- Automation: Automate repetitive tasks.
- Support for .NET Framework: Develop and run .NET applications.
- Run Flask and Python App on Web Server: Deploy Flask and Python applications on a web server.
- Robust Error Handling: Improve error handling mechanisms.
- Store your API Keys: Store your API Secrets
- Notebook: An Interactive Notebook for Python
- Auto Completion: An Auto Completion
- Retrieve File Size: Retrieve your file size
- Make an ignore file: Make an .gitignore file
- SQLite Integration: Supports SQLite Database
- OpenAI Integration: Integrates with OpenAI API Key
- Tmux Integration: Integrates with Tmux
- Benchmark: An Benchmark shows Execution Time CPU Usage and more
- Security Features: Integration with AES and GPG
- Robust Git Integration: Seamlessly integrate with Git for version control.
- help: List all available commands.
- man txtmax: Access the comprehensive manual for Txtmax.
- create : Create a new file, write code in 80 languages, save and quit with :wq, type a commit message, branch, and version, and save it locally.
- rename: Rename a file.
- movef: Move multiple files to a folder.
- copy: Copy multiple files to a folder.
- files: List all files in the current directory.
- view : View the contents of a file with syntax highlighting.
- edit : Edit a specific line in the file.
- delete : Delete a specified file.
- search : Search for files by name.
- info : Get detailed information about the file (name, extension, creation time, modification time, and version control such as commit message, branch, and version).
- examples: Show examples of "Hello, World!" programs in various languages including C, Python, Java, JavaScript, C++, Rust, Ruby, Elixir, Kotlin, TypeScript, Dart, Objective-C, and Go.
- sql: Display example queries for SQL databases, including SQL, PostgreSQL, and NoSQL (MongoDB).
- run: Run your code quickly without exiting Txtmax using compilers and interpreters such as GCC, Clang, g++, Python, Lua, Ruby, nasm, tcl, and rustc, perl, go, Node.js. It will prompt for the file name and extension, followed by the compiler or interpreter name, and then prompts for an external library name if theres no then type "n" and then execute the code.
- packages: Install packages by choosing a package manager (pip, npm, gem, go, yarn, composer, cargo, nuget, or apt), entering the package name, and installing it. (Requires prior installation of Python, Node.js, and other dependencies)
- api: Test RESTful APIs directly in the editor by entering a URL to fetch data via curl.
- axios: Fetch RESTful API data from a URL by entering a filename, writing code, quitting with :wq, and running it.
- advance: Enter a file name with its extension to view its content, jump to specific lines, and perform search and replace operations.
- debug: Debug and warn C files. Choose between debugging code or running code, then provide the project name and filename including its extension to see debug or warning messages.
- latex: Edit LaTeX files.
- dotnet: Support for .NET Framework. Choose a .NET component (currently supports .NET SDK and ASP.NET), enter a filename including its extension, write content, quit with :wq, and run the code. Use the packages command for nuget (requires prior installation of .NET).
- tarball: Convert files to tarball format.
- terminal: Access a built-in terminal to type commands directly in the editor.
- localhost: Start a Python or Flask app on a web server. Choose between Flask or PythonHTTP, enter a filename including its extension, and run it on localhost:8080.
- recycle: Recover deleted files by listing all deleted files and typing "recover ." to restore them.
- environment: Store your API key secrets securely. You will be prompted to provide database credentials, the API name, and its secrets. You can type 'y' or 'n' for "Debug Mode," and then you will be asked for the server port. Based on your inputs, a
.env
file will be generated. - ignore: Create a
.gitignore
file. You will be prompted to choose from options such as "nodejs," "env," or "log." Based on your selection, a.gitignore
file will be generated. - version: Although not included in manual and help, it creates a version.txtmax to see details like Name, Size, Maintainer
- sqlite: Work with an SQLite database. You will be prompted to provide a filename, including its extension. Then, enter your SQLite code, and it will be saved locally and it will run it
- openai: Integration with OpenAI prompts for a filename, including its extension. It then prompts for Pasting OpenAI API key, it prompts for the OpenAI model name. Based on the provided inputs, it generates an python code of using OpenAI API Key and executes that Python code.
- size: Retrieve File Size, This prompts the user for a filename, including its extension, and then displays the file size.
- benchmark: Shows Execution time and CPU Usage and Additional things like System CPU Time and Total CPU Time and Max Memory usage and Page Faults and Context Switches
- exit: Exit the Txtmax editor.
We have introduced an automation feature to simplify your tasks.
Commands:
- make: Build and test a project with Make. Enter the project name and filename including its extension, and Txtmax will generate an Makefile based on inputs and run the code.
- gradle: Build and test a Java project with Gradle. Provide the necessary inputs, and Txtmax will generate and run the code based on the inputs.
We Introduced an Pattern-Matching AI to help users use Txtmax Better it's had many Predefined Questions and increase your productivity.
Conversations:
-
Running Code
- Queries: "run my code", "how to run"
- Response: Steps to run code in Txtmax:
- Step 1: Type "run" in Txtmax, and it will ask for the filename including its extension.
- Step 2: Choose a compiler or interpreter such as GCC, Clang, Python, Node, Ruby, etc.
- Step 3: Txtmax will seamlessly run your code.
-
Hello World Examples
- Queries: "examples of hello world", "hello world example"
- Response: Type "examples" command in Txtmax to get Hello World examples in various languages.
-
Creating a File
- Queries: "create a file", "how to create"
- Response: To create a file in Txtmax, type "create ". Then write contents and save with :wq.
-
Deleting a File
- Queries: "delete a file", "remove file"
- Response: To delete a file, type "delete ". This will remove the specified file.
-
Searching for a File
- Queries: "search a file", "find file"
- Response: To search for a file, type "search ". It will locate files matching the given name.
-
Listing All Files
- Queries: "list all files", "view files in directory"
- Response: To list all files in the current directory, type "files".
-
Editing a File
- Queries: "edit file", "modify file"
- Response: To edit a file, type "edit ".
-
Getting File Information
- Queries: "get file info", "file details"
- Response: To get file details, type "info ".
-
Debugging C Files
- Queries: "debug c files", "check c code errors"
- Response: To debug C files, type "debug" and provide the project name and filename.
-
Testing APIs
- Queries: "test apis", "fetch restful api data"
- Response: To test RESTful APIs, use "api" or "axios" command.
-
Creating a Tarball
- Queries: "convert file to tarball", "make tar file"
- Response: To create a tarball file, type "tarball ".
-
Installing Packages
- Queries: "install package", "package manager"
- Response: To install a package, use "packages" command and choose a package manager.
-
Editing LaTeX Files
- Queries: "latex files", "edit latex"
- Response: To create and edit LaTeX files, use "latex .tex".
-
Unrecognized Queries
- Response: If the query is not understood, it will respond with "I'm sorry, I don't understand your query. Try asking something related to Txtmax commands!".
Txtmax Notebook is an interactive notebook for Python developers written in C.
Features:
- File Handling: You'll be prompted to enter a filename, including its extension.
- Text-Based Cells: Write your Python code in text-based cells with syntax highlighting.
If-else
statements are highlighted in green.Int
types are highlighted in blue.- Comments are highlighted in black.
- Variables are highlighted in light blue.
- Loops are highlighted in pink.
Print
andinput
functions are highlighted in orange.
- Automatic Execution: When you write your Python code, it will automatically execute.
- Package Management: You can also install packages using pip.
Commands:
save
: Creates a.txtmaxnb
file, storing cells and their outputs.exit
: Exits the Txtmax Notebook.
In Txtmax, type the command notebook
. It will go to system()
, compile notebook.c
, and run notebook.c
, allowing you to use Txtmax Notebook.
We introduced Txtmax Auto Completion to streamline the process of writing code, specifically C code. It's built from scratch to enhance your coding efficiency.
In Txtmax, you can use the command auto_completion
to activate Txtmax Auto Completion.
Upon activation, it will prompt you for the filename, including its extension. You can then write the file's contents and exit with :wq
.
Additionally, Txtmax offers syntax highlighting:
- Keywords such as
int
,float
,if
, andreturn
are highlighted in green. - Loops are highlighted in magenta.
- Built-in functions (e.g.,
printf
) are highlighted in red. - Comments are highlighted in blue.
As you type code, Txtmax will suggest relevant keywords to assist you.
The Txtmax Tmux Integration enables efficient multi-task management within Txtmax through seamless integration with Tmux.
Getting Started: To begin using Txtmax Tmux Integration, type "multiplexer" within Txtmax.
How It Works:
- Session Initialization:
- Prompts the user for a session name.
- Creates a new Tmux session with the specified name.
- Enters an interactive loop where the user can input commands to be sent to the Tmux session.
- After the user types "exit," they are attached to the session to view the results of the executed commands.
Key Features:
-
Session Management:
- Creates a new detached Tmux session.
- Validates successful session creation.
- Handles session names cleanly.
-
Command Execution:
- Provides an interactive command prompt.
- Executes commands within the Tmux session.
- Supports multi-word commands.
- Includes a built-in 'exit' command to terminate input.
-
Safety Features:
- Sanitizes input to prevent errors.
- Performs error checking for system calls.
- Prevents buffer overflow.
-
User Experience:
- Offers clear prompts and status messages.
- Ensures a 1-second delay between commands for reliability.
- Attaches the final session for direct user interaction.
Note: Tmux must be installed on the system. Tested on Linux systems with Tmux version 3.2+.
Txtmax Security is a feature integrated with Txtmax. It integrates AES via OpenSSL and GPG.
To start using Txtmax Security, type "security" in Txtmax.
You will see:
Welcome to Txtmax's Security with AES and GPG Integration.
Enter command (type 'help' for options):
Commands:
aes-encrypt
: Encrypts a file using AES-256-CBC. You will be prompted for the input file name and the encrypted output file name.aes-decrypt
: Decrypts an AES-encrypted file. You will be prompted for the encrypted file name, the decrypted output file name, and the decryption password.gpg-export-key
: Exports a GPG secret key. You will be asked for an email address and the private key filename.gpg-delete-key
: Deletes a GPG key. You will be asked for an email address.gpg-import-key
: Imports a GPG public key. You will be asked for the private key.help
: Displays this help message.exit
: Exits the program.
Features:
-
Security Enhancements:
- Password input hiding during entry.
- Uses PBKDF2 for key derivation (modern security practice).
- Suppresses error messages for OpenSSL commands.
-
Robust Input Handling:
- Proper input sanitization.
- Filename quoting to handle spaces in paths.
- Buffer overflow prevention.
-
Advanced GPG Operations:
- Complete key deletion (both secret and public).
- Armored key export.
- Batch mode operations for non-interactive execution.
-
User Experience:
- Clear command prompts.
- Helpful command list.
- Error handling for failed operations.
Note: This code requires OpenSSL and GPG to be installed on the system. The functionality has been tested on Linux systems and may require adjustments for other platforms.
Terminal-based, feature-rich, user-friendly, and lightweight, it presents '~/txtmax' as the command prompt, enabling users to enter commands. Upon launching, it greets with: 'Welcome to txtmax! Type 'help' for a list of available commands.
Txtmax uses ANSI colors for syntax highlighting to enhance readability. The following colors are used:
- Keywords: Green
- Strings: Blue
- Comments: Yellow
To get started with Txtmax, follow these steps:
- Install: Install it by running:
git clone https://github.com/Calestial2/Txtmax
cd Txtmax
cd src
gcc txtmax.c -o txtmax
./txtmax
- Makefile: You can use Makefile:
git clone https://github.com/Calestial2/Txtmax
cd Txtmax
cd src
make
make clean
./txtmax
Available on Linux and Unix-like systems (macOS and BSD). For Other OS use Emulators like WSL and Cwgwin or MinGW
Extremely fast and lightweight, faster than GNU Nano and Vim because:
- C is fast in itself.
- It uses many standard libraries.
This project is licensed under the GNU General Public License v3.0. You are free to use, modify, and distribute this software under the terms of the license. See the LICENSE file for more information.
Contributions are welcome! Here's how you can help:
- Report bugs or request features using GitHub Issues
- Submit pull requests with clear descriptions of changes.
- Ensure your code follows the style and design of the project.
For detailed guidelines, see CONTRIBUTING.md.
Our platform supports a vast array of popular programming languages, encompassing both low-level and high-level categories. This includes functional languages, legacy languages still in use today, game engine languages, educational languages, and many rare or less common languages.
Supported Languages:
- C
- Python
- Java
- JavaScript (JS)
- C++
- Rust
- Ruby
- Elixir
- Kotlin
- Swift
- TypeScript
- Dart
- Go
- Haskell
- R
- PHP
- Lua
- Objective-C (ObjC)
- Groovy
- Erlang
- Bash
- Julia
- F# (F-sharp)
- C# (C-sharp)
- Scheme
- Clojure
- Fortran
- COBOL
- VHDL
- Lisp
- SQL
- MATLAB
- Perl
- Scala
- HTML
- PostgreSQL
- NoSQL
- ActionScript
- Ada
- Nim
- Crystal
- D
- PureScript
- Assembly
- Prolog
- Zig
- Brainfuck
- Algol
- LabVIEW
- Mercury
- Shellscript
- OCaml
- TXL
- Xojo
- Forth
- Verilog
- AWK
- Turing
- GDScript
- Fantom
- Zsh
- AutoHotKey
- Ceylon
- ChucK
- Natural
- Pike
- Oberon
- XML
- Yaml
- JSON
- Visual Basic
- HTML5
- CSS
- Babel
- Sass
- Babel
- SAS
- Pl SQL
- Graphql
- SQLite
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <dirent.h>
#include <ctype.h>
#include <sys/stat.h>
#include <time.h>
#include <errno.h>
#include <regex.h>
#include <unistd.h>
#include <fcntl.h>
#include <math.h>
#include <sys/time.h>
#include <sys/resource.h>
- README.md: The README file
- LICENSE.md: The License file (GNU General Public License)
- src/txtmax.c: The source code of Txtmax
- src/notebook.c: The Source code of Txtmax Notebook
- src/auto_completion.c: The source code of Txtmax Auto Completion
- src/Makefile: Makefile to automate the process
- src/security.c: Code of Txtmax Security
- CHANGELOG.md: Document detailing changes
- CONTRIBUTING.md: Comprehensive guidelines for contributing to Txtmax
- Comprehensive File Management: Txtmax offers comprehensive file management, including creating, listing, viewing, searching files, deleting, and editing files and jumping to specific lines and Search And Replace.
- Version Control and Git Integration: Supports robust Git integration and robust error handling for every command.
- Open Source and Free: Fully open source and completely free (no hidden costs) under the GNU General Public License.
- Syntax Highlighting and Multi-Language Support: Supports over 80 languages with extensive syntax highlighting.
- Compiling and Running Code: Compile and run C, Python, JavaScript codes with compilers and interpreters such as GCC, Clang, Python, Node, Nasm, Tcl, Bash. without leaving Txtmax.
- Package and Dependency Management: Install packages directly from the editor easily.
- Rich Documentation: Detailed help and comprehensive manual for beginners and Had Examples of Hello world for various languages to get started
- Extremely Fast and Easy to Use: Faster than GNU Nano and Vim, and very easy to use with commands that are easy to understand and use, offering a lower learning curve.
- Terminal Integration: Supports typing Terminal Commands in the Editor
- Frequent Major Updates: Frequent new major updates