rtfm-filemanager 1.7.2 → 1.8.1
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 +4 -4
- data/bin/rtfm +27 -15
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5dcdef99c7f6967e0925bb3b845e52234ad4b452addc8e6744e27d0a3245b34e
|
4
|
+
data.tar.gz: eb88eb47c8a8012f2572a552a488b0cd22d4bcca026603e950dc51853d80ac7d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3a148d5fdc968b8fbdbb0d506f55ce5c72362ca1e49f326e664e1b2d1baf7bad65a09e0c776394aebb190376857d29b81c1d6aef2a5e20e767279b1e45155064
|
7
|
+
data.tar.gz: 0b0545fe445c78e284817bab8a83319935e9519117e809f8517f30d7354bb724b1b32af861588886a59e37edd6888f58eda54ed0fd98c48424be4da8d10d98ab
|
data/bin/rtfm
CHANGED
@@ -46,10 +46,11 @@ JUMPING AND MARKS
|
|
46
46
|
Press '-' and a letter to delete that mark
|
47
47
|
M = Show marked items in right pane
|
48
48
|
' = Jump to mark (next letter is the name of the mark [a-zA-Z'])
|
49
|
+
The 5 latest directories visited are stored in marks 1-5 (1 being the very latest)
|
49
50
|
/ = Enter search string in bottom window to highlight matching items and jump to the first match
|
50
51
|
n = Jump to the next item matched by '/'
|
51
52
|
N = Jump to the previous item matched by '/'
|
52
|
-
|
53
|
+
~ = Jump to Home directory
|
53
54
|
f = Follow symlink to the directory where the target resides
|
54
55
|
L = Start 'locate' search for files, then use '#' to jump to desired line/directory
|
55
56
|
|
@@ -315,7 +316,7 @@ def main_getkey # GET KEY FROM USER
|
|
315
316
|
var_resets
|
316
317
|
cur_dir = Dir.pwd
|
317
318
|
@directory[Dir.pwd] = @selected # Store this directory before leaving
|
318
|
-
|
319
|
+
mark_latest
|
319
320
|
Dir.chdir("..")
|
320
321
|
@directory[Dir.pwd] = File.basename(cur_dir) unless @directory.key?(Dir.pwd)
|
321
322
|
@w_r.update = true
|
@@ -323,14 +324,14 @@ def main_getkey # GET KEY FROM USER
|
|
323
324
|
when 'RIGHT', 'l'
|
324
325
|
var_resets
|
325
326
|
@directory[Dir.pwd] = @selected # Store this directory before leaving
|
326
|
-
|
327
|
+
mark_latest
|
327
328
|
open_selected()
|
328
329
|
@w_r.update = true
|
329
330
|
@w_b.update = true
|
330
331
|
when 'x' # Force open with file opener (used to open HTML files in browser)
|
331
332
|
var_resets
|
332
333
|
@directory[Dir.pwd] = @selected # Store this directory before leaving
|
333
|
-
|
334
|
+
mark_latest
|
334
335
|
open_selected(true)
|
335
336
|
@w_r.update = true
|
336
337
|
@w_b.update = true
|
@@ -370,14 +371,12 @@ def main_getkey # GET KEY FROM USER
|
|
370
371
|
@w_r.update = false
|
371
372
|
@w_b.update = true
|
372
373
|
when 'M' # Show marks
|
373
|
-
@marks = @marks.sort.to_h
|
374
|
-
@w_r.fg = 147
|
375
374
|
marks_info
|
376
375
|
@w_r.update = false
|
377
376
|
@w_b.update = true
|
378
377
|
when "'" # Jump to mark
|
379
378
|
marks_info
|
380
|
-
m =
|
379
|
+
m = stdscr.getch.to_s
|
381
380
|
if m.match(/[\w']/) and @marks[m]
|
382
381
|
var_resets
|
383
382
|
@directory[Dir.pwd] = @selected # Store this directory before leaving
|
@@ -387,20 +386,21 @@ def main_getkey # GET KEY FROM USER
|
|
387
386
|
rescue
|
388
387
|
w_b_info(" No such directory")
|
389
388
|
end
|
389
|
+
mark_latest
|
390
390
|
@marks["'"] = dir_before
|
391
391
|
end
|
392
392
|
@w_r.update = true
|
393
393
|
@w_b.update = true
|
394
|
-
when '
|
394
|
+
when '~' # Go to home dir
|
395
395
|
var_resets
|
396
396
|
@directory[Dir.pwd] = @selected # Store this directory before leaving
|
397
|
-
|
397
|
+
mark_latest
|
398
398
|
Dir.chdir
|
399
399
|
@w_r.update = true
|
400
400
|
@w_b.update = true
|
401
401
|
when 'f' # Follow symlink
|
402
402
|
@directory[Dir.pwd] = @selected # Store this directory before leaving
|
403
|
-
|
403
|
+
mark_latest
|
404
404
|
if File.symlink?(@selected)
|
405
405
|
begin
|
406
406
|
Dir.chdir(File.dirname(File.readlink(@selected)))
|
@@ -426,7 +426,7 @@ def main_getkey # GET KEY FROM USER
|
|
426
426
|
jumpdir = File.dirname(jumpdir)
|
427
427
|
end
|
428
428
|
@directory[Dir.pwd] = @selected # Store this directory before leaving
|
429
|
-
|
429
|
+
mark_latest
|
430
430
|
Dir.chdir(jumpdir)
|
431
431
|
@w_r.pager = 0
|
432
432
|
end
|
@@ -461,15 +461,12 @@ def main_getkey # GET KEY FROM USER
|
|
461
461
|
when 'p' # Copy tagged items here
|
462
462
|
copy_move_link("copy")
|
463
463
|
@w_r.update = true
|
464
|
-
@w_b.update = true
|
465
464
|
when 'P' # Move tagged items here
|
466
465
|
copy_move_link("move")
|
467
466
|
@w_r.update = true
|
468
|
-
@w_b.update = true
|
469
467
|
when 's' # Create symlink to tagged items here
|
470
468
|
copy_move_link("link")
|
471
469
|
@w_r.update = true
|
472
|
-
@w_b.update = true
|
473
470
|
when 'd' # Delete items tagged and @selected
|
474
471
|
tagged_info
|
475
472
|
w_b_info(" Delete selected and tagged? (press 'd' again to delete)")
|
@@ -769,6 +766,14 @@ def ansifix(text) # Format [[fg, attr, text]]
|
|
769
766
|
end
|
770
767
|
return output
|
771
768
|
end
|
769
|
+
def mark_latest
|
770
|
+
@marks["5"] = @marks["4"]
|
771
|
+
@marks["4"] = @marks["3"]
|
772
|
+
@marks["3"] = @marks["2"]
|
773
|
+
@marks["2"] = @marks["1"]
|
774
|
+
@marks["1"] = @marks["'"]
|
775
|
+
@marks["'"] = Dir.pwd
|
776
|
+
end
|
772
777
|
# TOP WINDOW FUNCTIONS
|
773
778
|
def w_t_info # SHOW INFO IN @w_t
|
774
779
|
text = " " + ENV['USER'].to_s + "@" + `hostname 2>/dev/null`.to_s.chop + ": " + Dir.pwd + "/"
|
@@ -890,7 +895,7 @@ end
|
|
890
895
|
def open_selected(html = nil) # OPEN SELECTED ITEM (when pressing RIGHT)
|
891
896
|
if File.directory?(@selected) # Rescue for permission error
|
892
897
|
begin
|
893
|
-
|
898
|
+
mark_latest
|
894
899
|
Dir.chdir(@selected)
|
895
900
|
rescue
|
896
901
|
end
|
@@ -924,10 +929,13 @@ def copy_move_link(type) # COPY OR MOVE TAGGED ITEMS (COPY IF "keep == true")
|
|
924
929
|
case type
|
925
930
|
when "copy"
|
926
931
|
FileUtils.cp_r(item, dest)
|
932
|
+
w_b_info(" Item(s) copied here.")
|
927
933
|
when "move"
|
928
934
|
FileUtils.mv(item, dest)
|
935
|
+
w_b_info(" Item(s) moved here.")
|
929
936
|
when "link"
|
930
937
|
FileUtils.ln_s(item, dest)
|
938
|
+
w_b_info(" Item(s) symlinked here.")
|
931
939
|
end
|
932
940
|
rescue StandardError => err
|
933
941
|
w_b_info(err.to_s)
|
@@ -1036,6 +1044,8 @@ def w_r_info(info) # SHOW INFO IN THE RIGHT WINDOW
|
|
1036
1044
|
@w_r.update = false
|
1037
1045
|
end
|
1038
1046
|
def marks_info # SHOW MARKS IN RIGHT WINDOW
|
1047
|
+
@w_r.fg = 183
|
1048
|
+
@marks = @marks.sort.to_h
|
1039
1049
|
info = "MARKS:\n"
|
1040
1050
|
unless @marks.empty?
|
1041
1051
|
@marks.each do |mark, dir|
|
@@ -1304,6 +1314,8 @@ def w_b_exec(cmd) # EXECUTE COMMAND FROM @W_B
|
|
1304
1314
|
pager_start
|
1305
1315
|
pager_show
|
1306
1316
|
@w_r.update = false
|
1317
|
+
else
|
1318
|
+
@w_r.update = true
|
1307
1319
|
end
|
1308
1320
|
}
|
1309
1321
|
rescue
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rtfm-filemanager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Geir Isene
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-12-
|
11
|
+
date: 2021-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: curses
|
@@ -33,8 +33,8 @@ dependencies:
|
|
33
33
|
description: 'A full featured terminal browser with syntax highlighted files, images
|
34
34
|
shown in the terminal, videos thumbnailed, etc. You can bookmark and jump around
|
35
35
|
easily, delete, rename, copy, symlink and move files. RTFM has a a wide range of
|
36
|
-
other features. New in 1.
|
37
|
-
|
36
|
+
other features. New in 1.8.0: The 5 latest directories visited are stored in marks
|
37
|
+
1-5 (1 being the very latest), 1.8.1: Small bug fix in the storing the 1-5 marks.'
|
38
38
|
email: g@isene.com
|
39
39
|
executables:
|
40
40
|
- rtfm
|