mirror of
https://github.com/junegunn/fzf.git
synced 2025-11-19 00:53:42 -05:00
Updated Examples (markdown)
19
Examples.md
19
Examples.md
@@ -5,6 +5,7 @@
|
|||||||
Table of Contents
|
Table of Contents
|
||||||
=================
|
=================
|
||||||
|
|
||||||
|
* [General](#general)
|
||||||
* [Opening files](#opening-files)
|
* [Opening files](#opening-files)
|
||||||
* [Changing directory](#changing-directory)
|
* [Changing directory](#changing-directory)
|
||||||
* [Searching file contents](#searching-file-contents)
|
* [Searching file contents](#searching-file-contents)
|
||||||
@@ -54,6 +55,24 @@ Table of Contents
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### General
|
||||||
|
|
||||||
|
```sh
|
||||||
|
# Use fd and fzf to get the args to a command.
|
||||||
|
# Works only with zsh
|
||||||
|
# Examples:
|
||||||
|
# f mv # To move files. You can write the destination after selecting the files.
|
||||||
|
# f 'echo Selected: '
|
||||||
|
# f 'echo Selected music: ' --extention mp3
|
||||||
|
# fc rm # To rm files in current directory
|
||||||
|
f() {
|
||||||
|
sels=( "${(@f)$(fd "${fd_default[@]}" "${@:2}"|fz)}" )
|
||||||
|
test -n "$sels" && print -z -- "$1${sels[@]:q:q}"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Like f, but not recursive.
|
||||||
|
fc() f "$@" --max-depth 1
|
||||||
|
```
|
||||||
|
|
||||||
### Opening files
|
### Opening files
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user