Created
December 27, 2017 10:17
-
-
Save ryotako/258cfbf0b94a89f2cc48f0bdd6d71918 to your computer and use it in GitHub Desktop.
volt.fish
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Defined in /Users/Ryota/.config/fish/functions/volt.fish @ line 2 | |
function volt | |
set -q VOLTPATH | |
and set -l voltpath $VOLTPATH | |
or set -l voltpath "$HOME/volt" | |
switch "$argv[1]" | |
case "" | |
volt repo | |
case up | |
command volt self-upgrade # update volt | |
command volt get -u -l # update plugins | |
case conf | |
if string match all "$argv[2]" | |
vim -R "$HOME/.vim/pack/volt/start/system/plugin/bundled_plugconf.vim" | |
else | |
set -l repo (command volt list | string match -r '(?<=github.com/)[^/]+/[^ ]+' | sort | peco --query "$argv[2]") | |
if test -n "$repo" | |
vim "$voltpath/plugconf/github.com/$repo.vim" | |
and volt get -u "$repo" | |
end | |
end | |
case repo | |
command volt list | string match -r '(?<=github.com/)[^/]+/[^ ]+' | sort | |
case \* | |
command volt $argv | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment