rtfm-filemanager 7.3.6 → 7.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.
data/bin/rtfm CHANGED
@@ -18,7 +18,7 @@
18
18
  # get a great understanding of the code itself by simply sending
19
19
  # or pasting this whole file into you favorite AI for coding with
20
20
  # a prompt like this: "Help me understand every part of this code".
21
- @version = '7.3.6' # Preview toggle clears images and performance
21
+ @version = '7.4.0' # Comprehensive documentation release
22
22
 
23
23
  # SAVE & STORE TERMINAL {{{1
24
24
  ORIG_STTY = `stty -g`.chomp
@@ -0,0 +1,397 @@
1
+ # RTFM Configuration Guide
2
+
3
+ Complete guide to customizing RTFM.
4
+
5
+ ## Configuration File
6
+
7
+ Location: `~/.rtfm/conf`
8
+
9
+ RTFM automatically creates this file on first exit, saving:
10
+ - Bookmarks (@marks)
11
+ - Tagged items
12
+ - Command history
13
+ - Directory hashes
14
+
15
+ ## Viewing Configuration
16
+
17
+ | Action | Key |
18
+ |--------|-----|
19
+ | View current config | `C` |
20
+ | Save config | `W` |
21
+ | Reload config | `R` |
22
+
23
+ ## Core Settings
24
+
25
+ ### Display Options
26
+
27
+ ```ruby
28
+ # Toggle preview in right pane
29
+ @preview = true # false to disable
30
+
31
+ # Toggle image display
32
+ @showimage = true # false to disable
33
+
34
+ # Show hidden files
35
+ @lsall = "-a" # "" to hide hidden files
36
+
37
+ # Show long file info (ls -l format)
38
+ @lslong = true # false for compact view
39
+
40
+ # Pane width ratio (2-7)
41
+ # 2 = narrow left, 7 = wide left
42
+ @width = 5
43
+
44
+ # Border style (0-3)
45
+ # 0 = no borders
46
+ # 1 = right pane only
47
+ # 2 = both panes
48
+ # 3 = left pane only
49
+ @border = 2
50
+
51
+ # Syntax highlighting
52
+ @batuse = true # false to use plain cat
53
+ ```
54
+
55
+ ### File Operations
56
+
57
+ ```ruby
58
+ # Enable trash bin (move to ~/.rtfm/trash instead of permanent delete)
59
+ @trash = true # false for permanent deletion
60
+
61
+ # Use run-mailcap instead of xdg-open
62
+ @runmailcap = true # false to use xdg-open
63
+ ```
64
+
65
+ ### Sorting & Ordering
66
+
67
+ ```ruby
68
+ # Sort order
69
+ @lsorder = "" # "" = name
70
+ # "-S" = size
71
+ # "-t" = time
72
+ # "-X" = extension
73
+
74
+ # Invert sort
75
+ @lsinvert = "" # "-r" to reverse
76
+
77
+ # Additional ls options
78
+ @lsuser = "--ignore=test" # Any valid ls flags
79
+ ```
80
+
81
+ ### File Type Filtering
82
+
83
+ ```ruby
84
+ # Show only specific extensions
85
+ @lsfiles = "txt,md,rb" # Comma-separated extensions
86
+ # "" to show all
87
+ ```
88
+
89
+ ## Color Customization
90
+
91
+ ### Pane Colors
92
+
93
+ ```ruby
94
+ # Bottom pane background
95
+ @bottomcolor = 238
96
+
97
+ # Command mode background
98
+ @cmdcolor = 24
99
+
100
+ # Ruby debug mode background
101
+ @rubycolor = 52
102
+
103
+ # OpenAI chat background
104
+ @aicolor = 17
105
+ ```
106
+
107
+ ### Path-Based Top Bar Colors
108
+
109
+ Change top bar color based on current path:
110
+
111
+ ```ruby
112
+ @topmatch = [
113
+ ["projects", 165], # Blue when path contains "projects"
114
+ ["downloads", 220], # Yellow for downloads
115
+ ["personal", 156], # Green for personal
116
+ ["", 238] # Default gray
117
+ ]
118
+ ```
119
+
120
+ **Order matters:** First match wins. Last entry should have empty string for default.
121
+
122
+ ## Persistent Data
123
+
124
+ ### Bookmarks
125
+
126
+ ```ruby
127
+ # Directory bookmarks (saved automatically)
128
+ @marks = {
129
+ "h" => "/home/user",
130
+ "d" => "/home/user/Documents",
131
+ "p" => "/home/user/projects",
132
+ "0" => "/initial/launch/directory"
133
+ }
134
+ ```
135
+
136
+ **Special marks:**
137
+ - `'` - Last visited directory
138
+ - `0` - Launch directory
139
+ - `1-5` - Last 5 visited directories (auto-managed)
140
+
141
+ ### Command History
142
+
143
+ ```ruby
144
+ # Prepopulate command history
145
+ @history = [
146
+ "git status",
147
+ "ls -la",
148
+ "cat TODO.txt"
149
+ ]
150
+ ```
151
+
152
+ ### Ruby Command History
153
+
154
+ ```ruby
155
+ # Prepopulate Ruby debug history
156
+ @rubyhistory = [
157
+ "puts @selected",
158
+ "puts @tagged.inspect"
159
+ ]
160
+ ```
161
+
162
+ ### OpenAI History
163
+
164
+ ```ruby
165
+ # Prepopulate AI chat history
166
+ @aihistory = [
167
+ "Explain this code",
168
+ "What does this file do?"
169
+ ]
170
+ ```
171
+
172
+ ### SSH Connection History
173
+
174
+ ```ruby
175
+ # Prepopulate SSH connections
176
+ @sshhistory = [
177
+ "user@server.com:/var/www # Production",
178
+ "admin@192.168.1.10 # Local dev"
179
+ ]
180
+ ```
181
+
182
+ ### Directory Hashes
183
+
184
+ ```ruby
185
+ # Cryptographic hashes of directory trees
186
+ # (generated with H key, compared on subsequent runs)
187
+ @hash = {
188
+ "/home/user/important" => "abc123...",
189
+ "/etc/config" => "def456..."
190
+ }
191
+ ```
192
+
193
+ ## Advanced Settings
194
+
195
+ ### Interactive Program Whitelist
196
+
197
+ Programs that take full terminal control must be whitelisted:
198
+
199
+ ```ruby
200
+ @interactive = "htop,vim,emacs,nano,less,ranger,mc"
201
+ ```
202
+
203
+ **Add programs:**
204
+ - Press `+` in RTFM and type program name
205
+ - Or manually add to @interactive
206
+
207
+ **Force interactive mode:**
208
+ - Prefix command with `§`: `:§program`
209
+
210
+ ### OpenAI Integration
211
+
212
+ ```ruby
213
+ # Add your OpenAI API key
214
+ @ai = "sk-your-api-key-here"
215
+ ```
216
+
217
+ **Features enabled:**
218
+ - `I` - Get file description
219
+ - `Ctrl-a` - Start AI chat
220
+
221
+ **Get API key:** https://platform.openai.com/api-keys
222
+
223
+ ### Preview Customization
224
+
225
+ See [plugins.md](plugins.md) for custom preview handlers.
226
+
227
+ ## Configuration Best Practices
228
+
229
+ ### Organized Config File
230
+
231
+ ```ruby
232
+ # ~/.rtfm/conf - Well organized
233
+
234
+ # ============================================================
235
+ # DISPLAY SETTINGS
236
+ # ============================================================
237
+ @preview = true
238
+ @showimage = true
239
+ @batuse = true
240
+ @width = 5
241
+ @border = 2
242
+
243
+ # ============================================================
244
+ # FILE OPERATIONS
245
+ # ============================================================
246
+ @trash = true
247
+ @runmailcap = false
248
+
249
+ # ============================================================
250
+ # SORTING
251
+ # ============================================================
252
+ @lsall = "-a"
253
+ @lslong = false
254
+ @lsorder = ""
255
+ @lsinvert = ""
256
+
257
+ # ============================================================
258
+ # COLORS
259
+ # ============================================================
260
+ @bottomcolor = 238
261
+ @cmdcolor = 24
262
+ @aicolor = 17
263
+
264
+ @topmatch = [
265
+ ["work", 165],
266
+ ["personal", 156],
267
+ ["", 238]
268
+ ]
269
+
270
+ # ============================================================
271
+ # BOOKMARKS (auto-managed, but you can edit)
272
+ # ============================================================
273
+ @marks = {
274
+ "h" => ENV['HOME'],
275
+ "d" => "#{ENV['HOME']}/Documents",
276
+ "w" => "#{ENV['HOME']}/work"
277
+ }
278
+
279
+ # ============================================================
280
+ # HISTORY (auto-managed)
281
+ # ============================================================
282
+ @history = []
283
+ @rubyhistory = []
284
+ @aihistory = []
285
+ @sshhistory = []
286
+
287
+ # ============================================================
288
+ # ADVANCED
289
+ # ============================================================
290
+ @interactive = "htop,vim,nano,emacs,ranger"
291
+ @ai = "" # Add your OpenAI key here
292
+ ```
293
+
294
+ ### Testing Changes
295
+
296
+ After editing `~/.rtfm/conf`:
297
+ 1. Press `R` in RTFM to reload
298
+ 2. Or restart RTFM
299
+
300
+ ### Backing Up Config
301
+
302
+ ```bash
303
+ cp ~/.rtfm/conf ~/.rtfm/conf.backup
304
+ ```
305
+
306
+ ## Terminal-Specific Settings
307
+
308
+ ### urxvt / xterm / Eterm
309
+
310
+ No special configuration needed - works perfectly out of the box.
311
+
312
+ ### kitty
313
+
314
+ Images work with brief flash (w3m protocol limitation with kitty).
315
+
316
+ ### mlterm
317
+
318
+ Best Sixel protocol support - fast inline images.
319
+
320
+ ## Resetting Configuration
321
+
322
+ ```bash
323
+ # Backup current config
324
+ cp ~/.rtfm/conf ~/.rtfm/conf.old
325
+
326
+ # Delete config (will regenerate on next run)
327
+ rm ~/.rtfm/conf
328
+
329
+ # Or reset specific settings
330
+ r # Launch RTFM
331
+ W # Write default config
332
+ ```
333
+
334
+ ## Environment Variables
335
+
336
+ RTFM respects standard environment variables:
337
+
338
+ ```bash
339
+ # Default editor
340
+ export EDITOR=vim
341
+
342
+ # LS_COLORS for terminal theming
343
+ export LS_COLORS="di=1;34:ln=1;36:..."
344
+
345
+ # OpenAI key (alternative to @ai in config)
346
+ export OPENAI_API_KEY="sk-..."
347
+ ```
348
+
349
+ ## Performance Tuning
350
+
351
+ ### For Large Directories
352
+
353
+ ```ruby
354
+ # Turn off preview for faster navigation
355
+ @preview = false
356
+
357
+ # Turn off long info
358
+ @lslong = false
359
+
360
+ # Disable images
361
+ @showimage = false
362
+ ```
363
+
364
+ ### For Slow Networks (SSH)
365
+
366
+ Enable persistent SSH connections in `~/.ssh/config`:
367
+ ```
368
+ Host *
369
+ ControlMaster auto
370
+ ControlPath ~/.ssh/control-%r@%h:%p
371
+ ControlPersist 10m
372
+ ```
373
+
374
+ ## Troubleshooting
375
+
376
+ ### Config File Errors
377
+
378
+ If RTFM won't start after editing config:
379
+
380
+ ```bash
381
+ # Check for syntax errors
382
+ ruby -c ~/.rtfm/conf
383
+
384
+ # Restore backup
385
+ cp ~/.rtfm/conf.backup ~/.rtfm/conf
386
+ ```
387
+
388
+ ### Reset to Defaults
389
+
390
+ ```bash
391
+ mv ~/.rtfm ~/.rtfm.old
392
+ # Restart RTFM - creates fresh config
393
+ ```
394
+
395
+ ---
396
+
397
+ [← Getting Started](getting-started.md) | [Next: Keyboard Reference →](keyboard-reference.md)