Adding a space to "isfname"

56 views
Skip to first unread message

David Fishburn

unread,
Aug 8, 2007, 7:51:21 AM8/8/07
to v...@vim.org
Vim 7.1
WinXP

I am surprised that isfname does not include the space in it's list of valid filename characters on the Windows platform.
  So far I have been unable to add it to the list.  Looking for some suggestions.

I have tried:
set isfname+=\
set isfname+=32  "32 is the results from "ga" on a space
set isfname=\ ,@,48-57,/,\,.,-,_,+,,,#,$,%,{,},[,],:,@-@,!,~,=,
let &isfname=' '.&isfname

Nothing is working at this point.  A number of the command report an error.

This was my test case:
echo matchstr('c:\Documents and Settings\fishburn.FISHBURN-M20\My Documents\filename.sql;', '\f\+')

Which only returns:
c:\Documents

I also tried this, but you can not use the special character classes within the []s:
echo matchstr('c:\Documents and Settings\fishburn.FISHBURN-M20\My Documents\filename.sql;', '[\f ]\+')


\f  is taken literally as "\", "f", " ".

Suggestions?

Thanks,
Dave

Tony Mechelynck

unread,
Aug 8, 2007, 8:18:10 AM8/8/07
to vim...@googlegroups.com

Only very few backslash-escapes are allowed inside a collection, see ":help /\]".

When I try ":set isf+=32" (without the quotes, on Linux) I get no error and
,32 gets added at the end. Then I tried (still on Linux, hence the forward
slashes)

:echo matchstr('/Documents and Settings/fishburn.FISHBURN-M20/My
Documents/filename.sql;', '\f\+')

(all on one line) and the answer was

/Documents and Settings/fishburn.FISHBURN-M20/My Documents/filename.sql

Conclusion: Works for me using

VIM - Vi IMproved 7.1 (2007 May 12, compiled Aug 7 2007 22:56:01)
Included patches: 1-56
Compiled by antoine.m...@skynet.be
Huge version with GTK2-GNOME GUI. Features included (+) or not (-):
[...]

Does it work for you when you invoke Vim as

gvim -N -u NONE

?

Best regards,
Tony.
--
Dear Miss Manners:
My home economics teacher says that one must never place one's
elbows on the table. However, I have read that one elbow, in between
courses, is all right. Which is correct?

Gentle Reader:
For the purpose of answering examinations in your home
economics class, your teacher is correct. Catching on to this
principle of education may be of even greater importance to you now
than learning correct current table manners, vital as Miss Manners
believes that is.

Jürgen Krämer

unread,
Aug 8, 2007, 8:26:32 AM8/8/07
to vim...@googlegroups.com

Hi,

David Fishburn wrote:
>
> Vim 7.1
> WinXP
>
> I am surprised that isfname does not include the space in it's list of
> valid filename characters on the Windows platform.
> So far I have been unable to add it to the list. Looking for some
> suggestions.
>
> I have tried:
> set isfname+=\
> set isfname+=32 "32 is the results from "ga" on a space

I changed this

> set isfname=\ ,@,48-57,/,\,.,-,_,+,,,#,$,%,{,},[,],:,@-@,!,~,=,

to

set isfname=\ ,@,48-57,/,\\,.,-,_,+,,,#,$,%,{,},[,],:,@-@,!,~,=,

(note the doubled backslash) and it worked, i.e., VIM correctly opened
the file between the single quotes after pressing <C-W>f.

> let &isfname=' '.&isfname
>
> Nothing is working at this point. A number of the command report an error.
>
> This was my test case:
> echo matchstr('c:\Documents and Settings\fishburn.FISHBURN-M20\My Documents\filename.sql;', '\f\+')
>
> Which only returns:
> c:\Documents
>
> I also tried this, but you can not use the special character classes
> within the []s:
> echo matchstr('c:\Documents and Settings\fishburn.FISHBURN-M20\My Documents\filename.sql;', '[\f ]\+')
>
>
> \f is taken literally as "\", "f", " ".

Regards,
Jürgen

--
Sometimes I think the surest sign that intelligent life exists elsewhere
in the universe is that none of it has tried to contact us. (Calvin)

David Fishburn

unread,
Aug 8, 2007, 9:34:14 AM8/8/07
to vim...@googlegroups.com


Thanks for the response.

I am seeing inconsistent behavior.


E474: Invalid argument: isfname+=32
E474: Invalid argument: isf+=32
E474: Invalid argument: isf+=32
E474: Invalid argument: isf+=32
E474: Invalid argument: isfname+=32

Yet, once it worked and the matchstr() did what I expected.
Then I removed it:
set isf-=32

And when I try to add it again, I am getting the above.

:ver
VIM - Vi IMproved 7.1 (2007 May 12, compiled Jul  2 2007 22:45:08)
MS-Windows 32 bit GUI version with OLE support
Included patches: 1-18
Compiled by fishburn@FISHBURN-M20


Bram Moolenaar

unread,
Aug 8, 2007, 4:10:41 PM8/8/07
to David Fishburn, v...@vim.org

David Fishburn wrote:

> Vim 7.1
> WinXP
>
> I am surprised that isfname does not include the space in it's list of valid
> filename characters on the Windows platform.
> So far I have been unable to add it to the list. Looking for some
> suggestions.
>
> I have tried:
> set isfname+=\
> set isfname+=32 "32 is the results from "ga" on a space
> set isfname=\ ,@,48-57,/,\,.,-,_,+,,,#,$,%,{,},[,],:,@-@,!,~,=,
> let &isfname=' '.&isfname
>
> Nothing is working at this point. A number of the command report an error.

This should work:

:set isfname+=32

However, keep in mind that this causes problems. For example, "gf" will
often use a whole line as a file name.

--
Common sense is what tells you that the world is flat.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ download, build and distribute -- http://www.A-A-P.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Reply all
Reply to author
Forward
0 new messages