Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

New option: vimrplugin_only_in_tmux.

  • Loading branch information...
commit 426301a1e691cad00d594d073e030575995a6cda 1 parent 7889330
Jakson Alves de Aquino jalvesaq authored

Showing 2 changed files with 34 additions and 1 deletion. Show diff stats Hide diff stats

  1. +26 1 doc/r-plugin.txt
  2. +8 0 r-plugin/common_global.vim
27 doc/r-plugin.txt
@@ -745,6 +745,9 @@ A sample detachable session could be:
745 745 Tmux session:
746 746 tmux attach
747 747
  748 +See |vimrplugin_only_in_tmux| if you always prefer starting Tmux before
  749 +starting Vim, but sometimes forget to start Tmux.
  750 +
748 751
749 752 4.9. GNU Screen usage~
750 753 *r-plugin-screen*
@@ -1186,6 +1189,7 @@ If you want to use your own ~/.screenrc, put in your vimrc:
1186 1189 *vimrplugin_screenplugin*
1187 1190 *vimrplugin_screenvsplit*
1188 1191 *vimrplugin_tmux*
  1192 + *vimrplugin_only_in_tmux*
1189 1193 The screen.vim plugin supports both GNU Screen and Tmux, but only Tmux allows
1190 1194 you to split the terminal vertically (that is, to have the panels side by
1191 1195 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
1218 1222 R in a terminal emulator, rather than using the graphical interface provided
1219 1223 by GVim.
1220 1224
  1225 +If you prefer to use the plugin in a terminal emulator in a Tmux session, you
  1226 +may prefer to start Tmux before Vim (see |r-plugin-tmux|). In this case, you
  1227 +may want to set the value of |vimrplugin_only_in_tmux| as below:
  1228 +>
  1229 + let vimrplugin_only_in_tmux = 1
  1230 +<
  1231 +With the above option, the Vim-R-plugin will not start R if not running in a
  1232 +Tmux session, and it will warn you about that.
  1233 +
1221 1234 If you have the screen.vim plugin installed but prefer do not integrate it
1222 1235 with the Vim-R-plugin you will need to add the following to your |vimrc|:
1223 1236 >
@@ -1873,7 +1886,19 @@ them in your vimrc. For example
1873 1886
1874 1887 will produce a german document with a table of contents.
1875 1888
1876   -9.21. Integration with the Conque Shell plugin~
  1889 +9.21. Start Tmux and Vim at once~
  1890 +
  1891 +If you always prefer to run Tmux before running Vim you may want to put in
  1892 +your ~/.bashrc:
  1893 +>
  1894 + function tvim(){ tmux new-session "vim $@" ; }
  1895 +<
  1896 +Then you will be able to start Vim inside a Tmux session by typing:
  1897 +>
  1898 + tvim filename.R
  1899 +<
  1900 +
  1901 +9.22. Integration with the Conque Shell plugin~
1877 1902 *r-plugin-conque*
1878 1903 In addition to being integrated with the screen.vim plugin the Vim-R-plugin
1879 1904 can also use the Conque Shell plugin, but the Conque Shell still has some
8 r-plugin/common_global.vim
@@ -568,6 +568,13 @@ function StartR(whatr)
568 568 endif
569 569
570 570 if g:vimrplugin_screenplugin
  571 + if g:vimrplugin_only_in_tmux && g:vimrplugin_tmux
  572 + if $TMUX_PANE == ""
  573 + call RWarningMsg("Not inside Tmux.")
  574 + return
  575 + endif
  576 + endif
  577 +
571 578 if $TERM =~ "screen"
572 579 if g:vimrplugin_tmux
573 580 call system("tmux set-environment VIMRPLUGIN_TMPDIR " . $VIMRPLUGIN_TMPDIR)
@@ -2818,6 +2825,7 @@ call RSetDefaultValue("g:vimrplugin_specialplot", 0)
2818 2825 call RSetDefaultValue("g:vimrplugin_nosingler", 0)
2819 2826 call RSetDefaultValue("g:vimrplugin_noscreenrc", 0)
2820 2827 call RSetDefaultValue("g:vimrplugin_notmuxconf", 0)
  2828 +call RSetDefaultValue("g:vimrplugin_only_in_tmux", 0)
2821 2829 call RSetDefaultValue("g:vimrplugin_routnotab", 0)
2822 2830 call RSetDefaultValue("g:vimrplugin_editor_w", 66)
2823 2831 call RSetDefaultValue("g:vimrplugin_help_w", 46)

0 comments on commit 426301a

Please sign in to comment.
Something went wrong with that request. Please try again.