this post was submitted on 10 Nov 2023
9 points (100.0% liked)

Neovim

2157 readers
3 users here now

founded 1 year ago
MODERATORS
 

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

top 2 comments
sorted by: hot top controversial new old
[โ€“] chimay@lemmy.world 1 points 11 months ago (1 children)

you can use a dot to concatenate strings :

let trial = $HOME . '/dir1/dir2/dir3'
[โ€“] dafunkkk@lemmy.world 1 points 11 months ago

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