rufio 1.3.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 61f470cce894bacf7a88eaffbca98212689c7a74fe615c41cc90f75af4c6c8da
4
- data.tar.gz: eb507f8b6ccfc365f1276512fd13d7959cffac7ae9b8208d8e3ae6a9716ab2d1
3
+ metadata.gz: d03b8da1539c55090e70b9b255fdd8a19e6621a5217da447904b6ff37db21b9a
4
+ data.tar.gz: be3e1764c29da9cd392e84f9fb85f8afed29f1582cc26570125de2171fb5d0fe
5
5
  SHA512:
6
- metadata.gz: 43483f6db196732505620756a314556d7a2c07c709df960995e87e56b68d7aa348271344c215307859b92bcc4f90c5c0afd349cabf999eaf7b64845698c4da11
7
- data.tar.gz: 9e0998e7819be5f14f4ad25a6beb8ddcd2de7da78858168e32b884d0b604347395f0b812b0fb3555e1773687d7cdbeaaf02893e09e1de9d2997e3a37b150f718
6
+ metadata.gz: 6549958abeefb479c647fde946cbb100c4283a2f3f7d3d88694c3edf41dab4e3eea6bbf0cd6813f806f74d02fded4c279a13b313a46873f5b38a22ab6f643615
7
+ data.tar.gz: d8d422b37676ffaef5116b4e78ec3fd49855633c0b1dd22f04e52da3125fb83a0b9108d1e43ce559fd964e66f89965167290246176a6413e2df2fdc437b64f25
data/CHANGELOG.md CHANGED
@@ -7,6 +7,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ### Added
11
+ - G mode supports `Ctrl+J` / `Ctrl+K` to select the next / previous result; Enter (CR) opens the selected result
12
+
13
+ ## [1.4.0] - 2026-11-02
14
+
15
+ ### Added
16
+ - `P` opens a fullscreen preview of the selected file that hides the file list; `j` / `k` and `Ctrl+D` / `Ctrl+U` scroll it, the mouse wheel scrolls it, and `ESC` returns to the file list. In Logs mode `P` opens a log the same way
17
+ - `:cd <path>` in command mode goes to a pasted path. A file path opens its folder and selects the file, relative paths start from the current directory, `cd -` returns to the previous directory, and `Tab` completes directory names. Surrounding quotes, a trailing newline, `\ ` escapes and `file://` URLs from copied paths are accepted
18
+ - Floating dialogs show scroll direction indicators when their content is longer than the dialog
19
+ - `docs/guide.md` / `docs/guide_ja.md` collect the full usage guide; the README now keeps only an overview and the main keys
20
+
21
+ ### Changed
22
+ - `Enter` only enters directories; it no longer moves focus to the preview for files (use `P`)
23
+ - Copying an item whose name already exists in the destination creates a numbered copy (`name_1.ext`, `dir_1`, ...) instead of failing. Moving still refuses to overwrite
24
+ - The help menu and info docs list the current keys and modes
25
+
10
26
  ## [1.3.0] - 2026-11-01
11
27
 
12
28
  ### Added
data/README.md CHANGED
@@ -32,8 +32,10 @@ rufio brings finding files, running scripts, and checking results together in on
32
32
  ### As a File Manager
33
33
 
34
34
  - **Vim-like Key Bindings**: Intuitive navigation
35
- - **Real-time Preview**: Instantly display file contents with syntax highlighting (via `bat`)
36
- - **Fast Search**: Integration with fzf/rga
35
+ - **Real-time Preview**: Instantly display file contents with syntax highlighting (via `bat`), including `.zip` entry lists
36
+ - **Fast Search**: Integration with fzf/rga, plus built-in search across all bookmarks that also reads PDF, Excel and PowerPoint
37
+ - **ZIP Archives**: Extract or compress selected items as a background job
38
+ - **Jump to a Path**: Paste any path into `:cd`
37
39
  - **Bookmarks**: Quick access to frequently used directories
38
40
  - **zoxide Integration**: Smart directory history
39
41
 
@@ -78,382 +80,38 @@ rufio /path/to # Launch in specified directory
78
80
 
