Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

New option: vimrplugin_only_in_tmux.

  • Loading branch information...
commit 426301a1e691cad00d594d073e030575995a6cda 1 parent 7889330
@jalvesaq jalvesaq authored
Showing with 34 additions and 1 deletion.
  1. +26 −1 doc/r-plugin.txt
  2. +8 −0 r-plugin/common_global.vim
View
27 doc/r-plugin.txt
@@ -745,6 +745,9 @@ A sample detachable session could be:
Tmux session:
tmux attach
+See |vimrplugin_only_in_tmux| if you always prefer starting Tmux before
+starting Vim, but sometimes forget to start Tmux.
+
4.9. GNU Screen usage~
*r-plugin-screen*
@@ -1186,6 +1189,7 @@ If you want to use your own ~/.screenrc, put in your vimrc:
*vimrplugin_screenplugin*
*vimrplugin_screenvsplit*
*vimrplugin_tmux*
+ *vimrplugin_only_in_tmux*
The screen.vim plugin supports both GNU Screen and Tmux, but only Tmux allows
you to split the terminal vertically (that is, to have the panels side by
side). Also, the automatic updating of the Object Browser is enabled only when
@@ -1218,6 +1222,15 @@ at the same time is especially useful for users who may prefer to use Vim and
R in a terminal emulator, rather than using the graphical interface provided
by GVim.
+If you prefer to use the plugin in a terminal emulator in a Tmux session, you
+may prefer to start Tmux before Vim (see |r-plugin-tmux|). In this case, you
+may want to set the value of |vimrplugin_only_in_tmux| as below:
+>
+ let vimrplugin_only_in_tmux = 1
+<
+With the above option, the Vim-R-plugin will not start R if not running in a
+Tmux session, and it will warn you about that.
+
If you have the screen.vim plugin installed but prefer do not integrate it
with the Vim-R-plugin you will need to add the following to your |vimrc|:
>
@@ -1873,7 +1886,19 @@ them in your vimrc. For example
will produce a german document with a table of contents.
-9.21. Integration with the Conque Shell plugin~
+9.21. Start Tmux and Vim at once~
+
+If you always prefer to run Tmux before running Vim you may want to put in
+your ~/.bashrc:
+>
+ function tvim(){ tmux new-session "vim $@" ; }
+<
+Then you will be able to start Vim inside a Tmux session by typing:
+>
+ tvim filename.R
+<
+
+9.22. Integration with the Conque Shell plugin~
*r-plugin-conque*
In addition to being integrated with the screen.vim plugin the Vim-R-plugin
can also use the Conque Shell plugin, but the Conque Shell still has some
View
8 r-plugin/common_global.vim
@@ -568,6 +568,13 @@ function StartR(whatr)
endif
if g:vimrplugin_screenplugin
+ if g:vimrplugin_only_in_tmux && g:vimrplugin_tmux
+ if $TMUX_PANE == ""
+ call RWarningMsg("Not inside Tmux.")
+ return
+ endif
+ endif
+
if $TERM =~ "screen"
if g:vimrplugin_tmux
call system("tmux set-environment VIMRPLUGIN_TMPDIR " . $VIMRPLUGIN_TMPDIR)
@@ -2818,6 +2825,7 @@ call RSetDefaultValue("g:vimrplugin_specialplot", 0)
call RSetDefaultValue("g:vimrplugin_nosingler", 0)
call RSetDefaultValue("g:vimrplugin_noscreenrc", 0)
call RSetDefaultValue("g:vimrplugin_notmuxconf", 0)
+call RSetDefaultValue("g:vimrplugin_only_in_tmux", 0)
call RSetDefaultValue("g:vimrplugin_routnotab", 0)
call RSetDefaultValue("g:vimrplugin_editor_w", 66)
call RSetDefaultValue("g:vimrplugin_help_w", 46)
Please sign in to comment.
Something went wrong with that request. Please try again.