You are not logged in.

#1 2023-09-17 10:36:38

b42
Member
Registered: 2023-07-20
Posts: 160

How to source rc files from a different dir than home?

Hi all,

How can I source my various dotfiles like .zshrc .vimrc and others from another directory than home? Lets say I want to organize everything and put them to .config

Offline

#2 2023-09-17 10:46:34

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: How to source rc files from a different dir than home?

Offline

#3 2023-09-17 20:46:51

espritlibre
Member
Registered: 2022-12-15
Posts: 130

Re: How to source rc files from a different dir than home?

for zsh related files you can use:
/etc/zsh/zshenv

export ZDOTDIR=$HOME/.config/zsh

Offline

#4 2023-09-18 11:13:10

b42
Member
Registered: 2023-07-20
Posts: 160

Re: How to source rc files from a different dir than home?

espritlibre wrote:

for zsh related files you can use:
/etc/zsh/zshenv

export ZDOTDIR=$HOME/.config/zsh

Okay I tried it on my VM and it works, but when I try it on my main machine it does not, it does not matter if I use rsync or cp even as a root user I get:

cannot stat 'zshenv' : Permission denied

why cannot I copy it to etc folder even though I am root or a user with sudo?

Offline

#5 2023-09-19 16:04:18

b42
Member
Registered: 2023-07-20
Posts: 160

Re: How to source rc files from a different dir than home?

espritlibre wrote:

for zsh related files you can use:
/etc/zsh/zshenv

export ZDOTDIR=$HOME/.config/zsh

can I source vim bash and others in the same manner?

Offline

#6 2023-09-19 16:16:26

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,924
Website

Re: How to source rc files from a different dir than home?

If by "same manner" you mean reading the link you were provided with so you can learn how, then yes.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#7 2023-09-19 16:43:00

b42
Member
Registered: 2023-07-20
Posts: 160

Re: How to source rc files from a different dir than home?

Trilby wrote:

If by "same manner" you mean reading the link you were provided with so you can learn how, then yes.

No I meant zshenv file.

How for example I do it with vim? I have read it but could not understand exactly how I should do that.

Offline

#8 2023-09-21 07:55:29

b42
Member
Registered: 2023-07-20
Posts: 160

Re: How to source rc files from a different dir than home?

any help on this matter?

Offline

#9 2023-09-21 10:51:39

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,645

Re: How to source rc files from a different dir than home?

b42 wrote:

any help on this matter?

Don't do that. https://wiki.archlinux.org/title/Genera … es#Bumping

What have you tried? Have you read the link you were given in post #2?

Offline

Board footer

Powered by FluxBB