From 5fde8f77e46f2b3156facacbabfc04a60897f769 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Thu, 27 Oct 2016 14:57:15 +0200 Subject: Load vimcom only if R was called by vim @jalvesaq Many thanks for the tip! --- Rprofile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'Rprofile') diff --git a/Rprofile b/Rprofile index 5b77822..e3d81d5 100644 --- a/Rprofile +++ b/Rprofile @@ -14,7 +14,9 @@ local({ if (interactive()) { library(colorout) library(setwidth) - # vimcom will generally only be installed on boxes where this is necessary - if (requireNamespace("vimcom")) options(vimcom.verbose = 1) - # However, vimcom does not get in the way of Nvim-R if it is loaded + # Load vimcom only if R was started by vim + if(Sys.getenv("VIMRPLUGIN_TMPDIR") != "") { + options(vimcom.verbose = 1) + library(vimcom) + } } -- cgit v1.2.1