mirror of
https://github.com/junegunn/fzf.git
synced 2025-11-18 16:45:38 -05:00
Updated Examples (fish) (markdown)
@@ -138,15 +138,23 @@ end
|
|||||||
|
|
||||||
### Vscode
|
### Vscode
|
||||||
```fish
|
```fish
|
||||||
set -gx vscode_path "$HOME/.config/VScodium"
|
|
||||||
set -gx vscode_command "codium"
|
|
||||||
|
|
||||||
function vsr -d "List recently opened files with vscode"
|
function vsr -d "List recently opened files with vscode"
|
||||||
codium (\
|
set -l vscode_path "$HOME/.config/VSCodium"
|
||||||
rg -o --no-line-number '"path": "/.*[^/]"' "$vscode_path/storage.json" \
|
set -l grep
|
||||||
|
|
||||||
|
if type -q rg
|
||||||
|
set grep rg -o --no-line-number
|
||||||
|
else
|
||||||
|
set grep grep -o
|
||||||
|
end
|
||||||
|
|
||||||
|
set -l selected (\
|
||||||
|
$grep '"path": "/.*[^/]"' "$vscode_path/storage.json" \
|
||||||
| string replace -a '"path": ' '' \
|
| string replace -a '"path": ' '' \
|
||||||
| string trim -c '"'\
|
| string trim -c '"'\
|
||||||
| fzf )
|
| fzf --select-1 --exit-0 )
|
||||||
|
|
||||||
|
[ -n "$selected" ]; and codium "$selected"
|
||||||
end
|
end
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user