luajitos

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

QUICKSTART.md (4515B)


      1 # Lunar Editor - Quick Start Guide
      2 
      3 ## Launch the Editor
      4 
      5 ```lua
      6 run("com.luajitos.lunareditor")
      7 ```
      8 
      9 ## Menu Bar
     10 
     11 The top of the editor has three menu buttons:
     12 
     13 - **[New]** - Create a new empty file (clears current content)
     14 - **[Open]** - Open a file from your home directory
     15 - **[Save]** - Save current file with a new name
     16 
     17 Click these buttons to perform file operations!
     18 
     19 ## Basic Controls
     20 
     21 | Action | Key |
     22 |--------|-----|
     23 | **Type** | Any letter/number/symbol |
     24 | **New Line** | Enter |
     25 | **Delete** | Backspace |
     26 | **Move** | Arrow keys (←↑↓→) |
     27 | **Tab** | Tab (inserts 4 spaces) |
     28 
     29 ## What You See
     30 
     31 ```
     32 ┌─────────────────────────────────────┐
     33 │ Lunar Editor                      [X]│ ← Title bar
     34 ├────┬──────────────────────────────────┤
     35 │  1 │ Hello World                      │ ← Line 1
     36 │  2 │ This is a simple text editor     │ ← Line 2
     37 │  3 │ with word wrap and line numbers| │ ← Line 3 (cursor)
     38 │    │                                  │
     39 ├────┴──────────────────────────────────┤
     40 │ [Untitled] | Line 3, Col 31 | ...  │ ← Status bar
     41 └─────────────────────────────────────┘
     42 ```
     43 
     44 ## Features
     45 
     46 ### Line Numbers (Left Side)
     47 - **Shown by default** in grey color
     48 - Numbered starting from 1
     49 - Shows source line (not wrapped line)
     50 
     51 ### Word Wrap
     52 - **Enabled by default**
     53 - Long lines automatically wrap
     54 - Tries to break at spaces
     55 - No horizontal scrolling needed
     56 
     57 ### Cursor
     58 - **Blue blinking line** shows position
     59 - Moves with arrow keys
     60 - Inserts text where positioned
     61 
     62 ### Status Bar (Bottom)
     63 Shows:
     64 - File name (or `[Untitled]`)
     65 - `[Modified]` if edited
     66 - Current line and column
     67 - Total line count
     68 - Settings status
     69 
     70 ## File Operations
     71 
     72 ### Create New File
     73 1. Click **[New]** in the menu bar
     74 2. Editor clears and you have a blank document
     75 3. Type your text
     76 4. Click **[Save]** to save it
     77 
     78 ### Open Existing File
     79 1. Click **[Open]** in the menu bar
     80 2. File dialog appears showing files in ~/
     81 3. Click on a file to open it
     82 4. Click Cancel to close dialog without opening
     83 
     84 ### Save Current File
     85 1. Click **[Save]** in the menu bar
     86 2. Save dialog appears
     87 3. Enter filename or select location
     88 4. Click to confirm save
     89 
     90 ## Tips
     91 
     92 1. **Click the window** to ensure it has focus before typing
     93 2. **Use arrow keys** to navigate instead of mouse
     94 3. **Enter creates new lines** - no automatic word wrap on typing
     95 4. **Tab inserts spaces** - 4 spaces per tab
     96 5. **Backspace at line start** merges with previous line
     97 6. **Files must be in ~/** - home directory only
     98 
     99 ## Common Tasks
    100 
    101 ### Write a Note
    102 ```lua
    103 -- 1. Start editor
    104 run("com.luajitos.lunareditor")
    105 
    106 -- 2. Type your note
    107 -- (just start typing)
    108 
    109 -- 3. Save it
    110 saveFile("~/notes.txt")
    111 ```
    112 
    113 ### Edit a Script
    114 ```lua
    115 -- 1. Open the file
    116 run("com.luajitos.lunareditor", "~/script.lua")
    117 
    118 -- 2. Make changes
    119 -- (navigate with arrows, type to edit)
    120 
    121 -- 3. Save changes
    122 saveFile("~/script.lua")
    123 ```
    124 
    125 ### Create a List
    126 ```
    127 1. Type first item
    128 2. Press Enter
    129 3. Type next item
    130 4. Press Enter
    131 5. Repeat
    132 ```
    133 
    134 ## Settings
    135 
    136 Both features are **ON by default**:
    137 
    138 - ✅ **Word Wrap** - Lines wrap automatically
    139 - ✅ **Line Numbers** - Grey numbers on left
    140 
    141 To change settings, modify `settings` table in `editor.lua`:
    142 
    143 ```lua
    144 settings = {
    145     wordWrap = true,      -- ON
    146     lineNumbers = true    -- ON
    147 }
    148 ```
    149 
    150 ## Limitations
    151 
    152 - ⚠️ **No undo** - Be careful with edits
    153 - ⚠️ **No copy/paste** - Must retype
    154 - ⚠️ **No search** - Navigate manually
    155 - ⚠️ **No mouse** - Use keyboard only
    156 - ⚠️ **ASCII only** - No emoji or special characters
    157 
    158 ## Troubleshooting
    159 
    160 ### Can't type anything
    161 **Solution:** Click on the editor window to focus it.
    162 
    163 ### Text appears outside window
    164 **Solution:** Word wrap is disabled. It should be ON by default.
    165 
    166 ### Can't see line numbers
    167 **Solution:** Line numbers should be ON by default. Check `settings.lineNumbers`.
    168 
    169 ### File not saving
    170 **Solution:** Ensure path starts with `~/` (e.g., `~/file.txt` not `/file.txt`)
    171 
    172 ## That's It!
    173 
    174 You're ready to use Lunar Editor. Just remember:
    175 
    176 1. **Launch** with `run("com.luajitos.lunareditor")`
    177 2. **Type** to add text
    178 3. **Arrows** to navigate
    179 4. **Enter** for new lines
    180 5. **Backspace** to delete
    181 
    182 Happy editing! 📝