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 "${selected_files}"', run_type = "background" } },
{ label = "Helix", action = { run = 'hx "${selected_files}"', 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 "${selected_files}"', run_type = "background" } },
# suspend rovr for interactive commands
{ label = "Edit with Helix", action = { run = 'hx "${selected_files}"', run_type = "suspend" } },
# show command output as notification
{ label = "Get SHA256", action = { run = 'pwsh -nop -c "(Get-FileHash -Algorithm SHA256 \"${highlighted_file}\").Hash"', run_type = "background" } },
# shell mode for complex commands (piping, etc.)
{ label = "Count lines", action = { run = 'cat "${highlighted_file}" | wc -l', run_type = "background", shell = true } },
]

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

variable description
${highlighted_file} path to the currently highlighted file
${selected_files} space-separated list of all selected file paths (shell-quoted)
${current_working_directory} the current directory path
${highlighted_file_name} the name of the highlighted file (without path)

each variable also has an alternative real_ version that properly converts the file path to the OS-specific format (which means Windows will use backslash as separator)

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 "${selected_files}"', run_type = "background" } },
{ label = "Pixelorama", action = { run = 'pixelorama "${selected_files}"', 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 "${selected_files}"', run_type = "background" } },
]
append_right_click = [
{ label = "Get SHA256", action = { run = 'sha256sum "${highlighted_file}"', 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 -nop -c \"(New-Object -ComObject Shell.Application).NameSpace('${current_working_directory}'.replace('/', '\\\\')).ParseName('${highlighted_file_name}').InvokeVerb('Properties'); Start-Sleep -m 500; do { Start-Sleep -m500 } while ((Get-Process | Where-Object { $_.MainWindowTitle -match '${highlighted_file_name} Properties' }))\"", run_type = "suspend" }, if = { os = ["Windows"] } },
]