How can I find out if a text (coming from fzf) is file or folder? I am using below code from wiki and would like to customize it to do different operation depending on whether a file is chosen or a folder?
command! FZFlocateC : set noquickview
\| let $FZF_PICK = term('locate $HOME | fzf 2>/dev/tty')
\| if $FZF_PICK != ''
\| execute 'goto' fnameescape($FZF_PICK)
You'll have to use an external command for this:
if system("test -d $FZF_PICK && echo dir") == 'dir'
" handle dir
" handle file