Skip to content

Instantly share code, notes, and snippets.

@ryotako
Created December 27, 2017 10:17
Show Gist options
  • Save ryotako/258cfbf0b94a89f2cc48f0bdd6d71918 to your computer and use it in GitHub Desktop.
Save ryotako/258cfbf0b94a89f2cc48f0bdd6d71918 to your computer and use it in GitHub Desktop.
volt.fish
# 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