55Authors: Jakson A. Aquino <jalvesaq@gmail.com>
66 Jose Claudio Faria <joseclaudio.faria@gmail.com>
77
8- Version: 1.2.6
8+ Version: 1.2.7
99For Vim version 7.4
1010
1111 1. Overview | r-plugin-overview |
@@ -115,7 +115,7 @@ dependencies:
115115
116116 * R's version must be >= 3.0.0: http://www.r-project.org/
117117
118- * vimcom = 1.2-6 : http://www.lepem.ufc.br/jaa/vimcom.html
118+ * vimcom = 1.2-7 : http://www.lepem.ufc.br/jaa/vimcom.html
119119
120120 Note: If you cannot build vimcom yourself, you will want to
121121 download and install the zip file.
@@ -152,7 +152,7 @@ Before installing the plugin, you should install its dependencies:
152152
153153 R >= 3.0.0: http://www.r-project.org/
154154
155- vimcom = 1.2-6 : http://www.lepem.ufc.br/jaa/vimcom.html
155+ vimcom = 1.2-7 : http://www.lepem.ufc.br/jaa/vimcom.html
156156
157157 Only if you edit Rnoweb files: MacTeX, BasicTeX or other LaTeX system.
158158
@@ -206,7 +206,7 @@ Before installing the plugin, you should install its dependencies:
206206
207207 R >= 3.0.0: http://www.r-project.org/
208208
209- vimcom = 1.2-6 : http://www.lepem.ufc.br/jaa/vimcom.html
209+ vimcom = 1.2-7 : http://www.lepem.ufc.br/jaa/vimcom.html
210210
211211 Tmux >= 1.8: http://tmux.sourceforge.net
212212 Tmux is necessary to send commands from Vim to R Console.
@@ -253,23 +253,25 @@ Put the following in your `~/.bashrc`:
253253Before proceeding, you have to start a new shell session to have the alias
254254enabled.
255255
256- If you start either GVim or Vim in a terminal emulator the plugin will start R
257- in a external terminal emulator. If you start Vim inside of a Tmux session,
258- the plugin will split the Tmux window in two and start R in the other pane.
259-
260- The recommended way of running the plugin on Linux is running Vim inside a
261- Tmux session. Please, read | r-plugin-tmux | for details .
256+ If you start Vim in a terminal emulator, inside of a Tmux session, the plugin
257+ will split the Tmux window in two and start R in the other pane. This is the
258+ recommended way of running the plugin on Linux (read | r-plugin-tmux | for
259+ details). If you either use GVim or Vim not inside a Tmux session the plugin
260+ will start R in a external terminal emulator. This is useful if you have two
261+ monitors .
262262
263263If you run Vim in a terminal emulator, it must be started with the argument
264- | --servername | . Please, read the section | r-plugin-bash-setup | to know some
265- tips on how to configure Bash.
264+ | --servername | to enable the 'clientserver' feature (please, read the section
265+ | r-plugin-bash-setup | to know some tips on how to configure Bash). This is not
266+ necessary with GVim because it always runs with the 'clientserver' feature
267+ enabled.
266268
267269
268270------------------------------------------------------------------------------
2692713.4. Plugin installation (instructions for all systems)~
270272
271273You need to activate plugins and indentation according to 'filetype' . You
272- should have at least the following options at the top or at near the very top
274+ should have at least the following options at the top or near the very top
273275of your | vimrc | (but below `set ` `runtimepath ` , if you have set it):
274276>
275277 set nocompatible
@@ -512,18 +514,22 @@ line currently under the cursor you should type <LocalLeader>d. If you want to
512514see what lines are being sourced when sending a selection of lines, you can
513515use either <LocalLeader> se or <LocalLeader> sa instead of <LocalLeader> ss.
514516
517+ The command <LocalLeader> o runs in the background the R command `print (line )` ,
518+ where `line ` is the line under cursor, and adds the output as commented lines
519+ to the source code.
520+
515521If the cursor is over the header of an R chunk with the `child` option (from
516522Rnoweb, RMarkdown or RreStructuredText document), and you use one of the
517523commands that send a single line of code to R, then the plugin will send to R
518524the command to knit the child document.
519525
520526After the send, sweave and knit commands, Vim will save the current buffer if
521- it has any pending changes before performing the tasks. After
522- <LocalLeader> ao, Vim will run "R CMD BATCH --no-restore --no-save" on the
523- current file and show the resulting .Rout file in a new tab. Please see
524- | vimrplugin_routnotab | if you prefer that the file is open in a new split
525- window. Note: The command <LocalLeader> ao, silently writes the current buffer
526- to its file if it was modified and deletes the .Rout file if it exists.
527+ it has any pending changes before performing the tasks. After <LocalLeader> ao,
528+ Vim will run "R CMD BATCH --no-restore --no-save" on the current file and show
529+ the resulting .Rout file in a new tab. Please see | vimrplugin_routnotab | if
530+ you prefer that the file is open in a new split window. Note: The command
531+ <LocalLeader> ao, silently writes the current buffer to its file if it was
532+ modified and deletes the .Rout file if it exists.
527533
528534R syntax uses " <- " to assign values to variables which is inconvenient to
529535type. In insert mode, typing a single underscore, "_", will write " <- ",
@@ -815,9 +821,12 @@ file:
815821
816822 # Options enable mouse support in Tmux
817823 set -g terminal-overrides 'xterm*:smcup@:rmcup@'
824+ # For Tmux < 2.1
818825 set -g mode-mouse on
819826 set -g mouse-select-pane on
820827 set -g mouse-resize-pane on
828+ # For Tmux >= 2.1
829+ set -g mouse on
821830
822831 # Act more like vim:
823832 set-window-option -g mode-keys vi
@@ -999,16 +1008,16 @@ operator. See: https://github.com/jcfaria/Vim-R-plugin/issues/94
9991008------------------------------------------------------------------------------
100010095.4. Wrong message that "R is busy" (Windows only)~
10011010
1002- On Windows, when code is sent from Vim to R Console, the vimcom library
1003- sets the value of the internal variable `r_is_busy` to 1. The value is set
1004- back to 0 when any code is successfully evaluated. If you send invalid code to
1005- R, there will be no successful evaluation of code and, thus, the value of
1006- `r_is_busy` will remain set to 1. If you then try to update the Object
1007- Browser, see the R documentation for any function, or do other tasks that
1008- require the hidden evaluation of code by R, the vimcom library will
1009- refuse to do the tasks to avoid any risk of corrupting R's memory. It will
1010- tell Vim that "R is busy" and Vim will display this message. Everything should
1011- work as expected again after any valid code is executed in the R Console.
1011+ On Windows, when code is sent from Vim to R Console, the vimcom library sets
1012+ the value of the internal variable `r_is_busy` to 1. The value is set back to
1013+ 0 when any code is successfully evaluated. If you send invalid code to R,
1014+ there will be no successful evaluation of code and the value of `r_is_busy`
1015+ will remain set to 1. If you then try to update the Object Browser, see the R
1016+ documentation for any function, or do other tasks that require the hidden
1017+ evaluation of code by R, the vimcom library will refuse to do the tasks to
1018+ avoid any risk of corrupting R's memory. It will tell Vim that "R is busy" and
1019+ Vim will display this message. Everything should work as expected again after
1020+ any valid code is executed in the R Console.
10121021
10131022The vimcom library is started with the state `busy` .
10141023
@@ -1101,7 +1110,7 @@ VIMINSTANCEID, and VIMRPLUGIN_SECRET. The first one is the path used by the R
11011110package vimcom to save temporary files used by the Vim-R-plugin to: perform
11021111omnicompletion, show R documentation in a Vim buffer, and update the Object
11031112Browser. The two last ones are used by the Vim-R-plugin and by vimcom to know
1104- that the connections are valid. If you use Vim to start R, but then closes
1113+ that the connections are valid. If you use Vim to start R, but then close
11051114Vim, some variables will become outdated. Additionally, the Vim-R-plugin sets
11061115the value of its internal variable SendCmdToR from SendCmdToR_fake to the
11071116appropriate value when R is successfully started. It is possible to set the
@@ -1400,8 +1409,8 @@ it works, please, read the subsection 6.5.2 below.
14001409------------------------------------------------------------------------------
140114106.5.2. Details and other options:~
14021411
1403- The plugin key bindings will remain active in the documentation buffer, and,
1404- thus, you will be able to send commands to R as you do while editing an R
1412+ The plugin key bindings will remain active in the documentation buffer
1413+ allowing you to send commands to R as you would do do while editing an R
14051414script. You can, for example, use <LocalLeader> rh to jump to another R help
14061415document.
14071416
@@ -1662,7 +1671,7 @@ this behavior. Examples:
16621671 let vimrplugin_latexcmd = 'latexmk -pdf -pdflatex="xelatex %O -synctex=1 %S"'
16631672<
16641673By default, vimrplugin_latexmk is 0 on Windows and 1 on other systems.
1665- If you want to pass arguments do the `Sweave ()` function, set the value of the
1674+ If you want to pass arguments to the `Sweave ()` function, set the value of the
16661675vimrplugin_sweaveargs variable.
16671676
16681677If the value of `vimrplugin_texerr` is `1 ` , a summary of LaTeX errors
@@ -2148,7 +2157,7 @@ can type |:map| to see the complete list of current mappings, and below is the
21482157list of the names for custom key bindings (the prefix RE means "echo";
21492158RD, "cursor down"; RED, both "echo" and "down"):
21502159
2151- Star /Close R~
2160+ Start /Close R~
21522161 RStart
21532162 RCustomStart
21542163 RClose
@@ -2282,7 +2291,7 @@ later version.
22822291
22832292The Vim-R-plugin is distributed in the hope that it will be useful, but
22842293WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
2285- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
2294+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
22862295details.
22872296
22882297A copy of the GNU General Public License is available at
@@ -2553,9 +2562,9 @@ develop a better algorithm in the future.
255325629.10. Highlight chunk header as R code~
25542563
25552564By default, Vim will highlight chunk headers of RMarkdown and
2556- RreStructuredText with a single color. When the code is processed by knitr,
2557- chunk headers should contain valid R code and, thus, you may want to highlight
2558- them as such. You can do this by putting in your | vimrc | :
2565+ RreStructuredText with a single color. Chunk headers should contain valid R
2566+ code when the code is processed by knitr, so you may want to highlight them as
2567+ such. You can do this by putting in your | vimrc | :
25592568>
25602569 let rrst_syn_hl_chunk = 1
25612570 let rmd_syn_hl_chunk = 1
@@ -2586,13 +2595,7 @@ Vim breaks the R code automatically put in your |vimrc|:
25862595
25872596If you want 256 colors support in Vim, install the package ncurses-term. Then
25882597put in your `~/.bashrc ` the lines suggested at | r-plugin-bash-setup | .
2589- Finally, put in your | vimrc | :
2590- >
2591- if &term =~ "xterm" || &term =~ "256" || $DISPLAY != ""
2592- set t_Co=256
2593- endif
2594- colorscheme your_preferred_color_scheme
2595- <
2598+
25962599You have to search the internet for color schemes supporting 256 colors,
25972600download and copy them to ~/.vim/colors. You may use the command
25982601| :colorscheme | to try them one by one before setting your preference in your
@@ -2738,11 +2741,6 @@ please read this document from the beginning.
27382741 " schemes that supports 256 colors in the terminal emulator. Then,
27392742 " uncomment the code below to set you color scheme:
27402743 "colorscheme not_defined
2741-
2742- " Use 256 colors even if in a terminal emulator:
2743- if &term =~ "xterm" || &term =~ "256" || $DISPLAY != ""
2744- set t_Co=256
2745- endif
27462744<
27472745
27482746 *r-plugin-R-setup*
@@ -2763,25 +2761,30 @@ please read this document from the beginning.
27632761<
27642762
27652763 *r-plugin-bash-setup*
2766- ~/.bashrc for Vim ( Unix):~
2764+ ~/.bashrc (Linux, Mac OS X, and other Unix systems ):~
27672765>
2768- # Change the TERM environment variable (to get 256 colors) and make Vim
2769- # connecting to X Server even if running in a terminal emulator (many of
2770- # the plugin features depend on this).
2766+ # Change the TERM environment variable (to get 256 colors) even if you are
2767+ # accessing your system through ssh and using either Tmux or GNU Screen:
2768+ if [ "$TERM" = "xterm" ] || [ "$TERM" = "xterm-256color" ]
2769+ then
2770+ export TERM=xterm-256color
2771+ export HAS_256_COLORS=yes
2772+ fi
2773+ if [ "$TERM" = "screen" ] && [ "$HAS_256_COLORS" = "yes" ]
2774+ then
2775+ export TERM=screen-256color
2776+ fi
2777+
2778+ # Make Vim connect to X Server even if the gui is not running (many of the
2779+ # plugin features depend on this).
27712780 if [ "x$DISPLAY" != "x" ]
27722781 then
2773- if [ "screen" = "$TERM" ]
2774- then
2775- export TERM=screen-256color
2776- else
2777- export TERM=xterm-256color
2778- fi
27792782 alias vim='vim --servername VIM'
27802783 fi
27812784<
27822785
27832786
2784- Finally, if you want to use vi key bindings in Bash:
2787+ Finally, if you want to use vi key bindings in Bash or other shell :
27852788
27862789 ~/.inputrc~
27872790>
@@ -2830,6 +2833,10 @@ put in your |vimrc|:
28302833 *r-plugin-news*
2831283410. News~
28322835
2836+ 1.2.7 (2015-11-27)
2837+
2838+ * Fix incompatibility with Tmux 2.1.
2839+
283328401.2.6 (2015-06-12)
28342841
28352842 * Improve support for lazy load objects in the Object Browser.
0 commit comments