Created
April 5, 2013 18:37
-
-
Save abullrd/5321570 to your computer and use it in GitHub Desktop.
Vim use .gitignore
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
let filename = '.gitignore' | |
if filereadable(filename) | |
let igstring = '' | |
for oline in readfile(filename) | |
let line = substitute(oline, '\s|\n|\r', '', "g") | |
if line =~ '^#' | con | endif | |
if line == '' | con | endif | |
if line =~ '^!' | con | endif | |
if line =~ '/$' | let igstring .= "," . line . "*" | con | endif | |
let igstring .= "," . line | |
endfor | |
let execstring = "set wildignore=".substitute(igstring, '^,', '', "g") | |
execute execstring | |
endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment