From 3d525cb8c45934eb32aac65987fdde4993916d67 Mon Sep 17 00:00:00 2001 From: Albert G <516972+alber70g@users.noreply.github.com> Date: Mon, 16 Nov 2020 15:41:23 +0100 Subject: [PATCH] Fix grep for OSX (#3955) Grep doesn't have the -P option in macOS --- config/plugins/ctrlp.vim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/config/plugins/ctrlp.vim b/config/plugins/ctrlp.vim index f8c45b812..a8ca8b1a2 100644 --- a/config/plugins/ctrlp.vim +++ b/config/plugins/ctrlp.vim @@ -35,9 +35,12 @@ elseif executable('ag') && !exists('g:ctrlp_user_command') elseif s:SYS.isWindows let g:ctrlp_user_command = \ 'dir %s /-n /b /s /a-d | findstr /v /l ".jpg \\tmp\\"' " Windows +elseif s:SYS.isOSX + let g:ctrlp_user_command = + \ 'find %s -type f | grep --invert-match --extended-regexp "\.jpg$|/tmp/"' " MacOSX else let g:ctrlp_user_command = - \ 'find %s -type f | grep -v -P "\.jpg$|/tmp/"' " MacOSX/Linux + \ 'find %s -type f | grep -v -P "\.jpg$|/tmp/"' " Linux endif if !exists('g:ctrlp_match_func') && (has('python') || has('python3')) let g:ctrlp_match_func = { 'match': 'pymatcher#PyMatch' }