Saturday, November 25, 2017

location of vim rc files and directories. Making them relocatable.

Hi,

this is a quick question about how to modify my .vimrc and all my
plugins so I can copy all of them to different hosts (under different
usernames) and still work.

I have all of them (vimrc and all plugin directories) in a github account.
So my intention is, when I login to a remote host -either root or any
other user account-, I would like to clone that account, and being
able to keep using them.
I don't want to place them under the usual locations (~/.vimrc and
~/.vim) because, as mentioned, sometimes I log as root, on a shared
host, so I cannot interfere with others.

So basically I want to place the files under /tmp/, for example.
However, I have things hardcoded in the files. Things like this:

autocmd BufNewFile *.py :-1read ~/.vim/templates/emptypython

So I would like to know if there is a mechanism, like an env var or
similar, to avoid using hardcoded absolute paths, and make everything
relative.

googling, I got that I can use -u to point to .vimrc. That solves part
of the problem.
But I still need a way to make the rest of them relative.
Which key word should I search for?


Thanks a lot in advance,
Jose

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment