openFileUnderCursor :: Maybe (EditorM ()) -> YiM ()
openFileUnderCursor editorAction = do
  fileName <- fmap R.toString . withCurrentBuffer $ readUnitB unitViWORD
  fileExists <- io $ doesFileExist =<< expandTilda fileName
  if fileExists then do
      maybeM withEditor editorAction
      openNewFile $ fileName
  else
      withEditor . fail $ "Can't find file \"" <> fileName <> "\""
openFileUnderCursor :: Maybe (EditorM ()) -> YiM ()
openFileUnderCursor editorAction = do
  fileName <- fmap R.toString . withCurrentBuffer $ readUnitB unitViWORD
  fileExists <- io $ doesFileExist =<< expandTilda fileName
  if fileExists then do
      maybeM withEditor editorAction
      openNewFile $ fileName
  else
      withEditor . fail $ "Can't find file \"" <> fileName <> "\""
openFileUnderCursor editorAction = do
  fileName <- fmap R.toString . withCurrentBuffer $ readUnitB unitViWORD
  fileExists <- io $ doesFileExist =<< expandTilda fileName
  if fileExists then do
      maybeM withEditor editorAction
      openNewFile $ fileName
  else
      withEditor . fail $ "Can't find file \"" <> fileName <> "\""