3

So for example, i would have a command i could run from a bash script, and all open gvim and vim sessions would reload their config.

This is already the whole question, really, but I will also include my specific issue:

I want to be able to change between a light and a dark theme on the fly from a script. i have these files in ~/:

.vimrc             # contains "source ~/.vimrc_theme"
.vimrc_theme       # is a symbolic link to either of the following two files
.vimrc_theme_light # contains "colorscheme morning"
.vimrc_theme_dark  # contains "colorscheme evening"

and my theme-changer script:

#!/bin/bash

# should be either "light" or "dark"
_mode=${1:-light}

cd \
    && rm .vimrc_theme \
    && ln -s .vimrc_theme_${_mode} .vimrc_theme \
    && touch .vimrc \
    && touch .gvimrc

This question deals with a similar thing. There, one wants to edit .vimrc from inside vim, and then reload it. I want to trigger a reload from the outside.

hoijui
  • 3,615
  • 2
  • 33
  • 41
  • Not exactly what you asked, but following '[One Vim ... just one* - Using One Vim session is the way to go](http://vimeo.com/4446112)' would also simplify your question to the link you referenced. – mMontu Feb 23 '18 at 16:40
  • it states there, that this only works for gvim, not vim, and even so, as much as i know, the question i linked to has answers that rely on methods that only work vim internal, as much as i know (and as a few quick tests confirmed). meaning: if only reloads the configuration if the config file was changed in vim, within the same session. – hoijui Feb 23 '18 at 20:19

0 Answers0