A minimal text editor for KDE built with Kirigami and Qt 6, featuring professional syntax highlighting for 300+ languages. Inspired by Windows 7 Notepad with modern KDE integration.
π New to the docs? See the Documentation Guide for help navigating all available documentation.
π Getting Started:
- Quick Start Guide - Get up and running in 5 minutes
- Building & Installation - Build from source or install locally
π Feature Documentation:
- MIME Type Support - Comprehensive list of supported file formats
- Unsaved Changes Protection - How the auto-save protection works
π§ Developer Resources:
- Refactoring Summary - MIME type implementation details
- Project Index - Complete project overview and history
- Syntax Highlighting - Professional code highlighting for 300+ languages:
- Automatic detection from file extension and MIME type
- Same highlighting engine as Kate, KWrite, and KDevelop
- Supports all major programming languages (Python, C++, JavaScript, Java, Rust, Go, etc.)
- Markup languages (HTML, XML, Markdown, JSON, YAML, etc.)
- Shell scripts, configuration files, and more
- Manual syntax selection via Syntax menu
- Theme-aware (adapts to system dark/light mode)
- Readable text colors for plain text files
- Simple Text Editing - Clean, distraction-free text editing interface
- File Operations - New, Open, Save, Save As functionality
- Unsaved Changes Protection - Prevents accidental data loss:
- Prompts before quitting with unsaved changes
- Prompts before opening a new file with unsaved changes
- Prompts before creating a new document with unsaved changes
- Three options: Save, Discard, or Cancel
- Works with window close button and keyboard shortcuts
- See Unsaved Changes Protection for details
- Comprehensive MIME Type Support - Intelligently detects and opens all standard text-based file formats:
- Plain text files (text/plain, README, logs, etc.)
- Programming languages (C/C++, Python, Java, JavaScript, QML, etc.)
- Data formats (JSON, YAML, XML, TOML)
- Build systems (CMake, Makefiles)
- Documentation (Markdown, DocBook XML)
- Configuration files (.desktop, .ini, .conf)
- Web technologies (HTML, CSS)
- Shell scripts (Bash, Zsh, etc.)
- See MIME Type Support for the complete list
- Smart File Type Detection - Uses Qt's QMimeDatabase for accurate MIME type detection
- Drag and Drop - Drop any supported text file directly into the editor:
- Empty editor: opens the file in the current window
- Editor with content: opens the file in a new window
- Automatic validation of text-based files
- Desktop Integration - Full integration with KDE/freedesktop.org:
- Appears in "Open With" dialogs for supported file types
- Can be set as default application for text files
- Handles files from file manager and command line
- Status Bar - Shows line count, character count, and file status
- Keyboard Shortcuts - Standard shortcuts (Ctrl+N, Ctrl+O, Ctrl+S, etc.)
- Auto-save Indicator - Visual feedback for unsaved changes
- Modern KDE Design - Uses Kirigami components for a native KDE look
- Command-Line Support - Open files directly:
kirigami-noteapp file.txt
- Qt 6.5 or later
- KDE Frameworks 6:
- KF6CoreAddons
- KF6I18n
- KF6SyntaxHighlighting
- Kirigami 6
- CMake 3.20 or later
- C++17 compatible compiler
π New to the project? Start with the Quick Start Guide for step-by-step instructions.
# Build and run
make run
# Or use the build script
./build.sh# Create build directory
mkdir build
cd build
# Configure and build
cmake ..
make -j$(nproc)
# Run
./kirigami-noteappInstall for the current user only (no sudo required):
./install-local.shThis will:
- Build the application
- Install to
~/.local/share/kirigami-noteapp/ - Create a desktop entry as "NoteApp"
- Make it available in your application launcher
./uninstall-local.shmake installRequires sudo. Installs for all users.
From Command Line:
# Open a specific file
kirigami-noteapp /path/to/file.txt
# Or after local installation
~/.local/share/kirigami-noteapp/kirigami-noteapp file.txtDrag and Drop:
- Drag any text-based file from your file manager onto the editor window
- If the editor is empty, the file opens in the current window
- If the editor has content, a new window opens with the dropped file
- Smart Detection: Uses MIME type detection to identify text files
- Supports 50+ text file formats including:
- Source code (.cpp, .py, .js, .java, etc.)
- Data files (.json, .yaml, .xml, .toml)
- Build files (CMakeLists.txt, Makefile)
- Documentation (.md, README, .docbook)
- Configuration files (.desktop, .conf, .ini)
- And many more - see MIME Type Support
- Ctrl+N - New file
- Ctrl+O - Open file
- Ctrl+S - Save file
- Ctrl+Shift+S - Save as
- Ctrl+Q - Quit
Standard menu bar at the top with:
File Menu:
- New - Create a new blank document
- Open - Open an existing text file
- Save - Save the current file
- Save As - Save with a new name
- Quit - Exit the application
Syntax Menu:
- Auto-detect from File - Automatically detect syntax from file extension/type
- Plain Text - Disable syntax highlighting
- Select Syntax... - Manual syntax selection from 300+ available languages
Help Menu:
- About - Application information
- Left side - Line and character count
- Center - Current syntax highlighting mode (e.g., "Syntax: Python")
- Right side - File modification status (Modified/Saved)
The app automatically detects and applies syntax highlighting based on file type:
Automatic Detection:
- Opens
.pyfiles β Python highlighting - Opens
.cpp,.hfiles β C++ highlighting - Opens
.jsonfiles β JSON highlighting - Opens
.mdfiles β Markdown highlighting - And 300+ more file types!
Manual Selection:
- Open the Syntax menu
- Choose Select Syntax...
- Browse by category (e.g., "Sources / Python")
- Click to apply
Plain Text Mode:
- Select Syntax β Plain Text to disable highlighting
- Useful for viewing raw text or logs
- Text remains readable in both dark and light themes
Supported Languages Include:
- Programming: C, C++, C#, Java, JavaScript, TypeScript, Python, Ruby, Rust, Go, Kotlin, Swift, PHP, Perl, Lua, R, Julia, Haskell, Scala, and more
- Markup: HTML, XML, Markdown, reStructuredText, AsciiDoc, LaTeX
- Data: JSON, YAML, TOML, CSV, XML, INI
- Scripting: Bash, PowerShell, Fish, Zsh, Batch, VBScript
- Configuration: Nginx, Apache, Docker, CMake, Makefile
- And many more... - See the Syntax menu for the complete list!
kirigami-noteapp/
βββ assets/
β βββ docs/ - π Documentation
β β βββ DOCUMENTATION_GUIDE.md - Navigation guide for all docs
β β βββ INDEX.md - Project index and overview
β β βββ QUICKSTART.md - Quick start guide
β β βββ MIME_TYPES.md - Supported file formats reference
β β βββ UNSAVED_CHANGES_FEATURE.md - Unsaved changes feature details
β β βββ REFACTORING_SUMMARY.md - Technical refactoring notes
β βββ hello-world.png - Screenshot
βββ build/ - Build output (generated)
βββ main.cpp - C++ application entry point
βββ main.qml - QML UI definition
βββ CMakeLists.txt - Build configuration
βββ NoteApp.desktop - Desktop entry with MIME type associations
βββ Makefile - Convenience build commands
βββ build.sh - Build and run script
βββ run.sh - Quick run script
βββ install-local.sh - Local installation script
βββ uninstall-local.sh - Uninstall script
βββ test-mime-detection.sh - MIME type detection testing script
βββ README.md - This file (you are here)
Based on the Kirigami Hello World template. The application uses:
- Qt Quick for the UI framework
- Kirigami for KDE-style components
- Qt Quick Controls for standard UI elements
- Qt Quick Dialogs for file dialogs
- KSyntaxHighlighting for professional code highlighting (same engine as Kate)
- Uses Sublime Text
.sublime-syntaxformat - Supports 300+ programming and markup languages
- Provides QML bindings for easy integration
- Uses Sublime Text
The application uses Qt's QMimeDatabase for intelligent file type detection. This ensures compatibility with all standard text-based MIME types in KDE and other freedesktop.org-compliant environments.
Supported MIME type categories:
text/*- All text MIME types (plain text, markdown, source code, etc.)application/json,application/x-yaml,application/xml- Data formatsapplication/x-docbook+xml- DocBook documentationapplication/x-shellscript- Shell scripts- And many more - see MIME Type Support for details
Testing MIME detection:
./test-mime-detection.shπ All documentation is organized in the
assets/docs/directory. See the Documentation Guide for navigation help.
Available Documentation:
- Documentation Guide - How to navigate all docs (start here!)
- Quick Start Guide - Get started in 5 minutes
- MIME Type Support - Complete list of 50+ supported text file formats
- Unsaved Changes Protection - How the save prompt feature works
- Refactoring Summary - Technical details of MIME type implementation
- Project Index - Full project overview and development history
- Text files are saved with UTF-8 encoding
- File I/O is handled by a C++ backend (FileIO class)
- Syntax highlighting powered by KSyntaxHighlighting framework:
- Automatic detection from file extension and MIME type
- Same highlighting engine and definitions as Kate editor
- Theme-aware (adapts to system dark/light mode)
- Readable text colors in both plain text and code modes
- MIME type detection uses Qt's QMimeDatabase for accuracy
- Drag and drop supports 50+ text file formats with automatic validation
- Multiple instances can be opened simultaneously via drag and drop or command line
- Visual feedback (highlight border) when dragging files over the editor
- Proper error handling and file permissions
- Desktop integration for "Open With" functionality
This is a sample application for educational purposes.
Created: 2025-10-13 | Platform: KDE 6
