|
diff --git a/DOCS.md b/DOCS.md
|
|
|
1 |
# QWE Editor Documentation |
|
|
2 |
|
|
|
3 |
QWE is a modal text editor written in Go. |
|
|
4 |
|
|
|
5 |
## Modes |
|
|
6 |
|
|
|
7 |
- **Normal**: Navigation and text manipulation (default). |
|
|
8 |
- **Insert**: Text entry. |
|
|
9 |
- **Visual**: Character-wise selection. |
|
|
10 |
- **Visual Line**: Line-wise selection. |
|
|
11 |
- **Visual Block**: Rectangular block selection. |
|
|
12 |
- **Command**: Colon commands (`:`). |
|
|
13 |
- **Find**: Incremental search (`/`). |
|
|
14 |
- **Fuzzy**: File/buffer switching. |
|
|
15 |
- **Replace**: Pattern replacement. |
|
|
16 |
- **Confirm**: Action confirmation. |
|
|
17 |
|
|
|
18 |
## Keybindings |
|
|
19 |
|
|
|
20 |
### Navigation (Normal Mode) |
|
|
21 |
|
|
|
22 |
| Key | Action | |
|
|
23 |
|-----|--------| |
|
|
24 |
| `Arrows` | Move cursor | |
|
|
25 |
| `w` / `q` | Next / Previous word | |
|
|
26 |
| `Q` / `W` | Line start / End | |
|
|
27 |
| `{` / `}` | Top / Bottom of file | |
|
|
28 |
| `[` / `]` | Previous / Next empty line | |
|
|
29 |
| `Ctrl+O` / `Ctrl+I` | Jump history back / forward | |
|
|
30 |
| `Ctrl+N` / `Ctrl+P` | Next / Previous buffer | |
|
|
31 |
| `zz` | Center screen | |
|
|
32 |
|
|
|
33 |
### Editing (Normal Mode) |
|
|
34 |
|
|
|
35 |
| Key | Action | |
|
|
36 |
|-----|--------| |
|
|
37 |
| `i` / `I` | Insert (before cursor / start of line) | |
|
|
38 |
| `a` / `A` | Append (after cursor / end of line) | |
|
|
39 |
| `o` / `O` | Open new line (below / above) | |
|
|
40 |
| `x` | Delete character | |
|
|
41 |
| `dd` | Delete line | |
|
|
42 |
| `D` | Delete to end of line | |
|
|
43 |
| `cw` | Change word | |
|
|
44 |
| `C` | Change to end of line | |
|
|
45 |
| `cc` / `s` | Change character | |
|
|
46 |
| `y` | Yank current line | |
|
|
47 |
| `p` / `P` | Paste (below / above) | |
|
|
48 |
| `u` / `U` | Undo / Redo | |
|
|
49 |
| `zx` | Toggle comment | |
|
|
50 |
| `zq` | Format text (80 char wrap) | |
|
|
51 |
| `J` | Join lines | |
|
|
52 |
| `Alt+Up/Down` | Move lines up / down | |
|
|
53 |
| `Alt+Left/Right`| Unindent / Indent | |
|
|
54 |
| `Ctrl+A` / `Ctrl+Z`| Increment / Decrement number | |
|
|
55 |
| `c(`, `d[`, etc. | Change / Delete inside delimiters | |
|
|
56 |
|
|
|
57 |
### Visual Mode |
|
|
58 |
|
|
|
59 |
| Key | Action | |
|
|
60 |
|-----|--------| |
|
|
61 |
| `v` / `V` / `Ctrl+V` | Enter Visual / Visual Line / Visual Block | |
|
|
62 |
| `y` / `d` / `x` | Yank / Delete selection | |
|
|
63 |
| `c` / `p` | Change / Paste selection | |
|
|
64 |
| `zx` / `zq` | Comment / Format selection | |
|
|
65 |
| `~` | Toggle case | |
|
|
66 |
| `o` | Swap cursor and selection anchor | |
|
|
67 |
| `R` | Enter Range Replace mode | |
|
|
68 |
| `Leader+o` | Ollama AI Code Completion | |
|
|
69 |
|
|
|
70 |
### Multi-cursor |
|
|
71 |
|
|
|
72 |
| Key | Action | |
|
|
73 |
|-----|--------| |
|
|
74 |
| `Ctrl+X` | Add cursor at next word match | |
|
|
75 |
| `Ctrl+Up/Down` | Add cursor above / below | |
|
|
76 |
| `Esc` | Clear secondary cursors | |
|
|
77 |
|
|
|
78 |
### Search & Find |
|
|
79 |
|
|
|
80 |
| Key | Action | |
|
|
81 |
|-----|--------| |
|
|
82 |
| `/` | Start search | |
|
|
83 |
| `n` / `N` | Next / Previous result | |
|
|
84 |
| `Leader+p` | Find Files | |
|
|
85 |
| `Leader+b` | Find Buffers | |
|
|
86 |
| `Leader+w` | Find Warnings (Diagnostics) | |
|
|
87 |
| `Leader+m` | Find Bookmarks | |
|
|
88 |
| `Leader+q` | Clear Highlighting | |
|
|
89 |
|
|
|
90 |
### LSP & Features |
|
|
91 |
|
|
|
92 |
| Key | Action | |
|
|
93 |
|-----|--------| |
|
|
94 |
| `gd` | Go to Definition | |
|
|
95 |
| `gf` | Go to File | |
|
|
96 |
| `Ctrl+K` | Show Hover Information | |
|
|
97 |
| `Ctrl+N` (Insert) | Trigger Autocomplete | |
|
|
98 |
| `F1` - `F5` | Goto Bookmark 1-5 | |
|
|
99 |
| `Leader+F1-F5` | Set Bookmark 1-5 | |
|
|
100 |
| `Leader+d` | Delete current buffer | |
|
|
101 |
| `Leader+l` | Toggle debug window | |
|
|
102 |
|
|
|
103 |
## Commands (:) |
|
|
104 |
|
|
|
105 |
| Command | Action | |
|
|
106 |
|---------|--------| |
|
|
107 |
| `:w [file]` | Save buffer | |
|
|
108 |
| `:wa` | Save all buffers | |
|
|
109 |
| `:q` / `:q!` | Quit (force) | |
|
|
110 |
| `:wq` | Save and quit | |
|
|
111 |
| `:waq` | Save all and quit | |
|
|
112 |
| `:bd` / `:bd!` | Close buffer (force) | |
|
|
113 |
| `:n` | New buffer | |
|
|
114 |
| `:e <file>` | Open file | |
|
|
115 |
| `:reload` | Reload from disk | |
|
|
116 |
| `:help` | Show help | |
|
|
117 |
| `:mouse` | Toggle mouse support | |
|
|
118 |
| `:debug` | Toggle debug window | |
|
|
119 |
| `:!cmd` | Run shell command | |
|
|
120 |
| `:r!cmd` | Run shell command and insert output | |
|
|
121 |
| `:<number>` | Jump to line | |
|
|
122 |
|
|
|
123 |
## Technical Features |
|
|
124 |
|
|
|
125 |
### Language Server Protocol (LSP) |
|
|
126 |
Supports Hover, Autocomplete, Diagnostics, and Go to Definition via JSON-RPC. Default servers: `gopls` (Go), `clangd` (C/C++), `typescript-language-server` (JS/TS), `pyright-langserver` (Python). |
|
|
127 |
|
|
|
128 |
### AI Integration |
|
|
129 |
Local completion via Ollama API. Triggered with `Leader+o` on visual selection. |
|
|
130 |
|
|
|
131 |
### Tree-sitter |
|
|
132 |
Syntax highlighting via Tree-sitter. Supported: Go, C, C++, JS/TS, Python, Bash, CSS, PHP, SQL, Markdown, Dockerfile. |
|
|
133 |
|
|
|
134 |
### Multi-cursor |
|
|
135 |
Simultaneous editing with multiple cursors. Supports vertical and pattern-based cursor addition. |
|
|
136 |
|
|
|
137 |
### Range Replacement |
|
|
138 |
Triggered with `R` in visual mode. Syntax: `/pattern/replacement/flags`. Supports regex and `g`/`i` flags. |