help writing vim script

18 views
Skip to first unread message

Siddhant Gupta

unread,
Jun 15, 2016, 3:03:28 AM6/15/16
to vim_use
I have a variable containing Result: "/tmp/abcd/1234". I want to store tmp/abcd/1234 in another variable. how can I do this.

Dmitri Vereshchagin

unread,
Jun 15, 2016, 3:30:51 AM6/15/16
to vim_use
* Siddhant Gupta <dpsrk...@gmail.com> [2016-06-15 10:03]:
> I have a variable containing Result: "/tmp/abcd/1234". I want to store
> tmp/abcd/1234 in another variable. how can I do this.

There is more than one way to do it :) Two of them are

let bar = foo[1:]
let bar = substitute(foo, '^/', '', '')

--
Dmitri Vereshchagin
Reply all
Reply to author
Forward
0 new messages