summaryrefslogtreecommitdiffstats
path: root/resources/default-conf/verbs.hjson
blob: 3cc533a42cc9ff96de3ef0436ed19ef64e4b2802 (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
###############################################################
# This file contains the verb definitions for broot
#
# Doc at https://dystroy.org/broot/verbs/
###############################################################

verbs: [

    # 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 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=/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.
    # Example:
    #  execution: nvim +{line} {file}
    {
        invocation: edit
        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}"
    }

    # 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 not executed 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}"
    }

    # 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 shortcut bringing you to your home directory
    # {
    #     invocation: home
    #     key: ctrl-home
    #     execution: ":focus ~"
    # }

    # 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: 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
    # }
]