Hello,

 When a file name is completed in insert mode using Ctrl-X Ctrl-F Win32
version of gvim helpfully "corrects" the path separator characters to fit
those used by the current platform. So under Windows pressing Ctrl-X Ctrl-F
after typing "include/foo/" results in "include\foo\bar" which, while
undoubtedly logical, is never what I want: I'd like the slashes to be
preserved. Does anybody have any idea about how to achieve this?

 I tried doing

        inoremap <C-X><C-F> <C-X><C-F><Esc>:s...@\\@/@<C-M>A

(I have gdefault set) and it does work but suffers from a couple of minor
but obvious problems:
 - Doesn't restore the cursor position correctly unless you're typing at
the end of line (which is usually, but not quite always, the case)
 - Gives an error if there are no slashes/backslashes at all
 - Changes last match
 - Can mangle other "legitimate" backslashes

They could probably be fixed with some extra effort (any hints about how to
do it easily would be welcome too) but generally speaking it just seems
wrong to replace slashes with backslashes first only to undo it later --
maybe there is some way to prevent this from happening in the first place?

 Thanks in advance!
VZ

Attachment: pgp2O8aBLuLZq.pgp
Description: PGP signature

Reply via email to