79
81
  ## Key Bindings
80
82
 
81
- ### Basic Operations
82
-
83
- | Key | Function |
84
- |-----|----------|
85
- | `j/k` | Move up/down |
86
- | `h/l` | Parent/child directory |
87
- | `g/}` | Top/bottom |
88
- | `Enter` | Enter directory/open file |
89
- | `q` | Quit |
90
- | `T` | Quit and cd to the current directory ([Shell Integration](#shell-integration)) |
91
-
92
- ### File Operations
93
-
94
- | Key | Function |
95
- |-----|----------|
96
- | `Space` | Select/deselect |
97
- | `o` | Open with external editor |
98
- | `a/A` | Create file/directory |
99
- | `r` | Rename |
100
- | `d` | Delete |
101
- | `m/c/x` | Move/copy/delete (selected) |
102
- | `z` | Extract selected `.zip` files / compress selected items (selected) |
103
-
104
- ### Search & Filter
105
-
106
- | Key | Function |
107
- |-----|----------|
108
- | `f` | Filter mode |
109
- | `s` | Search files with fzf |
110
- | `F` | Search file contents with rga |
111
-
112
- ### Navigation
113
-
114
- | Key | Function |
115
- |-----|----------|
116
- | `b` | Add bookmark |
117
- | `B` | Bookmark menu |
118
- | `0` | Return to startup directory |
119
- | `1-9` | Jump to bookmark |
120
- | `Tab` | Cycle to next bookmark (Files mode only) |
121
- | `z` | zoxide history (when nothing is selected) |
122
-
123
- ### Tool Runtime
124
-
125
- | Key | Function |
126
- |-----|----------|
127
- | `:` | Command mode |
128
- | `G` | Search file names or contents across all bookmarked directories |
129
- | `C` | Open ~/.config/rufio/ in Config mode (same controls as Files) |
130
- | `J` | Job mode |
131
- | `L` | View execution logs |
83
+ The most used keys. See the **[User Guide](./docs/guide.md)** for every key and mode, or press `?` inside rufio.
84
+
85
+ | Key | Action |
86
+ |-----|--------|
87
+ | `j/k`, `h/l` | Move / parent directory / enter directory |
88
+ | `g/}` | First / last entry |
89
+ | `P` | Fullscreen preview |
90
+ | `Space` | Select |
91
+ | `m/c/x` | Move / copy / delete selected items |
92
+ | `z` | Extract or compress selected items (`.zip`); zoxide history when nothing is selected |
93
+ | `a/A`, `r`, `d` | Create file / directory, rename, delete |
94
+ | `f`, `s`, `F` | Filter, fzf file name search, rga content search |
95
+ | `G` | Search names or contents (PDF, Excel, PowerPoint too) across all bookmarks |
96
+ | `b`, `B`, `1-9`, `Tab` | Add bookmark, bookmark menu, jump, next bookmark |
97
+ | `:` | Command mode (`@script`, `rake:task`, `!shell`, `cd <path>`) |
98
+ | `J`, `L`, `C` | Jobs, logs, config directory |
132
99
  | `?` | Help |
133
- | `Shift+Tab` | Switch mode (reverse) |
100
+ | `q`, `T` | Quit, quit and cd the shell to the current directory |
134
101
 
135
- ### Global Search (G mode)
102
+ In G mode, use `Ctrl+J` / `Ctrl+K` to select the next / previous result and `Enter` to open it.
136
103
 
137
- Press `G` to search recursively across all bookmarked directories. `Tab`
138
- switches between **File names** and **Content**. Type a literal string to
139
- search (case insensitive); content results include the file, line number,
140
- and matching text. Plain text is read as UTF-8; other unsupported files containing
141
- NUL bytes in the first 8 KB are skipped as binary. Use Up/Down or Ctrl+N/P to select a
142
- result, and press Enter to jump to that file in Files mode. `Ctrl+U` clears
143
- the query; `Esc` cancels and returns to your previous view. Scanning runs in
144
- the background and skips inaccessible directories and directory symlinks.
145
- Add bookmarks with `b` before searching. G mode needs no external search tools.
146
- While scanning, a yellow `Searching...` indicator animates even before matches
147
- arrive. It turns green and displays `Search complete` when the scan finishes.
104
+ ## Documentation
148
105
 
149
- To exclude extensions from both file name and content searches, add this to
150
- `~/.config/rufio/config.rb` and restart Rufio:
151
-
152
- ```ruby
153
- GLOBAL_SEARCH_EXCLUDED_EXTENSIONS = %w[.png .jpg .zip .tar.gz .log].freeze
154
- ```
155
-
156
- Extensions are case insensitive and the leading dot is optional. The default
157
- is `[]` (no extension exclusions). Directory names are unaffected.
158
-
159
- #### PDF, Excel and PowerPoint content search (v1.2.0)
160
-
161
- Content mode also extracts text from documents using Ruby gems; Python,
162
- Microsoft Office and external conversion tools are not required.
163
-
164
- | File | Searchable content | Result location |
165
- |------|--------------------|-----------------|
166
- | `.pdf` | Extractable text | Page number |
167
- | `.xlsx` | Cell text and values | Sheet name and cell address |
168
- | `.pptx` | Text in slide shapes and tables | Slide number |
169
-
170
- Search remains literal and case insensitive. Split text runs in a PowerPoint
171
- paragraph are joined, and slides follow the presentation's display order.
172
- Excel formulas use the values saved in the workbook; Rufio does not recalculate them.
173
- Enter locates the original document in Files mode; it does not open Office at a cell or slide.
174
-
175
- Extracted text is cached in memory across searches within the running app.
176
- The cache keeps up to 64 documents and approximately 16 MiB of text and metadata;
177
- larger extracted documents remain searchable without being cached. Updated or
178
- replaced files are re-extracted. No document text cache is written to disk.
179
-
180
- Extension exclusions apply to documents too. Damaged, unsupported or encrypted
181
- documents may report errors while other files continue to be searched.
182
- Scanned images need OCR, which is not included. Legacy `.xls`/`.ppt`, slide notes,
183
- and text embedded only in images or charts are not supported by this implementation.
184
- PDF text extraction depends on the document's font and character mappings.
185
-
186
- ### Config Mode (C)
187
-
188
- Press `C` to open `~/.config/rufio/`, creating it if needed. Navigation, previews,
189
- and file operations work as in Files mode. Browse settings and scripts directly;
190
- leaving the config directory returns the mode display to Files.
191
-
192
- ### Shell Integration
193
-
194
- `rufio --shell-init` prints a shell function named `rf` for your OS: PowerShell on
195
- Windows, and your login shell (`bash`, `zsh` or `fish`) elsewhere. Pass the shell name to
196
- choose explicitly. Launch rufio with `rf` and press `T` to quit and move the shell to the
197
- directory you were viewing; `q` quits without moving.
198
-
199
- ```bash
200
- # bash / zsh (~/.bashrc or ~/.zshrc)
201
- eval "$(rufio --shell-init)"
202
-
203
- # fish (~/.config/fish/config.fish)
204
- rufio --shell-init fish | source
205
- ```
206
-
207
- ```powershell
208
- # PowerShell ($PROFILE)
209
- Invoke-Expression (& rufio --shell-init powershell | Out-String)
210
- ```
211
-
212
- To avoid starting Ruby with every shell, append the output once instead, for example
213
- `rufio --shell-init >> ~/.bashrc`.
214
-
215
- ## Command Mode
216
-
217
- Press `:` to enter command mode and execute various commands.
218
-
219
- ### Script Execution
220
-
221
- ```
222
- :@build # @ prefix triggers script completion
223
- :@deploy.rb # Execute registered script
224
- :@local.sh # Scripts in current directory are also available
225
- ```
226
-
227
- ### Rake Task Execution
228
-
229
- ```
230
- :rake:test # Execute rake task
231
- :rake:build # Tab completion supported
232
- ```
233
-
234
- Rakefile in the current directory is automatically parsed. Supports `Rakefile`, `rakefile`, `Rakefile.rb`.
235
-
236
- ### Shell Commands
237
-
238
- ```
239
- :!git status # ! prefix for shell commands
240
- :!ls -la # Execute in background
241
- ```
242
-
243
- ### Built-in Commands
244
-
245
- ```
246
- :hello # Greeting message
247
- :stop # Quit rufio
248
- ```
249
-
250
- ## Script Path
251
-
252
- ### What is Script Path?
253
-
254
- A feature to register directories containing script files. Scripts in registered directories can be executed using the `@` prefix in command mode.
255
-
256
- ### Management
257
-
258
- Press `B` → `3` to open the script path management menu:
259
-
260
- - View registered paths
261
- - `d`: Remove path
262
- - `Enter`: Jump to directory
263
- - `ESC`: Close menu
264
-
265
- ### Supported Scripts
266
-
267
- | Extension | Language |
268
- |-----------|----------|
269
- | `.rb` | Ruby |
270
- | `.py` | Python |
271
- | `.sh` | Shell (bash/zsh) |
272
- | `.js` | JavaScript (Node.js) |
273
- | `.ts` | TypeScript (ts-node/deno) |
274
- | `.pl` | Perl |
275
- | `.ps1` | PowerShell |
276
-
277
- ## DSL Commands
278
-
279
- Define custom commands in `~/.config/rufio/commands.rb`:
280
-
281
- ```ruby
282
- command "hello" do
283
- ruby { "Hello from rufio!" }
284
- description "Greeting command"
285
- end
286
-
287
- command "status" do
288
- shell "git status"
289
- description "Git status"
290
- end
291
-
292
- command "build" do
293
- script "~/.config/rufio/scripts/build.rb"
294
- description "Run build"
295
- end
296
- ```
297
-
298
- ## Configuration
299
-
300
- ### Configuration File Structure
301
-
302
- ```
303
- ~/.config/rufio/
304
- ├── config.rb # DSL-style main configuration
305
- ├── script_paths.yml # Script directories (list format)
306
- ├── bookmarks.yml # Bookmarks (list format)
307
- ├── commands.rb # DSL command definitions
308
- ├── scripts/ # Script files
309
- └── logs/ # Execution logs
310
- ```
311
-
312
- ### config.rb (DSL Configuration)
313
-
314
- ```ruby
315
- # ~/.config/rufio/config.rb
316
-
317
- # Language setting: 'en' or 'ja'
318
- LANGUAGE = 'ja'
319
-
320
- # Color settings (HSL format)
321
- COLORS = {
322
- directory: { hsl: [220, 80, 60] },
323
- file: { hsl: [0, 0, 90] },
324
- executable: { hsl: [120, 70, 50] },
325
- selected: { hsl: [50, 90, 70] },
326
- preview: { hsl: [180, 60, 65] }
327
- }.freeze
328
-
329
- # Keybind settings
330
- KEYBINDS = {
331
- quit: %w[q ESC],
332
- up: %w[k UP],
333
- down: %w[j DOWN]
334
- }.freeze
335
- ```
336
-
337
- ### script_paths.yml
338
-
339
- ```yaml
340
- # ~/.config/rufio/script_paths.yml
341
- - ~/.config/rufio/scripts
342
- - ~/bin
343
- - ~/scripts
344
- ```
345
-
346
- ### bookmarks.yml
347
-
348
- ```yaml
349
- # ~/.config/rufio/bookmarks.yml
350
- - path: ~/Documents
351
- name: Documents
352
- - path: ~/projects
353
- name: Projects
354
- ```
355
-
356
- ### Local Configuration
357
-
358
- Place `rufio.yml` in your project root for project-specific script paths:
359
-
360
- ```yaml
361
- # ./rufio.yml (project root)
362
- script_paths:
363
- - ./scripts
364
- - ./bin
365
- ```
366
-
367
- ## External Tool Integration
368
-
369
- rufio integrates with the following external tools to extend functionality.
370
- All tools are **optional** — rufio works without them, falling back to built-in behavior.
371
-
372
- | Tool | Purpose | Key | Required? |
373
- |------|---------|-----|-----------|
374
- | fzf | File name search | `s` | Optional |
375
- | rga | File content search | `F` | Optional |
376
- | zoxide | Directory history | `z` | Optional |
377
- | bat | Syntax highlighting in preview | — | Optional |
378
-
379
- ### bat — Syntax Highlighting
380
-
381
- When `bat` is installed, code files in the preview pane are displayed with full syntax
382
- highlighting (Ruby, Python, Go, Rust, TypeScript, and 15+ more languages).
383
-
384
- Highlighting is loaded asynchronously — navigation stays fast even on large source trees.
385
-
386
- ```bash
387
- # macOS
388
- brew install bat
389
-
390
- # Ubuntu/Debian
391
- apt install bat
392
- ```
393
-
394
- Run `rufio -c` to verify bat is detected correctly.
395
-
396
- ### Installation (all tools)
397
-
398
- ```bash
399
- # macOS
400
- brew install fzf bat rga zoxide
401
-
402
- # Ubuntu/Debian
403
- apt install fzf bat zoxide
404
- # rga requires separate installation: https://github.com/phiresky/ripgrep-all
405
- ```
406
-
407
- ## Advanced Features
408
-
409
- ### Native Content Search
410
-
411
- G mode content search uses a bundled Zig engine on macOS (arm64/x86_64), Linux (x86_64/aarch64, glibc 2.17+ or musl), and Windows (x64/arm64). It searches bookmarks in parallel and caches file contents between queries, so retyping a query is about 10x faster than `rg`. Other platforms, and queries containing non-ASCII letters with case, use the Ruby search automatically. Set `RUFIO_NATIVE_SEARCH=0` to disable it.
412
-
413
- ### ZIP Archives
414
-
415
- Select items in Files mode with `Space` and press `z`: when every selected item is a `.zip` file, each is extracted into `<name>/` in the current directory; otherwise the selection is compressed into one `.zip`. The work runs as a job (progress and cancel in Jobs mode). `.zip` files also show their entry list in the preview.
416
-
417
- Extraction validates the whole archive before writing anything: it rejects path traversal and absolute paths, overlapping entries, and archives over 16 GiB in total, 100,000 entries, or a 1000:1 compression ratio (for entries over 1 MiB); it skips symlink and encrypted entries, verifies CRC-32, and never overwrites existing files. Only Stored and Deflate entries are supported.
418
-
419
- On the same platforms as content search, the bundled Zig engine decompresses entries and compresses files of 1 MiB or more in parallel (in our measurements on 8 × 64 MB text files with 4 CPUs, about 4.6x faster to compress and 3.2x faster to extract than the Ruby implementation). Validation stays in Ruby either way. Set `RUFIO_NATIVE_ZIP=0` to use the Ruby implementation only.
420
-
421
- To rebuild the bundled binaries (requires Zig 0.17):
422
-
423
- ```bash
424
- make -C lib_zig/rufio_native dist # all platforms
425
- bundle exec rake native:check # verify bundled binaries
426
- ```
427
-
428
- ### Native Scanner (Experimental)
429
-
430
- Support for native implementation for fast directory scanning:
431
-
432
- ```bash
433
- rufio --native # Auto-detect
434
- rufio --native=zig # Zig implementation
435
- ```
436
-
437
- ### JIT Compiler
438
-
439
- ```bash
440
- rufio --yjit # Ruby 3.1+ YJIT
441
- rufio --zjit # Ruby 3.4+ ZJIT
442
- ```
443
-
444
- ### Health Check
445
-
446
- ```bash
447
- rufio -c # Check system dependencies
448
- rufio --check-health # Same as above
449
- ```
106
+ - **[User Guide](./docs/guide.md)**: keys, modes, command mode, scripts, DSL commands, configuration, shell integration and the native engine
107
+ - **[CHANGELOG](./CHANGELOG.md)**: release notes
108
+ - **[SECURITY.md](./SECURITY.md)**: security design
450
109
 
451
110
  ## Development
452
111
 
453
112
  ### Requirements
454
113
 
455
114
  - Ruby 2.7.0 or later
456
- - io-console, pastel, tty-cursor, tty-screen gems
457
115
 
458
116
  ### Running Development Version
459
117