https://github.com/sayanarijit/find.xplr
An interactive finder plugin to complement map.xplr
https://github.com/sayanarijit/find.xplr
Last synced: 7 months ago
JSON representation
An interactive finder plugin to complement map.xplr
- Host: GitHub
- URL: https://github.com/sayanarijit/find.xplr
- Owner: sayanarijit
- License: mit
- Created: 2022-02-03T05:10:57.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-02-10T06:10:13.000Z (over 1 year ago)
- Last Synced: 2025-03-19T06:04:08.100Z (7 months ago)
- Language: Lua
- Homepage: https://xplr.dev
- Size: 20.5 KB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://gifyu.com/image/Szb6a)
An interactive finder plugin to complement [map.xplr](https://github.com/sayanarijit/map.xplr).
> **WARNING:** This plugin will execute the find command during each input. So
> only use read-only commands.## Requirements
`find` or `fd` or any finder of your choice. By default it uses `find`.
## Installation
### Install manually
- Add the following line in `~/.config/xplr/init.lua`
```lua
local home = os.getenv("HOME")
package.path = home
.. "/.config/xplr/plugins/?/init.lua;"
.. home
.. "/.config/xplr/plugins/?.lua;"
.. package.path
```- Clone the plugin
```bash
mkdir -p ~/.config/xplr/pluginsgit clone https://github.com/sayanarijit/find.xplr ~/.config/xplr/plugins/find
```- Require the module in `~/.config/xplr/init.lua`
```lua
require("find").setup()-- Or
require("find").setup{
mode = "default",
key = "F",
templates = {
["find all"] = {
key = "a",
find_command = "find",
find_args = ". -name ",
cursor_position = 8,
},
["find files"] = {
key = "f",
find_command = "find",
find_args = ". -name -type f",
cursor_position = 8,
},
["find directories"] = {
key = "d",
find_command = "find",
find_args = ". -name -type d",
cursor_position = 8,
},
},
refresh_screen_key = "ctrl-r",
}-- Press `F` to find files interactively using the `find_command`.
```## Find-Map workflow
This library complements [map.xplr](https://github.com/sayanarijit/map.xplr) to
create a powerful workflow in which you first **find a set of files
interactively**, and then **map them to some command, also interactively**.## Features
- Set the initial cursor position for complex find command templates.
- Use custom find command templates.
- Refresh screen with `ctrl-r`.## TODO
- [ ] Ignore errors
- [ ] Improve performance
- [ ] Add timeout
- [ ] Allow pipes
- [ ] Templates for most common find command arguments
- [ ] More convenient integration with map.xplr