kitaro-tn
2/5/2018 - 5:37 AM

[vim] match

[vim] match

if expand('%:p:h') =~ 'app\|lib\|src'
  echo 'class'
elseif expand('%:p:h') =~ 'test\|tests'
  echo 'test'
elseif expand('%:p:h') =~ 'spec'
  echo 'spec'
else
  echo 'non'
endif