How can I let to variable a path with other env variable in it in init.vim?

Hi, how can I associate to a var a path with both env variable and text? something like this for example: let trial=$HOME/dir1/dir2/$env1/dir3 I saw that let trial=$HOME works when I echo it, but if I add $HOME/dir1 it doesn't anymore....any help? Thanks

9 points · 2 comments · view on lemmy.world

2 Comments

chimay@lemmy.world · 1 pts · 2y (1 reply)

you can use a dot to concatenate strings :

let trial = $HOME . '/dir1/dir2/dir3'
dafunkkk@lemmy.world · 1 pts · 2y

it works!!!....many thanks!!!