--vroot helps isolating navigation of an xplr session inside a specific
directory. However, interaction still requires passing full paths
(`/tmp/vroot`). Shell scripts and Lua functions can still access files
outside the virtual root.
This PR also fixes unwanted dot (.) and extra slash (//) issues in paths.
A new optional section of the configuration defined using the lua return
statement, which can be used to define append only things, such as hooks
and callbacks, specific to each config file.
Example
```lua
version = "0.0.0"
return {
-- Adds messages to pass when xplr loads (similar to `--on-load`)
on_load = {
{ LogInfo = "Hello xplr user," },
{ LogSuccess = "Configuration successfully loaded!" },
}
}
```
- Use `xplr.config.general.global_key_bindings` to define a set of
key bindings that are available by default in every mode. e.g `esc`
and `ctrl-c`.
- Remove boilerplate config from `init.lua`.
- Update docs.
- BREAKING: Rename mode `create directory` and `create file` to
`create_directory` and `create_file`.
- Add key binding `gp` to go to a given path from input.
- Add function `fn.builtin.try_complete_path` to auto complete the path
in input buffer.
- Use `tab` to auto complete path in `rename`, `create_file`,
`create_directory` and `go_to_path` modes.
- Show different prompts in different modes.
And some cleanup.
Use `--print-pwd-as-result` to print the last working directory instead
of the focused or selected nodes, when you quit using the `PrintResultAndQuit`
message (i.e. by pressing `enter`).
This helps with implementing the "cd on quit" functionality using a plain shell
alias.
Example:
```
alias xcd='cd "$(xplr --print-pwd-as-result)"'
```
With this alias set, you can navigate directories using xplr by entering
`xcd` command, and when you quit by pressing enter, you will enter the
directory.
You can of course, quit with plain `Quit` (i.e. by pressing `esc`) to
gracefully cancel "cd on quit".
Features:
- Display debug menu on configuration error
- Configure wether xplr should show the debug menu
(through `debug_on_error`)
- Open logs in editor
- Redirect people to the issues page on Github.
This PR breaks the custom layout renderer API by deprecating the
following heavyweight fields in the Lua Context passed to the renderer
functions.
The following fields are being deprecated:
- app.directory_buffer
- app.history
- app.last_modes
However, there's no change in the Lua Context passed to the functions
called via `CallLua*` messages.
Closes: https://github.com/sayanarijit/xplr/issues/418
This adds `on_function` handler to handle F1-F12 keys.
This also fixes issues with previously added handlers and adds a
checklist for future additions.