|
|
|
@ -1,5 +1,4 @@
|
|
|
|
|
Message
|
|
|
|
|
=======
|
|
|
|
|
# Message
|
|
|
|
|
|
|
|
|
|
You can think of xplr as a server. Just like web servers listen to HTTP
|
|
|
|
|
requests, xplr listens to [messages][1].
|
|
|
|
@ -10,9 +9,7 @@ You can send these messages to an xplr session in the following ways:
|
|
|
|
|
- Via [Lua function calls][3]
|
|
|
|
|
- Via shell command using the [input pipe][4]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Format
|
|
|
|
|
------
|
|
|
|
|
## Format
|
|
|
|
|
|
|
|
|
|
To send messages using the [key bindings][2] or
|
|
|
|
|
[Lua function calls][3], messages are represented in
|
|
|
|
@ -30,9 +27,7 @@ represented using
|
|
|
|
|
- FocusPath: "/path/to/file"
|
|
|
|
|
- Call: { command: bash, args: ["-c", "read -p test"] }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Full List of Messages
|
|
|
|
|
---------------------
|
|
|
|
|
## Full List of Messages
|
|
|
|
|
|
|
|
|
|
### "ExplorePwd"
|
|
|
|
|
|
|
|
|
@ -267,39 +262,87 @@ Reset the input buffer back to null. It will not show in the UI.
|
|
|
|
|
**YAML:** `SwitchMode: string`
|
|
|
|
|
|
|
|
|
|
Switch input [mode][8].
|
|
|
|
|
It clears the input buffer.
|
|
|
|
|
|
|
|
|
|
> **NOTE:** To be specific about which mode to switch to, use `SwitchModeBuiltin` or
|
|
|
|
|
`SwitchModeCustom` instead.
|
|
|
|
|
> `SwitchModeCustom` instead.
|
|
|
|
|
|
|
|
|
|
**YAML Example:** `SwitchMode: default`
|
|
|
|
|
|
|
|
|
|
**Lua Example:** `{ SwitchMode = "default" }`
|
|
|
|
|
|
|
|
|
|
### { SwitchModeKeepingInputBuffer = "string" }
|
|
|
|
|
|
|
|
|
|
**YAML:** `SwitchModeKeepingInputBuffer: string`
|
|
|
|
|
|
|
|
|
|
Switch input [mode][8].
|
|
|
|
|
It keeps the input buffer.
|
|
|
|
|
|
|
|
|
|
> **NOTE:** To be specific about which mode to switch to, use
|
|
|
|
|
> `SwitchModeBuiltinKeepingInputBuffer` or
|
|
|
|
|
> `SwitchModeCustomKeepingInputBuffer` instead.
|
|
|
|
|
|
|
|
|
|
**YAML Example:** `SwitchModeKeepingInputBuffer: default`
|
|
|
|
|
|
|
|
|
|
**Lua Example:** `{ SwitchModeKeepingInputBuffer = "default" }`
|
|
|
|
|
|
|
|
|
|
### { SwitchModeBuiltin = "string" }
|
|
|
|
|
|
|
|
|
|
**YAML:** `SwitchModeBuiltin: string`
|
|
|
|
|
|
|
|
|
|
Switch to a [builtin mode][9].
|
|
|
|
|
It clears the input buffer.
|
|
|
|
|
|
|
|
|
|
**YAML Example:** `SwitchModeBuiltin: default`
|
|
|
|
|
|
|
|
|
|
**Lua Example:** `{ SwitchModeBuiltin = "default" }`
|
|
|
|
|
|
|
|
|
|
### { SwitchModeBuiltinKeepingInputBuffer = "string" }
|
|
|
|
|
|
|
|
|
|
**YAML:** `SwitchModeBuiltinKeepingInputBuffer: string`
|
|
|
|
|
|
|
|
|
|
Switch to a [builtin mode][9].
|
|
|
|
|
It keeps the input buffer.
|
|
|
|
|
|
|
|
|
|
**YAML Example:** `SwitchModeBuiltinKeepingInputBuffer: default`
|
|
|
|
|
|
|
|
|
|
**Lua Example:** `{ SwitchModeBuiltinKeepingInputBuffer = "default" }`
|
|
|
|
|
|
|
|
|
|
### { SwitchModeCustom = "string" }
|
|
|
|
|
|
|
|
|
|
**YAML:** `SwitchModeCustom: string`
|
|
|
|
|
|
|
|
|
|
Switch to a [custom mode][10].
|
|
|
|
|
It clears the input buffer.
|
|
|
|
|
|
|
|
|
|
**YAML Example:** `SwitchModeCustom: my_custom_mode`
|
|
|
|
|
|
|
|
|
|
**Lua Example:** `{ SwitchModeCustom = "my_custom_mode" }`
|
|
|
|
|
|
|
|
|
|
### { SwitchModeCustomKeepingInputBuffer = "string" }
|
|
|
|
|
|
|
|
|
|
**YAML:** `SwitchModeCustom: string`
|
|
|
|
|
|
|
|
|
|
Switch to a [custom mode][10].
|
|
|
|
|
It keeps the input buffer.
|
|
|
|
|
|
|
|
|
|
**YAML Example:** `SwitchModeCustomKeepingInputBuffer: my_custom_mode`
|
|
|
|
|
|
|
|
|
|
**Lua Example:** `{ SwitchModeCustomKeepingInputBuffer = "my_custom_mode" }`
|
|
|
|
|
|
|
|
|
|
### "PopMode"
|
|
|
|
|
|
|
|
|
|
**YAML:** `PopMode`
|
|
|
|
|
|
|
|
|
|
Pop the last mode from the history and switch to it.
|
|
|
|
|
It clears the input buffer.
|
|
|
|
|
|
|
|
|
|
### PopModeKeepingInputBuffer
|
|
|
|
|
|
|
|
|
|
**YAML:** `PopModeKeepingInputBuffer`
|
|
|
|
|
|
|
|
|
|
Pop the last mode from the history and switch to it.
|
|
|
|
|
It keeps the input buffer.
|
|
|
|
|
|
|
|
|
|
### { SwitchLayout = "string" }
|
|
|
|
|
|
|
|
|
@ -308,7 +351,7 @@ Pop the last mode from the history and switch to it.
|
|
|
|
|
Switch [layout][11].
|
|
|
|
|
|
|
|
|
|
> **NOTE:** To be specific about which layout to switch to, use `SwitchLayoutBuiltin` or
|
|
|
|
|
`SwitchLayoutCustom` instead.
|
|
|
|
|
> `SwitchLayoutCustom` instead.
|
|
|
|
|
|
|
|
|
|
**YAML Example:** `SwitchLayout: default`
|
|
|
|
|
|
|
|
|
@ -556,7 +599,6 @@ Add a [sorter][17] to sort nodes while exploring directories.
|
|
|
|
|
|
|
|
|
|
**YAML Example:** `{ AddNodeSorter = { sorter = "ByRelativePath", reverse = false } }`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### { RemoveNodeSorter = [Sorter][17] }
|
|
|
|
|
|
|
|
|
|
**YAML:** `RemoveNodeSorter: Sorter`
|
|
|
|
@ -748,9 +790,7 @@ Write the application state to a file, without quitting. Also helpful for debugg
|
|
|
|
|
|
|
|
|
|
Terminate the application with a non-zero return code.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Lua Function Calls
|
|
|
|
|
------------------
|
|
|
|
|
## Lua Function Calls
|
|
|
|
|
|
|
|
|
|
xplr allows users to define lua functions using the `xplr.fn.custom` Lua API.
|
|
|
|
|
|
|
|
|
@ -782,7 +822,6 @@ It contains the following information:
|
|
|
|
|
- [history][41]
|
|
|
|
|
- [last_modes][42]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### version
|
|
|
|
|
|
|
|
|
|
Type: string
|
|
|
|
@ -853,7 +892,6 @@ The session path.
|
|
|
|
|
|
|
|
|
|
[TODO][66]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### history
|
|
|
|
|
|
|
|
|
|
Type: [History][70]
|
|
|
|
@ -888,21 +926,18 @@ Type: string
|
|
|
|
|
|
|
|
|
|
The extension of the node.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### is_symlink
|
|
|
|
|
|
|
|
|
|
Type: boolean
|
|
|
|
|
|
|
|
|
|
`true` if the node is a symlink.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### is_broken
|
|
|
|
|
|
|
|
|
|
Type: boolean
|
|
|
|
|
|
|
|
|
|
`true` if the node is a broken symlink.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### is_dir
|
|
|
|
|
|
|
|
|
|
Type: boolean
|
|
|
|
@ -921,7 +956,6 @@ Type: boolean
|
|
|
|
|
|
|
|
|
|
`true` if the node is real-only.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### mime_essence
|
|
|
|
|
|
|
|
|
|
Type: string
|
|
|
|
@ -983,7 +1017,6 @@ A node contains the following fields:
|
|
|
|
|
- [canonical][58]
|
|
|
|
|
- [symlink][59]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### DirectoryBuffer
|
|
|
|
|
|
|
|
|
|
Directory buffer contains the following fields:
|
|
|
|
@ -1018,7 +1051,6 @@ Type: int
|
|
|
|
|
The index of the node under focus. It can be `0` even when there's no node to
|
|
|
|
|
focus on.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### History
|
|
|
|
|
|
|
|
|
|
History contains the following fields:
|
|
|
|
@ -1038,7 +1070,6 @@ Type: list of string
|
|
|
|
|
|
|
|
|
|
Visited paths.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### Example: Using Lua Function Calls
|
|
|
|
|
|
|
|
|
|
```lua
|
|
|
|
@ -1067,9 +1098,7 @@ xplr.config.modes.builtin.default.key_bindings.on_key.space = {
|
|
|
|
|
-- name. Enter your name to receive a nice greeting and to know your location.
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Environment Variables and Pipes
|
|
|
|
|
-------------------------------
|
|
|
|
|
## Environment Variables and Pipes
|
|
|
|
|
|
|
|
|
|
Alternative to `CallLua`, `CallLuaSilently` messages that call Lua functions,
|
|
|
|
|
there are `Call`, `CallSilently`, `BashExec`, `BashExecSilently` messages
|
|
|
|
@ -1163,7 +1192,6 @@ New-line delimited list of last visited paths (similar to jump list in vim).
|
|
|
|
|
New-line delimited list of paths, filtered and sorted as displayed in the
|
|
|
|
|
[files table][28].
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### Example: Using Environment Variables and Pipes
|
|
|
|
|
|
|
|
|
|
```lua
|
|
|
|
@ -1188,8 +1216,6 @@ xplr.config.modes.builtin.default.key_bindings.on_key.space = {
|
|
|
|
|
-- name. Enter your name to receive a nice greeting and to know your location.
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[1]: #full-list-of-messages
|
|
|
|
|
[2]: modes.md#key-bindings
|
|
|
|
|
[3]: #lua-function-calls
|
|
|
|
|