Not for normies
| 1 | ############################################################### |
| 2 | # This file contains the verb definitions for broot |
| 3 | # |
| 4 | # Some verbs here are examples and not enabled by default: you |
| 5 | # need to uncomment them if you want to use them. |
| 6 | # |
| 7 | # Documentation at https://dystroy.org/broot/verbs/ |
| 8 | ############################################################### |
| 9 | |
| 10 | verbs: [ |
| 11 | |
| 12 | # You should customize this standard opening of text files. |
| 13 | # If you edit text files in your terminal (vi, emacs, helix, eg.), then |
| 14 | # you'll find it convenient to change the 'key' from 'ctrl-e' to 'enter'. |
| 15 | # |
| 16 | # If $EDITOR isn't set on your computer, you should either set it using |
| 17 | # something similar to |
| 18 | # export EDITOR=/usr/local/bin/nvim |
| 19 | # or just replace it with your editor of choice in the 'execution' |
| 20 | # pattern. |
| 21 | # If your editor is able to open a file on a specific line, use {line} |
| 22 | # so that you may jump directly at the right line from a preview or |
| 23 | # a content search. |
| 24 | # Examples depending on your favourite editor: |
| 25 | # execution: "nvim +{line} {file}" |
| 26 | # execution: "helix {file}:{line}" |
| 27 | { |
| 28 | invocation: edit |
| 29 | shortcut: e |
| 30 | key: ctrl-e |
| 31 | apply_to: text_file |
| 32 | execution: "$EDITOR {file}" |
| 33 | leave_broot: false |
| 34 | } |
| 35 | |
| 36 | # Example 1: launching `tail -n` on the selected file (leaving broot) |
| 37 | # { |
| 38 | # name: tail_lines |
| 39 | # invocation: tl {lines_count} |
| 40 | # execution: "tail -f -n {lines_count} {file}" |
| 41 | # } |
| 42 | |
| 43 | # Example 2: creating a new file without leaving broot |
| 44 | # { |
| 45 | # name: touch |
| 46 | # invocation: touch {new_file} |
| 47 | # execution: "touch {directory}/{new_file}" |
| 48 | # leave_broot: false |
| 49 | # } |
| 50 | |
| 51 | # A convenient shortcut to create new text files in |
| 52 | # the current directory or below |
| 53 | { |
| 54 | invocation: create {subpath} |
| 55 | execution: "$EDITOR {directory}/{subpath}" |
| 56 | leave_broot: false |
| 57 | } |
| 58 | |
| 59 | { |
| 60 | invocation: git_diff |
| 61 | shortcut: gd |
| 62 | leave_broot: false |
| 63 | execution: "git difftool -y {file}" |
| 64 | } |
| 65 | |
| 66 | # On ctrl-b, propose the creation of a copy of the selection. |
| 67 | # While this might occasionally be useful, this verb is mostly here |
| 68 | # as an example to demonstrate rare standard groups like {file-stem} |
| 69 | # and {file-dot-extension} and the auto_exec verb property which |
| 70 | # allows verbs to stay unexecuted until you hit enter |
| 71 | { |
| 72 | invocation: "backup {version}" |
| 73 | key: ctrl-b |
| 74 | leave_broot: false |
| 75 | auto_exec: false |
| 76 | execution: "cp -r {file} {parent}/{file-stem}-{version}{file-dot-extension}" |
| 77 | } |
| 78 | |
| 79 | # By default, `rm` does the system rm, and completely removes |
| 80 | # the file. If you prefer to have the file moved to the system |
| 81 | # trash, you may use the ':trash' internal with the verb below: |
| 82 | # { |
| 83 | # invocation: "rm" |
| 84 | # internal: "trash" |
| 85 | # leave_broot: false |
| 86 | # } |
| 87 | |
| 88 | # This verb lets you launch a terminal on ctrl-T |
| 89 | # (on exit you'll be back in broot) |
| 90 | { |
| 91 | invocation: terminal |
| 92 | key: ctrl-t |
| 93 | execution: "$SHELL" |
| 94 | set_working_dir: true |
| 95 | leave_broot: false |
| 96 | } |
| 97 | |
| 98 | # Here's an example of a verb needing the shell capabilities. |
| 99 | # It copies all children of the currently selected directory |
| 100 | # to a destination you type. |
| 101 | # It uses a star, which needs the shell for expansion. That's |
| 102 | # why such verb must have the `from_shell: true` parameter. |
| 103 | # { |
| 104 | # invocation: "cpa {dest}" |
| 105 | # external: "cp -r {directory}/* {dest}" |
| 106 | # from_shell: true |
| 107 | # } |
| 108 | |
| 109 | # Here's an example of a shortcut bringing you to your home directory |
| 110 | # { |
| 111 | # invocation: home |
| 112 | # key: ctrl-home |
| 113 | # execution: ":focus ~" |
| 114 | # } |
| 115 | |
| 116 | # Here's going to the work-dir root of the current git repository |
| 117 | # { |
| 118 | # invocation: gtr |
| 119 | # execution: ":focus {git-root}" |
| 120 | # } |
| 121 | |
| 122 | # A popular set of shortcuts for going up and down: |
| 123 | # |
| 124 | # { |
| 125 | # key: ctrl-k |
| 126 | # execution: ":line_up" |
| 127 | # } |
| 128 | # { |
| 129 | # key: ctrl-j |
| 130 | # execution: ":line_down" |
| 131 | # } |
| 132 | # { |
| 133 | # key: ctrl-u |
| 134 | # execution: ":page_up" |
| 135 | # } |
| 136 | # { |
| 137 | # key: ctrl-d |
| 138 | # execution: ":page_down" |
| 139 | # } |
| 140 | |
| 141 | # If you develop using git, you might like to often switch |
| 142 | # to the git status filter: |
| 143 | # { |
| 144 | # key: alt-g |
| 145 | # execution: ":toggle_git_status" |
| 146 | # } |
| 147 | |
| 148 | # You can reproduce the bindings of Norton Commander |
| 149 | # on copying or moving to the other panel: |
| 150 | # { |
| 151 | # key: F5 |
| 152 | # external: "cp -r {file} {other-panel-directory}" |
| 153 | # leave_broot: false |
| 154 | # } |
| 155 | # { |
| 156 | # key: F6 |
| 157 | # external: "mv {file} {other-panel-directory}" |
| 158 | # leave_broot: false |
| 159 | # } |
| 160 | ] |