Skip to content

context menu

rovr provides a convenient right-click context menu that gives you quick access to common file operations.

you can open the context menu by:

  • right-clicking on any file or folder in the file list
  • pressing shift+f10 (or your configured keybind)
  • the menu appears at your cursor position with relevant actions

the context menu includes the following built-in operations:

these actions operate within rovr’s clipboard and are defined in rovr/core/file_list_right_click_menu.py:

action description
rovr:copy copy the selected file(s) to rovr’s clipboard
rovr:cut cut the selected file(s) to rovr’s clipboard for moving
rovr:paste paste files from rovr’s clipboard to the current directory
rovr:new create a new file or folder
rovr:rename rename the selected item
rovr:delete delete the selected file(s)
rovr:zip compress the selected file(s) into an archive
rovr:unzip extract the contents of a compressed file

these actions interact with your operating system clipboard:

action description
system:copy_highlighted copy the highlighted file’s path to the system clipboard
system:copy_current_directory copy the current directory path to the system clipboard
system:copy_to_system_clip copy rovr’s clipboard contents to the system clipboard

you can create submenus by using the options field instead of action:

right_click = [
{ label = "Open With", options = [
{ label = "VSCode", action = { run = 'code %s', run_type = "background" } },
{ label = "Helix", action = { run = 'hx %s', run_type = "suspend" } },
] },
]

you can execute shell commands directly from the context menu using a structured action object format.

shell actions are configured as objects with the following properties:

property type description
run string the command to execute. command expansions are supported.
run_type enum ("suspend", "background", "orphan") how to run the command: suspend waits for completion, background runs without waiting, orphan detaches completely.
shell boolean (default: false) whether to run in a shell (required for piping, redirection, etc.)
right_click = [
# basic command (background execution)
{ label = "Open in VSCode", action = { run = 'code %s', run_type = "background" } },
# suspend rovr for interactive commands
{ label = "Edit with Helix", action = { run = 'hx %s', run_type = "suspend" } },
# show command output as notification
{ label = "Get SHA256", action = { run = 'pwsh -nop -c "(Get-FileHash -Algorithm SHA256 \"%h\").Hash"', run_type = "background" } },
# shell mode for complex commands (piping, etc.)
{ label = "Count lines", action = { run = 'cat "%h" | wc -l', run_type = "background", shell = true } },
]

shell actions support variable expansions via rovr/functions/utils.py::expand_command:

expansion description
%cwd current working directory
%rcwd real path of the current working directory
%h currently highlighted file
%rh real path of the currently highlighted file
%nh name of the currently highlighted file, without its parent path
%rnh name of the real path of the currently highlighted file
%s shell-quoted, space-separated selected file paths
%rs shell-quoted, space-separated real paths of selected files
%copy shell-quoted paths in rovr’s copy clipboard
%cut shell-quoted paths in rovr’s cut clipboard
%th highlighted file in the next tab
%tNh highlighted file N tabs after the focused tab, such as %t2h
%Th highlighted file in the previous tab
%TNh highlighted file N tabs before the focused tab, such as %T2h

tab-relative expansions wrap around the tab list. The old ${variable} expansions are deprecated.

menu items can be conditionally shown or hidden based on file path, operating system, current directory, or file type. conditions are checked via rovr/core/file_list_right_click_menu.py::ifed.

right_click = [
{ label = "Open in VSCode", action = { run = 'code %s', run_type = "background" } },
{ label = "Pixelorama", action = { run = 'pixelorama %s', run_type = "suspend" }, if = { path = ["*.png", "*.jpg"] } },
{ label = "Windows Only", action = { run = 'echo hello', run_type = "background" }, if = { os = ["Windows"] } },
{ label = "Git Projects", action = { run = 'git status', run_type = "background" }, if = { cwd = ["C:/Projects/*"] } },
{ label = "Folder Action", action = { run = 'do something', run_type = "background" }, if = { directory = true } },
{ label = "File Action", action = { run = 'do something', run_type = "background" }, if = { directory = false } },
]
field type description
path list[str] show only if the file path matches one of these glob patterns (fnmatch)
os list[str] show only on specified operating systems (case insensitive: Windows, Linux, Darwin)
cwd list[str] show only if the current working directory matches one of these glob patterns
directory bool show only for directories (true) or files (false)

the keyboard shortcut is configured via open_right_click_menu in [keybinds]:

[keybinds]
open_right_click_menu = ["shift+f10"]

the context menu is configured in your config.toml under [settings]:

if you want to add anything, you MUST include the default options, otherwise you will lose them.

instead of redefining the full list, you can use prepend_right_click and append_right_click to add items before or after the defaults:

[settings]
prepend_right_click = [
{ label = "My Tool", action = { run = 'mytool %s', run_type = "background" } },
]
append_right_click = [
{ label = "Get SHA256", action = { run = 'sha256sum "%h"', run_type = "background" }, if = { directory = false } },
]

these follow the same item format as right_click and support all the same fields (action, if, options).

[settings]
right_click = [
{ label = "\uf0c5 Copy", options = [
{ label = "\uf07f Copy in rovr", action = "rovr:copy" },
{ label = "\U000f0147 Copy highlighted file path", action = "system:copy_highlighted" },
{ label = "\U000f14e5 Copy current directory path", action = "system:copy_current_directory" },
{ label = "\U000f1265 Copy to OS clipboard", action = "system:copy_to_system_clip" },
] },
{ label = "\uf0c4 Cut", action = "rovr:cut" },
{ label = "\uf429 Paste", action = "rovr:paste" },
{ label = "\uea7f New", action = "rovr:new" },
{ label = "\uf246 Rename", action = "rovr:rename" },
{ label = "\uf014 Delete", action = "rovr:delete" },
{ label = "\uf410 Zip", action = "rovr:zip" },
{ label = "\uf07c Unzip", action = "rovr:unzip" },
{ label = "\uea74 Properties", action = { run = [
"powershell",
"-NoProfile",
"-Command",
"& { param([string] $cwd, [string] $name) $shell = New-Object -ComObject Shell.Application; $shell.NameSpace($cwd).ParseName($name).InvokeVerb('Properties'); Start-Sleep -Milliseconds 500; while (Get-Process | Where-Object { $_.MainWindowTitle -match ([regex]::Escape($name) + ' Properties') }) { Start-Sleep -Milliseconds 500 } }",
"%rcwd",
"%rnh",
], run_type = "background", shell = false }, if = { os = ["Windows"] } },
]