rtfm-filemanager 1.7.1 → 1.8.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 +4 -4
- data/bin/rtfm +31 -15
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1a5fdd577ea09bf7b15b8f6e13dc554ac9db1b8643d39ad64091d1db3ce550ff
|
4
|
+
data.tar.gz: a2747f9fb64d1b841a79598016d8b6b659cf386ecc2b6f49bb375fd948d4a174
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4952148b138ccea17ef1d3834e378acbb3aa275ed580343c02ea5566f07f09cb92373dbd05d23a7b3395fe0196bf48dbcf9aa0b714cda6d2d07712d8c9b4696
|
7
|
+
data.tar.gz: 9f33313d3e6d14ff4c76afc808b7c3f429b8bf1eefe928fccb8ccd5e756f5f12640219750b15f547f7e7b8627e8c5aa2b1c5f10bc3844672fdb657ffb0099104
|
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
|
@@ -377,7 +378,7 @@ def main_getkey # GET KEY FROM USER
|
|
377
378
|
@w_b.update = true
|
378
379
|
when "'" # Jump to mark
|
379
380
|
marks_info
|
380
|
-
m =
|
381
|
+
m = stdscr.getch.to_s
|
381
382
|
if m.match(/[\w']/) and @marks[m]
|
382
383
|
var_resets
|
383
384
|
@directory[Dir.pwd] = @selected # Store this directory before leaving
|
@@ -387,20 +388,21 @@ def main_getkey # GET KEY FROM USER
|
|
387
388
|
rescue
|
388
389
|
w_b_info(" No such directory")
|
389
390
|
end
|
391
|
+
mark_latest
|
390
392
|
@marks["'"] = dir_before
|
391
393
|
end
|
392
394
|
@w_r.update = true
|
393
395
|
@w_b.update = true
|
394
|
-
when '
|
396
|
+
when '~' # Go to home dir
|
395
397
|
var_resets
|
396
398
|
@directory[Dir.pwd] = @selected # Store this directory before leaving
|
397
|
-
|
399
|
+
mark_latest
|
398
400
|
Dir.chdir
|
399
401
|
@w_r.update = true
|
400
402
|
@w_b.update = true
|
401
403
|
when 'f' # Follow symlink
|
402
404
|
@directory[Dir.pwd] = @selected # Store this directory before leaving
|
403
|
-
|
405
|
+
mark_latest
|
404
406
|
if File.symlink?(@selected)
|
405
407
|
begin
|
406
408
|
Dir.chdir(File.dirname(File.readlink(@selected)))
|
@@ -426,7 +428,7 @@ def main_getkey # GET KEY FROM USER
|
|
426
428
|
jumpdir = File.dirname(jumpdir)
|
427
429
|
end
|
428
430
|
@directory[Dir.pwd] = @selected # Store this directory before leaving
|
429
|
-
|
431
|
+
mark_latest
|
430
432
|
Dir.chdir(jumpdir)
|
431
433
|
@w_r.pager = 0
|
432
434
|
end
|
@@ -461,15 +463,12 @@ def main_getkey # GET KEY FROM USER
|
|
461
463
|
when 'p' # Copy tagged items here
|
462
464
|
copy_move_link("copy")
|
463
465
|
@w_r.update = true
|
464
|
-
@w_b.update = true
|
465
466
|
when 'P' # Move tagged items here
|
466
467
|
copy_move_link("move")
|
467
468
|
@w_r.update = true
|
468
|
-
@w_b.update = true
|
469
469
|
when 's' # Create symlink to tagged items here
|
470
470
|
copy_move_link("link")
|
471
471
|
@w_r.update = true
|
472
|
-
@w_b.update = true
|
473
472
|
when 'd' # Delete items tagged and @selected
|
474
473
|
tagged_info
|
475
474
|
w_b_info(" Delete selected and tagged? (press 'd' again to delete)")
|
@@ -632,12 +631,16 @@ def main_getkey # GET KEY FROM USER
|
|
632
631
|
@w_b.update = true
|
633
632
|
when '-'
|
634
633
|
@preview = !@preview
|
634
|
+
@preview ? p = "On" : p = "Off"
|
635
|
+
w_b_info("Preview = " + p)
|
636
|
+
getch
|
635
637
|
@break = true
|
636
|
-
@w_b.update = true
|
637
638
|
when '_'
|
638
639
|
@showimage = !@showimage
|
640
|
+
@showimage ? i = "On" : i = "Off"
|
641
|
+
w_b_info("Image preview = " + i)
|
642
|
+
getch
|
639
643
|
@break = true
|
640
|
-
@w_b.update = true
|
641
644
|
# ADDITIONAL COMMANDS
|
642
645
|
when '/' # Get search string to mark items that match the input
|
643
646
|
@w_b.nohistory = true
|
@@ -765,6 +768,14 @@ def ansifix(text) # Format [[fg, attr, text]]
|
|
765
768
|
end
|
766
769
|
return output
|
767
770
|
end
|
771
|
+
def mark_latest
|
772
|
+
@marks["5"] = @marks["4"]
|
773
|
+
@marks["4"] = @marks["3"]
|
774
|
+
@marks["3"] = @marks["2"]
|
775
|
+
@marks["2"] = @marks["1"]
|
776
|
+
@marks["1"] = Dir.pwd
|
777
|
+
@marks["'"] = Dir.pwd
|
778
|
+
end
|
768
779
|
# TOP WINDOW FUNCTIONS
|
769
780
|
def w_t_info # SHOW INFO IN @w_t
|
770
781
|
text = " " + ENV['USER'].to_s + "@" + `hostname 2>/dev/null`.to_s.chop + ": " + Dir.pwd + "/"
|
@@ -886,7 +897,7 @@ end
|
|
886
897
|
def open_selected(html = nil) # OPEN SELECTED ITEM (when pressing RIGHT)
|
887
898
|
if File.directory?(@selected) # Rescue for permission error
|
888
899
|
begin
|
889
|
-
|
900
|
+
mark_latest
|
890
901
|
Dir.chdir(@selected)
|
891
902
|
rescue
|
892
903
|
end
|
@@ -920,10 +931,13 @@ def copy_move_link(type) # COPY OR MOVE TAGGED ITEMS (COPY IF "keep == true")
|
|
920
931
|
case type
|
921
932
|
when "copy"
|
922
933
|
FileUtils.cp_r(item, dest)
|
934
|
+
w_b_info(" Item(s) copied here.")
|
923
935
|
when "move"
|
924
936
|
FileUtils.mv(item, dest)
|
937
|
+
w_b_info(" Item(s) moved here.")
|
925
938
|
when "link"
|
926
939
|
FileUtils.ln_s(item, dest)
|
940
|
+
w_b_info(" Item(s) symlinked here.")
|
927
941
|
end
|
928
942
|
rescue StandardError => err
|
929
943
|
w_b_info(err.to_s)
|
@@ -1300,6 +1314,8 @@ def w_b_exec(cmd) # EXECUTE COMMAND FROM @W_B
|
|
1300
1314
|
pager_start
|
1301
1315
|
pager_show
|
1302
1316
|
@w_r.update = false
|
1317
|
+
else
|
1318
|
+
@w_r.update = true
|
1303
1319
|
end
|
1304
1320
|
}
|
1305
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.0
|
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,7 +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.
|
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)'
|
37
38
|
email: g@isene.com
|
38
39
|
executables:
|
39
40
|
- rtfm
|