Reputation: 637
If I define a variable in vim script:
let path = "E:\mainVersion\GameServer"
and then echo it:
echo path
But I get this :
E:mainVersionGameServer
I think maybe it's because the backslash is an special character. Here's my quertion:
\
) disappear?Can you help me?
Upvotes: 1
Views: 387
Reputation: 1496
Like in most languages, you can use backslash to escape those characters.
:let path= "E:\\path\\subdirectory"
Upvotes: 1
Reputation: 195079
use single quote
let path = 'E:\mainVersion\GameServer'
then
echo path
another test:
let foo="a\nb"
echo foo
output:
a
b
and:
let foo='a\nb'
echo foo
you will see: a\nb
With single quote those sequences will be ignored.
Upvotes: 3