m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-18 16:45:38 -05:00

Including vagrant script

Mateus Revoredo
2015-05-16 21:49:00 -03:00
parent 5e208e5642
commit 74c0e30e83

@@ -368,4 +368,15 @@ frb() {
# https://github.com/D630/fzf-wrapper
% . fzf-wrapper
% [<ENV>] __fzf_wrapper [<ARGS>]
```
###Vagrant
You must have [`jq`](https://github.com/stedolan/jq) installed on your computer in order to use this function.
```sh
vs(){
#List all vagrant boxes available in the system including its status, and try to access the selected one via ssh
cd $(cat ~/.vagrant.d/data/machine-index/index | jq '.machines[] | {name, vagrantfile_path, state}' | jq '.name + "," + .state + "," + .vagrantfile_path'| sed 's/^"\(.*\)"$/\1/'| column -s, -t | sort -rk 2 | fzf | awk '{print $3}'); vagrant ssh
}
```