Q:

Vim autocmd pattern that matches only files in a particular directory (not in subdirectories)

I am trying to match all and only files that are directly on my Desktop.  But the autocmd pattern */Desktop/* also matches files in any subdirectory of the Desktop.  What pattern can do what I need?

A:

One way is to use a suitable regex, but this one might fail if you have /s in the filename, but you can improve it:
au BufRead * if expand('<amatch>') =~ "/Desktop/[^/]*$" | set tw=90 | endif

Another way is to use two commands, one reverting the other:
  au BufRead */Desktop/*  set tw=90
  au BufRead */Desktop/*/*  set tw=31

