summaryrefslogtreecommitdiffstats
path: root/resources/default-conf/verbs.hjson
blob: a7a9c78bce15257064a9c56434615f17bfe1a2f0 (plain)
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
###############################################################
# This file contains the verb definitions for broot
#
# Some verbs here are examples and not enabled by default: you
#  need to uncomment them if you want to use them.
#
# Documentation at https://dystroy.org/broot/verbs/
###############################################################

verbs: [

    # You should customize this standard opening of text files.
    # If you edit text files in your terminal (vi, emacs, helix, eg.), then
    #  you'll find it convenient to change the 'key' from 'ctrl-e' to 'enter'.
    #
    # If $EDITOR isn't set on your computer, you should either set it using
    #  something similar to
    #    export EDITOR=/usr/local/bin/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 or
    #  a content search.
    # Examples depending on your favourite editor:
    #    execution: "nvim +{line} {file}"
    #    execution: "helix {file}:{line}"
    {
        invocation: edit
        shortcut: e
        key: ctrl-e
        apply_to: text_file
        execution: "$EDITOR {file}"
        leave_broot: false
    }

    # Example 1: launching `tail -n` on the selected file (leaving broot)
    # {
    #     name: tail_lines
    #     invocation: tl {lines_count}
    #     execution: "tail -f -n {lines_count} {file}"
    # }

    # Example 2: creating a new file without leaving broot
    # {
    #     name: touch
    #     invocation: touch {new_file}
    #     execution: "touch {directory}/{new_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}"
    }

    # On ctrl-b, propose the creation of a copy of the selection.
    # While this might occasionally be useful, this verb is mostly here
    # as an example to demonstrate rare standard groups like {file-stem}
    # and {file-dot-extension} and the auto_exec verb property which
    # allows verbs to stay unexecuted until you hit enter
    {
        invocation: "backup {version}"
        key: ctrl-b
        leave_broot: false
        auto_exec: false
        execution: "cp -r {file} {parent}/{file-stem}-{version}{file-dot-extension}"
    }

    # By default, `rm` does the system rm, and completely removes
    # the file. If you prefer to have the file moved to the system
    # trash, you may use the ':trash' internal with the verb below:
    # {
    #     invocation: "rm"
    #     internal: "trash"
    #     leave_broot: false
    # }

    # 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 verb needing the shell capabilities.
    # It copies all children of the currently selected directory
    #  to a destination you type.
    # It uses a star, which needs the shell for expansion. That's
    #  why such verb must have the `from_shell: true` parameter.
    # {
    #     invocation: "cpa {dest}"
    #     external: "cp -r {directory}/* {dest}"
    #     from_shell: true
    # }

    # Here's an example of a shortcut bringing you to your home directory
    # {
    #     invocation: home
    #     key: ctrl-home
    #     execution: ":focus ~"
    # }

    # Here's going to the work-dir root of the current git repository
    # {
    #     invocation: gtr
    #     execution: ":focus {git-root}"
    # }

    # A popular set of shortcuts 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: alt-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
    # }
]