EinfachToll / DidYouMean

Vim plugin which asks for the right file to open
82 stars 8 forks source link

Do not prompt for single file #8

Closed jalanb closed 7 years ago

jalanb commented 7 years ago

On my machine there exists a file at ~/jab/todo.txt. If I edit it with vim from command line, like

$ vim ~/jab/todo.txt

then the file is opened normally, and away I go. However, if I use single-quotes around the filename then DidYouMean catches it and offers me a menu:

$ vim '~/jab/todo.txt'
Did you mean:
1. /Users/jab/jab/todo.txt
Type number and <Enter> or click with mouse (empty cancels):

I think that is good in that the ~ has been caught and expanded correctly (which was suppressed at shell by use of single quotes). But it does seem superfluous to offer a menu with only one item, and I think that DidYouMean should bypass the menu in that case and go straight to allowing vim to open the file.

EinfachToll commented 7 years ago

Cool, I didn't know DidYouMean catches cases like this too. But I think prompting is still the right thing, so that the user can decide if they really want to open the file '~/bla' or '/home/…/bla' instead.