四方に目を配る means 'to look in all directions / keep a watchful eye all around' — 四方 (four directions) + に + 目を配る (to distribute one's gaze). 暗闇で sets the scene in darkness. A vivid military or suspense scene that teaches both the idiom and atmospheric description.