Skip to content

A lightweight terminal-based text editor written in C, inspired by GNU nano. This minimalist editor provides essential text editing functionality with a clean, straightforward interface.

License

Notifications You must be signed in to change notification settings

SekulDev/nano_clone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nano Clone

A lightweight terminal-based text editor written in C, inspired by GNU nano. This minimalist editor provides essential text editing functionality with a clean, straightforward interface.

About This Project

This is a casual project I wrote to dive into some low-level programming concepts - terminal manipulation, raw mode input handling, and text buffer management. It's not a serious production-ready editor, just a fun exploration of how terminal-based text editors work under the hood.

If you have suggestions, improvements, or bug fixes, feel free to open a pull request!

Don't forget to leave a star! ⭐️

Features

  • File Operations

    • Open and edit existing files
    • Save changes to disk (Ctrl+O)
  • Text Editing

    • Full cursor navigation
    • Insert and delete characters
    • Multi-line text support
  • Search Functionality

    • Find text within the document (Ctrl+W)
    • Case-sensitive search
  • Keyboard Shortcuts

    • Ctrl+X - Exit the editor
    • Ctrl+O - Save file (write out)
    • Ctrl+W - Search for text

Requirements

  • C compiler (GCC or Clang)
  • CMake or Make
  • Linux/macOS/Unix system

Installation & Usage

The Super Simple Way

  1. Clone the repo:
git clone https://github.com/SekulDev/nano_clone.git
cd nano_clone
  1. Build it:
make
  1. Run it:
./nano_clone your_file.txt

That's it! 🎉

Using CMake (if you prefer)

mkdir build
cd build
cmake ..
make
./nano_clone your_file.txt

Install System-Wide (Optional)

sudo make install

Now you can use it from anywhere:

nano_clone myfile.txt

Usage

Important: You must provide a filename when starting the editor!

nano_clone filename.txt

Keyboard Shortcuts

Shortcut Action
Ctrl+X Exit the editor
Ctrl+O Save file
Ctrl+W Search for text
Arrow Keys Move cursor around

Troubleshooting

Editor won't compile?

  • Make sure you have GCC or Clang installed
  • Try gcc --version to check

"Command not found" when running?

  • Use ./nano_clone instead of just nano_clone if you didn't install it system-wide

Weird characters on screen?

  • Your terminal might not support the required features
  • Try a different terminal emulator

Known Limitations

  • Basic text editing only (no syntax highlighting)
  • No undo/redo
  • No multi-file editing
  • It's a learning project, not production software!

Contributing

Contributions are welcome! This is a casual project, so don't worry about making it perfect - just make it better!

License

MIT License - do whatever you want with it.


Note: Built as a fun dive into low-level terminal programming. The code might not be perfect, but it works and it taught me a lot!

About

A lightweight terminal-based text editor written in C, inspired by GNU nano. This minimalist editor provides essential text editing functionality with a clean, straightforward interface.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published