mirror of
https://github.com/Llewellynvdm/zoxide.git
synced 2024-06-04 08:20:50 +00:00
Improved preview window for fzf
This commit is contained in:
parent
1306fba4ac
commit
e4b9e12b0f
|
@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
|
||||
- Fish: change fuzzy completion prefix to `z!`.
|
||||
- Zsh: allow `z` to navigate dirstack via `+n` and `-n`.
|
||||
- Fzf: improved preview window.
|
||||
|
||||
## [0.8.2] - 2022-06-26
|
||||
|
||||
|
|
13
src/util.rs
13
src/util.rs
|
@ -54,8 +54,17 @@ impl Fzf {
|
|||
"--bind=ctrl-z:ignore",
|
||||
]);
|
||||
if cfg!(unix) {
|
||||
command.env("SHELL", "sh");
|
||||
command.args(&[r"--preview=\command -p ls -p {2..}", "--preview-window=down"]);
|
||||
// Non-POSIX args are only available on certain operating systems.
|
||||
const LS_ARGS: &str = if cfg!(target_os = "linux") {
|
||||
"--color=always --group-directories-first"
|
||||
} else if cfg!(target_os = "macos") {
|
||||
"--color=always"
|
||||
} else {
|
||||
""
|
||||
};
|
||||
command
|
||||
.args(&[&format!(r"--preview=\command -p ls -Cp {LS_ARGS} {{2..}}"), "--preview-window=down,30%"])
|
||||
.env("SHELL", "sh");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -114,14 +114,14 @@ end
|
|||
{%- when Some with (cmd) %}
|
||||
|
||||
abbr --erase {{cmd}} &>/dev/null
|
||||
complete -c {{cmd}} -e
|
||||
complete --command {{cmd}} --erase
|
||||
function {{cmd}}
|
||||
__zoxide_z $argv
|
||||
end
|
||||
complete -c {{cmd}} -f -a '(__zoxide_z_complete)'
|
||||
complete --command {{cmd}} --no-files --arguments '(__zoxide_z_complete)'
|
||||
|
||||
abbr --erase {{cmd}}i &>/dev/null
|
||||
complete -c {{cmd}}i -e
|
||||
complete --command {{cmd}}i --erase
|
||||
function {{cmd}}i
|
||||
__zoxide_zi $argv
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user