mirror of
https://github.com/junegunn/fzf.git
synced 2025-11-20 01:23:43 -05:00
Updated examples (markdown)
31
examples.md
31
examples.md
@@ -1,8 +1,8 @@
|
|||||||
Useful examples
|
|
||||||
===============
|
|
||||||
|
|
||||||
Feel free to edit this page if you have a nice example of using fzf.
|
Feel free to edit this page if you have a nice example of using fzf.
|
||||||
|
|
||||||
|
Shell scripts
|
||||||
|
=============
|
||||||
|
|
||||||
Opening files
|
Opening files
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
@@ -15,6 +15,13 @@ fe() {
|
|||||||
file=$(fzf --query="$1" --select-1 --exit-0)
|
file=$(fzf --query="$1" --select-1 --exit-0)
|
||||||
[ -n "$file" ] && ${EDITOR:-vim} "$file"
|
[ -n "$file" ] && ${EDITOR:-vim} "$file"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Equivalent to above, but opens it with `open` command
|
||||||
|
fo() {
|
||||||
|
local file
|
||||||
|
file=$(fzf --query="$1" --select-1 --exit-0)
|
||||||
|
[ -n "$file" ] && open "$file"
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Changing directory
|
Changing directory
|
||||||
@@ -101,8 +108,8 @@ fco() {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
ctags
|
Tags
|
||||||
-----
|
----
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
# ftags - search ctags
|
# ftags - search ctags
|
||||||
@@ -132,18 +139,12 @@ fs() {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
open files
|
|
||||||
----
|
|
||||||
|
|
||||||
```sh
|
Vim scripts
|
||||||
fo() {
|
===========
|
||||||
local file
|
|
||||||
file=$(fzf --query="$1" --select-1 --exit-0)
|
|
||||||
[ -n "$file" ] && open "$file"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
narrow ag results within vim
|
|
||||||
|
Narrow ag results within vim
|
||||||
----
|
----
|
||||||
|
|
||||||
add this to your .vimrc
|
add this to your .vimrc
|
||||||
|
|||||||
Reference in New Issue
Block a user