netrw_gitignore.vim (1407B)
1 " Previous Maintainer: Luca Saccarola <github.e41mv@aleeas.com> 2 " Maintainer: This runtime file is looking for a new maintainer. 3 4 " netrw_gitignore#Hide: gitignore-based hiding 5 " Function returns a string of comma separated patterns convenient for 6 " assignment to `g:netrw_list_hide` option. 7 " Function can take additional filenames as arguments, example: 8 " netrw_gitignore#Hide('custom_gitignore1', 'custom_gitignore2') 9 " 10 " Usage examples: 11 " let g:netrw_list_hide = netrw_gitignore#Hide() 12 " let g:netrw_list_hide = netrw_gitignore#Hide() . 'more,hide,patterns' 13 " 14 " Copyright: Copyright (C) 2013 Bruno Sutic {{{ 15 " Permission is hereby granted to use and distribute this code, 16 " with or without modifications, provided that this copyright 17 " notice is copied with it. Like anything else that's free, 18 " netrw_gitignore.vim is provided *as is* and comes with no 19 " warranty of any kind, either expressed or implied. By using 20 " this plugin, you agree that in no event will the copyright 21 " holder be liable for any damages resulting from the use 22 " of this software. }}} 23 24 function! netrw_gitignore#Hide(...) 25 return substitute(substitute(system('git ls-files --other --ignored --exclude-standard --directory'), '\n', ',', 'g'), ',$', '', '') 26 endfunction 27 28 " vim:ts=8 sts=4 sw=4 et fdm=marker