rtfm-filemanager 2.6.4 → 2.7
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/README.md +3 -1
- data/bin/rtfm +50 -27
- 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: 2aa222a4668d6751af768b71fb4041d9a8f2c07b9546c2c6a85a3599fd99f9b5
|
4
|
+
data.tar.gz: bac0932190b194982ea98da8f20919b101a2e0be293a8bbc1e8ec77fbc67bb5d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0048f6b34b0cadef7d539330ea23f45b782e2718b843b46f648c4d3f00dc67fd73561b2a55fd494b9a5af50e873afb0b8f9234bb4b663be325b812208736d137'
|
7
|
+
data.tar.gz: e8c03a48d9b6b17bd248b377ce7f82f2d783989fa412e3aacdf803c1561e347855c3a4072a75ea63f966ba43be30efb952b51ef966e533a65193953718d1944c
|
data/README.md
CHANGED
@@ -232,8 +232,9 @@ S-TAB | Previous page (if you have moved down the document first - ∆ in the t
|
|
232
232
|
w | Change the width of the left/right panes (left pane ⇒ ⅓ ⇒ ¼ ⇒ ⅕ ⇒ ⅙ ⇒ ½ ⇒ ⅓)
|
233
233
|
\- | Toggle preview in right pane (turn it off for faster traversing of directories)
|
234
234
|
_ | Toggle preview of images in right pane
|
235
|
+
b | Toggle syntax highlighting (and line numbering)
|
235
236
|
|
236
|
-
###
|
237
|
+
### Additional commands
|
237
238
|
|
238
239
|
Key | Description
|
239
240
|
-------|------------------------------------------------------------------
|
@@ -245,6 +246,7 @@ B | Toggle border
|
|
245
246
|
; | Show command history in right pane
|
246
247
|
y | Copy path of selected item to primary selection (for pasting with middle mouse button)
|
247
248
|
Y | Copy path of selected item to clipboard
|
249
|
+
C-Y | Copy content of right pane to clipboard
|
248
250
|
S | Show comprehensive system info (system, CPU, filesystem, latest dmesg messages)
|
249
251
|
Ctrl-n | Invoke navi (see https://github.com/denisidoro/navi) with any output in right window
|
250
252
|
|
data/bin/rtfm
CHANGED
@@ -56,7 +56,6 @@ JUMPING AND MARKS
|
|
56
56
|
L = Start 'locate' search for files, then use '#' to jump to desired line/directory
|
57
57
|
Ctrl-l = Locate files via fzf from the current directory down
|
58
58
|
(fuzzy file finder must be installed https://github.com/junegunn/fzf)
|
59
|
-
Ctrl-n = Invoke navi (see https://github.com/denisidoro/navi) with any output in right window
|
60
59
|
|
61
60
|
TAGGING
|
62
61
|
t = Tag item (toggles)
|
@@ -93,8 +92,9 @@ RIGHT PANE
|
|
93
92
|
w = Change the width of the left/right panes (left pane ⇒ ⅓ ⇒ ¼ ⇒ ⅕ ⇒ ⅙ ⇒ ½ ⇒ ⅓)
|
94
93
|
- = (Minus sign) Toggle preview in right pane (turn it off for faster traversing of directories)
|
95
94
|
_ = (Underscore) Toggle preview of images in right pane
|
95
|
+
b = Toggle syntax highlighting (and line numbering)
|
96
96
|
|
97
|
-
|
97
|
+
ADDITIONAL COMMANDS
|
98
98
|
f = Show only files in the left pane matching extension(s) (e.g. "txt" or "pdf,png,jpg")
|
99
99
|
F = Show only files matching a pattern (Ruby Regex) (e.g. "abc" or "ab.+12(\w3)*")
|
100
100
|
g = Run 'grep' to show files that contains the MATCH in current directory
|
@@ -103,7 +103,9 @@ ADDITINAL COMMANDS
|
|
103
103
|
; = Show command history in right pane
|
104
104
|
y = Copy path of selected item to primary selection (for pasting with middle mouse button)
|
105
105
|
Y = Copy path of selected item to clipboard
|
106
|
+
C-Y = Copy content of right pane to clipboard
|
106
107
|
S = Show comprehensive System info (system, CPU, filesystem, latest dmesg messages)
|
108
|
+
Ctrl-n = Invoke navi (see https://github.com/denisidoro/navi) with any output in right window
|
107
109
|
|
108
110
|
COPYRIGHT: Geir Isene, 2020-3. No rights reserved. See http://isene.com for more.
|
109
111
|
HELPTEXT
|
@@ -154,6 +156,7 @@ begin # BASIC SETUP
|
|
154
156
|
@showimage = false unless (cmd?('xwininfo') and cmd?('xdotool'))
|
155
157
|
|
156
158
|
cmd?('bat') ? @bat = "bat" : @bat = "batcat"
|
159
|
+
@batuse = true
|
157
160
|
|
158
161
|
STDIN.set_encoding(Encoding::UTF_8) # Set encoding for STDIN
|
159
162
|
LScolors = `echo $LS_COLORS` # Import LS_COLORS
|
@@ -189,6 +192,7 @@ begin # BASIC SETUP
|
|
189
192
|
@lsfiles = "" # File types to show (initially set to all file types) - not saved on exit
|
190
193
|
@lsmatch = "" # Files to match (initially set to matching all files) - not saved on exit
|
191
194
|
@index = 0 # Set chosen item to first on startup
|
195
|
+
@cont = ""
|
192
196
|
@navi = ""
|
193
197
|
@marks["'"] = Dir.pwd
|
194
198
|
## File type recognizers
|
@@ -309,6 +313,7 @@ def getchr # PROCESS KEY PRESSES
|
|
309
313
|
when "" then chr = "C-L"
|
310
314
|
when "" then chr = "C-N"
|
311
315
|
when "" then chr = "C-T"
|
316
|
+
when "" then chr = "C-Y"
|
312
317
|
when "\r" then chr = "ENTER"
|
313
318
|
when "\t" then chr = "TAB"
|
314
319
|
when /./ then chr = c
|
@@ -543,14 +548,14 @@ def main_getkey # GET KEY FROM USER
|
|
543
548
|
w_b_info(err.to_s)
|
544
549
|
end
|
545
550
|
@w_r.update = true
|
546
|
-
when 'z'
|
551
|
+
when 'z' # Unzip selected archive file
|
547
552
|
cmd = w_b_getstr("Command = ", "tar xfz #{@tagged.first}")
|
548
553
|
begin
|
549
554
|
w_b_exec(cmd + " 2>/dev/null")
|
550
555
|
rescue StandardError => err
|
551
556
|
w_b_info(err.to_s)
|
552
557
|
end
|
553
|
-
when 'Z'
|
558
|
+
when 'Z' # Create archive file
|
554
559
|
arc = w_b_getstr("Archive name: ", "")
|
555
560
|
cmd = w_b_getstr("Command = ", "tar cfz #{arc}.gz #{@tagged.join(" ")}")
|
556
561
|
begin
|
@@ -669,7 +674,7 @@ def main_getkey # GET KEY FROM USER
|
|
669
674
|
rescue
|
670
675
|
w_r_info("Unable to show system info")
|
671
676
|
end
|
672
|
-
when 'I'
|
677
|
+
when 'I' # OpenAI integration
|
673
678
|
if @ai
|
674
679
|
openai
|
675
680
|
else
|
@@ -701,21 +706,24 @@ def main_getkey # GET KEY FROM USER
|
|
701
706
|
@width = 2 if @width == 7
|
702
707
|
@break = true
|
703
708
|
@w_b.update = true
|
704
|
-
when 'B'
|
709
|
+
when 'B' # Toggle borders
|
705
710
|
@border = !@border
|
706
711
|
@break = true
|
707
|
-
when '-'
|
712
|
+
when '-' # Toggle content view in right pane
|
708
713
|
@preview = !@preview
|
709
714
|
@preview ? p = "On" : p = "Off"
|
710
715
|
w_b_info("Preview = " + p)
|
711
716
|
getch
|
712
717
|
@break = true
|
713
|
-
when '_'
|
718
|
+
when '_' # Toggle image view
|
714
719
|
@showimage = !@showimage
|
715
720
|
@showimage ? i = "On" : i = "Off"
|
716
721
|
w_b_info("Image preview = " + i)
|
717
722
|
getch
|
718
723
|
@break = true
|
724
|
+
when 'b'
|
725
|
+
@batuse = !@batuse
|
726
|
+
@break = true
|
719
727
|
# ADDITIONAL COMMANDS
|
720
728
|
when 'f' # Filter out filetypes not matching @lsfiles
|
721
729
|
loop do
|
@@ -726,7 +734,7 @@ def main_getkey # GET KEY FROM USER
|
|
726
734
|
when 'F' # Filter out files not matching @lsmatch
|
727
735
|
@lsmatch = w_b_getstr("Files will match RegEx: ", @lsmatch)
|
728
736
|
w_b_info(nil)
|
729
|
-
when 'C-L'
|
737
|
+
when 'C-L' # fzf integration (https://github.com/junegunn/fzf)
|
730
738
|
begin
|
731
739
|
jump = `fzf`.chomp
|
732
740
|
rescue
|
@@ -738,7 +746,7 @@ def main_getkey # GET KEY FROM USER
|
|
738
746
|
mark_latest
|
739
747
|
Dir.chdir(jumpdir)
|
740
748
|
@break = true
|
741
|
-
when 'C-N'
|
749
|
+
when 'C-N' # navi integration (https://github.com/denisidoro/navi)
|
742
750
|
begin
|
743
751
|
@navi = `navi`
|
744
752
|
rescue
|
@@ -796,6 +804,19 @@ def main_getkey # GET KEY FROM USER
|
|
796
804
|
end
|
797
805
|
system("echo -n '#{path}' | #{clip}")
|
798
806
|
end
|
807
|
+
when 'C-Y' # Copy right pane to clipboard
|
808
|
+
clip = "xclip -selection clipboard"
|
809
|
+
@cont.gsub!(/ ¤¤\d+¤¤\d*¤¤/, '')
|
810
|
+
@cont.gsub!(/^¤¤\d+¤¤\d*¤¤ */, '')
|
811
|
+
@cont.gsub!(/¤¤\d+¤¤\d*¤¤/, '')
|
812
|
+
@cont.gsub!(/ /, '')
|
813
|
+
@cont.gsub!(/ (\d)/, '\1')
|
814
|
+
@cont.gsub!(/\[(\d+;)+\d+m/, '')
|
815
|
+
@cont = @cont.inspect
|
816
|
+
@cont.gsub!('\"', '"')
|
817
|
+
@cont = @cont [1...-1]
|
818
|
+
w_b_info(" Right pane copied to clipboard")
|
819
|
+
system("echo -n '#{@cont}' | #{clip}")
|
799
820
|
when '@' # Enter "Ruby debug"
|
800
821
|
@w_b.nohistory = true
|
801
822
|
cmd = w_b_getstr("◆ ", "")
|
@@ -851,15 +872,8 @@ def conf_write
|
|
851
872
|
conf += "@preview = #{@preview}\n"
|
852
873
|
conf.sub!(/^@showimage.*\n/, "")
|
853
874
|
conf += "@showimage = #{@showimage}\n"
|
854
|
-
|
855
|
-
|
856
|
-
w_b_info(" Parameters written to .rtfm.conf")
|
857
|
-
@w_r.update = true
|
858
|
-
else
|
859
|
-
w_b_info(" Config NOT updated")
|
860
|
-
@w_r.update = true
|
861
|
-
return
|
862
|
-
end
|
875
|
+
@w_r.fg = 249
|
876
|
+
w_r_info("Configuration written to .rtfm.conf:\n\n" + conf)
|
863
877
|
end
|
864
878
|
File.write(Dir.home+'/.rtfm.conf', conf)
|
865
879
|
end
|
@@ -948,6 +962,7 @@ def list_dir(active) # LIST CONTENT OF A DIRECTORY (BOTH active AND RIGHT WINDOW
|
|
948
962
|
ix = @index - @w_l.maxy/2 if @index > @w_l.maxy/2 and @files.size > @w_l.maxy - 1
|
949
963
|
else
|
950
964
|
win = @w_r
|
965
|
+
@cont = ""
|
951
966
|
end
|
952
967
|
while ix < @files.size and t < win.maxy do
|
953
968
|
str = @files[ix]
|
@@ -1006,6 +1021,7 @@ def list_dir(active) # LIST CONTENT OF A DIRECTORY (BOTH active AND RIGHT WINDOW
|
|
1006
1021
|
return
|
1007
1022
|
end
|
1008
1023
|
str += link + dir
|
1024
|
+
@cont += str + "\n" unless active # Adds to content in right win for copying
|
1009
1025
|
win.attron(file_marker) { win << str } # Implement color/bold to the item
|
1010
1026
|
win.clrtoeol
|
1011
1027
|
win << "\n"
|
@@ -1089,12 +1105,17 @@ def w_r_show # SHOW CONTENTS IN THE RIGHT WINDOW
|
|
1089
1105
|
list_dir(false)
|
1090
1106
|
# TEXT
|
1091
1107
|
elsif File.read(@selected).force_encoding("UTF-8").valid_encoding? and @w_r.pager == 0
|
1092
|
-
|
1093
|
-
|
1094
|
-
|
1095
|
-
|
1096
|
-
|
1097
|
-
|
1108
|
+
if @batuse
|
1109
|
+
begin # View the file as text if it is utf-8
|
1110
|
+
@w_r.pager_cmd = "#{@bat} -n --color=always #{@selected_safe} 2>/dev/null"
|
1111
|
+
@w_r.text = `#{@bat} -n --color=always --line-range :#{@w_r.maxy} #{@selected_safe} 2>/dev/null`
|
1112
|
+
pager_start
|
1113
|
+
syntax_highlight(@w_r.text)
|
1114
|
+
rescue
|
1115
|
+
@w_r.pager_cmd = "cat #{@selected_safe} 2>/dev/null"
|
1116
|
+
w_r_doc
|
1117
|
+
end
|
1118
|
+
else
|
1098
1119
|
@w_r.pager_cmd = "cat #{@selected_safe} 2>/dev/null"
|
1099
1120
|
w_r_doc
|
1100
1121
|
end
|
@@ -1159,8 +1180,8 @@ def w_r_doc # GET FULL CONTENT TO PAGE
|
|
1159
1180
|
end
|
1160
1181
|
def w_r_info(info) # SHOW INFO IN THE RIGHT WINDOW
|
1161
1182
|
image_show("clear") if @image; @image = false
|
1162
|
-
|
1163
|
-
|
1183
|
+
#@w_r.clr
|
1184
|
+
#@w_r.refresh
|
1164
1185
|
w_r_width = Curses.cols - (Curses.cols/@width) - 2
|
1165
1186
|
info.gsub!(/(.{1,#{w_r_width}})( +|$\n?)|(.{1,#{w_r_width}})/, "\\1\\3\n")
|
1166
1187
|
@w_r.text = info
|
@@ -1230,6 +1251,7 @@ def pager_start # START PAGING
|
|
1230
1251
|
if @w_r.text.lines.count > @w_r.maxy - 2
|
1231
1252
|
@w_r.pager_more = true
|
1232
1253
|
end
|
1254
|
+
@cont = @w_r.text # For copying right win
|
1233
1255
|
end
|
1234
1256
|
def pager_show # SHOW THE CURRENT PAGE CONTENT
|
1235
1257
|
@w_r.setpos(0,0)
|
@@ -1249,6 +1271,7 @@ def pager_show # SHOW THE CURRENT PAGE CONTENT
|
|
1249
1271
|
@w_r.attr = 0 if @w_r.attr == nil
|
1250
1272
|
@w_r.attron(color_pair(@w_r.fg) | @w_r.attr) { @w_r << input }
|
1251
1273
|
end
|
1274
|
+
@cont = input # For copying right win
|
1252
1275
|
(@w_r.maxy - @w_r.cury).times {@w_r.deleteln()} # Clear to bottom of window
|
1253
1276
|
pager_add_markers
|
1254
1277
|
@w_r.refresh
|
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: 2.
|
4
|
+
version: '2.7'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Geir Isene
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-04-
|
11
|
+
date: 2023-04-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: curses
|
@@ -47,7 +47,8 @@ dependencies:
|
|
47
47
|
description: 'A full featured terminal browser with syntax highlighted files, images
|
48
48
|
shown in the terminal, videos thumbnailed, etc. You can bookmark and jump around
|
49
49
|
easily, delete, rename, copy, symlink and move files. RTFM has a a wide range of
|
50
|
-
other features. New in 2.
|
50
|
+
other features. New in 2.7: Added copying of right pane (C-Y) and toggle highlighting
|
51
|
+
(b)'
|
51
52
|
email: g@isene.com
|
52
53
|
executables:
|
53
54
|
- rtfm
|