Vimjas / vim-testbed

Docker image for testing Vim plugins
42 stars 6 forks source link

Improve vimrc loading #8

Open blueyed opened 7 years ago

blueyed commented 7 years ago

Via https://github.com/tweekmonster/vim-testbed/issues/1#issuecomment-239695455 from @tweekmonster:

I was also thinking about removing the requirement of sourcing /rtp.vim and having a standard vimrc script that loads a known script name from the volume instead.

Please elaborate, but I understand it as such there should be another vimrc sourced by a minimal script, which could be /rtp.vim still.

btw: I had some remarks somewhere regarding Neomake to push some things into the default vimrc IIRC.

tweekmonster commented 7 years ago

What I meant is that instead of the user sourcing /rtp.vim in their own script, we could instead setup an environment that just works for both Vim and Neovim. In hindsight, I think it's annoying to impose special setup when Vim has a pretty well defined startup procedure.

How I think it should work:

Volume

The volume directory is /testbed

Home directory

The user directory should be /home/testbed instead of the current /home. It has the default directory structure that's compatible with Vim and Neovim:

Startup

The container's $HOME/.vim/init.vim script does the following:

The container ENTRYPOINT script runs exec su -l vimtest -c "env VIM_TESTBED=1 /vim-build/bin/$BIN $ARGS". VIM_TESTBED is a flag that might be useful to non-trivial plugins that call external scripts.

Just a thought: plug.vim could be bundled to aid with fetching dependencies.

Benefits

blueyed commented 7 years ago

Makes total sense.

testbed.vim would be a dangling file analogous to .travis.yml.

Can you elaborate what you mean with "dangling" here, please?

I suggest then also to include some default vimrc, e.g. https://github.com/neomake/neomake/blob/master/tests/vim/vimrc (which is based on your's used for braceless).

blueyed commented 7 years ago

The container ENTRYPOINT script runs exec su -l vimtest -c "env VIM_TESTBED=1 /vim-build/bin/$BIN $ARGS".

Shouldn't it still cd /testbed? Did I understand it correctly that /testbed replaces /testplugin?

I have some WIP here - will create a PR later.