mirror of
				https://github.com/dcarrillo/prezto.git
				synced 2025-11-04 00:29:08 +00:00 
			
		
		
		
	Compare commits
	
		
			2 Commits
		
	
	
		
			865cc2ef02
			...
			pull/715-g
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					72328d0eed | ||
| 
						 | 
					a14b6e5c31 | 
@@ -237,6 +237,7 @@ Functions
 | 
			
		||||
  - `git-stash-recover` recovers given dropped stashed states.
 | 
			
		||||
  - `git-submodule-move` moves a submodule.
 | 
			
		||||
  - `git-submodule-remove` removes a submodule.
 | 
			
		||||
  - `git-ignore-template` get gitignore template from [gitignore.io][9]
 | 
			
		||||
 | 
			
		||||
Theming
 | 
			
		||||
-------
 | 
			
		||||
@@ -332,3 +333,4 @@ Authors
 | 
			
		||||
[6]: https://github.com/sorin-ionescu/prezto/issues
 | 
			
		||||
[7]: https://github.com/sorin-ionescu/prezto/issues/219
 | 
			
		||||
[8]: http://www.kernel.org/pub/software/scm/git/docs/git-log.html
 | 
			
		||||
[9]: https://gitignore.io/
 | 
			
		||||
 
 | 
			
		||||
@@ -179,3 +179,6 @@ alias gwc='git clean -n'
 | 
			
		||||
alias gwC='git clean -f'
 | 
			
		||||
alias gwx='git rm -r'
 | 
			
		||||
alias gwX='git rm -rf'
 | 
			
		||||
 | 
			
		||||
# Ignore list (ig)
 | 
			
		||||
alias gig='git-ignore-template'
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										26
									
								
								modules/git/functions/_git-ignore-template
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								modules/git/functions/_git-ignore-template
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,26 @@
 | 
			
		||||
#compdef _gitignireio git-ignore-template
 | 
			
		||||
#autoload
 | 
			
		||||
 | 
			
		||||
#
 | 
			
		||||
# Completes git-ignore-template
 | 
			
		||||
#
 | 
			
		||||
# Authors:
 | 
			
		||||
#   Haojia Che <haojia.che@gmail.com>
 | 
			
		||||
#
 | 
			
		||||
 | 
			
		||||
typeset -A opt_args
 | 
			
		||||
 | 
			
		||||
_arguments -C \
 | 
			
		||||
    '1::ignore:->ignores' \
 | 
			
		||||
&& ret=0
 | 
			
		||||
 | 
			
		||||
list=(`git-ignore-template`)
 | 
			
		||||
 | 
			
		||||
case "$state" in
 | 
			
		||||
    (ignores)
 | 
			
		||||
        languages=(`echo  $list| tr "," "\n"`)
 | 
			
		||||
        _describe 'templates' languages && ret=0
 | 
			
		||||
    ;;
 | 
			
		||||
esac;
 | 
			
		||||
 | 
			
		||||
return 1;
 | 
			
		||||
							
								
								
									
										20
									
								
								modules/git/functions/git-ignore-template
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								modules/git/functions/git-ignore-template
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,20 @@
 | 
			
		||||
#
 | 
			
		||||
# Get  ignore template from https://gitignore.io.
 | 
			
		||||
#
 | 
			
		||||
# Authors:
 | 
			
		||||
#   Haojia Che <haojia.che@gmail.com>
 | 
			
		||||
#
 | 
			
		||||
#  Use `git-ignore-template` or `git-ignore-template list` to get the list
 | 
			
		||||
#  Uset `git-ignore-template <template name>` to get the template 
 | 
			
		||||
#
 | 
			
		||||
#   Example:
 | 
			
		||||
#   `git-ignore-template java` to get a  gitignore template for java.
 | 
			
		||||
#
 | 
			
		||||
 | 
			
		||||
function git-ignore-template() {
 | 
			
		||||
    if [ $@ ]; then
 | 
			
		||||
        curl -L -s https://www.gitignore.io/api/$@;
 | 
			
		||||
    else
 | 
			
		||||
        curl -L -s https://www.gitignore.io/api/list;
 | 
			
		||||
    fi
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user