0

Basically what I'm trying to achieve is set my vim-session name same as my vim servername from vimrc, i.e.

I'm using vim-session plugin and it provides an option to set the name of the autosave session by setting g:session_autosave_to in my vimrc, what I'm trying to achieve now is something like let g:session_autosave_to=v:servername

Don't know that's the right way to do, but I believe that should have worked and my session name should have been set to my servername, but that does not seem to be happen.

Any help is much appreciated.

Sushil
  • 383
  • 1
  • 10
  • You might be able to access `$HOST` from vim. Or you could shell out to expand `!hostname`. – Micah Elliott Jul 15 '15 at 02:54
  • It seems the .vimrc is sourced even before the `v:servername` variable is defined hence I get the value as empty string. So for now as suggested I export the servername to a variable and use it in .vimrc. Though, I'm still now convinced with the way I'm doing it now. Will keep digging to fine a nice way around. – Sushil Jul 15 '15 at 07:34

0 Answers0