1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
|
/// the content a the conf.hjson file broot creates
/// when there's none. It features some default
/// configuration and many completable
/// or uncommentable sections to help the user
/// define their own configuration.
pub const DEFAULT_CONF_FILE: &str = r#"
###############################################################
# This configuration file lets you
# - define new commands
# - change the shortcut or triggering keys of built-in verbs
# - change the colors
# - set default values for flags
# - set special behaviors on specific paths
# - and more...
#
# Configuration documentation is available at
# https://dystroy.org/broot
#
# This file's format is Hjson ( https://hjson.github.io/ ). Some
# properties are commented out. To enable them, remove the `#`.
#
###############################################################
{
###############################################################
# Default flags
# You can set up flags you want broot to start with by
# default, for example `default_flags="ihp"` if you usually want
# to see hidden and gitignored files and the permissions (then
# if you don't want the hidden files you can launch `br -H`)
# A popular flag is the `g` one which displays git related info.
#
# default_flags:
###############################################################
# Date/Time format
# If you want to change the format for date/time, uncomment the
# following line and change it according to
# https://docs.rs/chrono/0.4.11/chrono/format/strftime/index.html
#
# date_time_format: %Y/%m/%d %R
###############################################################
# "vim mode"
#
#
# modal: true
###############################################################
# Whether to mark the selected line with a triangle
#
# show_selection_mark: true
###############################################################
# Column order
# cols_order, if specified, must be a permutation of the following
# array. You should keep the name at the end as it has a variable
# length.
#
# cols_order: [
# mark
# git
# size
# permission
# date
# count
# branch
# name
# ]
###############################################################
# True Colors
# If this parameter isn't set, broot tries to automatically
# determine whether true colors (24 bits) are available.
# As this process is unreliable, you may uncomment this setting
# and set it to false or true if you notice the colors in
# previewed images are too off.
#
# true_colors: false
###############################################################
# Icons
# If you want to display icons in broot, uncomment this line
# (see https://dystroy.org/broot/icons for installation and
# troubleshooting)
#
# icon_theme: vscode
###############################################################
# Special paths
# If some paths must be handled specially, uncomment (and change
# this section as per the examples)
#
# special_paths: {
# "/media/slow-backup-disk" : no-enter
# "/home/dys/useless" : hide
# "/home/dys/my-link-I-want-to-explore" : enter
# }
###############################################################
# Search modes
#
# broot allows many search modes.
# A search mode is defined by
# - the way to search: fuzzy, exact, or a regular expression.
# - where to search: name, sub-path, or file content
# A search pattern may for example be "fuzzy name" (default),
# "regex content" or "exact path".
#
# The search mode is selected from its prefix. For example, if
# you type "abc", the default mode is "fuzzy name". If you type
# "/abc", the mode is "regex name". If you type "rp/abc", the mode
# is "regex path".
#
# This mapping may be modified. You may want to dedicate the
# empty prefix (the one which doesn't need a '/') to the
# search mode you use most often. The example below makes it
# easy to search on subpath rather than on the name.
#
# More information on
# https://dystroy.org/broot/input/#the-filtering-pattern
#
# search_modes: {
# <empty>: fuzzy path
# /: regex path
# }
###############################################################
# Verbs and shortcuts
# You can define your own commands which would be applied to
# the selection.
# You'll also find below verbs that you can customize or enable.
verbs: [
# Exemple 1: launching `tail -n` on the selected file (leaving broot)
# {
# name: tail_lines
# invocation: tl {lines_count}
# execution: "tail -f -n {lines_count} {file}"
# }
# Exemple 2: creating a new file without leaving broot
# {
# name: touch
# invocation: touch {new_file}
# execution: "touch {directory}/{new_file}"
# leave_broot: false
# }
# A standard recommended command for editing files, that you
# can customize.
# If $EDITOR isn't set on your computer, you should either set it using
# something similar to
# export EDITOR=nvim
# or just replace it with your editor of choice in the 'execution'
# pattern.
# If your editor is able to open a file on a specific line, use {line}
# so that you may jump directly at the right line from a preview.
# Example:
# execution: nvim +{line} {file}
{
invocation: edit
key: F2
shortcut: e
execution: "$EDITOR +{line} {file}"
leave_broot: false
}
# A convenient shortcut to create new text files in
# the current directory or below
{
invocation: create {subpath}
execution: "$EDITOR {directory}/{subpath}"
leave_broot: false
}
{
invocation: git_diff
shortcut: gd
leave_broot: false
execution: "git difftool -y {file}"
}
# This verb lets you launch a terminal on ctrl-T
# (on exit you'll be back in broot)
{
invocation: terminal
key: ctrl-t
execution: "$SHELL"
set_working_dir: true
leave_broot: false
}
# Here's an example of a shorctut bringing you to your home directory
# {
# invocation: home
# key: ctrl-home
# execution: ":focus ~"
# }
# A popular set of shorctuts for going up and down:
#
# {
# key: ctrl-k
# execution: ":line_up"
# }
# {
# key: ctrl-j
# execution: ":line_down"
# }
# {
# key: ctrl-u
# execution: ":page_up"
# }
# {
# key: ctrl-d
# execution: ":page_down"
# }
# If you develop using git, you might like to often switch
# to the git status filter:
# {
# key: ctrl-g
# execution: ":toggle_git_status"
# }
# You can reproduce the bindings of Norton Commander
# on copying or moving to the other panel:
# {
# key: F5
# external: "cp -r {file} {other-panel-directory}"
# leave_broot: false
# }
# {
# key: F6
# external: "mv {file} {other-panel-directory}"
# leave_broot: false
# }
]
###############################################################
# Skin
# If you want to change the colors of broot,
# uncomment the following bloc and start messing
# with the various values.
# A skin entry value is made of two parts separated with a '/':
# The first one is the skin for the active panel.
# The second one, optional, is the skin for non active panels.
# You may find explanations and other skins on
# https://dystroy.org/broot/skins
###############################################################
#
# skin: {
# default: gray(23) none / gray(20) none
# tree: ansi(94) None / gray(3) None
# file: gray(20) None / gray(15) None
# directory: ansi(208) None Bold / ansi(172) None bold
# exe: Cyan None
# link: Magenta None
# pruning: gray(12) None Italic
# perm__: gray(5) None
# perm_r: ansi(94) None
# perm_w: ansi(132) None
# perm_x: ansi(65) None
# owner: ansi(138) None
# group: ansi(131) None
# count: ansi(136) gray(3)
# dates: ansi(66) None
# sparse: ansi(214) None
# content_extract: ansi(29) None
# content_match: ansi(34) None
# git_branch: ansi(229) None
# git_insertions: ansi(28) None
# git_deletions: ansi(160) None
# git_status_current: gray(5) None
# git_status_modified: ansi(28) None
# git_status_new: ansi(94) None Bold
# git_status_ignored: gray(17) None
# git_status_conflicted: ansi(88) None
# git_status_other: ansi(88) None
# selected_line: None gray(5) / None gray(4)
# char_match: Yellow None
# file_error: Red None
# flag_label: gray(15) None
# flag_value: ansi(208) None Bold
# input: White None / gray(15) gray(2)
# status_error: gray(22) ansi(124)
# status_job: ansi(220) gray(5)
# status_normal: gray(20) gray(3) / gray(2) gray(2)
# status_italic: ansi(208) gray(3) / gray(2) gray(2)
# status_bold: ansi(208) gray(3) Bold / gray(2) gray(2)
# status_code: ansi(229) gray(3) / gray(2) gray(2)
# status_ellipsis: gray(19) gray(1) / gray(2) gray(2)
# purpose_normal: gray(20) gray(2)
# purpose_italic: ansi(178) gray(2)
# purpose_bold: ansi(178) gray(2) Bold
# purpose_ellipsis: gray(20) gray(2)
# scrollbar_track: gray(7) None / gray(4) None
# scrollbar_thumb: gray(22) None / gray(14) None
# help_paragraph: gray(20) None
# help_bold: ansi(208) None Bold
# help_italic: ansi(166) None
# help_code: gray(21) gray(3)
# help_headers: ansi(208) None
# help_table_border: ansi(239) None
# preview: gray(20) gray(1) / gray(18) gray(2)
# preview_line_number: gray(12) gray(3)
# preview_match: None ansi(29)
# hex_null: gray(11) None
# hex_ascii_graphic: gray(18) None
# hex_ascii_whitespace: ansi(143) None
# hex_ascii_other: ansi(215) None
# hex_non_ascii: ansi(167) None
# }
###############################################################
# File Extension Colors
#
# uncomment and modify the next section if you want to color
# file name depending on their extension
#
# ext_colors: {
# png: rgb(255, 128, 75)
# rs: yellow
# }
}
"#;
|