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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Jose Caballero
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

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

Nikolay Aleksandrovich Pavlov
2017-11-25 19:17 GMT+03:00 Jose Caballero <[hidden email]>:

> 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?

:h <sfile>

>
>
> 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 [hidden email].
> For more options, visit https://groups.google.com/d/optout.

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

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

Dave Bucklin
On Sat, Nov 25, 2017 at 07:38:10PM +0300, Nikolay Aleksandrovich Pavlov wrote:

> 2017-11-25 19:17 GMT+03:00 Jose Caballero <[hidden email]>:
> > 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?
>
> :h <sfile>
>

You can also pair GNU stow and Git to manage configuration files.
http://davebucklin.com/play/2017/03/24/backing-up-dotfiles-with-stow-and-git.html

> >
> >
> > 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 [hidden email].
> > For more options, visit https://groups.google.com/d/optout.
>
> --
> --
> 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 [hidden email].
> For more options, visit https://groups.google.com/d/optout.

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.