1
0
mirror of https://github.com/skywind3000/z.lua synced 2026-04-19 13:21:27 +00:00

Updated FAQ (markdown)

Linwei
2019-03-28 11:41:29 +08:00
parent 35964a8ccd
commit dd3dda97c4

36
FAQ.md

@@ -1,3 +1,20 @@
## How to input a hyphen `-` in the keyword ?
Q: There is a `~/Documents/github/vue-my-ui` directory, but when I use `z vue-my-ui` the directory cannot be matched.
A: `-` is a reserved character in lua regexp. you can use either `z vue%-my%-ui` or `z vue my ui`.
## How to integrate z.lua to ranger ?
Copy [ranger_zlua.py](https://github.com/skywind3000/z.lua/blob/master/ranger_zlua.py) to your `~/.config/ranger/plugins` folder, and set environment variable in your shell rc:
```bash
export RANGER_ZLUA="/path/to/z.lua"
```
The integration script provides a `z` command in ranger. It also tracks directories changes in ranger.
## How to use `z` as `cd` ?
Paste this script in your `.bashrc` / `.zshrc`:
@@ -63,22 +80,3 @@ function zii() {
[ -n "$dir" ] && cd "$dir"
}
```
## How to input a hyphen `-` in the keyword ?
Q: There is a `~/Documents/github/vue-my-ui` directory, but when I use `z vue-my-ui` the directory cannot be matched.
A: `-` is a reserved character in lua regexp. you can use either `z vue%-my%-ui` or `z vue my ui`.
## How to integrate z.lua to ranger ?
Copy [ranger_zlua.py](https://github.com/skywind3000/z.lua/blob/master/ranger_zlua.py) to your `~/.config/ranger/plugins` folder, and set environment variable in your shell rc:
```bash
export RANGER_ZLUA="/path/to/z.lua"
```
The integration script provides a `z` command in ranger. It also tracks directories changes in ranger.