How to use a separate colorscheme

Hi,

On my login, I created a .vimrc file

$ cat .vimrc
syntax on
set termguicolors
set background=dark
colorscheme nord

I also created a .vim/colors/nord.vim that I got from https://www.nordtheme.com/ports/vim

This is all good and fine.

Now we have a shared account that our team uses that we sudo to. I can't or rather don't want to overwrite that vim settings for that account in case some of the members of that team prefers to use whatever settings it has.

Is it possible to copy the vim settings on my account and 'source' it somehow so that I can use it for this account after I sudo to it? I would want to set it manually, i.e. without including in the .bashrc file of the account.

Please advise. Thanks.

A shared account produces this problem, and a security problem in general.
Can you instead use the personal accounts with a common group, and a common shared directory(-tree) owned by that group? (Techniques like group-s-bit and umask can be used to make real shared files.)

Sorry MadeInGermany, not sure I understand what you mean. I am a complete newbie-and-even-less when it comes to these security stuff. Do you mean having a shared directory that is available on both hosts?

Basically I login to hosta and then ssh to hostb that automatically logs me in as this shared account. There is a shared directory between hosts. There is a directory that I save my dircolors settings for example and I have several alias of dircolors command that do eval $( dircolors [colorscheme] ) after I ssh to hostb. Then I just run the dircolors command that I wanted.

I want to be able to do the same when using vim similar to how I do it with dircolors. Searching further, I found https://superuser.com/questions/928875/vim-gvim-command-line-switches

So, I created an alias like below

alias myvi='vim -c "so nord.vim" -c "set termguicolors" -c "set background=dark"'

and test like below

myvi blah

it appears to be working. I see the file has been opened with the nord.vim colorscheme :slight_smile:

I can't get the syntax off/on to work though. The default appears to be on anyway.

But a bit curious how come adding -c "set syntax=on" or -c "set syntax=off" doesn't have an effect. Same with set nopaste / set paste.

I meant shared between individual user accounts, not shared between hosts.
Maybe the word "common" is more clear.?

I see --- gotcha.
I'll stick with the vi -c for the time being.
I thought there maybe some command line option that I can use simply as vi [use-this-config], I thought that is what the -u is for.
Thanks for your input. Always much appreciated.

Try
-c "syntax off"