This works. Thank you, but I have two questions please:
Why is gs
needed? In normal mode when we do ggvG
followed by enter, we have everything selected and we do not need to press gs
to retrieve the selection.
Is there any difference between using execute "norm gg"
and normal gg
? So, can we do this instead of using execute?
command! mSelAllDirA : set noquickview
\| if system('[[ -z "$(fd --type f)" ]] && echo 1') == '1'
\| normal ggvG<cr>
\| endif