mirror of
https://github.com/junegunn/fzf.git
synced 2025-11-19 00:53:42 -05:00
Add line number capability to vg() function as additional option.
13
Examples.md
13
Examples.md
@@ -103,6 +103,19 @@ vg() {
|
||||
vim $file
|
||||
fi
|
||||
}
|
||||
|
||||
# fuzzy grep open via ag with line number
|
||||
vg() {
|
||||
local file
|
||||
local line
|
||||
|
||||
read -r file line <<<"$(ag --nobreak --noheading $@ | fzf -0 -1 | awk -F: '{print $1, $2}')"
|
||||
|
||||
if [[ -n $file ]]
|
||||
then
|
||||
vim $file +$line
|
||||
fi
|
||||
}
|
||||
```
|
||||
|
||||
### Changing directory
|
||||
|
||||
Reference in New Issue
Block a user