<!DOCTYPE HTML>
< html lang = "en" class = "sidebar-visible no-js light" >
< head >
<!-- Book generated using mdBook -->
< meta charset = "UTF-8" >
< title > Message - xplr book< / title >
<!-- Custom HTML head -->
< meta content = "text/html; charset=utf-8" http-equiv = "Content-Type" >
< meta name = "description" content = "A hackable, minimal, fast TUI file explorer" >
< meta name = "viewport" content = "width=device-width, initial-scale=1" >
< meta name = "theme-color" content = "#ffffff" / >
< link rel = "icon" href = "favicon.svg" >
< link rel = "shortcut icon" href = "favicon.png" >
< link rel = "stylesheet" href = "css/variables.css" >
< link rel = "stylesheet" href = "css/general.css" >
< link rel = "stylesheet" href = "css/chrome.css" >
< link rel = "stylesheet" href = "css/print.css" media = "print" >
<!-- Fonts -->
< link rel = "stylesheet" href = "FontAwesome/css/font-awesome.css" >
< link rel = "stylesheet" href = "fonts/fonts.css" >
<!-- Highlight.js Stylesheets -->
< link rel = "stylesheet" href = "highlight.css" >
< link rel = "stylesheet" href = "tomorrow-night.css" >
< link rel = "stylesheet" href = "ayu-highlight.css" >
<!-- Custom theme stylesheets -->
< / head >
< body >
<!-- Provide site root to javascript -->
< script type = "text/javascript" >
var path_to_root = "";
var default_theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "navy" : "light";
< / script >
<!-- Work around some values being stored in localStorage wrapped in quotes -->
< script type = "text/javascript" >
try {
var theme = localStorage.getItem('mdbook-theme');
var sidebar = localStorage.getItem('mdbook-sidebar');
if (theme.startsWith('"') & & theme.endsWith('"')) {
localStorage.setItem('mdbook-theme', theme.slice(1, theme.length - 1));
}
if (sidebar.startsWith('"') & & sidebar.endsWith('"')) {
localStorage.setItem('mdbook-sidebar', sidebar.slice(1, sidebar.length - 1));
}
} catch (e) { }
< / script >
<!-- Set the theme before any content is loaded, prevents flash -->
< script type = "text/javascript" >
var theme;
try { theme = localStorage.getItem('mdbook-theme'); } catch(e) { }
if (theme === null || theme === undefined) { theme = default_theme; }
var html = document.querySelector('html');
html.classList.remove('no-js')
html.classList.remove('light')
html.classList.add(theme);
html.classList.add('js');
< / script >
<!-- Hide / unhide sidebar before it is displayed -->
< script type = "text/javascript" >
var html = document.querySelector('html');
var sidebar = 'hidden';
if (document.body.clientWidth >= 1080) {
try { sidebar = localStorage.getItem('mdbook-sidebar'); } catch(e) { }
sidebar = sidebar || 'visible';
}
html.classList.remove('sidebar-visible');
html.classList.add("sidebar-" + sidebar);
< / script >
< nav id = "sidebar" class = "sidebar" aria-label = "Table of contents" >
< div class = "sidebar-scrollbox" >
< ol class = "chapter" > < li class = "chapter-item expanded " > < a href = "introduction.html" > < strong aria-hidden = "true" > 1.< / strong > Introduction< / a > < / li > < li class = "chapter-item expanded " > < a href = "quickstart.html" > < strong aria-hidden = "true" > 2.< / strong > Quickstart< / a > < / li > < li > < ol class = "section" > < li class = "chapter-item expanded " > < a href = "install.html" > < strong aria-hidden = "true" > 2.1.< / strong > Install< / a > < / li > < li class = "chapter-item expanded " > < a href = "post-install.html" > < strong aria-hidden = "true" > 2.2.< / strong > Post Install< / a > < / li > < / ol > < / li > < li class = "chapter-item expanded " > < a href = "configuration.html" > < strong aria-hidden = "true" > 3.< / strong > Configuration< / a > < / li > < li > < ol class = "section" > < li class = "chapter-item expanded " > < a href = "general-config.html" > < strong aria-hidden = "true" > 3.1.< / strong > General Config< / a > < / li > < li class = "chapter-item expanded " > < a href = "modes.html" > < strong aria-hidden = "true" > 3.2.< / strong > Modes< / a > < / li > < li class = "chapter-item expanded " > < a href = "message.html" class = "active" > < strong aria-hidden = "true" > 3.3.< / strong > Message< / a > < / li > < li class = "chapter-item expanded " > < a href = "layouts.html" > < strong aria-hidden = "true" > 3.4.< / strong > Layouts< / a > < / li > < li class = "chapter-item expanded " > < a href = "node_types.html" > < strong aria-hidden = "true" > 3.5.< / strong > Node Types< / a > < / li > < li class = "chapter-item expanded " > < a href = "style.html" > < strong aria-hidden = "true" > 3.6.< / strong > Style< / a > < / li > < li class = "chapter-item expanded " > < a href = "sorting.html" > < strong aria-hidden = "true" > 3.7.< / strong > Sorting< / a > < / li > < li class = "chapter-item expanded " > < a href = "filtering.html" > < strong aria-hidden = "true" > 3.8.< / strong > Filtering< / a > < / li > < li class = "chapter-item expanded " > < a href = "column-renderer.html" > < strong aria-hidden = "true" > 3.9.< / strong > Column Renderer< / a > < / li > < / ol > < / li > < li class = "chapter-item expanded " > < a href = "default-key-bindings.html" > < strong aria-hidden = "true" > 4.< / strong > Default Key Bindings< / a > < / li > < li class = "chapter-item expanded " > < a href = "plugin.html" > < strong aria-hidden = "true" > 5.< / strong > Plugin< / a > < / li > < li > < ol class = "section" > < li class = "chapter-item expanded " > < a href = "installing-plugins.html" > < strong aria-hidden = "true" > 5.1.< / strong > Installing Plugins< / a > < / li > < li class = "chapter-item expanded " > < a href = "writing-plugins.html" > < strong aria-hidden = "true" > 5.2.< / strong > Writing Plugins< / a > < / li > < li class = "chapter-item expanded " > < a href = "awesome-plugins.html" > < strong aria-hidden = "true" > 5.3.< / strong > Awesome Plugins< / a > < / li > < / ol > < / li > < li class = "chapter-item expanded " > < a href = "integration.html" > < strong aria-hidden = "true" > 6.< / strong > Integration< / a > < / li > < li > < ol class = "section" > < li class = "chapter-item expanded " > < a href = "awesome-integrations.html" > < strong aria-hidden = "true" > 6.1.< / strong > Awesome Integrations< / a > < / li > < / ol > < / li > < li class = "chapter-item expanded " > < a href = "todo.html" > < strong aria-hidden = "true" > 7.< / strong > TODO< / a > < / li > < li class = "chapter-item expanded " > < a href = "alternatives.html" > < strong aria-hidden = "true" > 8.< / strong > Alternatives< / a > < / li > < li class = "chapter-item expanded " > < a href = "upgrade-guide.html" > < strong aria-hidden = "true" > 9.< / strong > Upgrade Guide< / a > < / li > < li class = "chapter-item expanded " > < a href = "community.html" > < strong aria-hidden = "true" > 10.< / strong > Community< / a > < / li > < li class = "chapter-item expanded " > < a href = "contribute.html" > < strong aria-hidden = "true" > 11.< / strong > Contribute< / a > < / li > < / ol > < / div >
< div id = "sidebar-resize-handle" class = "sidebar-resize-handle" > < / div >
< / nav >
< div id = "page-wrapper" class = "page-wrapper" >
< div class = "page" >
< div id = "menu-bar-hover-placeholder" > < / div >
< div id = "menu-bar" class = "menu-bar sticky bordered" >
< div class = "left-buttons" >
< button id = "sidebar-toggle" class = "icon-button" type = "button" title = "Toggle Table of Contents" aria-label = "Toggle Table of Contents" aria-controls = "sidebar" >
< i class = "fa fa-bars" > < / i >
< / button >
< button id = "theme-toggle" class = "icon-button" type = "button" title = "Change theme" aria-label = "Change theme" aria-haspopup = "true" aria-expanded = "false" aria-controls = "theme-list" >
< i class = "fa fa-paint-brush" > < / i >
< / button >
< ul id = "theme-list" class = "theme-popup" aria-label = "Themes" role = "menu" >
< li role = "none" > < button role = "menuitem" class = "theme" id = "light" > Light (default)< / button > < / li >
< li role = "none" > < button role = "menuitem" class = "theme" id = "rust" > Rust< / button > < / li >
< li role = "none" > < button role = "menuitem" class = "theme" id = "coal" > Coal< / button > < / li >
< li role = "none" > < button role = "menuitem" class = "theme" id = "navy" > Navy< / button > < / li >
< li role = "none" > < button role = "menuitem" class = "theme" id = "ayu" > Ayu< / button > < / li >
< / ul >
< button id = "search-toggle" class = "icon-button" type = "button" title = "Search. (Shortkey: s)" aria-label = "Toggle Searchbar" aria-expanded = "false" aria-keyshortcuts = "S" aria-controls = "searchbar" >
< i class = "fa fa-search" > < / i >
< / button >
< / div >
< h1 class = "menu-title" > xplr book< / h1 >
< div class = "right-buttons" >
< a href = "print.html" title = "Print this book" aria-label = "Print this book" >
< i id = "print-button" class = "fa fa-print" > < / i >
< / a >
< a href = "https://github.com/sayanarijit/xplr" title = "Git repository" aria-label = "Git repository" >
< i id = "git-repository-button" class = "fa fa-github" > < / i >
< / a >
< a href = "https://github.com/sayanarijit/xplr/edit/main/docs/en/src/message.md" title = "Suggest an edit" aria-label = "Suggest an edit" >
< i id = "git-edit-button" class = "fa fa-edit" > < / i >
< / a >
< / div >
< / div >
< div id = "search-wrapper" class = "hidden" >
< form id = "searchbar-outer" class = "searchbar-outer" >
< input type = "search" id = "searchbar" name = "searchbar" placeholder = "Search this book ..." aria-controls = "searchresults-outer" aria-describedby = "searchresults-header" >
< / form >
< div id = "searchresults-outer" class = "searchresults-outer hidden" >
< div id = "searchresults-header" class = "searchresults-header" > < / div >
< ul id = "searchresults" >
< / ul >
< / div >
< / div >
<!-- Apply ARIA attributes after the sidebar and the sidebar toggle button are added to the DOM -->
< script type = "text/javascript" >
document.getElementById('sidebar-toggle').setAttribute('aria-expanded', sidebar === 'visible');
document.getElementById('sidebar').setAttribute('aria-hidden', sidebar !== 'visible');
Array.from(document.querySelectorAll('#sidebar a')).forEach(function(link) {
link.setAttribute('tabIndex', sidebar === 'visible' ? 0 : -1);
});
< / script >
< div id = "content" class = "content" >
< main >
< h1 id = "message" > < a class = "header" href = "#message" > Message< / a > < / h1 >
< p > You can think of xplr as a server. Just like web servers listen to HTTP
requests, xplr listens to < a href = "#full-list-of-messages" > messages< / a > .< / p >
< p > You can send these messages to an xplr session in the following ways:< / p >
< ul >
< li > Via < a href = "modes.html#key-bindings" > key bindings< / a > < / li >
< li > Via < a href = "#lua-function-calls" > Lua function calls< / a > < / li >
< li > Via shell command using the < a href = "#input-pipe" > input pipe< / a > < / li >
< / ul >
< h2 id = "format" > < a class = "header" href = "#format" > Format< / a > < / h2 >
< p > To send messages using the < a href = "modes.html#key-bindings" > key bindings< / a > or
< a href = "#lua-function-calls" > Lua function calls< / a > , messages are represented in
< a href = "https://www.lua.org/" > Lua< / a > syntax. For example:< / p >
< ul >
< li > " Quit" < / li >
< li > { FocusPath = " /path/to/file" }< / li >
< li > { Call = { command = " bash" , args = { " -c" , " read -p test" } } }< / li >
< / ul >
< p > However, to send messages using the < a href = "#input-pipe" > input pipe< / a > , they need to be
represented using
< a href = "http://yaml.org/" > YAML< / a > (or < a href = "https://www.json.org" > JSON< / a > ) syntax. For example:< / p >
< ul >
< li > Quit< / li >
< li > FocusPath: " /path/to/file" < / li >
< li > Call: { command: bash, args: [" -c" , " read -p test" ] }< / li >
< / ul >
< h2 id = "full-list-of-messages" > < a class = "header" href = "#full-list-of-messages" > Full List of Messages< / a > < / h2 >
< h3 id = "explorepwd" > < a class = "header" href = "#explorepwd" > " ExplorePwd" < / a > < / h3 >
< p > < strong > YAML:< / strong > < code > ExplorePwd< / code > < / p >
< p > Explore the present working directory and register the filtered nodes.
This operation is expensive. So, try to avoid using it too often.< / p >
< h3 id = "explorepwdasync" > < a class = "header" href = "#explorepwdasync" > " ExplorePwdAsync" < / a > < / h3 >
< p > < strong > YAML:< / strong > < code > ExplorePwdAsync< / code > < / p >
< p > Explore the present working directory and register the filtered nodes asynchronously.
This operation happens asynchronously. That means, the xplr directory buffers won't be updated
immediately. Hence, it needs to be used with care and probably with special checks in place.
To explore < code > $PWD< / code > synchronously, use < code > ExplorePwd< / code > instead.< / p >
< h3 id = "exploreparentsasync" > < a class = "header" href = "#exploreparentsasync" > " ExploreParentsAsync" < / a > < / h3 >
< p > < strong > YAML:< / strong > < code > ExploreParentsAsync< / code > < / p >
< p > Explore the present working directory along with its parents and register the filtered nodes.
This operation happens asynchronously. That means, the xplr directory buffers won't be updated
immediately. Hence, it needs to be used with care and probably with special checks in place.
To explore just the < code > $PWD< / code > synchronously, use < code > ExplorePwd< / code > instead.< / p >
< h3 id = "refresh" > < a class = "header" href = "#refresh" > " Refresh" < / a > < / h3 >
< p > < strong > YAML:< / strong > < code > Refresh< / code > < / p >
< p > Refresh the UI.
But it will not re-explore the directory if the working directory is the same.
If there is some change in the working directory and you want to re-explore it,
use the < code > Explore< / code > message instead.
Also, it will not clear the screen. Use < code > ClearScreen< / code > for that.< / p >
< h3 id = "clearscreen" > < a class = "header" href = "#clearscreen" > " ClearScreen" < / a > < / h3 >
< p > < strong > YAML:< / strong > < code > ClearScreen< / code > < / p >
< p > Clears the screen.< / p >
< h3 id = "focusnext" > < a class = "header" href = "#focusnext" > " FocusNext" < / a > < / h3 >
< p > < strong > YAML:< / strong > < code > FocusNext< / code > < / p >
< p > Focus next node.< / p >
< h3 id = "-focusnextbyrelativeindex--int-" > < a class = "header" href = "#-focusnextbyrelativeindex--int-" > { FocusNextByRelativeIndex = int }< / a > < / h3 >
< p > < strong > YAML:< / strong > < code > FocusNextByRelativeIndex: int< / code > < / p >
< p > Focus on the < code > n< / code > th node relative to the current focus where < code > n< / code > is a given value.< / p >
< p > < strong > YAML Example:< / strong > < code > FocusNextByRelativeIndex: 2< / code > < / p >
< p > < strong > Lua Example:< / strong > < code > { FocusNextByRelativeIndex = 2 }< / code > < / p >
< h3 id = "focusnextbyrelativeindexfrominput" > < a class = "header" href = "#focusnextbyrelativeindexfrominput" > " FocusNextByRelativeIndexFromInput" < / a > < / h3 >
< p > < strong > YAML:< / strong > < code > FocusNextByRelativeIndexFromInput< / code > < / p >
< p > Focus on the < code > n< / code > th node relative to the current focus where < code > n< / code > is read from
the input buffer.< / p >
< h3 id = "focusprevious" > < a class = "header" href = "#focusprevious" > " FocusPrevious" < / a > < / h3 >
< p > < strong > YAML:< / strong > < code > FocusPrevious< / code > < / p >
< p > Focus on the previous item.< / p >
< h3 id = "-focuspreviousbyrelativeindex--int-" > < a class = "header" href = "#-focuspreviousbyrelativeindex--int-" > { FocusPreviousByRelativeIndex = int }< / a > < / h3 >
< p > < strong > YAML:< / strong > < code > FocusPreviousByRelativeIndex: int< / code > < / p >
< p > Focus on the < code > -n< / code > th node relative to the current focus where < code > n< / code > is a given value.< / p >
< p > < strong > YAML Example:< / strong > < code > FocusPreviousByRelativeIndex: 2< / code > < / p >
< p > < strong > Lua Example:< / strong > < code > { FocusPreviousByRelativeIndex = 2 }< / code > < / p >
< h3 id = "focuspreviousbyrelativeindexfrominput" > < a class = "header" href = "#focuspreviousbyrelativeindexfrominput" > " FocusPreviousByRelativeIndexFromInput" < / a > < / h3 >
< p > < strong > YAML:< / strong > < code > FocusPreviousByRelativeIndexFromInput< / code > < / p >
< p > Focus on the < code > -n< / code > th node relative to the current focus where < code > n< / code > is read from
the input buffer.< / p >
< h3 id = "focusfirst" > < a class = "header" href = "#focusfirst" > " FocusFirst" < / a > < / h3 >
< p > < strong > YAML:< / strong > < code > FocusFirst< / code > < / p >
< p > Focus on the first node.< / p >
< h3 id = "focuslast" > < a class = "header" href = "#focuslast" > " FocusLast" < / a > < / h3 >
< p > < strong > YAML:< / strong > < code > FocusLast< / code > < / p >
< p > Focus on the last node.< / p >
< h3 id = "-focuspath--string-" > < a class = "header" href = "#-focuspath--string-" > { FocusPath = " string" }< / a > < / h3 >
< p > < strong > YAML:< / strong > < code > FocusPath: string< / code > < / p >
< p > Focus on the given path.< / p >
< p > < strong > YAML Example:< / strong > < code > FocusPath: /path/to/file< / code > < / p >
< p > < strong > Lua Example:< / strong > < code > { FocusPath = " /path/to/file" }< / code > < / p >
< h3 id = "focuspathfrominput" > < a class = "header" href = "#focuspathfrominput" > " FocusPathFromInput" < / a > < / h3 >
< p > < strong > YAML:< / strong > < code > FocusPathFromInput< / code > < / p >
< p > Focus on the path read from input buffer.< / p >
< h3 id = "-focusbyindex--int-" > < a class = "header" href = "#-focusbyindex--int-" > { FocusByIndex = int }< / a > < / h3 >
< p > < strong > YAML:< / strong > < code > FocusByIndex: int< / code > < / p >
< p > Focus on the absolute < code > n< / code > th node where < code > n< / code > is a given value.< / p >
< p > < strong > YAML Example:< / strong > < code > FocusByIndex: 2< / code > < / p >
< p > < strong > Lua Example:< / strong > < code > { FocusByIndex = 2 }< / code > < / p >
< h3 id = "focusbyindexfrominput" > < a class = "header" href = "#focusbyindexfrominput" > " FocusByIndexFromInput" < / a > < / h3 >
< p > < strong > YAML:< / strong > < code > FocusByIndexFromInput< / code > < / p >
< p > Focus on the absolute < code > n< / code > th node where < code > n< / code > is read from the input buffer.< / p >
< h3 id = "-focusbyfilename--string-" > < a class = "header" href = "#-focusbyfilename--string-" > { FocusByFileName = " string" }< / a > < / h3 >
< p > < strong > YAML:< / strong > < code > FocusByFileName: string< / code > < / p >
< p > Focus on the file by name from the present working directory.< / p >
< p > < strong > YAML Example:< / strong > < code > FocusByFileName: filename.ext< / code > < / p >
< p > < strong > Lua Example:< / strong > < code > { FocusByFileName = " filename.ext" }< / code > < / p >
< h3 id = "-changedirectory--string-" > < a class = "header" href = "#-changedirectory--string-" > { ChangeDirectory = " string" }< / a > < / h3 >
< p > < strong > YAML:< / strong > < code > ChangeDirectory: string< / code > < / p >
< p > Change the present working directory ($PWD)< / p >
< p > < strong > YAML Example:< / strong > < code > ChangeDirectory: /path/to/directory< / code > < / p >
< p > < strong > Lua Example:< / strong > < code > { ChangeDirectory = " /path/to/directory" }< / code > < / p >
< h3 id = "enter" > < a class = "header" href = "#enter" > " Enter" < / a > < / h3 >
< p > < strong > YAML:< / strong > < code > Enter< / code > < / p >
< p > Enter into the currently focused path if it's a directory.< / p >
< h3 id = "back" > < a class = "header" href = "#back" > " Back" < / a > < / h3 >
< p > < strong > YAML:< / strong > < code > Back< / code > < / p >
< p > Go back to the parent directory.< / p >
< h3 id = "lastvisitedpath" > < a class = "header" href = "#lastvisitedpath" > " LastVisitedPath" < / a > < / h3 >
< p > < strong > YAML:< / strong > < code > LastVisitedPath< / code > < / p >
< p > Go to the last path visited.< / p >
< h3 id = "nextvisitedpath" > < a class = "header" href = "#nextvisitedpath" > " NextVisitedPath" < / a > < / h3 >
< p > < strong > YAML:< / strong > < code > NextVisitedPath< / code > < / p >
< p > Go to the next path visited.< / p >
< h3 id = "followsymlink" > < a class = "header" href = "#followsymlink" > " FollowSymlink" < / a > < / h3 >
< p > < strong > YAML:< / strong > < code > FollowSymlink< / code > < / p >
< p > Follow the symlink under focus to its actual location.< / p >
< h3 id = "-bufferinput--string-" > < a class = "header" href = "#-bufferinput--string-" > { BufferInput = " string" }< / a > < / h3 >
< p > < strong > YAML:< / strong > < code > BufferInput(String)< / code > < / p >
< p > Append/buffer the given string into the input buffer.< / p >
< p > < strong > YAML Example:< / strong > < code > BufferInput: foo< / code > < / p >
< p > < strong > Lua Example:< / strong > < code > { BufferInput = " foo" }< / code > < / p >
< h3 id = "bufferinputfromkey" > < a class = "header" href = "#bufferinputfromkey" > " BufferInputFromKey" < / a > < / h3 >
< p > < strong > YAML:< / strong > < code > BufferInputFromKey< / code > < / p >
< p > Append/buffer the characted read from a keyboard input into the
input buffer.< / p >
< h3 id = "-setinputbuffer--string-" > < a class = "header" href = "#-setinputbuffer--string-" > { SetInputBuffer = " string" }< / a > < / h3 >
< p > < strong > YAML:< / strong > < code > SetInputBuffer: string< / code > < / p >
< p > Set/rewrite the input buffer with the given string.
When the input buffer is not-null (even if empty string)
it will show in the UI.< / p >
< p > < strong > YAML Example:< / strong > < code > SetInputBuffer: foo< / code > < / p >
< p > < strong > Lua Example:< / strong > < code > { SetInputBuffer = " foo" }< / code > < / p >
< h3 id = "removeinputbufferlastcharacter" > < a class = "header" href = "#removeinputbufferlastcharacter" > " RemoveInputBufferLastCharacter" < / a > < / h3 >
< p > < strong > YAML:< / strong > < code > RemoveInputBufferLastCharacter< / code > < / p >
< p > Remove input buffer's last character.< / p >
< h3 id = "removeinputbufferlastword" > < a class = "header" href = "#removeinputbufferlastword" > " RemoveInputBufferLastWord" < / a > < / h3 >
< p > < strong > YAML:< / strong > < code > RemoveInputBufferLastWord< / code > < / p >
< p > Remove input buffer's last word.< / p >
< h3 id = "resetinputbuffer" > < a class = "header" href = "#resetinputbuffer" > " ResetInputBuffer" < / a > < / h3 >
< p > < strong > YAML:< / strong > < code > ResetInputBuffer< / code > < / p >
< p > Reset the input buffer back to null. It will not show in the UI.< / p >
< h3 id = "-switchmode--string-" > < a class = "header" href = "#-switchmode--string-" > { SwitchMode = " string" }< / a > < / h3 >
< p > < strong > YAML:< / strong > < code > SwitchMode: string< / code > < / p >
< p > Switch input < a href = "modes.html#mode" > mode< / a > .< / p >
< blockquote >
< p > < strong > NOTE:< / strong > To be specific about which mode to switch to, use < code > SwitchModeBuiltin< / code > or
< code > SwitchModeCustom< / code > instead.< / p >
< / blockquote >
< p > < strong > YAML Example:< / strong > < code > SwitchMode: default< / code > < / p >
< p > < strong > Lua Example:< / strong > < code > { SwitchMode = " default" }< / code > < / p >
< h3 id = "-switchmodebuiltin--string-" > < a class = "header" href = "#-switchmodebuiltin--string-" > { SwitchModeBuiltin = " string" }< / a > < / h3 >
< p > < strong > YAML:< / strong > < code > SwitchModeBuiltin: string< / code > < / p >
< p > Switch to a < a href = "modes.html#builtin" > builtin mode< / a > .< / p >
< p > < strong > YAML Example:< / strong > < code > SwitchModeBuiltin: default< / code > < / p >
< p > < strong > Lua Example:< / strong > < code > { SwitchModeBuiltin = " default" }< / code > < / p >
< h3 id = "-switchmodecustom--string-" > < a class = "header" href = "#-switchmodecustom--string-" > { SwitchModeCustom = " string" }< / a > < / h3 >
< p > < strong > YAML:< / strong > < code > SwitchModeCustom: string< / code > < / p >
< p > Switch to a < a href = "modes.html#custom" > custom mode< / a > .< / p >
< p > < strong > YAML Example:< / strong > < code > SwitchModeCustom: my_custom_mode< / code > < / p >
< p > < strong > Lua Example:< / strong > < code > { SwitchModeCustom = " my_custom_mode" }< / code > < / p >
< h3 id = "popmode" > < a class = "header" href = "#popmode" > " PopMode" < / a > < / h3 >
< p > < strong > YAML:< / strong > < code > PopMode< / code > < / p >
< p > Pop the last mode from the history and switch to it.< / p >
< h3 id = "-switchlayout--string-" > < a class = "header" href = "#-switchlayout--string-" > { SwitchLayout = " string" }< / a > < / h3 >
< p > < strong > YAML:< / strong > < code > SwitchLayout: string< / code > < / p >
< p > Switch < a href = "layouts.html#layout" > layout< / a > .< / p >
< blockquote >
< p > < strong > NOTE:< / strong > To be specific about which layout to switch to, use < code > SwitchLayoutBuiltin< / code > or
< code > SwitchLayoutCustom< / code > instead.< / p >
< / blockquote >
< p > < strong > YAML Example:< / strong > < code > SwitchLayout: default< / code > < / p >
< p > < strong > Lua Example:< / strong > < code > { SwitchLayout = " default" }< / code > < / p >
< h3 id = "-switchlayoutbuiltin--string-" > < a class = "header" href = "#-switchlayoutbuiltin--string-" > { SwitchLayoutBuiltin = " string" }< / a > < / h3 >
< p > < strong > YAML:< / strong > < code > SwitchLayoutBuiltin: string< / code > < / p >
< p > Switch to a < a href = "layouts.html#builtin" > builtin layout< / a > .< / p >
< p > < strong > YAML Example:< / strong > < code > SwitchLayoutBuiltin: default< / code > < / p >
< p > < strong > Lua Example:< / strong > < code > { SwitchLayoutBuiltin = " default" }< / code > < / p >
< h3 id = "-switchlayoutcustom--string-" > < a class = "header" href = "#-switchlayoutcustom--string-" > { SwitchLayoutCustom = " string" }< / a > < / h3 >
< p > < strong > YAML:< / strong > < code > SwitchLayoutCustom: string< / code > < / p >
< p > Switch to a < a href = "layouts.html#custom" > custom layout< / a > .< / p >
< p > < strong > YAML Example:< / strong > < code > SwitchLayoutCustom: my_custom_layout< / code > < / p >
< p > < strong > Lua Example:< / strong > < code > { SwitchLayoutCustom = " my_custom_layout" }< / code > < / p >
< h3 id = "-call--string-" > < a class = "header" href = "#-call--string-" > { Call = " string" }< / a > < / h3 >
< p > < strong > YAML:< / strong > < code > Call: string< / code > < / p >
< p > Call a shell command with the given arguments.
Note that the arguments will be shell-escaped.
So to read the variables, the < code > -c< / code > option of the shell
can be used.
You may need to pass < code > ExplorePwd< / code > depening on the expectation.< / p >
< p > < strong > YAML Example:< / strong > < code > Call: { command: bash, args: [" -c" , " read -p test" ] }< / code > < / p >
< p > < strong > Lua Example:< / strong > < code > { Call = { command = " bash" , args = { " -c" , " read -p test" } } }< / code > < / p >
< h3 id = "-callsilently--string-" > < a class = "header" href = "#-callsilently--string-" > { CallSilently = " string" }< / a > < / h3 >
< p > < strong > YAML:< / strong > < code > CallSilently: string< / code > < / p >
< p > Like < code > Call< / code > but without the flicker. The stdin, stdout
stderr will be piped to null. So it's non-interactive.< / p >
< p > < strong > YAML Example:< / strong > < code > CallSilently: { command: tput, args: [" bell" ] }< / code > < / p >
< p > < strong > Lua Example:< / strong > < code > { CallSilently = { command = " tput" , args = { " bell" } } }< / code > < / p >
< h3 id = "-calllua--string-" > < a class = "header" href = "#-calllua--string-" > { CallLua = " string" }< / a > < / h3 >
< p > < strong > YAML:< / strong > < code > CallLua: string< / code > < / p >
< p > Call a Lua function.
A < a href = "#calllua-argument" > < code > CallLuaArg< / code > < / a > object will be passed to the
< a href = "#lua-function-calls" > function< / a > as argument.
The function can optionally return a list of messages for xplr to handle
after the executing the function.< / p >
< p > < strong > YAML Example:< / strong > < code > CallLua: custom.some_custom_funtion< / code > < / p >
< p > < strong > Lua Example:< / strong > < code > { CallLua = " custom.some_custom_funtion" }< / code > < / p >
< h3 id = "-callluasilently--string-" > < a class = "header" href = "#-callluasilently--string-" > { CallLuaSilently = " string" }< / a > < / h3 >
< p > < strong > YAML:< / strong > < code > CallLuaSilently: string< / code > < / p >
< p > Like < code > CallLua< / code > but without the flicker. The stdin, stdout
stderr will be piped to null. So it's non-interactive.< / p >
< p > < strong > YAML Example:< / strong > < code > CallLuaSilently: custom.some_custom_function< / code > < / p >
< p > < strong > Lua Example:< / strong > < code > { CallLuaSilently = " custom.some_custom_function" }< / code > < / p >
< h3 id = "-bashexec--string-" > < a class = "header" href = "#-bashexec--string-" > { BashExec = " string" }< / a > < / h3 >
< p > < strong > YAML:< / strong > < code > BashExec: string< / code > < / p >
< p > An alias to < code > Call: {command: bash, args: [" -c" , " {string}" ], silent: false}< / code >
where < code > {string}< / code > is the given value.< / p >
< p > < strong > YAML Example:< / strong > < code > BashExec: " read -p test" < / code > < / p >
< p > < strong > Lua Example:< / strong > < code > { BashExec = " read -p test" }< / code > < / p >
< h3 id = "-bashexecsilently--string-" > < a class = "header" href = "#-bashexecsilently--string-" > { BashExecSilently = " string" }< / a > < / h3 >
< p > < strong > YAML:< / strong > < code > BashExecSilently(String)< / code > < / p >
< p > Like < code > BashExec< / code > but without the flicker. The stdin, stdout
stderr will be piped to null. So it's non-interactive.< / p >
< p > < strong > YAML Example:< / strong > < code > BashExecSilently: " tput bell" < / code > < / p >
< p > < strong > Lua Example:< / strong > < code > { BashExecSilently = " tput bell" }< / code > < / p >
< h3 id = "select" > < a class = "header" href = "#select" > " Select" < / a > < / h3 >
< p > < strong > YAML:< / strong > < code > Select< / code > < / p >
< p > Select the focused node.< / p >
< h3 id = "selectall" > < a class = "header" href = "#selectall" > " SelectAll" < / a > < / h3 >
< p > < strong > YAML:< / strong > < code > SelectAll< / code > < / p >
< p > Select all the visible nodes.< / p >
< h3 id = "-selectpath--string-" > < a class = "header" href = "#-selectpath--string-" > { SelectPath = " string" }< / a > < / h3 >
< p > < strong > YAML:< / strong > < code > SelectPath: string< / code > < / p >
< p > Select the given path.< / p >
< p > < strong > YAML Example:< / strong > < code > SelectPath: /path/to/file< / code > < / p >
< p > < strong > Lua Example:< / strong > < code > { SelectPath = " /path/to/file" }< / code > < / p >
< h3 id = "unselect" > < a class = "header" href = "#unselect" > " UnSelect" < / a > < / h3 >
< p > < strong > YAML:< / strong > < code > UnSelect< / code > < / p >
< p > Unselect the focused node.< / p >
< h3 id = "unselectall" > < a class = "header" href = "#unselectall" > " UnSelectAll" < / a > < / h3 >
< p > < strong > YAML:< / strong > < code > UnSelectAll< / code > < / p >
< p > Unselect all the visible nodes.< / p >
< h3 id = "-unselectpath--string-" > < a class = "header" href = "#-unselectpath--string-" > { UnSelectPath = " string)" }< / a > < / h3 >
< p > < strong > YAML:< / strong > < code > UnSelectPath: string< / code > < / p >
< p > UnSelect the given path.< / p >
< p > < strong > YAML Example:< / strong > < code > UnSelectPath: /path/to/file< / code > < / p >
< p > < strong > Lua Example:< / strong > < code > { UnSelectPath = " /path/to/file" }< / code > < / p >
< h3 id = "toggleselection" > < a class = "header" href = "#toggleselection" > " ToggleSelection" < / a > < / h3 >
< p > < strong > YAML:< / strong > < code > ToggleSelection< / code > < / p >
< p > Toggle selection on the focused node.< / p >
< h3 id = "toggleselectall" > < a class = "header" href = "#toggleselectall" > " ToggleSelectAll" < / a > < / h3 >
< p > < strong > YAML:< / strong > < code > ToggleSelectAll< / code > < / p >
< p > Toggle between select all and unselect all.< / p >
< h3 id = "-toggleselectionbypath--string-" > < a class = "header" href = "#-toggleselectionbypath--string-" > { ToggleSelectionByPath = " string" }< / a > < / h3 >
< p > < strong > YAML:< / strong > < code > ToggleSelectionByPath: string< / code > < / p >
< p > Toggle selection by file path.< / p >
< p > < strong > YAML Example:< / strong > < code > ToggleSelectionByPath: /path/to/file< / code > < / p >
< p > < strong > Lua Example:< / strong > < code > { ToggleSelectionByPath = " /path/to/file" }< / code > < / p >
< h3 id = "clearselection" > < a class = "header" href = "#clearselection" > " ClearSelection" < / a > < / h3 >
< p > < strong > YAML:< / strong > < code > ClearSelection< / code > < / p >
< p > Clear the selection.< / p >
< h3 id = "-addnodefilter---filter--a-hreffilteringhtmlfilterfiltera-input--string-" > < a class = "header" href = "#-addnodefilter---filter--a-hreffilteringhtmlfilterfiltera-input--string-" > { AddNodeFilter = { filter = < a href = "filtering.html#filter" > Filter< / a > , input = " string" }< / a > < / h3 >
< p > < strong > YAML:< / strong > < code > AddNodeFilter: { filter = Filter, input = string }< / code > < / p >
< p > Add a < a href = "filtering.html" > filter< / a > to exclude nodes while exploring directories.< / p >
< p > < strong > YAML Example:< / strong > < code > AddNodeFilter: { filter: RelativePathDoesStartWith, input: foo }< / code > < / p >
< p > < strong > Lua Example:< / strong > < code > { AddNodeFilter = { filter = " RelativePathDoesStartWith" , input = " foo" } }< / code > < / p >
< h3 id = "-removenodefilter---filter--a-hreffilteringhtmlfilterfiltera-input--string-" > < a class = "header" href = "#-removenodefilter---filter--a-hreffilteringhtmlfilterfiltera-input--string-" > { RemoveNodeFilter = { filter = < a href = "filtering.html#filter" > Filter< / a > , input = " string" }< / a > < / h3 >
< p > < strong > YAML:< / strong > < code > RemoveNodeFilter: { filter = Filter, input = string< / code > < / p >
< p > Remove an existing < a href = "filtering.html" > filter< / a > .< / p >
< p > < strong > YAML Example:< / strong > < code > RemoveNodeFilter: { filter: RelativePathDoesStartWith, input: foo }< / code > < / p >
< p > < strong > Lua Example:< / strong > < code > { RemoveNodeFilter: { filter: " RelativePathDoesStartWith" , input: " foo" } }< / code > < / p >
< h3 id = "-togglenodefilter---filter--a-hreffilteringhtmlfilterfiltera-input--string-" > < a class = "header" href = "#-togglenodefilter---filter--a-hreffilteringhtmlfilterfiltera-input--string-" > { ToggleNodeFilter = { filter = < a href = "filtering.html#filter" > Filter< / a > , input = " string" }< / a > < / h3 >
< p > < strong > YAML:< / strong > < code > ToggleNodeFilter: { filter = Filter, input = string }< / code > < / p >
< p > Remove a < a href = "filtering.html" > filter< / a > if it exists, else, add a it.< / p >
< p > < strong > YAML Example:< / strong > < code > ToggleNodeFilter: { filter: RelativePathDoesStartWith, input: foo }< / code > < / p >
< p > < strong > Lua Example:< / strong > < code > { ToggleNodeFilter = { filter = " RelativePathDoesStartWith" , input = " foo" } }< / code > < / p >
< h3 id = "-addnodefilterfrominput--a-hreffilteringhtmlfilterfiltera-" > < a class = "header" href = "#-addnodefilterfrominput--a-hreffilteringhtmlfilterfiltera-" > { AddNodeFilterFromInput = < a href = "filtering.html#filter" > Filter< / a > }< / a > < / h3 >
< p > < strong > YAML:< / strong > < code > AddNodeFilterFromInput: Filter< / code > < / p >
< p > Add a node < a href = "filtering.html" > filter< / a > reading the input from the buffer.< / p >
< p > < strong > YAML Example:< / strong > < code > AddNodeFilterFromInput: RelativePathDoesStartWith< / code > < / p >
< p > < strong > Lua Example:< / strong > < code > { AddNodeFilterFromInput = " RelativePathDoesStartWith" }< / code > < / p >
< h3 id = "-removenodefilterfrominput--a-hreffilteringhtmlfilterfiltera-" > < a class = "header" href = "#-removenodefilterfrominput--a-hreffilteringhtmlfilterfiltera-" > { RemoveNodeFilterFromInput = < a href = "filtering.html#filter" > Filter< / a > }< / a > < / h3 >
< p > < strong > YAML:< / strong > < code > RemoveNodeFilterFromInput: Filter< / code > < / p >
< p > Remove a node < a href = "filtering.html" > filter< / a > reading the input from the buffer.< / p >
< p > < strong > YAML Example:< / strong > < code > RemoveNodeFilterFromInput: RelativePathDoesStartWith< / code > < / p >
< p > < strong > Lua Example:< / strong > < code > { RemoveNodeFilterFromInput = " RelativePathDoesStartWith" }< / code > < / p >
< h3 id = "removelastnodefilter" > < a class = "header" href = "#removelastnodefilter" > " RemoveLastNodeFilter" < / a > < / h3 >
< p > < strong > YAML:< / strong > < code > RemoveLastNodeFilter< / code > < / p >
< p > Remove the last node < a href = "filtering.html" > filter< / a > .< / p >
< h3 id = "resetnodefilters" > < a class = "header" href = "#resetnodefilters" > " ResetNodeFilters" < / a > < / h3 >
< p > < strong > YAML:< / strong > < code > ResetNodeFilters< / code > < / p >
< p > Reset the node < a href = "filtering.html" > filters< / a > back to the default configuration.< / p >
< h3 id = "clearnodefilters" > < a class = "header" href = "#clearnodefilters" > " ClearNodeFilters" < / a > < / h3 >
< p > < strong > YAML:< / strong > < code > ClearNodeFilters< / code > < / p >
< p > Clear all the node < a href = "filtering.html" > filters< / a > .< / p >
< h3 id = "-addnodesorter---sorter--a-hrefsortinghtmlsortersortera-reverse--bool--" > < a class = "header" href = "#-addnodesorter---sorter--a-hrefsortinghtmlsortersortera-reverse--bool--" > { AddNodeSorter = { sorter = < a href = "sorting.html#sorter" > Sorter< / a > , reverse = bool } }< / a > < / h3 >
< p > < strong > YAML:< / strong > < code > AddNodeSorter: { sorter: Sorter, reverse = bool }< / code > < / p >
< p > Add a < a href = "sorting.html#sorter" > sorter< / a > to sort nodes while exploring directories.< / p >
< p > < strong > YAML Example:< / strong > < code > AddNodeSorter: { sorter: ByRelativePath, reverse: false }< / code > < / p >
< p > < strong > YAML Example:< / strong > < code > { AddNodeSorter = { sorter = " ByRelativePath" , reverse = false } }< / code > < / p >
< h3 id = "-removenodesorter--a-hrefsortinghtmlsortersortera-" > < a class = "header" href = "#-removenodesorter--a-hrefsortinghtmlsortersortera-" > { RemoveNodeSorter = < a href = "sorting.html#sorter" > Sorter< / a > }< / a > < / h3 >
< p > < strong > YAML:< / strong > < code > RemoveNodeSorter: Sorter< / code > < / p >
< p > Remove an existing < a href = "sorting.html#sorter" > sorter< / a > .< / p >
< p > < strong > YAML Example:< / strong > < code > RemoveNodeSorter: ByRelativePath< / code > < / p >
< p > < strong > Lua Example:< / strong > < code > { RemoveNodeSorter = " ByRelativePath" }< / code > < / p >
< h3 id = "-reversenodesorter--a-hrefsortinghtmlsortersortera-" > < a class = "header" href = "#-reversenodesorter--a-hrefsortinghtmlsortersortera-" > { ReverseNodeSorter = < a href = "sorting.html#sorter" > Sorter< / a > }< / a > < / h3 >
< p > < strong > YAML:< / strong > < code > ReverseNodeSorter: Sorter< / code > < / p >
< p > Reverse a node < a href = "sorting.html#sorter" > sorter< / a > .< / p >
< p > < strong > YAML Example:< / strong > < code > ReverseNodeSorter: ByRelativePath< / code > < / p >
< p > < strong > Lua Example:< / strong > < code > { ReverseNodeSorter = " ByRelativePath" }< / code > < / p >
< h3 id = "-togglenodesorter---sorter--a-hrefsortinghtmlsortersortera-reverse--bool--" > < a class = "header" href = "#-togglenodesorter---sorter--a-hrefsortinghtmlsortersortera-reverse--bool--" > { ToggleNodeSorter = { sorter = < a href = "sorting.html#sorter" > Sorter< / a > , reverse = bool } }< / a > < / h3 >
< p > < strong > YAML:< / strong > < code > ToggleNodeSorter: { sorter: Sorter, reverse = bool }< / code > < / p >
< p > Remove a < a href = "sorting.html#sorter" > sorter< / a > if it exists, else, add a it.< / p >
< p > < strong > YAML Example:< / strong > < code > ToggleSorterSorter: {sorter: ByRelativePath, reverse: false }< / code > < / p >
< p > < strong > Lua Example:< / strong > < code > { ToggleSorterSorter: { sorter = " ByRelativePath" , reverse = false } }< / code > < / p >
< h3 id = "reversenodesorters" > < a class = "header" href = "#reversenodesorters" > " ReverseNodeSorters" < / a > < / h3 >
< p > < strong > YAML:< / strong > < code > ReverseNodeSorters< / code > < / p >
< p > Reverse the node < a href = "sorting.html#sorter" > sorters< / a > .< / p >
< h3 id = "removelastnodesorter" > < a class = "header" href = "#removelastnodesorter" > " RemoveLastNodeSorter" < / a > < / h3 >
< p > < strong > YAML:< / strong > < code > RemoveLastNodeSorter< / code > < / p >
< p > Remove the last node < a href = "sorting.html#sorter" > sorter< / a > .< / p >
< h3 id = "resetnodesorters" > < a class = "header" href = "#resetnodesorters" > " ResetNodeSorters" < / a > < / h3 >
< p > < strong > YAML:< / strong > < code > ResetNodeSorters< / code > < / p >
< p > Reset the node < a href = "sorting.html#sorter" > sorters< / a > back to the default configuration.< / p >
< h3 id = "clearnodesorters" > < a class = "header" href = "#clearnodesorters" > " ClearNodeSorters" < / a > < / h3 >
< p > < strong > YAML:< / strong > < code > ClearNodeSorters< / code > < / p >
< p > Clear all the node < a href = "sorting.html#sorter" > sorters< / a > .< / p >
< h3 id = "enablemouse" > < a class = "header" href = "#enablemouse" > " EnableMouse" < / a > < / h3 >
< p > < strong > YAML:< / strong > < code > EnableMouse< / code > < / p >
< p > Enable mouse< / p >
< h3 id = "disablemouse" > < a class = "header" href = "#disablemouse" > " DisableMouse" < / a > < / h3 >
< p > < strong > YAML:< / strong > < code > DisableMouse< / code > < / p >
< p > Disable mouse< / p >
< h3 id = "togglemouse" > < a class = "header" href = "#togglemouse" > " ToggleMouse" < / a > < / h3 >
< p > < strong > YAML:< / strong > < code > ToggleMouse< / code > < / p >
< p > Toggle mouse< / p >
< h3 id = "-startfifo--string-" > < a class = "header" href = "#-startfifo--string-" > { StartFifo = " string" }< / a > < / h3 >
< p > < strong > YAML:< / strong > < code > StartFifo: string< / code > < / p >
< p > Start piping the focused path to the given fifo path< / p >
< p > < strong > YAML Example:< / strong > < code > StartFifo: /tmp/xplr.fifo< / code > < / p >
< p > < strong > Lua Example:< / strong > < code > { StartFifo = " /tmp/xplr.fifo }< / code > < / p >
< h3 id = "stopfifo" > < a class = "header" href = "#stopfifo" > " StopFifo" < / a > < / h3 >
< p > < strong > YAML:< / strong > < code > StopFifo< / code > < / p >
< p > Close the active fifo and stop piping.< / p >
< h3 id = "-togglefifo--string-" > < a class = "header" href = "#-togglefifo--string-" > { ToggleFifo = " string" }< / a > < / h3 >
< p > < strong > YAML:< / strong > < code > ToggleFifo: string< / code > < / p >
< p > Toggle betwen {Start|Stop}Fifo< / p >
< p > < strong > YAML Example:< / strong > < code > ToggleFifo: /path/to/fifo< / code > < / p >
< p > < strong > Lua Example:< / strong > < code > { ToggleFifo = " /path/to/fifo" }< / code > < / p >
< h3 id = "-loginfo--string-" > < a class = "header" href = "#-loginfo--string-" > { LogInfo = " string" }< / a > < / h3 >
< p > < strong > YAML:< / strong > < code > LogInfo: string< / code > < / p >
< p > Log information message.< / p >
< p > < strong > YAML Example:< / strong > < code > LogInfo: launching satellite< / code > < / p >
< p > < strong > Lua Example:< / strong > < code > { LogInfo = " launching satellite" }< / code > < / p >
< h3 id = "-logsuccess--string-" > < a class = "header" href = "#-logsuccess--string-" > { LogSuccess = " String" }< / a > < / h3 >
< p > < strong > YAML:< / strong > < code > LogSuccess: string< / code > < / p >
< p > Log a success message.< / p >
< p > < strong > YAML Example:< / strong > < code > LogSuccess: satellite reached destination< / code > .< / p >
< p > < strong > Lua Example:< / strong > < code > { LogSuccess = " satellite reached destination" }< / code > .< / p >
< h3 id = "-logwarning--string-" > < a class = "header" href = "#-logwarning--string-" > { LogWarning = " string" }< / a > < / h3 >
< p > < strong > YAML:< / strong > < code > LogWarning: string< / code > < / p >
< p > Log an warning message.< / p >
< p > < strong > YAML Example:< / strong > < code > LogWarning: satellite is heating< / code > < / p >
< p > < strong > Lua Example:< / strong > < code > { LogWarning = " satellite is heating" }< / code > < / p >
< h3 id = "-logerror--string-" > < a class = "header" href = "#-logerror--string-" > { LogError = " string" }< / a > < / h3 >
< p > < strong > YAML:< / strong > < code > LogError: string< / code > < / p >
< p > Log an error message.< / p >
< p > < strong > YAML Example:< / strong > < code > LogError: satellite crashed< / code > < / p >
< p > < strong > Lua Example:< / strong > < code > { LogError = " satellite crashed" }< / code > < / p >
< h3 id = "quit" > < a class = "header" href = "#quit" > " Quit" < / a > < / h3 >
< p > < strong > YAML:< / strong > < code > Quit< / code > < / p >
< p > Quit with returncode zero (success).< / p >
< h3 id = "printpwdandquit" > < a class = "header" href = "#printpwdandquit" > " PrintPwdAndQuit" < / a > < / h3 >
< p > < strong > YAML:< / strong > < code > PrintPwdAndQuit< / code > < / p >
< p > Print $PWD and quit.< / p >
< h3 id = "printfocuspathandquit" > < a class = "header" href = "#printfocuspathandquit" > " PrintFocusPathAndQuit" < / a > < / h3 >
< p > < strong > YAML:< / strong > < code > PrintFocusPathAndQuit< / code > < / p >
< p > Print the path under focus and quit. It can be empty string if there's nothing to focus.< / p >
< h3 id = "printselectionandquit" > < a class = "header" href = "#printselectionandquit" > " PrintSelectionAndQuit" < / a > < / h3 >
< p > < strong > YAML:< / strong > < code > PrintSelectionAndQuit< / code > < / p >
< p > Print the selected paths and quit. It can be empty is no path is selected.< / p >
< h3 id = "printresultandquit" > < a class = "header" href = "#printresultandquit" > " PrintResultAndQuit" < / a > < / h3 >
< p > < strong > YAML:< / strong > < code > PrintResultAndQuit< / code > < / p >
< p > Print the selected paths if it's not empty, else, print the focused node's path.< / p >
< h3 id = "printappstateandquit" > < a class = "header" href = "#printappstateandquit" > " PrintAppStateAndQuit" < / a > < / h3 >
< p > < strong > YAML:< / strong > < code > PrintAppStateAndQuit< / code > < / p >
< p > Print the state of application in YAML format. Helpful for debugging or generating
the default configuration file.< / p >
< h3 id = "-debug--string-" > < a class = "header" href = "#-debug--string-" > { Debug = " string" }< / a > < / h3 >
< p > < strong > YAML:< / strong > < code > Debug: string< / code > < / p >
< p > Write the application state to a file, without quitting. Also helpful for debugging.< / p >
< p > < strong > YAML Example:< / strong > < code > Debug: /path/to/file< / code > < / p >
< p > < strong > Lua Example:< / strong > < code > { Debug = " /path/to/file" }< / code > < / p >
< h3 id = "terminate" > < a class = "header" href = "#terminate" > " Terminate" < / a > < / h3 >
< p > < strong > YAML:< / strong > < code > Terminate< / code > < / p >
< p > Terminate the application with a non-zero return code.< / p >
< h2 id = "lua-function-calls" > < a class = "header" href = "#lua-function-calls" > Lua Function Calls< / a > < / h2 >
< p > xplr allows users to define lua functions using the < code > xplr.fn.custom< / code > Lua API.< / p >
< p > These functions can be called using messages like < code > CallLua< / code > , < code > CallLuaSilently< / code > .< / p >
< p > When called the function receives a < a href = "#calllua-argument" > special argument< / a > that
contains some useful information. The function can optionally return a list of
messages which will be handled by xplr.< / p >
< h3 id = "calllua-argument" > < a class = "header" href = "#calllua-argument" > CallLua Argument< / a > < / h3 >
< p > This is a special argument passed to the lua functions when called using the
< code > CallLua< / code > , < code > CallLuaSilently< / code > messages.< / p >
< p > It contains the following information:< / p >
< ul >
< li > < a href = "#version" > version< / a > < / li >
< li > < a href = "#config" > config< / a > < / li >
< li > < a href = "#pwd" > pwd< / a > < / li >
< li > < a href = "#focused_node" > focused_node< / a > < / li >
< li > < a href = "#directory_buffer" > directory_buffer< / a > < / li >
< li > < a href = "#selection" > selection< / a > < / li >
< li > < a href = "#mode" > mode< / a > < / li >
< li > < a href = "#layout" > layout< / a > < / li >
< li > < a href = "#input_buffer" > input_buffer< / a > < / li >
< li > < a href = "#pid" > pid< / a > < / li >
< li > < a href = "#session_path" > session_path< / a > < / li >
< li > < a href = "#explorer_config" > explorer_config< / a > < / li >
< li > < a href = "#history" > history< / a > < / li >
< li > < a href = "#last_modes" > last_modes< / a > < / li >
< / ul >
< h3 id = "version" > < a class = "header" href = "#version" > version< / a > < / h3 >
< p > Type: string< / p >
< p > xplr version. Can be used to test compatibility.< / p >
< h3 id = "config" > < a class = "header" href = "#config" > config< / a > < / h3 >
< p > Type: < a href = "configuration.html#config" > Config< / a > < / p >
< p > The loaded configuration.< / p >
< h3 id = "pwd" > < a class = "header" href = "#pwd" > pwd< / a > < / h3 >
< p > Type: string< / p >
< p > The present working directory/< / p >
< h3 id = "focused_node" > < a class = "header" href = "#focused_node" > focused_node< / a > < / h3 >
< p > Type: nullable < a href = "#node" > Node< / a > < / p >
< p > The node under focus.< / p >
< h3 id = "directory_buffer" > < a class = "header" href = "#directory_buffer" > directory_buffer< / a > < / h3 >
< p > Type: nullable < a href = "#directorybuffer" > DirectoryBuffer< / a > < / p >
< p > The directory buffer being rendered.< / p >
< h3 id = "selection" > < a class = "header" href = "#selection" > selection< / a > < / h3 >
< p > Type: list of selected < a href = "#node" > Node< / a > s< / p >
< p > The selected nodes.< / p >
< h3 id = "mode" > < a class = "header" href = "#mode" > mode< / a > < / h3 >
< p > Type: < a href = "modes.html#mode" > Mode< / a > < / p >
< p > Current mode.< / p >
< h3 id = "layout" > < a class = "header" href = "#layout" > layout< / a > < / h3 >
< p > Type: < a href = "layouts.html#layout" > Layout< / a > < / p >
< p > Current layout.< / p >
< h3 id = "input_buffer" > < a class = "header" href = "#input_buffer" > input_buffer< / a > < / h3 >
< p > Type: nullable string< / p >
< p > The input buffer.< / p >
< h3 id = "pid" > < a class = "header" href = "#pid" > pid< / a > < / h3 >
< p > Type: integer< / p >
< p > The xplr session PID.< / p >
< h3 id = "session_path" > < a class = "header" href = "#session_path" > session_path< / a > < / h3 >
< p > Type: string< / p >
< p > The session path.< / p >
< h3 id = "explorer_config" > < a class = "header" href = "#explorer_config" > explorer_config< / a > < / h3 >
< p > < a href = "https://docs.rs/xplr/latest/xplr/app/struct.ExplorerConfig.html" > TODO< / a > < / p >
< h3 id = "history" > < a class = "header" href = "#history" > history< / a > < / h3 >
< p > Type: < a href = "#history-1" > History< / a > < / p >
< h3 id = "last_modes" > < a class = "header" href = "#last_modes" > last_modes< / a > < / h3 >
< p > Type: list of < a href = "modes.html#mode" > Mode< / a > < / p >
< p > Last modes, not popped yet.< / p >
< h3 id = "parent" > < a class = "header" href = "#parent" > parent< / a > < / h3 >
< p > Type: string< / p >
< p > The parent path of the node.< / p >
< h3 id = "relative_path" > < a class = "header" href = "#relative_path" > relative_path< / a > < / h3 >
< p > Type: string< / p >
< p > The path relative to the parent, i.e. the file/directory name with extension.< / p >
< h3 id = "absolute_path" > < a class = "header" href = "#absolute_path" > absolute_path< / a > < / h3 >
< p > Type: string< / p >
< p > The absolute path (without resolving symlinks) of the node.< / p >
< h3 id = "extension" > < a class = "header" href = "#extension" > extension< / a > < / h3 >
< p > Type: string< / p >
< p > The extension of the node.< / p >
< h3 id = "is_symlink" > < a class = "header" href = "#is_symlink" > is_symlink< / a > < / h3 >
< p > Type: boolean< / p >
< p > < code > true< / code > if the node is a symlink.< / p >
< h3 id = "is_broken" > < a class = "header" href = "#is_broken" > is_broken< / a > < / h3 >
< p > Type: boolean< / p >
< p > < code > true< / code > if the node is a broken symlink.< / p >
< h3 id = "is_dir" > < a class = "header" href = "#is_dir" > is_dir< / a > < / h3 >
< p > Type: boolean< / p >
< p > < code > true< / code > if the node is a directory.< / p >
< h3 id = "is_file" > < a class = "header" href = "#is_file" > is_file< / a > < / h3 >
< p > Type: boolean< / p >
< p > < code > true< / code > if the node is a file.< / p >
< h3 id = "is_readonly" > < a class = "header" href = "#is_readonly" > is_readonly< / a > < / h3 >
< p > Type: boolean< / p >
< p > < code > true< / code > if the node is real-only.< / p >
< h3 id = "mime_essence" > < a class = "header" href = "#mime_essence" > mime_essence< / a > < / h3 >
< p > Type: string< / p >
< p > The mime type of the node. For e.g. < code > text/csv< / code > , < code > image/jpeg< / code > etc.< / p >
< h3 id = "size" > < a class = "header" href = "#size" > size< / a > < / h3 >
< p > Type: integer< / p >
< p > The size of the exact node. The size of a directory won't be calculated
recursively.< / p >
< h3 id = "human_size" > < a class = "header" href = "#human_size" > human_size< / a > < / h3 >
< p > Type: string< / p >
< p > Like size but in human readable format.< / p >
< h3 id = "permissions" > < a class = "header" href = "#permissions" > permissions< / a > < / h3 >
< p > Type: < a href = "column-renderer.html#permission" > Permission< / a > < / p >
< p > The < a href = "column-renderer.html#permission" > permissions< / a > applied to the node.< / p >
< h3 id = "canonical" > < a class = "header" href = "#canonical" > canonical< / a > < / h3 >
< p > Type: nullable < a href = "column-renderer.html#resolved-node-metadata" > Resolved Node Metadata< / a > < / p >
< p > If the node is a symlink, it will hold information about the symlink resolved
node. Else, it will hold information the actual node. It the symlink is broken,
it will be null.< / p >
< h3 id = "symlink" > < a class = "header" href = "#symlink" > symlink< / a > < / h3 >
< p > Type: nullable < a href = "column-renderer.html#resolved-node-metadata" > Resolved Node Metadata< / a > < / p >
< p > If the node is a symlink and is not broken, it will hold information about the
symlink resolved node. However, it will never hold information about the actual
node. It will instead be null.< / p >
< h3 id = "node" > < a class = "header" href = "#node" > Node< / a > < / h3 >
< p > A node contains the following fields:< / p >
< ul >
< li > < a href = "#parent" > parent< / a > < / li >
< li > < a href = "#relative_path" > relative_path< / a > < / li >
< li > < a href = "#absolute_path" > absolute_path< / a > < / li >
< li > < a href = "#extension" > extension< / a > < / li >
< li > < a href = "#is_symlink" > is_symlink< / a > < / li >
< li > < a href = "#is_broken" > is_broken< / a > < / li >
< li > < a href = "#is_dir" > is_dir< / a > < / li >
< li > < a href = "#is_file" > is_file< / a > < / li >
< li > < a href = "#is_readonly" > is_readonly< / a > < / li >
< li > < a href = "#mime_essence" > mime_essence< / a > < / li >
< li > < a href = "#size" > size< / a > < / li >
< li > < a href = "#human_size" > human_size< / a > < / li >
< li > < a href = "#permissions" > permissions< / a > < / li >
< li > < a href = "#canonical" > canonical< / a > < / li >
< li > < a href = "#symlink" > symlink< / a > < / li >
< / ul >
< h3 id = "directorybuffer" > < a class = "header" href = "#directorybuffer" > DirectoryBuffer< / a > < / h3 >
< p > Directory buffer contains the following fields:< / p >
< ul >
< li > < a href = "#parent" > parent< / a > < / li >
< li > < a href = "#nodes" > nodes< / a > < / li >
< li > < a href = "#total" > total< / a > < / li >
< li > < a href = "#focus" > focus< / a > < / li >
< / ul >
< h4 id = "parent-1" > < a class = "header" href = "#parent-1" > parent< / a > < / h4 >
< p > Type: string< / p >
< p > The parent path of the node.< / p >
< h4 id = "nodes" > < a class = "header" href = "#nodes" > nodes< / a > < / h4 >
< p > Type: list of < a href = "#node" > Node< / a > s< / p >
< p > A list of visible nodes.< / p >
< h4 id = "total" > < a class = "header" href = "#total" > total< / a > < / h4 >
< p > Type: int< / p >
< p > The count of nodes being rendered.< / p >
< h4 id = "focus" > < a class = "header" href = "#focus" > focus< / a > < / h4 >
< p > Type: int< / p >
< p > The index of the node under focus. It can be < code > 0< / code > even when there's no node to
focus on.< / p >
< h3 id = "history-1" > < a class = "header" href = "#history-1" > History< / a > < / h3 >
< p > History contains the following fields:< / p >
< ul >
< li > < a href = "#loc" > loc< / a > < / li >
< li > < a href = "#paths" > paths< / a > < / li >
< / ul >
< h4 id = "loc" > < a class = "header" href = "#loc" > loc< / a > < / h4 >
< p > Type: int< / p >
< p > Location of the current path in history.< / p >
< h4 id = "paths" > < a class = "header" href = "#paths" > paths< / a > < / h4 >
< p > Type: list of string< / p >
< p > Visited paths.< / p >
< h3 id = "example-using-lua-function-calls" > < a class = "header" href = "#example-using-lua-function-calls" > Example: Using Lua Function Calls< / a > < / h3 >
< pre > < code class = "language-lua" > -- Define the function
xplr.fn.custom.ask_name_and_greet = function(app)
print(" What's your name?" )
local name = io.read()
local greeting = " Hello " .. name .. " !"
local message = greeting .. " You are inside " .. app.pwd
return {
{ LogSuccess = message },
}
end
-- Map the function to a key (space)
xplr.config.modes.builtin.default.key_bindings.on_key.space = {
help = " ask name and greet" ,
messages = {
{ CallLua = " custom.ask_name_and_greet" }
}
}
-- Now, when you press " space" in default mode, you will be prompted for your
-- name. Enter your name to receive a nice greeting and to know your location.
< / code > < / pre >
< h2 id = "environment-variables-and-pipes" > < a class = "header" href = "#environment-variables-and-pipes" > Environment Variables and Pipes< / a > < / h2 >
< p > Alternative to < code > CallLua< / code > , < code > CallLuaSilently< / code > messages that call Lua functions,
there are < code > Call< / code > , < code > CallSilently< / code > , < code > BashExec< / code > , < code > BashExecSilently< / code > messages
that call shell commands.< / p >
< p > However, unlike the Lua functions, these shell commands have to read the useful
information and send messages via environment variables and temporary files
called " pipe" s. These environment variables and files are only available when
a command is being executed.< / p >
< p > Visit the < a href = "modes.html#tutorial-adding-a-new-mode" > < strong > fzf integration tutorial< / strong > < / a >
for example.< / p >
< h3 id = "environment-variables" > < a class = "header" href = "#environment-variables" > Environment variables< / a > < / h3 >
< p > To see the environment variables, invoke the shell by typing < code > :!< / code > in default
mode and run the following command:< / p >
< pre > < code > env | grep ^XPLR_
< / code > < / pre >
< p > You will see something like:< / p >
< pre > < code > XPLR_FOCUS_INDEX=0
XPLR_MODE=action to
XPLR_PIPE_SELECTION_OUT=/run/user/1000/xplr/session/122278/pipe/selection_out
XPLR_INPUT_BUFFER=
XPLR_PIPE_GLOBAL_HELP_MENU_OUT=/run/user/1000/xplr/session/122278/pipe/global_help_menu_out
XPLR_PID=122278
XPLR_PIPE_MSG_IN=/run/user/1000/xplr/session/122278/pipe/msg_in
XPLR_PIPE_LOGS_OUT=/run/user/1000/xplr/session/122278/pipe/logs_out
XPLR_PIPE_RESULT_OUT=/run/user/1000/xplr/session/122278/pipe/result_out
XPLR_PIPE_HISTORY_OUT=/run/user/1000/xplr/session/122278/pipe/history_out
XPLR_FOCUS_PATH=/home/sayanarijit/Documents/GitHub/xplr/docs/en/book
XPLR_SESSION_PATH=/run/user/1000/xplr/session/122278
XPLR_APP_VERSION=0.14.3
XPLR_PIPE_DIRECTORY_NODES_OUT=/run/user/1000/xplr/session/122278/pipe/directory_nodes_out
< / code > < / pre >
< p > The environment variables starting with < code > XPLR_PIPE_< / code > are the temporary files
called " pipe" s.< / p >
< h4 id = "input-pipe" > < a class = "header" href = "#input-pipe" > Input pipe< / a > < / h4 >
< p > Current there is only one input pipe.< / p >
< ul >
< li > < a href = "#xplr_pipe_msg_in" > XPLR_PIPE_MSG_IN< / a > < / li >
< / ul >
< h4 id = "output-pipes" > < a class = "header" href = "#output-pipes" > Output pipes< / a > < / h4 >
< p > < code > XPLR_PIPE_*_OUT< / code > are the output pipes that contain data which cannot be
exposed directly via environment variables, like multi-line string.< / p >
< ul >
< li > < a href = "#xplr_pipe_selection_out" > XPLR_PIPE_SELECTION_OUT< / a > < / li >
< li > < a href = "#xplr_pipe_global_help_menu_out" > XPLR_PIPE_GLOBAL_HELP_MENU_OUT< / a > < / li >
< li > < a href = "#xplr_pipe_logs_out" > XPLR_PIPE_LOGS_OUT< / a > < / li >
< li > < a href = "#xplr_pipe_result_out" > XPLR_PIPE_RESULT_OUT< / a > < / li >
< li > < a href = "#xplr_pipe_history_out" > XPLR_PIPE_HISTORY_OUT< / a > < / li >
< li > < a href = "#xplr_pipe_directory_nodes_out" > XPLR_PIPE_DIRECTORY_NODES_OUT< / a > < / li >
< / ul >
< h4 id = "xplr_pipe_msg_in" > < a class = "header" href = "#xplr_pipe_msg_in" > XPLR_PIPE_MSG_IN< / a > < / h4 >
< p > Append new-line delimited messages to this pipe in < a href = "https://www.yaml.org" > YAML< / a >
(or < a href = "https://www.json.org" > JSON< / a > ) syntax. These messages will be read and
handled by xplr after the command execution.< / p >
< h4 id = "xplr_pipe_selection_out" > < a class = "header" href = "#xplr_pipe_selection_out" > XPLR_PIPE_SELECTION_OUT< / a > < / h4 >
< p > New-line delimited list of selected paths.< / p >
< h4 id = "xplr_pipe_global_help_menu_out" > < a class = "header" href = "#xplr_pipe_global_help_menu_out" > XPLR_PIPE_GLOBAL_HELP_MENU_OUT< / a > < / h4 >
< p > The full help menu.< / p >
< h4 id = "xplr_pipe_logs_out" > < a class = "header" href = "#xplr_pipe_logs_out" > XPLR_PIPE_LOGS_OUT< / a > < / h4 >
< p > New-line delimited list of logs.< / p >
< h4 id = "xplr_pipe_result_out" > < a class = "header" href = "#xplr_pipe_result_out" > XPLR_PIPE_RESULT_OUT< / a > < / h4 >
< p > New-line delimited result (selected paths if any, else the focused path)< / p >
< h4 id = "xplr_pipe_history_out" > < a class = "header" href = "#xplr_pipe_history_out" > XPLR_PIPE_HISTORY_OUT< / a > < / h4 >
< p > New-line delimited list of last visited paths (similar to jump list in vim).< / p >
< h4 id = "xplr_pipe_directory_nodes_out" > < a class = "header" href = "#xplr_pipe_directory_nodes_out" > XPLR_PIPE_DIRECTORY_NODES_OUT< / a > < / h4 >
< p > New-line delimited list of paths, filtered and sorted as displayed in the
< a href = "layouts.html#table" > files table< / a > .< / p >
< h3 id = "example-using-environment-variables-and-pipes" > < a class = "header" href = "#example-using-environment-variables-and-pipes" > Example: Using Environment Variables and Pipes< / a > < / h3 >
< pre > < code class = "language-lua" > xplr.config.modes.builtin.default.key_bindings.on_key.space = {
help = " ask name and greet" ,
messages = {
{
BashExec = [===[
echo " What's your name?"
read name
greeting=" Hello $name!"
message=" $greeting You are inside $PWD"
echo LogSuccess: '" '$message'" ' > > " ${XPLR_PIPE_MSG_IN:?}"
]===]
}
}
}
-- Now, when you press " space" in default mode, you will be prompted for your
-- name. Enter your name to receive a nice greeting and to know your location.
< / code > < / pre >
< / main >
< nav class = "nav-wrapper" aria-label = "Page navigation" >
<!-- Mobile navigation buttons -->
< a rel = "prev" href = "modes.html" class = "mobile-nav-chapters previous" title = "Previous chapter" aria-label = "Previous chapter" aria-keyshortcuts = "Left" >
< i class = "fa fa-angle-left" > < / i >
< / a >
< a rel = "next" href = "layouts.html" class = "mobile-nav-chapters next" title = "Next chapter" aria-label = "Next chapter" aria-keyshortcuts = "Right" >
< i class = "fa fa-angle-right" > < / i >
< / a >
< div style = "clear: both" > < / div >
< / nav >
< / div >
< / div >
< nav class = "nav-wide-wrapper" aria-label = "Page navigation" >
< a rel = "prev" href = "modes.html" class = "nav-chapters previous" title = "Previous chapter" aria-label = "Previous chapter" aria-keyshortcuts = "Left" >
< i class = "fa fa-angle-left" > < / i >
< / a >
< a rel = "next" href = "layouts.html" class = "nav-chapters next" title = "Next chapter" aria-label = "Next chapter" aria-keyshortcuts = "Right" >
< i class = "fa fa-angle-right" > < / i >
< / a >
< / nav >
< / div >
< script type = "text/javascript" >
window.playground_copyable = true;
< / script >
< script src = "elasticlunr.min.js" type = "text/javascript" charset = "utf-8" > < / script >
< script src = "mark.min.js" type = "text/javascript" charset = "utf-8" > < / script >
< script src = "searcher.js" type = "text/javascript" charset = "utf-8" > < / script >
< script src = "clipboard.min.js" type = "text/javascript" charset = "utf-8" > < / script >
< script src = "highlight.js" type = "text/javascript" charset = "utf-8" > < / script >
< script src = "book.js" type = "text/javascript" charset = "utf-8" > < / script >
<!-- Custom JS scripts -->
< / body >
< / html >