Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chmouel/zsh-select-with-lf
Zsh plugin to select a file or directory with LF
https://github.com/chmouel/zsh-select-with-lf
lf zsh zsh-plugin
Last synced: 1 day ago
JSON representation
Zsh plugin to select a file or directory with LF
- Host: GitHub
- URL: https://github.com/chmouel/zsh-select-with-lf
- Owner: chmouel
- License: apache-2.0
- Created: 2023-09-30T14:52:20.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-29T22:15:32.000Z (12 months ago)
- Last Synced: 2024-11-06T06:40:40.351Z (4 days ago)
- Topics: lf, zsh, zsh-plugin
- Language: Shell
- Homepage:
- Size: 12.7 KB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Select files or directories with lf
A simple plugin to let you select some files or a directory using [lf](https://github.com/gokcehan/lf)
https://github.com/chmouel/zsh-select-with-lf/assets/98980/e7c2801f-7a9c-40e7-9187-b75fcf64facf
## 🛠️ Installation
### Using [Antigen](https://github.com/zsh-users/antigen)
Bundle `zsh-vi-mode` in your `.zshrc`
```shell
antigen bundle chmouel/zsh-select-with-lf
```### Using [zplug](https://github.com/b4b4r07/zplug)
Load `zsh-vi-mode` as a plugin in your `.zshrc`
```shell
zplug "chmouel/zsh-select-with-lf"
```### Using [zgen](https://github.com/tarjoilija/zgen)
Include the load command in your `.zshrc`
```shell
zgen load chmouel/zsh-select-with-lf
```### Using [zinit](https://github.com/zdharma-continuum/zinit)
Include the load command in your `.zshrc`
```shell
zinit ice depth=1
zinit light chmouel/zsh-select-with-lf
```Note: the use of `depth=1` ice is optional, other types of ice are neither
recommended nor officially supported by this plugin.### As an [Oh My Zsh!](https://github.com/robbyrussell/oh-my-zsh) custom plugin
Clone `zsh-vi-mode` into your custom plugins repo
```shell
git clone https://github.com/chmouel/zsh-select-with-lf \
$ZSH_CUSTOM/plugins/zsh-select-with-lf
```Then load as a plugin in your `.zshrc`
```shell
plugins+=(zsh-select-with-lf)
```Keep in mind that plugins need to be added before `oh-my-zsh.sh` is sourced.
### Using [Antibody](https://getantibody.github.io/)
Add `zsh-vi-mode` to your plugins file (e.g. `~/.zsh_plugins.txt`)
```shell
chmouel/zsh-select-with-lf
```### Using [Zap](https://github.com/zap-zsh/zap)
Load `zsh-vi-mode` as a plugin in your `.zshrc`
```shell
plug "chmouel/zsh-select-with-lf"
```### Manual
Or any ZSH plugin manager (I use my own simple one [vtplug](https://blog.chmouel.com/2022/03/18/vtplug-a-very-dumb-and-tiny-zsh-plugin-manager/))
You can as well simply git clone this repository and source the
`zsh-select-with-lf.plugin.zsh` file if you want to do this just manually.## Requirements
Only [lf](https://github.com/gokcehan/lf) is needed.
## Usage
Just do `C-x C-l` to select a directory and `C-x l` (C-x mean control and x) it
will start `lf` and put the result file or directory on your command line.For files you need to select the files and press enter, for the directories you
need to navigate to the directory and press q to quit `lf`.This plugin will try to do the right thing if you have a file or a directory on
the current word to have `lf` initially started on the right directory.## Configuration
You can customize some variables
- `ZSH_SELECT_WITH_LF_FILE_BIND`: The keybinding to use to select files default to "^x^f"
- `ZSH_SELECT_WITH_LF_DIR_BIND`: The keybinding to use to select directories default to "^x^f"## Copyright
[Apache-2.0](./LICENSE)
## Authors
Chmouel Boudjnah
- Fediverse - <[@[email protected]](https://fosstodon.org/@chmouel)>
- Twitter - <[@chmouel](https://twitter.com/chmouel)>
- Blog - <[https://blog.chmouel.com](https://blog.chmouel.com)>## Alternative
The wiki list another method on how to do this: