Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
O
oh-my-fish
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
oh-my-fish
Commits
811e4692
Commit
811e4692
authored
Jul 20, 2014
by
Bruno Pinto
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #175 from jhillyerd/gi-fix
parents
1e7e712f
a42e564f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
53 additions
and
18 deletions
+53
-18
plugins/gi/README.md
plugins/gi/README.md
+23
-0
plugins/gi/_update_gi_completions.fish
plugins/gi/_update_gi_completions.fish
+21
-0
plugins/gi/gi.fish
plugins/gi/gi.fish
+9
-0
plugins/gi/gi.load
plugins/gi/gi.load
+0
-18
No files found.
plugins/gi/README.md
0 → 100644
View file @
811e4692
gitignore (gi) plugin
=====================
This plugin provides a simple command line interface to gitignore.io - a
website that generates .gitignore files based on your project requirements.
## Completions
The first step is to download the latest language list from gitignore.io so
that the fish completions can be updated. Run
`gi update-completions`
to
download the completions, they will be stored in
`~/.config/fish/completions/gi.fish`
You should repeat this occasionally to keep up to date.
## Usage
Type
`gi`
followed by TAB to view the list of languages available. To generate
a .gitignore file, specify the list of languages you are interested in and pipe
the output into the destination file. Example for a go-lang project:
gi go tags vagrant > .gitignore
git add .gitignore
plugins/gi/_update_gi_completions.fish
0 → 100644
View file @
811e4692
function _update_gi_completions -d "Update completions for gitignore.io"
set compl_dir ~/.config/fish/completions
set compl_file "$compl_dir/gi.fish"
# Download list of ignore types
set -l gi_list (gi list | tr ',' ' ')
if test -z $gi_list
echo "No result returned from gitignore.io" >&2
return 1
end
# Backup existing completions
if test -e $compl_file
mv -f $compl_file {$compl_file}.bak
else if not test -d $compl_dir
mkdir -p $compl_dir
end
# Output new completions
echo complete -c gi -a \"update-completions $gi_list\" >$compl_file
end
plugins/gi/gi.fish
0 → 100644
View file @
811e4692
function gi -d "gitignore.io cli for fish"
if test $argv[1] = 'update-completions'
_update_gi_completions
return $status
end
set -l params (echo $argv|tr ' ' ',')
curl -s http://www.gitignore.io/api/$params
end
plugins/gi/gi.load
deleted
100644 → 0
View file @
1e7e712f
# gitignore.io cli for fish
function gi
set -l params (echo $argv|tr ' ' ',')
curl -s http://www.gitignore.io/api/$params
end
# enable the complation by invoking `gi list`
if not set -q -g gi_list
ping -t 2 -c 1 -q gitignore.io >/dev/null
set gi_available $status
if test $gi_available
set -g gi_list (gi list| tr ',' ' ' ^/dev/null)
end
end
complete -c gi -a "$gi_list"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment