[Labs-l] can we get rid of default vim config?

Brad Jorsch bjorsch at wikimedia.org
Sun Jun 9 21:11:44 UTC 2013


On Sun, Jun 9, 2013 at 4:02 PM, Platonides <platonides at gmail.com> wrote:
> On 09/06/13 00:01, Tim Landscheidt wrote:
>>>>
>>>> Can't you make your .vimrc world-readable (does it contain
>>>> sensitive information?) and then "vim -u ~user/.vimrc"?  Ah,
>>>> sudo even sets SUDO_USER to the calling user, so you could
>>>> somewhat automate that even for multiple maintainers.
>>
>>
>>> SUDO_USER is very useful indeed. Do you also know which initialization
>>> files are called when becoming a service account? It would be nice to
>>> add `alias
>>> vim="vim -u ~$SUDO_USER/.vimrc"` somewhere, but .bashrc (for the service
>>> account) does not seem to be read.
>>
>>
>> ~/.bashrc is usually called by ~/.profile which is missing
>> for service accounts as well.  So I copy these (slightly
>> adapted) to new tools I create, not least to alias "rm" to
>> "rm -i" :-).
>
>
> I would add those alias to /etc/bash.bashrc, so that you don't need to copy
> dot files to service accounts.

Should probably make the alias conditional on [ -r ~$SUDO_USER/.vimrc
], otherwise if someone manages to not have a .vimrc (or it's not
readable) they'll get errors about the missing file.



More information about the Labs-l mailing list