Skip to content

UykiZhao/Notepad

Repository files navigation

Notepad

A cross-platform text editor built with Tauri 2.x + Rust (backend) and React + TypeScript + Monaco Editor (frontend). Targets Linux, macOS, and Windows with a clean, Notepad++-inspired UI.

Features

Core Features

  • Cross-platform (Linux, macOS, Windows)
  • Comprehensive keyboard shortcuts
  • Automatic line wrapping toggle
  • Light and dark mode themes
  • Line numbers on left side
  • Multi-language UI (简体中文 default, 繁體中文, English)

Additional Features

  • Syntax highlighting for multiple languages
  • Multiple file tabs
  • File tree sidebar
  • File tree operations (rename, move, copy, delete)
  • Find and Replace (Ctrl+F / Ctrl+H)
  • Word count statistics (Chinese characters, English words, total characters)
  • Editor font size zoom (Ctrl/Cmd + wheel or shortcuts)

Screenshots

The application features a clean, modern interface with:

  • Toolbar with file operations, undo/redo, and theme toggle
  • Collapsible file tree sidebar
  • Tabbed editor with Monaco Editor
  • Status bar with cursor position, word count, and language info

Technology Stack

Layer Technology
Backend Tauri 2.x, Rust
Frontend React 18, TypeScript, Vite
Editor Monaco Editor (@monaco-editor/react)
State Zustand
Styling CSS Variables (theming)
i18n react-i18next + i18next

Keyboard Shortcuts

File Operations

Shortcut Action
Ctrl+N New file
Ctrl+O Open file
Ctrl+Shift+O Open folder
Ctrl+S Save
Ctrl+Shift+S Save As
Ctrl+W Close tab
Ctrl+Shift+W Close all tabs
Ctrl+Shift+T Reopen closed tab

Edit Operations

Shortcut Action
Ctrl+Z Undo
Ctrl+Y / Ctrl+Shift+Z Redo
Ctrl+X Cut
Ctrl+C Copy
Ctrl+V Paste
Ctrl+A Select all
Ctrl+D Duplicate line
Ctrl+Shift+K Delete line
Ctrl+/ Toggle comment
Tab Indent
Shift+Tab Outdent

Find & Replace

Shortcut Action
Ctrl+F Find
Ctrl+H Find and Replace
F3 / Enter Find next
Shift+F3 Find previous
Ctrl+G Go to line

Navigation

Shortcut Action
Ctrl+Tab Next tab
Ctrl+Shift+Tab Previous tab
Ctrl+1-9 Switch to tab 1-9
Ctrl+Home Go to beginning
Ctrl+End Go to end

View

Shortcut Action
Ctrl+B Toggle sidebar
Ctrl++ / Ctrl+= Increase font size
Ctrl+- Decrease font size
Ctrl+0 Reset font size
F11 Toggle fullscreen
Alt+Z Toggle word wrap

Note: On macOS, use Cmd instead of Ctrl

Getting Started

Prerequisites

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/notepad.git
cd notepad
  1. Install dependencies:
npm install
  1. Run in development mode:
npm run tauri dev
  1. Build for production:
npm run tauri build

Project Structure

notepad/
├── package.json
├── tsconfig.json
├── vite.config.ts
├── index.html
│
├── src/                          # Frontend
│   ├── main.tsx                  # React entry
│   ├── App.tsx                   # Root component
│   ├── i18n.ts                   # i18n configuration
│   ├── components/
│   │   ├── editor/
│   │   │   ├── EditorPane/       # Monaco wrapper
│   │   │   ├── TabBar/           # File tabs
│   │   │   └── FindReplace/      # Search panel
│   │   ├── sidebar/
│   │   │   └── FileTree/         # Directory browser
│   │   └── ui/
│   │       ├── Toolbar/
│   │       ├── StatusBar/
│   │       └── LanguageSwitcher/
│   ├── stores/
│   │   ├── editorStore.ts        # Tabs, content state
│   │   └── settingsStore.ts      # Theme, language, preferences
│   ├── hooks/
│   │   └── useFileOperations.ts  # File I/O operations
│   ├── locales/                  # Translation files
│   │   ├── zh-CN.json            # 简体中文 (default)
│   │   ├── zh-TW.json            # 繁體中文
│   │   └── en.json               # English
│   └── styles/
│       └── themes/               # Light/dark CSS
│
└── src-tauri/                    # Backend (Rust)
    ├── Cargo.toml
    ├── tauri.conf.json
    └── src/
        ├── lib.rs                # Command registration
        └── commands.rs           # File system commands

UI Layout

┌─────────────────────────────────────────────────────┐
│  Toolbar: [New][Open File][Open Folder][Save] | [Undo][Redo] | [Find] | [Lang][Theme] │
├────────────┬────────────────────────────────────────┤
│            │  [file1.js] [file2.py] [+]             │
│  Folder    ├────────────────────────────────────────┤
│  Name      │  1 │ const x = 42;                     │
│            │  2 │ console.log(x);                   │
│  📁 src    │  3 │                                   │
│  ├── a.js  │         Monaco Editor                  │
│  └── b.ts  │                                        │
├────────────┴────────────────────────────────────────┤
│  Ln 1, Col 1 | Chinese: 0 Words: 2 Chars: 15 | UTF-8 | JavaScript │
└─────────────────────────────────────────────────────┘

Supported Languages

The editor supports syntax highlighting for:

  • JavaScript / TypeScript
  • Python
  • Rust
  • Go
  • Java
  • C / C++
  • C#
  • Ruby
  • PHP
  • HTML / CSS / SCSS / Less
  • JSON / XML / YAML
  • Markdown
  • SQL
  • Shell / PowerShell / Batch
  • And more...

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Notepad,一款自用的文本编辑器,仅仅只是自用而已

Resources

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors