diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..be52368 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +doc/tags* +r-plugin/objlist/omnils_* +r-plugin/objlist/fun_* +r-plugin/tmp* diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..bceeefb --- /dev/null +++ b/Makefile @@ -0,0 +1,175 @@ + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# A copy of the GNU General Public License is available at +# http://www.r-project.org/Licenses/ + + +########################################################### +# This script builds both the Vimball and the deb # +# files of released versions of the plugin. The files # +# are created at the /tmp directory. # +########################################################### + + + +PLUGINHOME=`pwd` +PLUGINVERSION=1.3.1 +DEBIANTIME=`date -R` +PLUGINRELEASEDATE=`date +"%Y-%m-%d"` +VIM2HTML=/usr/local/share/vim/vim74/doc/vim2html.pl + + +vimball: + # Update the version date in doc/r-plugin.txt header and in the news + sed -i -e "s/^Version: [0-9].[0-9].[0-9].[0-9]/Version: $(PLUGINVERSION)/" doc/r-plugin.txt + sed -i -e "s/^$(PLUGINVERSION) (201[0-9]-[0-9][0-9]-[0-9][0-9])$$/$(PLUGINVERSION) ($(PLUGINRELEASEDATE))/" doc/r-plugin.txt + vim -c "%MkVimball Vim-R-plugin ." -c "q" list_for_vimball + mv Vim-R-plugin.vmb /tmp + +deb: + # Clean previously created files + (cd /tmp ; rm -rf vim-r-plugin-tmp ) + # Create the directory of a Debian package + ( cd /tmp ;\ + mkdir -p vim-r-plugin-tmp/usr/share/vim/addons ;\ + mkdir -p vim-r-plugin-tmp/usr/share/vim/registry ;\ + mkdir -p vim-r-plugin-tmp/usr/share/doc/vim-r-plugin ) + # Create the Debian changelog + echo $(DEBCHANGELOG) "vim-r-plugin ($(PLUGINVERSION)-1) unstable; urgency=low\n\ + \n\ + * Initial Release.\n\ + \n\ + -- Jakson Alves de Aquino $(DEBIANTIME)\n\ + " | gzip --best > /tmp/vim-r-plugin-tmp/usr/share/doc/vim-r-plugin/changelog.gz + # Create the yaml script + echo "addon: r-plugin\n\ + description: \"Filetype plugin to work with R\"\n\ + disabledby: \"let disable_r_ftplugin = 1\"\n\ + files:\n\ + - autoload/rcomplete.vim\n\ + - doc/r-plugin.txt\n\ + - ftdetect/r.vim\n\ + - ftplugin/r_rplugin.vim\n\ + - ftplugin/rbrowser.vim\n\ + - ftplugin/rdoc.vim\n\ + - ftplugin/rhelp_rplugin.vim\n\ + - ftplugin/rmd_rplugin.vim\n\ + - ftplugin/rnoweb_rplugin.vim\n\ + - ftplugin/rrst_rplugin.vim\n\ + - r-plugin/common_buffer.vim\n\ + - r-plugin/common_global.vim\n\ + - r-plugin/functions.vim\n\ + - r-plugin/gui_running.vim\n\ + - r-plugin/setcompldir.vim\n\ + - r-plugin/synctex_evince_backward.py\n\ + - r-plugin/synctex_evince_forward.py\n\ + - r-plugin/tmux.vim\n\ + - r-plugin/tmux_split.vim\n\ + - r-plugin/extern_term.vim\n\ + - syntax/rbrowser.vim\n\ + - syntax/rdoc.vim\n\ + - syntax/rout.vim\n\ + " > /tmp/vim-r-plugin-tmp/usr/share/vim/registry/vim-r-plugin.yaml + # Create the copyright + echo "Copyright (C) 2011-2015 Jakson Aquino\n\ + \n\ + License: GPLv2+\n\ + \n\ + This program is free software; you can redistribute it and/or modify\n\ + it under the terms of the GNU General Public License as published by\n\ + the Free Software Foundation; either version 2 of the License, or\n\ + (at your option) any later version.\n\ + \n\ + This program is distributed in the hope that it will be useful,\n\ + but WITHOUT ANY WARRANTY; without even the implied warranty of\n\ + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n\ + GNU General Public License for more details.\n\ + \n\ + You should have received a copy of the GNU General Public License\n\ + along with this program; if not, write to the Free Software\n\ + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.\n\ + \n\ + See /usr/share/common-licenses/GPL-2, or\n\ + for the terms of the latest version\n\ + of the GNU General Public License.\n\ + " > /tmp/vim-r-plugin-tmp/usr/share/doc/vim-r-plugin/copyright + # Unpack the plugin + vim -c 'set nomore' -c 'let g:vimball_home="/tmp/vim-r-plugin-tmp/usr/share/vim/addons"' -c "so %" -c "q" /tmp/Vim-R-plugin.vmb + # Create the DEBIAN directory + ( cd /tmp/vim-r-plugin-tmp ;\ + mkdir DEBIAN ;\ + INSTALLEDSIZE=`du -s | sed -e 's/\t.*//'` ) + # Create the control file + echo "Package: vim-r-plugin\n\ + Version: $(PLUGINVERSION)\n\ + Architecture: all\n\ + Maintainer: Jakson Alves de Aquino \n\ + Installed-Size: $(INSTALLEDSIZE)\n\ + Depends: vim | vim-gtk | vim-gnome, tmux (>= 1.8), ncurses-term, vim-addon-manager, r-base-core\n\ + Suggests: wmctrl, latexmk\n\ + Enhances: vim\n\ + Section: text\n\ + Priority: extra\n\ + Homepage: http://www.vim.org/scripts/script.php?script_id=2628\n\ + Description: Plugin to work with R\n\ + This filetype plugin has the following main features:\n\ + - Start/Close R.\n\ + - Send lines, selection, paragraphs, functions, blocks, entire file.\n\ + - Send commands with the object under cursor as argument:\n\ + help, args, plot, print, str, summary, example, names.\n\ + - Support for editing Rnoweb files.\n\ + - Omni completion (auto-completion) for R objects.\n\ + - Ability to see R documentation in a Vim buffer.\n\ + - Object Browser." > /tmp/vim-r-plugin-tmp/DEBIAN/control + # Create the md5sum file + (cd /tmp/vim-r-plugin-tmp/ ;\ + find usr -type f -print0 | xargs -0 md5sum > DEBIAN/md5sums ) + # Create the posinst and postrm scripts + echo '#!/bin/sh\n\ + set -e\n\ + \n\ + helpztags /usr/share/vim/addons/doc\n\ + \n\ + exit 0\n\ + ' > /tmp/vim-r-plugin-tmp/DEBIAN/postinst + echo '#!/bin/sh\n\ + set -e\n\ + \n\ + helpztags /usr/share/vim/addons/doc\n\ + \n\ + exit 0\n\ + ' > /tmp/vim-r-plugin-tmp/DEBIAN/postrm + # Fix permissions + (cd /tmp/vim-r-plugin-tmp ;\ + chmod g-w -R * ;\ + chmod +x DEBIAN/postinst DEBIAN/postrm ) + # Build the Debian package + ( cd /tmp ;\ + fakeroot dpkg-deb -b vim-r-plugin-tmp vim-r-plugin_$(PLUGINVERSION)-1_all.deb ) + +htmldoc: + vim -c ":helptags ~/src/Vim-R-plugin/doc" -c ":quit" ;\ + (cd doc ;\ + $(VIM2HTML) tags r-plugin.txt ;\ + sed -i -e 's///' r-plugin.html ;\ + sed -i -e 's/||/<\/a>/g' r-plugin.html ;\ + sed -i -e 's/||/<\/code>/g' r-plugin.html ;\ + sed -i -e 's/&term/\&term/g' r-plugin.html ;\ + sed -i -e 's/`//g' r-plugin.html ;\ + sed -i -e 's/\( *\)\(http\S*\)/\1\2<\/a>/' r-plugin.html ;\ + sed -i -e 's/<\/pre>
/  --------------------------------------------------------\n/' r-plugin.html ;\
+	    mv r-plugin.html vim-stylesheet.css /tmp )
+
+all: vimball deb htmldoc
+
diff --git a/README b/README
deleted file mode 100644
index e5d3188..0000000
--- a/README
+++ /dev/null
@@ -1,98 +0,0 @@
-This is a mirror of http://www.vim.org/scripts/script.php?script_id=2628
-
-This plugin improves Vim's support for editing R code and makes it possible to integrate Vim with R. The functionality is similar to what you can find in Tinn-R and ess mode of emacs. This filetype plugin uses either screen (Linux, OS X, or other Unix, optionally with the Screen plugin, vimscript #2711) or Python (Microsoft Windows) or Conque Shell plugin (all platforms, vimscript #2771) or Apple Script (Mac OS X) to communicate with R. 
-
-Screenshots and Debian package: http://sites.google.com/site/jalvesaq/vimrplugin
-
-MAIN FEATURES:
-
-  * Syntax highlighting for R syntax, including:
-      - Special characters in strings.
-      - Functions of all installed packages (must be updated manually).
-      - Special highlighting for R output (.Rout files).
-      - Spell check only strings and comments.
-      - Fold code when foldmethod=syntax.
-  * Syntax highlighting for RHelp syntax.
-  * Smart indentation for R syntax.
-  * Smart indentation for RHelp syntax.
-  * Integrated communication with R:
-      - Start/Close R.
-      - Send lines, selection, paragraphs, functions, blocks, entire file.
-      - Send commands with the object under cursor as argument: help, args,
-	plot, print, str, summary, example, names.
-      - Send to R the Sweave and pdflatex commands.
-      - Run R inside a Vim's buffer.
-  * Omni completion (auto-completion) for R objects (.GlobalEnv and installed
-    packages. The list of installed packages must be updated manually.
-  * Ability to see R's documentation in a Vim's buffer:
-      - Automatic calculation of the best layout of the R documentation buffer
-	(split the window either horizontally or vertically according to the
-	available room).
-      - Automatic formating of the text to fit the panel width.
-      - Send code and commands to R (useful to run examples).
-      - Jump to another R documentation.
-      - Syntax highlighting of R documentation.
-  * Object Browser (.GlobalEnv and loaded packages; must be updated manually):
-      - Send commands with the object under cursor as argument.
-      - Call R's help() with the object under cursor as argument.
-      - Syntax highlighting of the Object Browser.
-  * Most of the plugin's behavior is customizable.
-
-
-USE: Please, read the plugin's documentation.
-
-FILES:
-
-   autoload/rcomplete.vim
-   bitmaps/RClearAll.bmp
-   bitmaps/RClearAll.png
-   bitmaps/RClear.bmp
-   bitmaps/RClear.png
-   bitmaps/RClose.bmp
-   bitmaps/RClose.png
-   bitmaps/ricon.png
-   bitmaps/ricon.xbm
-   bitmaps/RListSpace.bmp
-   bitmaps/RListSpace.png
-   bitmaps/RSendBlock.bmp
-   bitmaps/RSendBlock.png
-   bitmaps/RSendFile.bmp
-   bitmaps/RSendFile.png
-   bitmaps/RSendFunction.bmp
-   bitmaps/RSendFunction.png
-   bitmaps/RSendLine.bmp
-   bitmaps/RSendLine.png
-   bitmaps/RSendParagraph.bmp
-   bitmaps/RSendParagraph.png
-   bitmaps/RSendSelection.bmp
-   bitmaps/RSendSelection.png
-   bitmaps/RStart.bmp
-   bitmaps/RStart.png
-   doc/r-plugin.txt
-   ftdetect/r.vim
-   ftplugin/rhelp.vim
-   ftplugin/rnoweb.vim
-   ftplugin/r.vim
-   ftplugin/rbrowser.vim
-   indent/r.vim
-   indent/rhelp.vim
-   indent/rnoweb.vim
-   r-plugin/build_omniList.R
-   r-plugin/common_buffer.vim
-   r-plugin/common_global.vim
-   r-plugin/etags2ctags.R
-   r-plugin/functions.vim
-   r-plugin/omniList
-   r-plugin/vimbrowser.R
-   r-plugin/vimhelp.R
-   r-plugin/vimprint.R
-   r-plugin/vimSweave.R
-   r-plugin/r.snippets
-   r-plugin/specialfuns.R
-   r-plugin/tex_indent.vim
-   r-plugin/vimActivate.js
-   r-plugin/windows.py
-   syntax/rbrowser.vim
-   syntax/rout.vim
-   syntax/r.vim
-
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..86abe96
--- /dev/null
+++ b/README.md
@@ -0,0 +1,5 @@
+# Vim-R-plugin - DO NOT INSTALL THIS PLUGIN
+
+This plugin is no longer being maintained. It was superseded by 
+[Nvim-R](https://github.com/jalvesaq/Nvim-R).
+
diff --git a/Rakefile b/Rakefile
new file mode 100644
index 0000000..1d99dc2
--- /dev/null
+++ b/Rakefile
@@ -0,0 +1,97 @@
+# Copyright (c) 2009 Travis Jeffery 
+# 
+# Permission is hereby granted, free of charge, to any person
+# obtaining a copy of this software and associated documentation
+# files (the "Software"), to deal in the Software without
+# restriction, including without limitation the rights to use,
+# copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following
+# conditions:
+# 
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+# 
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+# OTHER DEALINGS IN THE SOFTWARE.
+
+# Contributions by scrooloose 
+
+require 'rake'
+require 'find'
+require 'pathname'
+
+IGNORE = [/\.gitignore$/, /Rakefile$/]
+
+files = `git ls-files`.split("\n")
+files.reject! { |f| IGNORE.any? { |re| f.match(re) } }
+
+desc 'Zip up the project files'
+task :zip do
+  zip_name = File.basename(File.dirname(__FILE__))
+  zip_name.gsub!(/ /, '_')
+  zip_name = "#{zip_name}.zip"
+
+  if File.exist?(zip_name)
+    abort("Zip file #{zip_name} already exists. Remove it first.")
+  end
+
+  puts "Creating zip file: #{zip_name}"
+  system("zip #{zip_name} #{files.join(" ")}")
+end
+
+desc 'Install plugin and documentation'
+task :install do
+  vimfiles = if ENV['VIMFILES']
+               ENV['VIMFILES']
+             elsif RUBY_PLATFORM =~ /(win|w)32$/
+               File.expand_path("~/vimfiles")
+             else
+               File.expand_path("~/.vim")
+             end
+  files.each do |file|
+    target_file = File.join(vimfiles, file)
+    FileUtils.mkdir_p File.dirname(target_file)
+    FileUtils.cp file, target_file
+
+    puts "Installed #{file} to #{target_file}"
+  end
+
+end
+
+desc 'Pulls from origin'
+task :pull do
+  puts "Updating local repo..."
+  system("cd " << Dir.new(File.dirname(__FILE__)).path << " && git pull")
+end
+
+desc 'Calls pull task and then install task'
+task :update => ['pull', 'install'] do
+  puts "Update of vim script complete."
+end
+
+desc 'Uninstall plugin and documentation'
+task :uninstall do
+  vimfiles = if ENV['VIMFILES']
+               ENV['VIMFILES']
+             elsif RUBY_PLATFORM =~ /(win|w)32$/
+               File.expand_path("~/vimfiles")
+             else
+               File.expand_path("~/.vim")
+             end
+  files.each do |file|
+    target_file = File.join(vimfiles, file)
+    FileUtils.rm target_file
+
+    puts "Uninstalled #{target_file}"
+  end
+
+end
+
+task :default => ['update']
diff --git a/autoload/rcomplete.vim b/autoload/rcomplete.vim
index a115111..e3b046e 100644
--- a/autoload/rcomplete.vim
+++ b/autoload/rcomplete.vim
@@ -1,56 +1,101 @@
 " Vim completion script
 " Language:    R
 " Maintainer:  Jakson Alves de Aquino 
-" Last Change: Tue Jan 18, 2011  10:11AM
 "
 
-fun! rcomplete#CompleteR(findstart, base)
-  if a:findstart
-    " locate the start of the word
-    let line = getline('.')
-    let start = col('.') - 1
-    while start > 0 && (line[start - 1] =~ '\a' || line[start - 1] =~ '\.' || line[start - 1] =~ '\$' || line[start - 1] =~ '\d')
-      let start -= 1
+" Tell R to create a list of objects file listing all currently available
+" objects in its environment. The file is necessary for omni completion.
+function BuildROmniList(pattern)
+    if string(g:SendCmdToR) == "function('SendCmdToR_fake')"
+        return
+    endif
+
+    let omnilistcmd = 'vimcom:::vim.bol("' . g:rplugin_tmpdir . "/GlobalEnvList_" . $VIMINSTANCEID . '"'
+    if g:vimrplugin_allnames == 1
+        let omnilistcmd = omnilistcmd . ', allnames = TRUE'
+    endif
+    let omnilistcmd = omnilistcmd . ', pattern = "' . a:pattern . '")'
+
+    call delete(g:rplugin_tmpdir . "/vimbol_finished")
+    call delete(g:rplugin_tmpdir . "/eval_reply")
+    call SendToVimCom("\x08" . $VIMINSTANCEID . omnilistcmd)
+    if g:rplugin_vimcomport == 0
+        sleep 500m
+        return
+    endif
+    let g:rplugin_lastev = ReadEvalReply()
+    if g:rplugin_lastev == "R is busy." || g:rplugin_lastev == "No reply"
+        call RWarningMsg(g:rplugin_lastev)
+        sleep 800m
+        return
+    endif
+    sleep 20m
+    let ii = 0
+    while !filereadable(g:rplugin_tmpdir . "/vimbol_finished") && ii < 5
+        let ii += 1
+        sleep
     endwhile
-    return start
-  else
-    if b:needsnewomnilist == 1
-      call BuildROmniList("GlobalEnv", "none")
+    echon "\r               "
+    if ii == 5
+        call RWarningMsg("No longer waiting...")
+        return
     endif
-    let res = []
-    if strlen(a:base) == 0
-      return res
+
+    let g:rplugin_globalenvlines = readfile(g:rplugin_tmpdir . "/GlobalEnvList_" . $VIMINSTANCEID)
+endfunction
+
+fun! rcomplete#CompleteR(findstart, base)
+    if (&filetype == "rnoweb" || &filetype == "rmd" || &filetype == "rrst" || &filetype == "rhelp") && b:IsInRCode(0) == 0 && b:rplugin_nonr_omnifunc != ""
+        let Ofun = function(b:rplugin_nonr_omnifunc)
+        let thebegin = Ofun(a:findstart, a:base)
+        return thebegin
     endif
-    let flines = g:rplugin_liblist + g:rplugin_globalenvlines
-    " The char '$' at the end of 'a:base' is treated as end of line, and
-    " the pattern is never found in 'line'.
-    let newbase = '^' . substitute(a:base, "\\$$", "", "")
-    for line in flines
-      if line =~ newbase
-        " Skip cols of data frames unless the user is really looking for them.
-        if a:base !~ '\$' && line =~ '\$'
-          continue
+    if a:findstart
+        let line = getline('.')
+        let start = col('.') - 1
+        while start > 0 && (line[start - 1] =~ '\w' || line[start - 1] =~ '\.' || line[start - 1] =~ '\$' || line[start - 1] =~ '@')
+            let start -= 1
+        endwhile
+        return start
+    else
+        call BuildROmniList(a:base)
+        let resp = []
+        if strlen(a:base) == 0
+            return resp
         endif
-	let tmp1 = split(line, ';')
-	if len(tmp1) == 5
-	  let info = tmp1[4]
-	else
-	  let tlen = len(tmp1)
-	  let info = tmp1[4]
-	  let i = 5
-	  while i < tlen
-	    let info = info . ';' . tmp1[i]
-	    let i += 1
-	  endwhile
-	endif
-	let info = substitute(info, "\t", "\n", "g")
-	let tmp2 = {'word': tmp1[0], 'menu': tmp1[1] . ' ' . tmp1[3], 'info': info}
-	call add(res, tmp2)
-      endif
-    endfor
-    return res
-  endif
-endfun
 
-set completefunc=CompleteR
+        if len(g:rplugin_omni_lines) == 0
+            call add(resp, {'word': a:base, 'menu': " [ List is empty. Did you load vimcom package? ]"})
+        endif
+
+        let flines = g:rplugin_omni_lines + g:rplugin_globalenvlines
+        " The char '$' at the end of 'a:base' is treated as end of line, and
+        " the pattern is never found in 'line'.
+        let newbase = '^' . substitute(a:base, "\\$$", "", "")
+        for line in flines
+            if line =~ newbase
+                " Skip cols of data frames unless the user is really looking for them.
+                if a:base !~ '\$' && line =~ '\$'
+                    continue
+                endif
+                " Skip slots of S4 objects unless the user is really looking for them.
+                if a:base !~ '@' && line =~ '@'
+                    continue
+                endif
+                let tmp1 = split(line, "\x06", 1)
+                if g:vimrplugin_show_args
+                    let info = tmp1[4]
+                    let info = substitute(info, "\t", ", ", "g")
+                    let info = substitute(info, "\x07", " = ", "g")
+                    let tmp2 = {'word': tmp1[0], 'menu': tmp1[1] . ' ' . tmp1[3], 'info': info}
+                else
+                    let tmp2 = {'word': tmp1[0], 'menu': tmp1[1] . ' ' . tmp1[3]}
+                endif
+                call add(resp, tmp2)
+            endif
+        endfor
+
+        return resp
+    endif
+endfun
 
diff --git a/bitmaps/RClear.bmp b/bitmaps/RClear.bmp
deleted file mode 100644
index 523bb7b..0000000
Binary files a/bitmaps/RClear.bmp and /dev/null differ
diff --git a/bitmaps/RClear.png b/bitmaps/RClear.png
deleted file mode 100644
index 34c6d2e..0000000
Binary files a/bitmaps/RClear.png and /dev/null differ
diff --git a/bitmaps/RClearAll.bmp b/bitmaps/RClearAll.bmp
deleted file mode 100644
index b276fb2..0000000
Binary files a/bitmaps/RClearAll.bmp and /dev/null differ
diff --git a/bitmaps/RClearAll.png b/bitmaps/RClearAll.png
deleted file mode 100644
index c5b2418..0000000
Binary files a/bitmaps/RClearAll.png and /dev/null differ
diff --git a/bitmaps/RClose.bmp b/bitmaps/RClose.bmp
deleted file mode 100644
index 882a66e..0000000
Binary files a/bitmaps/RClose.bmp and /dev/null differ
diff --git a/bitmaps/RClose.png b/bitmaps/RClose.png
deleted file mode 100644
index 9701406..0000000
Binary files a/bitmaps/RClose.png and /dev/null differ
diff --git a/bitmaps/RListSpace.bmp b/bitmaps/RListSpace.bmp
deleted file mode 100644
index 839f83a..0000000
Binary files a/bitmaps/RListSpace.bmp and /dev/null differ
diff --git a/bitmaps/RListSpace.png b/bitmaps/RListSpace.png
deleted file mode 100644
index 51c7da8..0000000
Binary files a/bitmaps/RListSpace.png and /dev/null differ
diff --git a/bitmaps/RSendBlock.bmp b/bitmaps/RSendBlock.bmp
deleted file mode 100644
index c45bc47..0000000
Binary files a/bitmaps/RSendBlock.bmp and /dev/null differ
diff --git a/bitmaps/RSendBlock.png b/bitmaps/RSendBlock.png
deleted file mode 100644
index 1ac24c5..0000000
Binary files a/bitmaps/RSendBlock.png and /dev/null differ
diff --git a/bitmaps/RSendFile.bmp b/bitmaps/RSendFile.bmp
deleted file mode 100644
index ca77bcd..0000000
Binary files a/bitmaps/RSendFile.bmp and /dev/null differ
diff --git a/bitmaps/RSendFile.png b/bitmaps/RSendFile.png
deleted file mode 100644
index 70508ca..0000000
Binary files a/bitmaps/RSendFile.png and /dev/null differ
diff --git a/bitmaps/RSendFunction.bmp b/bitmaps/RSendFunction.bmp
deleted file mode 100644
index 33738c2..0000000
Binary files a/bitmaps/RSendFunction.bmp and /dev/null differ
diff --git a/bitmaps/RSendFunction.png b/bitmaps/RSendFunction.png
deleted file mode 100644
index 9900acb..0000000
Binary files a/bitmaps/RSendFunction.png and /dev/null differ
diff --git a/bitmaps/RSendLine.bmp b/bitmaps/RSendLine.bmp
deleted file mode 100644
index 6832ac4..0000000
Binary files a/bitmaps/RSendLine.bmp and /dev/null differ
diff --git a/bitmaps/RSendLine.png b/bitmaps/RSendLine.png
deleted file mode 100644
index bb387b1..0000000
Binary files a/bitmaps/RSendLine.png and /dev/null differ
diff --git a/bitmaps/RSendParagraph.bmp b/bitmaps/RSendParagraph.bmp
deleted file mode 100644
index 5813b51..0000000
Binary files a/bitmaps/RSendParagraph.bmp and /dev/null differ
diff --git a/bitmaps/RSendParagraph.png b/bitmaps/RSendParagraph.png
deleted file mode 100644
index 1c1ddf0..0000000
Binary files a/bitmaps/RSendParagraph.png and /dev/null differ
diff --git a/bitmaps/RSendSelection.bmp b/bitmaps/RSendSelection.bmp
deleted file mode 100644
index f20db18..0000000
Binary files a/bitmaps/RSendSelection.bmp and /dev/null differ
diff --git a/bitmaps/RSendSelection.png b/bitmaps/RSendSelection.png
deleted file mode 100644
index fb7db34..0000000
Binary files a/bitmaps/RSendSelection.png and /dev/null differ
diff --git a/bitmaps/RStart.bmp b/bitmaps/RStart.bmp
deleted file mode 100644
index 026c70f..0000000
Binary files a/bitmaps/RStart.bmp and /dev/null differ
diff --git a/bitmaps/RStart.png b/bitmaps/RStart.png
deleted file mode 100644
index 524aaab..0000000
Binary files a/bitmaps/RStart.png and /dev/null differ
diff --git a/bitmaps/ricon.png b/bitmaps/ricon.png
deleted file mode 100644
index a91dda5..0000000
Binary files a/bitmaps/ricon.png and /dev/null differ
diff --git a/bitmaps/ricon.xbm b/bitmaps/ricon.xbm
deleted file mode 100644
index 7925af0..0000000
--- a/bitmaps/ricon.xbm
+++ /dev/null
@@ -1,10 +0,0 @@
-#define ricon_width 24
-#define ricon_height 24
-static unsigned char ricon_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f, 0x00, 0xf8, 0xff, 0x01,
- 0xf8, 0xff, 0x03, 0xf8, 0xff, 0x07, 0xf8, 0xe0, 0x07, 0xf8, 0xc0, 0x07,
- 0xf8, 0xc0, 0x07, 0xf8, 0xc0, 0x07, 0xf8, 0xe0, 0x03, 0xf8, 0xff, 0x03,
- 0xf8, 0xff, 0x00, 0xf8, 0xff, 0x00, 0xf8, 0xff, 0x01, 0xf8, 0xf0, 0x03,
- 0xf8, 0xe0, 0x07, 0xf8, 0xe0, 0x07, 0xf8, 0xc0, 0x0f, 0xf8, 0x80, 0x0f,
- 0xf8, 0x80, 0x1f, 0xf8, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
- } ;
diff --git a/doc/r-plugin.txt b/doc/r-plugin.txt
index c067fb9..0fdf920 100644
--- a/doc/r-plugin.txt
+++ b/doc/r-plugin.txt
@@ -1,243 +1,328 @@
-*r-plugin.txt*                                                      *vim-r-plugin*
+*r-plugin.txt*                                                  *vim-r-plugin*
 				 Vim-R-plugin~
 			     Plugin to work with R~
 
 Authors: Jakson A. Aquino   
-         Jose Claudio Faria
+         Jose Claudio Faria 
 
-Version: 110614
-For Vim version 7.3
+Version: 1.3.1
+For Vim version >= 7.4.1579
 
  1. Overview                                    |r-plugin-overview|
  2. Main features                               |r-plugin-features|
  3. Installation                                |r-plugin-installation|
  4. Use                                         |r-plugin-use|
- 5. How the plugin works                        |r-plugin-functioning|
- 6. Known bugs and workarounds                  |r-plugin-known-bugs|
- 7. Options                                     |r-plugin-options|
- 8. Custom key bindings                         |r-plugin-key-bindings|
- 9. Files                                       |r-plugin-files|
-10. FAQ and tips                                |r-plugin-tips|
-11. News                                        |r-plugin-news|
+ 5. Known bugs and workarounds                  |r-plugin-known-bugs|
+ 6. Options                                     |r-plugin-options|
+ 7. Custom key bindings                         |r-plugin-key-bindings|
+ 8. License and files                           |r-plugin-files|
+ 9. FAQ and tips                                |r-plugin-tips|
+10. News                                        |r-plugin-news|
 
 
 ==============================================================================
-1. Overview~
 							   *r-plugin-overview*
+1. Overview~
 
 This plugin improves Vim's support for editing R code and makes it possible to
-integrate Vim with R.
+integrate Vim with R. On Unix (Linux, Mac OS X, etc), the combination Neovim +
+Nvim-R + nvimcom works better. Please, see:
 
-It uses some ideas and code from Johannes Ranke's (vim-r-plugin), Eric Van
-Dewoestine's (screen plugin), Vincent Nijs (R.vim for Mac OS X) and some ideas
-from the Tinn-R (Windows only) project.
+   https://github.com/jalvesaq/Nvim-R
 
-The latest version of this plugin is available at:
+This plugin uses some ideas and code from Johannes Ranke's (vim-r-plugin),
+Eric Van Dewoestine's (screen.vim plugin), Vincent Nijs (R.vim for Mac OS X)
+and some ideas from the Tinn-R (Windows only) project.
+
+The latest stable version of this plugin is available at:
 
     http://www.vim.org/scripts/script.php?script_id=2628
 
-Feedback is welcomed. Please submit bug reports and feature requests to the
-developers, we are very interested in what you like and what you would like to
-see in future releases. Do not like a feature? Tell us and we may add an
-option to disable it. Cryptic error message are bugs... Please report them.
+Feedback is welcomed. Please submit bug reports to the developers. Do not like
+a feature? Tell us and we may add an option to disable it. If you have any
+comments or questions, please post them at:
+
+    https://groups.google.com/forum/#!forum/vim-r-plugin
+
 The plugin should emit useful warnings if you do things it was not programmed
-to deal with.
+to deal with. Cryptic error message are bugs... Please report them at:
+
+    https://github.com/jcfaria/Vim-R-plugin/issues
+
+We do not plan to take the initiative of writing code for new features, but
+patches and git pull requests are welcome. If you want a feature that only few
+people might be interested in, you can write a script to be sourced by the
+Vim-R-plugin (see |vimrplugin_source|).
 
 
 ==============================================================================
-2. Main features~
 							   *r-plugin-features*
+2. Main features~
 
-  * Syntax highlighting for R syntax, including:
+  * Syntax highlighting for R code, including:
       - Special characters in strings.
-      - Functions of all installed packages (must be updated manually).
+      - Functions of loaded packages.
       - Special highlighting for R output (.Rout files).
       - Spell check only strings and comments.
       - Fold code when foldmethod=syntax.
-  * Syntax highlighting for RHelp syntax.
-  * Smart indentation for R, RHelp and Rnoweb syntax.
+  * Syntax highlighting for RHelp, RMarkdown and RreStructuredText.
+  * Smart indentation for R, RHelp, Rnoweb, RMarkdown and RreStructuredText.
   * Integrated communication with R:
       - Start/Close R.
       - Send lines, selection, paragraphs, functions, blocks, entire file.
       - Send commands with the object under cursor as argument: help, args,
-	plot, print, str, summary, example, names.
-      - Send to R the Sweave and pdflatex commands.
-      - Run R inside a Vim's buffer.
-  * Omni completion (auto-completion) for R objects (.GlobalEnv and installed
-    packages. The list of installed packages must be updated manually.
+        plot, print, str, summary, example, names.
+      - Send to R the Sweave, knit and pdflatex commands.
+  * Omni completion (auto-completion) for R objects (.GlobalEnv and loaded
+    packages).
+  * Auto-completion of function arguments.
+  * Auto-completion of knitr chunk options.
   * Ability to see R's documentation in a Vim's buffer:
       - Automatic calculation of the best layout of the R documentation buffer
-	(split the window either horizontally or vertically according to the
-	available room).
-      - Automatic formating of the text to fit the panel width.
+        (split the window either horizontally or vertically according to the
+        available room).
+      - Automatic formatting of the text to fit the panel width.
       - Send code and commands to R (useful to run examples).
       - Jump to another R documentation.
       - Syntax highlighting of R documentation.
-  * Object Browser (.GlobalEnv and loaded packages; must be updated manually):
+  * Object Browser (.GlobalEnv and loaded packages):
       - Send commands with the object under cursor as argument.
-      - Call R's help() with the object under cursor as argument.
+      - Call R's `help()` with the object under cursor as argument.
       - Syntax highlighting of the Object Browser.
+  * SyncTeX support.
   * Most of the plugin's behavior is customizable.
 
 
 ==============================================================================
-3. Installation~
 						       *r-plugin-installation*
+3. Installation~
 
-3.1. General instructions I~
+The installation instructions are split in six sections:
 
-You need to activate plugins and indentation according to 'filetype'. You
-should have at least the following options in your |vimrc|:
->
-   set nocompatible
-   syntax enable
-   filetype plugin on
-   filetype indent on
-<
-Make a backup of your ~/.vim directory because existing files will be
-replaced. Please, look at |r-plugin-files| to see the list of files.
+   3.1. Preliminary system setup on Windows
+   3.2. Preliminary system setup on Unix
+   3.3. Plugin installation
+   3.4. Troubleshooting
+   3.5. Optional steps
 
-3.2. Operating system specific instructions~
 
-3.2.1. Unix (Linux, OS X, etc.)~
+------------------------------------------------------------------------------
+3.1. Preliminary system setup on Windows~
 
-In addition to having R installed in your system, this plugin requires users
-to install either:
+Before installing the plugin, you should install several external
+dependencies:
 
-   Conque Shell: http://www.vim.org/scripts/script.php?script_id=2771
-   or screen: http://www.gnu.org/software/screen
+    * R's version must be >= 3.0.0: http://www.r-project.org/
 
-   Note: The screen application is already packaged for most GNU/Linux
-   distributions and other Unix variants. In fact, screen is installed by
-   default on many Linux distributions.  Unfortunately, installation
-   instructions for these dependencies vary widely and are beyond the scope of
-   this documentation.
+    * vimcom = 1.3-1: https://github.com/jalvesaq/VimCom/releases
 
-Uncompress the archive:
->
-   unzip vim-r-plugin-*.zip -d ~/.vim
-<
-Start Vim and build the tags file for this document (and others that eventually
-are in at the same directory):
+      Note: If you cannot build vimcom yourself, you will want to
+      download and install the zip file.
+
+    * Vim's version must be >= 7.4.1579: http://www.vim.org/download.php
+      To get the latest version, look for Vim "without Cream".
+
+    * Only if you write Rnoweb code:
+
+       * Sumatra PDF viewer >= 3.0.
+
+       * MikTeX or other LaTeX distribution.
+
+       * Perl (required to run `latexmk`).
+
+
+------------------------------------------------------------------------------
+3.2. Preliminary system setup on Unix (Linux, Mac OS X, etc)~
+
+Before installing the plugin, you should install its dependencies:
+
+   Depends:~
+
+   Vim, GVim >= 7.4.1579: http://www.vim.org/download.php
+	                  You might have to look for "Vim without Cream".
+
+      Note: The Vim-R-plugin requires Vim compiled with |+channel|, |+job| and
+	    |+conceal| features. In Normal mode, do `:version` to check if
+	    your Vim has these features.
+
+   R >= 3.0.0: http://www.r-project.org/
+
+   vimcom = 1.3-1: https://github.com/jalvesaq/VimCom/releases
+
+   Tmux >= 1.8:   http://tmux.sourceforge.net
+                  Tmux is necessary to send commands from Vim to R Console.
+
+   wmctrl:     http://tomas.styblo.name/wmctrl/
+               Required for better SyncTeX support under X Server.
+
+
+   Suggests:~
+
+   colorout:      https://github.com/jalvesaq/colorout/releases
+                  Colorizes the R output.
+
+   setwidth:      An R package that can be installed with the command
+                  `install.packages("setwidth")`.
+                  The library setwidth adjusts the value of `options("width")`
+                  whenever the terminal is resized.
+
+   ncurses-term:  http://invisible-island.net/ncurses
+		  Might be necessary if you want support for 256 colors at the
+		  terminal emulator.
+
+   latexmk:       Automate the compilation of LaTeX documents.
+                  See examples in |vimrplugin_latexcmd|.
+
+   Note: Vim, R, Tmux, ncurses-term and latexmk are already packaged for most
+   GNU/Linux distributions and other Unix variants. Unfortunately their
+   installation instructions vary widely and are beyond the scope of this
+   documentation.
+
+Put the following lines in your `~/.Rprofile`:
 >
-  :helptags ~/.vim/doc
+   if(interactive()){
+       library(colorout)
+       library(setwidth)
+   }
 <
-You may be interested in integrating the Vim-R-plugin with either screen.vim
-plugin or Conque Shell plugin. See |vimrplugin_screenplugin| and
-|vimrplugin_conqueplugin| for details.
-
+Before proceeding, you have to start a new shell session to have the alias
+enabled.
 
-3.2.2. Windows~
+If you start Vim in a terminal emulator, inside of a Tmux session, the plugin
+will split the Tmux window in two and start R in the other pane. This is the
+recommended way of running the plugin on Linux (read |r-plugin-tmux| for
+details). If you either use GVim or Vim not inside a Tmux session the plugin
+will start R in a external terminal emulator. This is useful if you have two
+monitors.
 
-In addition to having R installed in your system, this plugin requires users
-to install several external dependencies:
 
-    * Vim's version must be >= 7.3
+------------------------------------------------------------------------------
+3.3. Plugin installation (instructions for all systems)~
 
-    * Python: http://www.python.org/download/
-      Note: Be careful to download the correct Python version because Vim
-      needs a specific version of Python DLL. For example, the official Vim
-      7.3 for Windows needs either Python 2.7 or 3.1. Note: the official Vim
-      is 32 bit and, thus, Python must be 32 bit too.
+You need to activate plugins and indentation according to 'filetype'. You
+should have at least the following options at the top or near the very top
+of your |vimrc| (but below `set` `runtimepath`, if you have set it):
+>
+   set nocompatible
+   syntax enable
+   filetype plugin on
+   filetype indent on
+<
+Download the latest version of the plugin from:
 
-    * pywin32: http://sourceforge.net/projects/pywin32/
-      Note: The default download may not match the Python version Vim was
-      linked with. You have to "View all files" on the download page to find
-      the file that matches the version of Python that you installed.
+    http://www.vim.org/scripts/script.php?script_id=2628
 
-Create your |vimfiles| directory if you do not have it yet. Its path will be
-similar to one of the following:
+If you either are on Windows or prefer to use a graphical interface, start the
+file manager, find the file `Vim-R-plugin.vmb` and open it with GVim or
+MacVim. Otherwise, start a terminal emulator, go to the directory where you
+have downloaded the plugin and type:
+>
+   vim Vim-R-plugin.vmb
+<
+Then, in Vim, type:
 >
-  C:\Documents and Settings\yourlogin\vimfiles
-  C:\Users\yourlogin\vimfiles
+   :so %
+<
+Press  to start the installation and press the  bar as many
+times as necessary to finish the installation. You should, then, quit Vim.
+
+Note: If you need to install the plugin in a non default directory, do
+`:UseVimball` `[path]`. In this case, the configuration of Vim's 'runtimepath'
+must be done before the command "filetype on" in both the system and the user
+|vimrc| files, otherwise, some file types might not be correctly recognized.
 
-Uncompress the archive. Right click on the plugin's zip file and choose
-"Extract all". Then choose ~/vimfiles as the destination directory.
+The plugin is installed and will be activated next time that you start to edit
+an R script.
 
-Start Vim and build the tags file for this document (and others that eventually
-are in the same directory):
+You may want to improve the configuration of your |vimrc| for a better use of
+the plugin. Please, see |r-plugin-vimrc-setup|.
+
+If you want to uninstall the plugin, do
 >
-  :helptags ~\vimfiles\doc
+   :RmVimball Vim-R-plugin
 <
-Start R and try to send some lines from GVim to R Console. You may have to
-adjust the value of |vimrplugin_sleeptime|.
 
+------------------------------------------------------------------------------
+3.4. Troubleshooting (if the plugin doesn't work)~
 
-3.3. Troubleshooting (if the plugin doesn't work)~
+Note: The  is '\' by default.
 
 The plugin is a |file-type| plugin. It will be active only if you are editing
-a .R or .Rnw file. The menu items and tool bar buttons will not be visible and
-the key bindings will not be active while editing either unnamed files or
-files with name extensions other than .R or .Rnw. If the plugin is active,
-pressing rf should start R (the  is '\' by default).
-
-Look at the ~/.vim (Linux, Unix, Os X) or ~/vimfiles (Windows) directory. Is
-there a subdirectory named "r-plugin"? If not, then you unpacked the plugin in
-the wrong place.
+a .R, .Rnw, .Rd, Rmd, or Rrst file. The menu items will not be visible and the
+key bindings will not be active while editing either unnamed files or files
+with name extensions other than the mentioned above. If the plugin is active,
+pressing rf should start R.
 
 Did you see warning messages but they disappeared before you have had time to
 read them? Type the command |:messages| in Normal mode to see them again.
 
+On Windows, if R does not start and you get an error message instead, you may
+want to set the path to your Rgui.exe in your |vimrc|, for example (please
+adapt to your installation):
+>
+   let vimrplugin_r_path = 'C:\\Program Files\\R\\R-3.2.2\\bin\\i386'
+<
 Are you using Debian, Ubuntu or other Debian based Linux distribution? If yes,
 you may prefer to install the Debian package available at:
 
-   https://sites.google.com/site/jalvesaq/vimrplugin
+   https://drive.google.com/open?id=0ByMBQcSs9G7KYkotRGpRYjlLVDg
 
+Did you see the message "VimCom port not found"? This means that R is not
+running, the vimcom package is not installed (or is installed but is not
+loaded), or R was not started by Vim.
 
-3.4. General instructions II (optional steps)~
+If R takes more than 5 seconds to load, you should adjust the value of
+|vimrplugin_vimcom_wait|.
 
-update list of objects~
 
-Start R and update the list of objects for omni completion and syntax
-highlight (see |:RUpdateObjList| for details).
+------------------------------------------------------------------------------
+3.5. Optional steps~
 
-
-customize the plugin~
+3.5.1 Customize the plugin~
 
 Please, read the section |r-plugin-options|. Emacs/ESS users should read the
-section 10.8 of this document (Indenting setup).
-
+section |r-plugin-indenting| of this document.
 
-hide unused buttons~
 
-Edit Vim's toolbar and remove the buttons that you never use. The plugin adds
-some buttons to the toolbar, but you may not see them because gvim has too
-many buttons by default. Please see the page below to know how to hide buttons
-on the toolbar:
-
-   http://vim.wikia.com/wiki/Hide_toolbar_or_menus_to_see_more_text
-
-
-install additional plugins~
+------------------------------------------------------------------------------
+3.5.2 Install additional plugins~
 
 You may be interested in installing additional general plugins to get
-functionality not provided by this file type plugin. ShowMarks and snipMate
-are particularly interesting. Please read |r-plugin-tips| for details.
+functionality not provided by this file type plugin. Particularly interesting
+are vim-signature, csv.vim and snipMate. Please read |r-plugin-tips| for
+details. If you edit Rnoweb files, you may want to try LaTeX-Box for
+omnicompletion of LaTeX code (see |r-plugin-latex-box| for details).
 
 
 ==============================================================================
-4. Use~
 								*r-plugin-use*
+4. Use~
 
 4.1. Key bindings~
 
-To use the plugin, open a .R or .Rnw or .Rd file with Vim and type \rf
-(replace \ with the key used as ). Then, you will be able to use
-the plugin key bindings to send commands to R.
+Note: The  is '\' by default.
+
+Note: It is recommended the use of different keys for  and
+ to avoid clashes between filetype plugins and general plugins
+key binds. See |filetype-plugins|, |maplocalleader| and |r-plugin-localleader|.
 
-This plugin has many key bindings, which correspond with menu entries and, in
-some cases, toolbar buttons. In the list below, the backslash represents the
- (see |maplocalleader|). Not all menu items and key bindings are
-enabled in all filetypes supported by the plugin (r, rnoweb, rhelp):
+To use the plugin, open a .R, .Rnw, .Rd, .Rmd or .Rrst file with Vim and type
+rf. Then, you will be able to use the plugin key bindings to send
+commands to R.
 
+This plugin has many key bindings, which correspond with menu entries. In the
+list below, the backslash represents the . Not all menu items and
+key bindings are enabled in all filetypes supported by the plugin (r, rnoweb,
+rhelp, rrst, rmd).
+
+Menu entry                                Default shortcut~
 Start/Close
-  . Start R (default)                                    \rf
-  . Start R --vanilla                                    \rv
-  . Start R (custom)                                     \rc
-  ----------------------------------------------------------
-  . Close R (no save)                                    \rq
-  . Close R (save workspace)                             \rw
--------------------------------------------------------------
+  . Start R (default)                                  \rf
+  . Start R (custom)                                   \rc
+  --------------------------------------------------------
+  . Close R (no save)                                  \rq
+  . Stop R                                          :RStop
+-----------------------------------------------------------
 
 Send
   . File                                               \aa
@@ -249,6 +334,12 @@ Send
   . Block (cur, down)                                  \bd
   . Block (cur, echo and down)                         \ba
   --------------------------------------------------------
+  . Chunk (cur)                                        \cc
+  . Chunk (cur, echo)                                  \ce
+  . Chunk (cur, down)                                  \cd
+  . Chunk (cur, echo and down)                         \ca
+  . Chunk (from first to here)                         \ch
+  --------------------------------------------------------
   . Function (cur)                                     \ff
   . Function (cur, echo)                               \fe
   . Function (cur and down)                            \fd
@@ -258,6 +349,7 @@ Send
   . Selection (echo)                                   \se
   . Selection (and down)                               \sd
   . Selection (echo and down)                          \sa
+  . Selection (evaluate and insert output in new tab)  \so
   --------------------------------------------------------
   . Paragraph                                          \pp
   . Paragraph (echo)                                   \pe
@@ -267,9 +359,12 @@ Send
   . Line                                                \l
   . Line (and down)                                     \d
   . Line (and new one)                                  \q
+  . Left part of line (cur)                       \r
+  . Right part of line (cur)                     \r
+  . Line (evaluate and insert the output as comment)    \o
 -----------------------------------------------------------
 
-Control
+Command
   . List space                                         \rl
   . Clear console                                      \rr
   . Clear all                                          \rm
@@ -277,6 +372,7 @@ Control
   . Print (cur)                                        \rp
   . Names (cur)                                        \rn
   . Structure (cur)                                    \rt
+  . View data.frame (cur)                              \rv
   --------------------------------------------------------
   . Arguments (cur)                                    \ra
   . Example (cur)                                      \re
@@ -290,56 +386,100 @@ Control
   --------------------------------------------------------
   . Sweave (cur file)                                  \sw
   . Sweave and PDF (cur file)                          \sp
-  . Sweave, BibTeX and PDF (cur file)                  \sb
-----------------------------------------------------------
+  . Sweave, BibTeX and PDF (cur file) (Linux/Unix)     \sb
+  --------------------------------------------------------
+  . Knit (cur file)                                    \kn
+  . Knit and PDF (cur file)                            \kp
+  . Knit, BibTeX and PDF (cur file) (Linux/Unix)       \kb
+  . Knit and Beamer PDF (cur file) (only .Rmd)         \kl
+  . Knit and Open Document (cur file) (only .Rmd)      \ko
+  . Knit and Word Document (cur file) (only .Rmd)      \kw
+  . Knit and HTML (cur file, verbose) (only .Rmd)      \kh
+  . Spin (cur file) (only .R)                          \ks
+  --------------------------------------------------------
+  . Open PDF (cur file)                                \op
+  . Search forward (SyncTeX)                           \gp
+  . Go to LaTeX (SyncTeX)                              \gt
+  --------------------------------------------------------
+  . Build tags file (cur dir)                  :RBuildTags
+-----------------------------------------------------------
 
 Edit
+  . Insert "<-"                                          _
+  . Complete object name                              ^X^O
+  . Complete function arguments                       ^X^A
+  --------------------------------------------------------
   . Indent (line)                                       ==
   . Indent (selected lines)                              =
   . Indent (whole buffer)                             gg=G
-  . Comment/Uncomment (line, sel)                      \cc
+  --------------------------------------------------------
+  . Toggle comment (line, sel)                         \xx
+  . Comment (line, sel)                                \xc
+  . Uncomment (line, sel)                              \xu
   . Add/Align right comment (line, sel)                 \;
-  . Go (next R chunk)                                   gn
-  . Go (previous R chunk)                               gN
-  . Build omniList (loaded packages)    :RUpdateObjList
-  . Build omniList (installed packages) :RUpdateObjListAll
-  . Build R tags file                   :RBuildTags
-----------------------------------------------------------
+  --------------------------------------------------------
+  . Go (next R chunk)                                  \gn
+  . Go (previous R chunk)                              \gN
+-----------------------------------------------------------
 
 Object Browser
   . Show/Update                                        \ro
   . Expand (all lists)                                 \r=
   . Collapse (all lists)                               \r-
   . Toggle (cur)                                     Enter
-  --------------------------------------------------------
+-----------------------------------------------------------
 
-Please see |r-plugin-key-bindings| to learn how to customize the key bindings
-without editing the plugin directly. 
+Help (plugin)
+Help (R)                                            :Rhelp
+-----------------------------------------------------------
 
-After the command \ao, Vim will save the current buffer if it has any pending
-changes, run "R CMD BATCH --no-restore --no-save" on the current file and show
+Please see |r-plugin-key-bindings| to learn how to customize the key bindings
+without editing the plugin directly.
+
+The plugin commands that send code to R Console are the most commonly used. If
+the code to be sent to R has a single line it is sent directly to R Console,
+but if it has more than one line (a selection of lines, a block of lines
+between two marks, a paragraph etc) the lines are written to a file and the
+plugin sends to R the command to source the file. To send to R Console the
+line currently under the cursor you should type d. If you want to
+see what lines are being sourced when sending a selection of lines, you can
+use either se or sa instead of ss.
+
+The command o runs in the background the R command `print(line)`,
+where `line` is the line under cursor, and adds the output as commented lines
+to the source code.
+
+If the cursor is over the header of an R chunk with the `child` option (from
+Rnoweb, RMarkdown or RreStructuredText document), and you use one of the
+commands that send a single line of code to R, then the plugin will send to R
+the command to knit the child document.
+
+After the send, sweave and knit commands, Vim will save the current buffer if
+it has any pending changes before performing the tasks. After ao,
+Vim will run "R CMD BATCH --no-restore --no-save" on the current file and show
 the resulting .Rout file in a new tab. Please see |vimrplugin_routnotab| if
-you prefer that the file is open in a new split window.  Note: The command
-\ao, silently writes the current buffer to its file if it was modified and
-deletes the .Rout file if it exists.
+you prefer that the file is open in a new split window. Note: The command
+ao, silently writes the current buffer to its file if it was
+modified and deletes the .Rout file if it exists.
 
 R syntax uses " <- " to assign values to variables which is inconvenient to
 type. In insert mode, typing a single underscore, "_", will write " <- ",
 unless you are typing inside a string. The replacement will always happen if
 syntax highlighting is off (see |:syn-on| and |:syn-off|). If necessary, it is
 possible to insert an actual underscore into your file by typing a second
-underscore.  This behavior is similar to the EMACS ESS mode some users may be
+underscore. This behavior is similar to the EMACS ESS mode some users may be
 familiar with and is enabled by default. You have to change the value of
-|vimrplugin_underscore| to disable underscore replacement.
-
-When you press \rh, the plugin shows the help for the function under the
-cursor. The plugin also checks the class of the object passed as argument to
-the function to try to figure out whether the function is a generic one and
-whether it is more appropriate to show a specific method. The same procedure
-is followed with \rp, that is, while printing an object. For example, if you
-run the code below and, then, press rh and rp over
-the two occurrences of summary, the plugin will show different documentations
-and print different objects in each case:
+|vimrplugin_assign| to disable underscore replacement.
+
+When you press rh, the plugin shows the help for the function
+under the cursor. The plugin also checks the class of the object passed as
+argument to the function to try to figure out whether the function is a
+generic one and whether it is more appropriate to show a specific method. The
+same procedure is followed with rp, that is, while printing an
+object. For example, if you run the code below and, then, press
+rh and rp over the two occurrences of `summary`, the
+plugin will show different help documents and print different function methods
+in each case:
 >
    y <- rnorm(100)
    x <- rnorm(100)
@@ -347,98 +487,196 @@ and print different objects in each case:
    summary(x)
    summary(m)
 <
-
-4.2. Edition of rnoweb files~
-
-In Rnoweb files (.Rnw), when the cursor is over the @ character, which
+If the object under the cursor is a data.frame or a matrix, rv
+will show it in a new tab. If the csv.vim plugin is not installed, the
+Vim-R-plugin will warn you about that (see |r-plugin-df-view|). Specially
+useful commands from the csv.vim plugin are |:CSVHeader|, |:ArrangeColumn| and
+|:CSVHiColumn|. It can be installed from:
+
+   http://www.vim.org/scripts/script.php?script_id=2830
+
+When completing object names (CTRL-X CTRL-O) and function arguments (CTRL-X
+CTRL-A) you have to press CTRL-N to go foward in the list and CTRL-P to go
+backward (see |popupmenu-completion|). Note: if using Vim in a terminal
+emulator, Tmux will capture the CTRL-A command. You have to do CTRL-A twice to
+pass a single CTRL-A to Vim. For rnoweb, rmd and rrst file types, CTRL-X
+CTRL-A can also be used to complete knitr chunk options if the cursor is
+inside the chunk header.
+
+If R is not running or if it is running but is busy the completion will be
+based on information from the packages listed by |vimrplugin_start_libs|
+(provided that the libraries were loaded at least once during a session of
+Vim-R-plugin usage). Otherwise, the pop up menu for completion of function
+arguments will include an additional line with the name of the library where
+the function is (if the function name can be found in more than one library)
+and the function method (if what is being shown are the arguments of a method
+and not of the function itself). For library() and require(), when completing
+the first argument, the popup list shows the names of installed packages, but
+only if R is running.
+
+To get help on an R topic, type in Vim (Normal mode):
+>
+   :Rhelp topic
+<
+The command may be abbreviated to  :Rh  and you can either press  to
+trigger the autocompletion of R objects names or hit CTRL-D to list the
+possible completions (see |cmdline-completion| for details on the various ways
+of getting command-line completion). The list of objects used for
+completion is the same available for omnicompletion (see
+|vimrplugin_start_libs|). You may close the R documentation buffer by
+simply pressing `q`.
+
+You can source all .R files in a directory with the Normal mode command
+:RSourceDir, which accepts an optional argument (the directory to be sourced).
+								    *:Rinsert*
+The command  :Rinsert   inserts one or more lines with the output of the
+R command sent to R. By using this command we can avoid the need of copying
+and pasting the output R from its console to Vim. For example, to insert the
+output of `dput(levels(var))`, where `var` is a factor vector, we could do in
+Vim:
+>
+   :Rinsert dput(levels(var))
+<
+The output inserted by  :Rinsert  is limited to 5012 characters.
+
+The command  :Rformat  calls the function `tidy_source()` of formatR package
+to format either the entire buffer or the selected lines. The value of the
+`width.cutoff` argument is set to the buffer's 'textwidth' if it is not
+outside the range 20-180. Se R help on `tidy_source` for details on how to
+control the function behavior.
+
+
+------------------------------------------------------------------------------
+4.2. Edition of Rnoweb files~
+
+In Rnoweb files (.Rnw), when the cursor is over the `@` character, which
 finishes an R chunk, the sending of all commands to R is suspended and the
 shortcut to send the current line makes the cursor to jump to the next chunk.
-While editing rnoweb files, the following commands are available in Normal
+While editing Rnoweb files, the following commands are available in Normal
 mode:
 
-   gn : go to the next chunk of R code
-   gN : go to the previous chunk of R code
+   [count]gn : go to the next chunk of R code
+   [count]gN : go to the previous chunk of R code
+
+The commands cc, ce, cd and ca send the current chunk of R code
+to R Console. The command ch sends the R code from the first
+chunk up to the current line.
+
+The commands kn builds the .tex file from the Rnoweb one using
+the knitr package and kp compiles the pdf; for Sweave, the
+commands are, respectively sw and sp. On Linux, if
+using Evince, Okular or Zathura, you can jump from the Rnoweb file to the PDF
+with the command gp. To jump from a specific location in the PDF
+to the corresponding line in the Rnoweb, in either Evince or Zathura you
+should press , and in Okular . No configuration is
+required if you use Evince, Gnome-Terminal and the knitr package, and work
+with single file Rnoweb documents. Otherwise, see |r-plugin-SyncTeX| for
+configuration details.
 
 
+------------------------------------------------------------------------------
 4.3. Omni completion and the highlighting of functions~
-							     *:RUpdateObjList*
-							  *:RUpdateObjListAll*
+
 The plugin adds some features to the default syntax highlight of R code. One
-such feature is the highlight of R functions. However, only functions that
-R loads by default are highlighted. To add functions of other libraries, you
-should do the following:
+such feature is the highlight of R functions. However, functions are
+highlighted only if their libraries are loaded by R (but see
+|vimrplugin_start_libs|).
 
-  1. Start R from within Vim.
-  2. Use R's library() to load the libraries whose functions you want
-     highlighted.
-  3. Run the following command in Vim's Normal mode:
-     :RUpdateObjList
+Note: If you have too many loaded packages Vim may be unable to load the list
+of functions for syntax highlight.
 
-The command :RUpdateObjList in addition to creating a list of function names
-to be highlighted also creates a file containing a list of objects for omni
-completion (|compl-omni|) including all objects currently in R's workspace,
-with the exception of the .GlobalEnv objects. These two lists are stored
-permanently in the ~/.vim/r-plugin directory and one of them, "omniList", is
-also used by the Object Browser to show the contents of libraries.
+Vim can automatically complete the names of R objects when CTRL-X CTRL-O is
+pressed in insert mode (see |omni-completion| for details). Omni completion
+shows in a pop up menu the name of the object, its class and its environment
+(most frequently, its package name). If the object is a function, the plugin
+can also show the function arguments in a separate preview window (this
+feature is disabled by default: see |vimrplugin_show_args|).
 
-The command  :RUpdateObjList  waits 120 seconds to R finish building the list.
-If this time is not enough to your system, please, set a different value of
-|vimrplugin_buildwait|.
+If a data.frame is found, while building the list of objects, the columns in
+the data.frame are added to the list. When you try to use omni completion to
+complete the name of a data.frame, the columns are not shown. But when the
+data.frame name is already complete, and you have inserted the '$' symbol,
+omni completion will show the column names.
 
-You should run  :RUpdateObjList  whenever you upgrade R since some functions
-are removed and new ones are added at each new R version.
+Only the names of objects in .GlobalEnv and in loaded libraries are completed.
+If either R is not running, only objects of libraries listed in
+|vimrplugin_start_libs| will have their names completed. When you load a new
+library in R, only the current buffer has the highlighting of function names
+immediately updated. If you have other buffers open, they will be updated when
+you enter them.
 
-The command  :RUpdateObjListAll  will tell R to load all installed packages
-and, then, build the "omniList".
+Vim uses one file to store the names of .GlobalEnv objects and a list of files
+for all other objects. The .GlobalEnv list is stored in the `$VIMRPLUGIN_TMPDIR`
+directory and is deleted when you quits Vim. The other files are stored in the
+`$VIMR_COMPLDIR` directory and remain available until you manually delete
+them.
 
 
+------------------------------------------------------------------------------
 4.4. The Object Browser~
 
-You have to do \ro to either start or updated the Object Browser. The Object
+You have to use ro to start the Object Browser. The Object
 Browser has two views: .GlobalEnv and Libraries. If you either press 
-or double click on the first line of the Object Browser it will toggle the
-view between the objects in .GlobalEnv and the currently loaded libraries (but
-only libraries loaded when |:RUpdateObjList| was run will be shown).
-
-In the .GlobalEnv view, if an object has the attribute "label", it will be
-displayed in the Object Browser. The options |vimrplugin_open_df| and
-|vimrplugin_open_list| control whether the elements of data.frames and lists
-are shown. In the Object Browser window, while in Normal mode, you can either
-press  or double click (GVim only) over a data.frame or list to
+or double click (GVim or Vim with 'mouse' set to "a") on the first line of the
+Object Browser, you will toggle the view between the objects in .GlobalEnv and
+the currently loaded libraries. The Object Browser requires the |+conceal|
+feature to correctly align list items.
+
+In the .GlobalEnv view, if an object has the attribute "label", it will also
+be displayed. In the Object Browser window, while in Normal mode, you can
+either press  or double click (GVim only) over a data.frame or list to
 show/hide its elements (not if viewing the content of loaded libraries). If
-you are running (G)Vim in an UTF-8 locale, unicode line drawing characters
-will be used to draw lines in the Object Browser. This is the case of most
-Linux distributions. If you are using Windows, ascii characters will be used,
-unless you have set the 'encoding' to utf-8 in your |vimrc| (on Windows, some
-fonts that support Unicode are "Courier_New", "Lucida_Console", "Consolas",
-and "Lucida_Sans_Typewriter").
-
-In the Libraries view, you can either double click or press  over a
-library to see its objects. The Object Browser goes down only one level in
-lists. Thus, if a list has a sublist among its elements, the sublist elements
-will not be shown. In the Object Browser, the libraries have the color defined
-by the PreProc highlighting group, and the other objects have their colors
-defined by the return value of some R functions. Each line in the table below
-shows a highlighting group and the corresponding R function (if any) used to
-classify the objects:
-
-	 PreProc	libraries
-	 Number		is.numeric()
-	 String		is.character()
-	 Special	is.factor()
-	 Boolean	is.logical()
-	 Type		is.list()
-	 Function	is.function()
+you are running R in an environment where the string UTF-8 is part of either
+LC_MESSAGES or LC_ALL variables, unicode line drawing characters will be used
+to draw lines in the Object Browser. This is the case of most Linux
+distributions.
 
+In the Libraries view, you can either double click or press  on a
+library name to see its objects. In the Object Browser, the libraries have the
+color defined by the PreProc highlighting group. The other objects have
+their colors defined by the return value of some R functions. Each line in the
+table below shows a highlighting group and the corresponding type of R object:
 
+	 PreProc	libraries
+	 Number		numeric
+	 String		character
+	 Special	factor
+	 Boolean	logical
+	 Type		list
+	 Function	function
+	 Statement	s4
+	 Comment	promise (lazy load object)
+
+One limitation of the Object Browser is that objects made available by the
+command `data()` are only links to the actual objects (promises of lazily
+loading the object when needed) and their real classes are not recognized in
+the GlobalEnv view. The same problem happens when the `knitr` option
+`cache.lazy=TRUE`. If you press  over the name of the object in the
+Object Browser, it will be actually loaded by the command (ran in the
+background):
+>
+   obj <- obj
+<
+
+------------------------------------------------------------------------------
 4.5. Commenting and uncommenting lines~
 
-You can toogle the state of a line as either commented or uncommented by
-typing cc.
+You can toggle the state of a line as either commented or uncommented by
+typing xx. The string used to comment the line will be "# ",
+"## " or "### ", depending on the values of |vimrplugin_indent_commented| and
+|r_indent_ess_comments|.
 
-You can also add comments to the right of a line with the ;
-shortcut. By default, the comment starts at the 40th column, which can be
-changed by setting the valude of r_indent_comment_column, as below:
+You can also add the string "# " to the beginning of a line by typing
+xc and remove it with xu. In this case, you can set
+the value of vimrplugin_rcomment_string to control what string will be added
+to the beginning of the line. Example:
+>
+   let vimrplugin_rcomment_string = "# "
+<
+Finally, you can also add comments to the right of a line with the
+; shortcut. By default, the comment starts at the 40th column,
+which can be changed by setting the value of r_indent_comment_column, as
+below:
 >
    let r_indent_comment_column = 20
 <
@@ -447,212 +685,412 @@ after the last character in the line. If you are running ; over a
 selection of lines, the comments will be aligned according to the longest
 line.
 
+Note: While typing comments the leader comment string is automatically added
+to new lines when you reach 'textwidth' but not when you press .
+Please, read the Vim help about 'formatoptions' and |fo-table|. For example,
+you can add the following line to your |vimrc| if you want the comment string
+being added after :
+>
+   autocmd FileType r setlocal formatoptions-=t formatoptions+=croql
+<
+Tip: You can use Vim substitution command `:%s/#.*//` to delete all comments
+in a buffer (see |:s| and |pattern-overview|).
+
 
-4.6. Build a tags file to jump to function definitions~
+------------------------------------------------------------------------------
 								 *:RBuildTags*
+4.6. Build a tags file to jump to function definitions~
+
 Vim can jump to functions defined in other files if you press CTRL-] over the
 name of a function, but it needs a tags file to be able to find the function
 definition (see |tags-and-searches|). The command  :RBuildTags  calls the R
-function rtags() to build the tags file for the R scripts in the current
+function `rtags()` to build the tags file for the R scripts in the current
 directory. Please read |r-plugin-tagsfile| to learn how to create a tags file
 referencing source code located in other directories, including the entire R
 source code.
 
 
-==============================================================================
-5. How the plugin works~
-							*r-plugin-functioning*
-
-5.1. Omni completion~
-
-Vim can automatically complete the names of R objects when CTRL-X CTRL-O is
-pressed in insert mode (see |omni-completion| for details and 'completeopt' to
-know how to customize the |omni-completion|).  Omni completion shows in a pop
-up menu the name of the object, its class and its environment (most
-frequently, its package name). If the object is a function, its arguments are
-shown in a separate window.
-
-If a data.frame is found, while building the list of objects, the columns in
-the data.frame are added to the list. When you try to use omni completion to
-complete the name of a data.frame, the columns are not shown.  But when the
-data.frame name is already complete, and you have inserted the '$' symbol,
-omni completion will show the column names.
-
-The file containing the list of objects used for omni completion is built by
-the R function contained in the script ~/.vim/r-plugin/buil_omniList.R. This
-function is sourced by R, which causes R to create the list used by Vim.
-
-Vim uses two files: one for the objects of .GlobalEnv and the other for all
-other objects. The .GlobalEnv list is stored in the /tmp/r-plugin-yourlogin
-directory and, thus, is deleted after each reboot. The other file is stored in
-~/.vim/r-plugin and remains available until you manually rebuild it with the
-command: |:RUpdateObjList|.
-
+------------------------------------------------------------------------------
+							       *r-plugin-tmux*
+4.7. Tmux usage~
+
+When running either GVim or Vim in a terminal emulator (Linux/Unix only), the
+Vim-R-plugin will use Tmux to start R in a separate terminal emulator. R will
+be running inside a Tmux session, but you will hardly notice any difference
+from R running directly in the terminal emulator. The remaining of this
+section refers to the case of starting R when Vim already is in a Tmux
+session, that is, if you do:
+>
+   tmux
+   vim filename.R
+   exit
+<
+In this case, the terminal window is split in two regions: one for Vim and the
+other for Tmux. Then, it's useful (but not required) to know some Tmux
+commands. After you finished editing the file, you have to type `exit` to quit
+the Tmux session.
+
+Note: Starting GVim within a Tmux session is not supported.
+
+
+------------------------------------------------------------------------------
+							 *r-plugin-tmux-setup*
+4.7.1 Tmux configuration~
+
+If, as recommended, you always prefer to run Tmux before running you have to
+create your `~/.tmux.conf` if it does not exist yet. You may put the lines
+below in your `~/.tmux.conf` as a starting point to your own configuration
+file:
+>
+   # Use  instead of the default  as Tmux prefix
+   set-option -g prefix C-a
+   unbind-key C-b
+   bind-key C-a send-prefix
+
+   # Options enable mouse support in Tmux
+   set -g terminal-overrides 'xterm*:smcup@:rmcup@'
+   # For Tmux < 2.1
+   set -g mode-mouse on
+   set -g mouse-select-pane on
+   set -g mouse-resize-pane on
+   # For Tmux >= 2.1
+   set -g mouse on
+
+   # Act more like vim:
+   set-window-option -g mode-keys vi
+   bind h select-pane -L
+   bind j select-pane -D
+   bind k select-pane -U
+   bind l select-pane -R
+   unbind p
+   bind p paste-buffer
+   bind -t vi-copy v begin-selection
+   bind -t vi-copy y copy-selection
+<
+
+------------------------------------------------------------------------------
+4.7.2 Key bindings and mouse support~
+
+The Tmux configuration file suggested above configures Tmux to use vi key
+bindings. It also configures Tmux to react to mouse clicks. You should be able
+to switch the active pane by clicking on an inactive pane, to resize the panes
+by clicking on the border line and dragging it, and to scroll the R Console
+with the mouse wheel. When you use the mouse wheel, Tmux enters in its
+copy/scroll back mode (see below).
+
+The configuration script also sets  as the Tmux escape character (the
+default is ), that is, you have to type  before typing a Tmux
+command. Below are the most useful key bindings for Tmux with the tmux.conf
+shown above:
+
+    arrow keys : Move the cursor to the Tmux panel above, below, at the
+                      right or at the left of the current one.
+
+         : Move the panel division upward one line, that is, resize
+                      the panels. Repeat  to move more.  will
+                      move the division downward one line. If you are using
+                      the vertical split, you should use  and
+                       to resize the panels.
+
+    [          : Enter the copy/scroll back mode. You can use ,
+                       and vi key bindings to move the cursor around
+                      the panel. Press q to quit copy mode.
+
+    ]          : Paste the content of Tmux paste buffer.
+
+    z          : Hide/show all panes except the current one.
+		      Note: If you mistakenly press , you have to
+		      type `fg` to get Tmux back to the foreground.
+
+While in the copy and scroll back mode, the following key bindings are very
+useful:
+
+    q               : Quit the copy and scroll mode.
+             : Start text selection.
+    v        : Start rectangular text selection.
+             : Copy the selection to Tmux paste buffer.
+
+Please, read the manual page of Tmux if you want to change the Tmux
+configuration and learn more commands. To read the Tmux manual, type in the
+terminal emulator:
+>
+  man tmux
+<
+Note: Because  was configured as the Tmux escape character, it will not
+be passed to applications running under Tmux. To send  to either R or Vim
+you have to type .
+
+
+------------------------------------------------------------------------------
+4.7.3 Copying and pasting~
+
+You do not need to copy code from Vim to R because you can use the plugin's
+shortcuts to send the code. For pasting the output of R commands into Vim's
+buffer, you can use the command |:Rinsert|. If you want to copy text from an
+application running inside the Tmux to another application also running in
+Tmux, as explained in the previous subsection, you can enter in Tmux
+copy/scroll mode, select the text, copy it, switch to the other application
+pane and, then, paste.
+
+However, if you want to copy something from either Vim or R to another
+application not running inside Tmux, Tmux may prevent the X server from
+capturing the text selected by the mouse. This can be prevented by
+pressing the  key, as it suspends the capturing of mouse events
+by tmux. If you keep  pressed while selecting text with the mouse,
+it will be available in the X server clipboard and can be inserted
+into other windows using the middle mouse button. It can of course also be
+inserted into a tmux window using  and the middle mouse button.
+
+------------------------------------------------------------------------------
+							     *r-plugin-remote*
+4.7.2 Remote access~
+
+The Vim-R-plugin can not send commands from a local Vim to a remote R, but you
+can access the remote machine through ssh and run Tmux, Vim and R in the
+remote machine. Tmux should not be running in the local machine because some
+environment variables could pass from the local to the remote Tmux and confuse
+the plugin.
+
+With Tmux, you can detach the Vim-R session and reattach it later (but the
+connection with the XServer could be lost in the process). This is useful if
+you plan to begin the use the Vim-R-plugin in a machine and later move to
+another computer and access your previous Vim-R session remotely. Below is the
+step-by-step procedure to run the Vim-R remotely:
+
+  - Start Tmux:
+      tmux
+
+  - Start Vim:
+      vim script.R
 
-5.2. Communication through screen, without the screen plugin (Linux/Unix only)~
+  - Use Vim to start an R session:
+      rf
 
-Vim and R run as independent processes. The main disadvantage is that we have
-limited communication between the two applications: Vim can send strings to R
-through screen and R can write files to be read by Vim. That's all.  The main
-advantage is that Vim's or the plugin's bugs will not affect R.
+  - Send code from Vim to R, and, then, detach Vim and R with d
+    The command will be d if you have not set  as the escape
+    character in your ~/.tmux.conf.
 
-The r-plugin uses screen to communicate with R. First, the plugin initiates a
-new screen session and  uses this to start a new R process. The plugin's menu
-options, toolbar buttons and key bindings can then be used to communicate with
-the newly started R process. The plugin sends commands to R through screen. By
-default, all Vim buffers share the same R process, but it is also possible to
-configure Vim so that each buffer runs its own instance of R in a separate
-terminal emulator. In this case, the screen sessions have unique names. The
-names are made using the user name and the seconds of localtime(). Hence, a
-name clash is possible if a single user starts more than one Vim buffer at the
-same second. To change the default behavior and force all Vim buffers to use
-different R processes see |vimrplugin_single_r|.
+  - Some time later (even if accessing the machine remotely) reattach the
+    Tmux session:
+      tmux attach
 
 
 ==============================================================================
-6. Known bugs and workarounds~
 							 *r-plugin-known-bugs*
+5. Known bugs and workarounds~
 
-6.1. R's source() issues~
+Known bugs that will not be fixed are listed in this section. Some of them can
+not be fixed because they depend on missing features in either R or Vim;
+others would be very time consuming to fix without breaking anything.
 
-The R's source() function prints an extra new line between commands if the
-option echo = TRUE, and error messages and warning are printed only after the
-entire code is sourced, which makes it more difficult to find errors in the
-code sent to R.
 
+------------------------------------------------------------------------------
+5.1. R's source() issues~
 
-6.2. GVim's toolbar buttons, menu and title bar blink during omni completion~
+The R's `source()` function of the base package prints an extra new line
+between commands if the option echo = TRUE, and error and warning messages are
+printed only after the entire code is sourced. This makes it more difficult to
+find errors in the code sent to R. Details:
 
-The plugin unmakes the R menu and the related toolbar buttons when Vim leaves
-the R buffer. During omni completion, Vim leaves the R buffer and goes to the
-scratch window which is not recognized as an R file type. Consequently, the
-plugin unmakes the toolbar buttons and R related menu items. If you prefer,
-you can use the option |vimrplugin_never_unmake_menu| but, then, the menu and
-tool bar buttons will never be deleted, even if you change from one file type
-to another.
+   https://stat.ethz.ch/pipermail/r-devel/2012-December/065352.html
 
 
-6.3. R session is detached when GVim is closed (Linux/Unix only)~
+------------------------------------------------------------------------------
+5.2. The menu may not reflect some of your custom key bindings~
 
-If you launch GVim through a custom keyboard shortcut, the problem may be
-solved if you add -f as parameter to GVim. The R session will also be detached
-when GVim is closed if you launch GVim by the command line in a terminal
-emulator, and, then, close the terminal-emulator. In any case, to reattach to 
-the R session, open a new terminal window and type:
->
-   screen -r
-<
-
-6.4. The clipboard's content is lost (Windows only)~
+If you have created a custom key binding for the Vim-R-plugin, the menu in
+GVim will not always reflect the correct key binding if it is not the same for
+Normal, Visual and Insert modes.
 
-On Windows, the plugin copies the command that will be sent to R into the
-clipboard when not using the Conque Shell plugin.  Thus, if you have anything
-in the clipboard it will be lost while using the plugin.
 
+------------------------------------------------------------------------------
+5.3. Functions are not always correctly sent to R~
 
-6.5. The buffer name must be in the window title (Windows only)~
+The plugin is only capable of recognizing functions defined using the `<-`
+operator. Also, only current function scope is sent to R. See:
 
-On Windows, when not using the Conque Shell plugin, the plugin tries to
-activate the "R Console" window, paste the command that is being sent to R,
-and, then, activate the GVim window. To activate the GVim window the plugin
-requires that the name of the file being edited be in the GVim windows title.
-This is the default on Vim if you have not set the option 'titlestring'.
+   https://github.com/jcfaria/Vim-R-plugin/issues/94
+   https://github.com/jalvesaq/Nvim-R/issues/34
 
 
-6.6. The menu may not reflect some of your custom key bindings~
+------------------------------------------------------------------------------
+5.4. Wrong message that "R is busy" (Windows only)~
 
-If you have created a custom key binding for the Vim-R-plugin, the menu in
-GVim will not always reflect the correct key binding if it is not the same for
-Normal, Visual and Insert modes.
+On Windows, when code is sent from Vim to R Console, the vimcom library sets
+the value of the internal variable `r_is_busy` to 1. The value is set back to
+0 when any code is successfully evaluated. If you send invalid code to R,
+there will be no successful evaluation of code and the value of `r_is_busy`
+will remain set to 1. If you then try to update the Object Browser, see the R
+documentation for any function, or do other tasks that require the hidden
+evaluation of code by R, the vimcom library will refuse to do the tasks to
+avoid any risk of corrupting R's memory. It will tell Vim that "R is busy" and
+Vim will display this message. Everything should work as expected again after
+any valid code is executed in the R Console.
 
+The vimcom library is started with the state `busy`.
 
-6.7. quit(save = "yes") may not work properly~
 
-If you are using either the Conque Shell plugin or the Screen plugin (and are
-not running R in an external terminal), the R command quit(save = "yes") may
-not have time enough to save the workspace. Vim will sleep for 1 second after
-the command \rw before killing R but this time is not enough for big
-workspaces.
+------------------------------------------------------------------------------
+							*r-plugin-SyncTeX-win*
+5.5. SyncTeX on Windows~
 
+On Windows, backward search with Sumatra pop ups a console window which
+quickly disappears (it is `vclientserver` running the required command).
 
-6.8. Syntactically correct code may be wrongly indented~
 
-If the Vim-R-plugin indents your code wrongly you may get the correct
-indentation by adding braces and line breaks to it. Example:
->
-    # This code will be wrongly indented
+------------------------------------------------------------------------------
+5.6. R must be started by Vim~
 
-    levels(x) <- ## nl == nL or 1
-        if (nl == nL) as.character(labels)
-        else paste(labels, seq_along(levels), sep = "")
-    class(x) <- c(if(ordered) "ordered", "factor")
+The communication between Vim and R will work only if R was started by Vim
+through the rf command because the plugin was designed to connect
+each Vim instance with its own R instance.
 
+If you start R before Vim, it will not inherit from Vim the environment
+variables VIMRPLUGIN_TMPDIR, VIMR_COMPLDIR, VIMEDITOR_SVRNM,
+VIMINSTANCEID, and VIMR_SECRET. The first one is the path used by the R
+package vimcom to save temporary files used by the Vim-R-plugin to: perform
+omnicompletion, show R documentation in a Vim buffer, and update the Object
+Browser. The two last ones are used by the Vim-R-plugin and by vimcom to know
+that the connections are valid. If you use Vim to start R, but then close
+Vim, some variables will become outdated. Additionally, the Vim-R-plugin sets
+the value of its internal variable SendCmdToR from SendCmdToR_fake to the
+appropriate value when R is successfully started. It is possible to set the
+values of all those variables manually, but, as you can see below, it is not
+practical to do so. If you have either started R before Vim or closed Vim and
+opened it again and really want full communication between Vim and R, you can
+try the following (not all procedures are necessary for all cases):
 
-    # But this one will be correctly indented
+   In Normal mode Vim do:
+>
+   :echo g:rplugin_tmpdir
+   :echo g:rplugin_compldir
+   :echo $VIMINSTANCEID
+   :echo $VIMR_SECRET
+   :echo $VIMEDITOR_SVRNM
+<
+   In R do:
+>
+   detach("package:vimcom", unload = TRUE)
+   Sys.setenv(VIMRPLUGIN_TMPDIR="T") # where "T" is what Vim has echoed
+   Sys.setenv(VIMINSTANCEID="I")     # where "I" is what Vim has echoed
+   Sys.setenv(VIMR_SECRET"="S")      # where "S" is what Vim has echoed
+   Sys.setenv(VIMEDITOR_SVRNM"="N")  # where "N" is what Vim has echoed
+   Sys.setenv(VIMR_COMPLDIR"="C")    # where "C" is what Vim has echoed
+   library(vimcom)
+<
+If you are running R in a terminal emulator (Linux/Unix) Vim still needs to
+know the name of Tmux session and Tmux pane where R is running.
 
-    levels(x) <- ## nl == nL or 1
-	if (nl == nL)
-	    as.character(labels)
-	else
-	    paste(labels, seq_along(levels), sep = "")
-    class(x) <- c(if(ordered) "ordered", "factor")
+So, in R do:
+>
+   Sys.getenv("TMUX_PANE")
+<
+   and the following Tmux command:
+>
+   :display-message -p '#S'
+<
+And in Normal mode Vim do:
+>
+   :let rplugin_rconsole_pane = "X"
+   :let rplugin_tmuxsname = "Y"
+<
+Finally, do one of the commands below in Normal mode Vim, according to how R
+is running:
+>
+   let SendCmdToR = function('SendCmdToR_TmuxSplit')
+   let SendCmdToR = function('SendCmdToR_Term')
+   let SendCmdToR = function('SendCmdToR_OSX')
+   let SendCmdToR = function('SendCmdToR_Windows')
 <
 
 ==============================================================================
-7. Options~
 							    *r-plugin-options*
-|vimrplugin_term|		External terminal to be used
-|vimrplugin_term_cmd|		Complete command to open an external terminal
-|vimrplugin_underscore|		Convert '_' into ' <- '
-|vimrplugin_rnowebchunk|	Convert '<' into '<<>>=\n@' in Rnoweb files
-|vimrplugin_objbr_place|	Placement of Object Browser
-|vimrplugin_objbr_w|		Initial width of Object Browser window
-|vimrplugin_vimpager|		Use Vim to see R documentation
-|vimrplugin_editor_w|		Minimum width of R script buffer
-|vimrplugin_help_w|		Desired width of R documentation buffer
-|vimrplugin_nosingler|		A single R process for all Vim instances
-|vimrplugin_by_vim_instance|	Each Vim instance runs its own R
-|vimrplugin_i386|		Use 32 bit version of R
-|vimrplugin_r_path|		Directory where R is
-|vimrplugin_r_args|		Arguments to pass to R
-|vimrplugin_buildwait|		Time to wait for :RUpdateObjList to finish
-|vimrplugin_routmorecolors|	More syntax highlighting in R output
-|vimrplugin_routnotab|		Show output of R CMD BATCH in new window
-|vimrplugin_indent_commented|	Indent lines commented with the \cc command
-|vimrplugin_sleeptime|		Delay while sending commands in MS Windows
-|vimrplugin_noscreenrc|		Do not write custom screenrc
-|vimrplugin_screenplugin|	Use the screen plugin
-|vimrplugin_screenvsplit|	Split the window vertically with screen plugin
-|vimrplugin_conqueplugin|	Use the Conque Shell plugin
-|vimrplugin_conquevsplit|	Split the window vertically for Conque Shell
-|vimrplugin_conquesleep|	Time that Conque Shell will wait for output
-|vimrplugin_applescript|	Use osascript in Mac OS X.
-|vimrplugin_open_df|		Show data.frame elements in the Object Browser
-|vimrplugin_open_list|		Show list elements in the Object Browser
-|vimrplugin_allnames|		Show names which begin with a dot
-|vimrplugin_listmethods|	Do .vim.list.args() instead of args()
-|vimrplugin_specialplot|	Do .vim.plot() instead of plot()
-|vimrplugin_maxdeparse|		Argument to R args() function
-|vimrplugin_latexcmd|		Command to run on .tex files
-|vimrplugin_sweaveargs|		Arguments do Sweave()
-|vimrplugin_never_unmake_menu|	Do not unmake menu when switching buffers
-|vimrplugin_map_r|		Use 'r' to send lines and selected text
-
-
-7.1. Terminal emulator (Linux/Unix only)~
+6. Options~
+
+|vimrplugin_term|              External terminal to be used
+|vimrplugin_term_cmd|          Complete command to open an external terminal
+|vimrplugin_sleeptime|         Delay while sending commands in MS Windows
+|vimrplugin_save_win_pos|      Save positions of R and GVim windows
+|vimrplugin_set_home_env|      Set the value of $HOME for R
+|vimrplugin_arrange_windows|   Restore positions of R and GVim windows
+|vimrplugin_assign|            Convert '_' into ' <- '
+|vimrplugin_assign_map|        Choose what to convert into ' <- '
+|vimrplugin_rnowebchunk|       Convert '<' into '<<>>=\n@' in Rnoweb files
+|vimrplugin_objbr_place|       Placement of Object Browser
+|vimrplugin_objbr_w|           Initial width of Object Browser window
+|vimrplugin_tmux_ob|           Run Object Browser in Tmux pane
+|vimrplugin_objbr_opendf|      Display data.frames open in the Object Browser
+|vimrplugin_objbr_openlist|    Display lists open in the Object Browser
+|vimrplugin_objbr_allnames|    Display hidden objects in the Object Browser
+|vimrplugin_objbr_labelerr|    Show error if "label" attribute is invalid
+|vimrplugin_vimpager|          Use Vim to see R documentation
+|vimrplugin_editor_w|          Minimum width of R script buffer
+|vimrplugin_help_w|            Desired width of R documentation buffer
+|vimrplugin_i386|              Use 32 bit version of R
+|vimrplugin_r_path|            Directory where R is
+|vimrplugin_r_args|            Arguments to pass to R
+|vimrplugin_start_libs|        Objects for omnicompletion and syntax highlight
+|vimrplugin_routnotab|         Show output of R CMD BATCH in new window
+|vimrplugin_indent_commented|  Indent lines commented with the \xx command
+|vimrplugin_rcomment_string|   String to comment code with \xx and \o
+|vimrplugin_notmuxconf|        Don't use a specially built Tmux config file
+|vimrplugin_rconsole_height|   The number of lines of R Console (Tmux split)
+|vimrplugin_vsplit|            Make Tmux split the window vertically
+|vimrplugin_rconsole_width|    The number of columns of R Console (Tmux split)
+|vimrplugin_tmux_title|        Set Tmux window title to "VimR"
+|vimrplugin_applescript|       Use osascript in Mac OS X
+|vimrplugin_listmethods|       Do `vim.list.args()` instead of `args()`
+|vimrplugin_specialplot|       Do `vim.plot()` instead of `plot()`
+|vimrplugin_source_args|       Arguments to R `source()` function
+|vimrplugin_latexcmd|          Command to run on .tex files
+|vimrplugin_latexmk|           Define wether `latexmk` should be run
+|vimrplugin_texerr|            Show a summary of LaTeX errors after compilation
+|vimrplugin_sweaveargs|        Arguments do `Sweave()`
+|vimrplugin_rmd_environment|   Environment in which to save evaluated rmd code
+|vimrplugin_never_unmake_menu| Do not unmake the menu when switching buffers
+|vimrplugin_map_r|             Use 'r' to send lines and selected text
+|vimrplugin_ca_ck|             Add ^A^K to the beginning of commands
+|vimrplugin_pdfviewer|         PDF application used to open PDF documents
+|vimrplugin_openpdf|           Open PDF after processing rnoweb file
+|vimrplugin_openhtml|          Open HTML after processing either Rrst or Rmd
+|vimrplugin_strict_rst|        Code style for generated rst files
+|vimrplugin_insert_mode_cmds|  Allow R commands in insert mode
+|vimrplugin_allnames|          Show names which begin with a dot
+|vimrplugin_rmhidden|          Remove hidden objects from R workspace
+|vimrplugin_source|            Source additional scripts
+|vimrplugin_show_args|         Show extra information during omnicompletion
+|vimrplugin_args_in_stline|    Set 'statusline' to function arguments
+|vimrplugin_vimcom_wait|       Time to wait for vimcom loading
+|vimrplugin_vim_wd|            Start R in Vim's working directory
+|vimrplugin_after_start|       System command to execute after R startup
+|vimrplugin_user_maps_only|    Only set user specified key bindings
+|vimrplugin_tmpdir|            Where temporary files are created
+|vimrplugin_compldir|          Where lists for omnicompletion are stored
+|r-plugin-df-view|             Options for visualizing a data.frame or matrix
+|r-plugin-SyncTeX|             Options for SyncTeX
+
+
+------------------------------------------------------------------------------
 							     *vimrplugin_term*
+6.1. Terminal emulator (Linux/Unix only, but not Mac OS X)~
+
+Note: The options of this section are ignored on Mac OS X, where the command
+`open` is called to run the default application used to run shell scripts.
+
 The plugin uses the first terminal emulator that it finds in the following
 list:
-    1. gnome-terminal, 
-    2. konsole, 
-    3. xfce4-terminal, 
-    4. iterm
-    5. Eterm, 
-    6. rxvt, 
-    7. aterm, 
-    8. xterm.
-
-If Vim does not select your favorite terminal emulator, you may define it in 
+    1. gnome-terminal,
+    2. konsole,
+    3. xfce4-terminal,
+    4. iterm,
+    5. Eterm,
+    6. (u)rxvt,
+    7. aterm,
+    8. roxterm,
+    9. terminator,
+   10. xterm.
+
+If Vim does not select your favorite terminal emulator, you may define it in
 your |vimrc| by setting the variable vimrplugin_term, as shown below:
 >
    let vimrplugin_term = "xterm"
@@ -663,95 +1101,192 @@ with the way your terminal emulator is called by the plugin, you may define in
 your |vimrc| the variable vimrplugin_term_cmd, as in the examples below:
 >
    let vimrplugin_term_cmd = "gnome-terminal --title R -e"
-   let vimrplugin_term_cmd = "/Applications/Utilities/iTerm.app/Contents/MacOS/iTerm -t R"
+   let vimrplugin_term_cmd = "terminator --title R -x"
 <
 Please, look at the manual of your terminal emulator to know how to call it.
 The last argument must be the one which precedes the command to be executed.
 
 
-7.2. Underscore and Rnoweb completion of code block~
-						       *vimrplugin_underscore*
-						      *vimrplugin_rnowebchunk*
-While editing R code, '_' is replace with ' <- '. To disable this feature, put
-in your |vimrc|:
+------------------------------------------------------------------------------
+						  *vimrplugin_sleeptime*
+						  *vimrplugin_save_win_pos*
+						  *vimrplugin_set_home_env*
+						  *vimrplugin_arrange_windows*
+6.2. Options specific to Windows~
+
+
+The plugin gives to R a small amount of time to process the paste command. The
+default value is 100 milliseconds, but you should experiment different values. The
+example show how to adjust the value of sleeptime in your |vimrc|:
+>
+   let vimrplugin_sleeptime = 30
+<
+By default, the Vim-R-plugin will save the positions of R Console and GVim
+windows when you quit R with the rq command, and it will restore
+the positions of the windows when you start R. If you do not like this
+behavior, you can put in your |vimrc|:
+>
+   let vimrplugin_save_win_pos = 0
+   let vimrplugin_arrange_windows = 0
+<
+If you want R and GVim windows always in a specific arrangement, regardless of
+their state when you have quited R for the last time, you should arrange them
+in the way you want, quit R, change in your |vimrc| only the value of
+vimrplugin_save_win_pos and, finally, quit Vim.
+
+The plugin sets `$HOME` as the Windows register value for "Personal" "Shell
+Folders" which is the same value set by R. However, if you have set `$HOME`
+yourself with the intention of changing the default value of `$HOME` assumed
+by R, you will want to put in your |vimrc|:
 >
-   let vimrplugin_underscore = 0
+   let vimrplugin_set_home_env = 0
 <
-In Rnoweb files, a '<' is replaced with '<<>>=\n@'. To disable this feature,
+Note: the old option vimrplugin_Rterm was deprecated because the C code to
+send strings from Vim to Windows PowerShell is not working.
+
+
+------------------------------------------------------------------------------
+						      *vimrplugin_rnowebchunk*
+	                                              *vimrplugin_assign_map*
+                                                      *vimrplugin_assign*
+6.3. Assignment operator and Rnoweb completion of code block~
+
+In Rnoweb files, a `<` is replaced with `<<>>=\n@`. To disable this feature,
 put in your |vimrc|:
 >
    let vimrplugin_rnowebchunk = 0
 <
+While editing R code, `_` is replaced with `<-`. If you want to bind other
+keys to be replaced by `<-`, set the value of |vimrplugin_assign_map| in your
+|vimrc|, as in the example below which emulates RStudio behavior (may only
+work on GVim):
+>
+   let vimrplugin_assign_map = ""
+<
+Note: If you are using Vim in a terminal emulator, you have to put in your
+|vimrc|:
+>
+   set =^[-
+   let vimrplugin_assign_map = ""
+<
+where `^[` is obtained by pressing CTRL-V CTRL-[ in Insert mode.
 
-7.3. Object Browser options~
-						      *vimrplugin_objbr_place*
-							  *vimrplugin_objbr_w*
-							  *vimrplugin_open_df*
-							*vimrplugin_open_list*
-							 *vimrplugin_allnames*
-The Object Browser may be created in four different places: at the right/left
-of the script windows or (if using Conque Shell) at the right/left of the R
-Console window (see |vimrplugin_conqueplugin| for details on the use of Conque
-Shell). By default, the Object Browser will be created with 40 columns at the
-right side of the R Console. If Conque Shell is not being used, the Object
-Browser will be at the right side of the script window. You can change the
-Object Browser's default width and placement by putting different values in
-your |vimrc|, as in the examples below:
+Note: You can't map , as StatET does because in Vim only alphabetic
+letters can be mapped in combination with the CTRL key.
+
+To completely disable this feature, put in your |vimrc|:
 >
-   let vimrplugin_objbr_place = "script,right"
-   let vimrplugin_objbr_place = "console,left"
-   let vimrplugin_objbr_w = 30
+   let vimrplugin_assign = 0
+<
+If you need to type many object names with underscores, you may want to change
+the value vimrplugin_assign to 2. Then, you will have to type two `_` to get
+them converted into `<-`. Alternatively, if the value of vimrplugin_assign is
+3, the plugin will run the following command in each buffer containing R code
+(R, Rnoweb, Rhelp, Rrst, and Rmd):
+>
+   iabb  _ <-
 <
-The minimum width of the Object Browser windows is 9 columns.
+That is, the underscore will be replaced with the assign operator only if it
+is preceded by a space and followed by a non-word character.
 
-By default, the elements of data.frames are shown in the Object Browser, but
-not the elements of other types of lists. You can put the following in your
-|vimrc| to change this behavior:
+
+------------------------------------------------------------------------------
+						   *vimrplugin_objbr_place*
+						   *vimrplugin_objbr_w*
+						   *vimrplugin_tmux_ob*
+						   *vimrplugin_objbr_opendf*
+						   *vimrplugin_objbr_openlist*
+						   *vimrplugin_objbr_allnames*
+						   *vimrplugin_objbr_labelerr*
+6.4. Object Browser options~
+
+By default, the Object Browser will be created with 40 columns. The minimum
+width of the Object Browser window is 9 columns. You can change the object
+browser's default width by setting the value of |vimrplugin_objbr_w| in your
+|vimrc|, as below:
+>
+   let vimrplugin_objbr_w = 30
+<
+The Object Browser is created by splitting the Vim script window, but if Vim
+is running in a terminal emulator inside a Tmux session, the Object Browser
+will be created in an independent Vim instance in a Tmux pane. If you prefer
+the Object Browser always created as a Vim split window, put in your |vimrc|:
+>
+   let vimrplugin_tmux_ob = 0
+<
+Valid values for the Object Browser placement are "script" or "console" and
+"right" or "left" separated by a comma. Examples:
 >
-   let vimrplugin_open_df = 0
-   let vimrplugin_open_list = 1
+   let vimrplugin_objbr_place = "script,right"
+   let vimrplugin_objbr_place = "console,left"
 <
-By default, names of objects which begin with a . are omitted. If you prefer
-to see them in the Object Browser, put in your |vimrc|:
+The "console" option is valid only if Vim is running inside of a Tmux session.
+
+Below is an example of setup of some other options in the |vimrc| that control
+the behavior of the Object Browser:
 >
-   let vimrplugin_allnames = 1
+   let vimrplugin_objbr_opendf = 1    " Show data.frames elements
+   let vimrplugin_objbr_openlist = 0  " Show lists elements
+   let vimrplugin_objbr_allnames = 0  " Show .GlobalEnv hidden objects
+   let vimrplugin_objbr_labelerr = 1  " Warn if label is not a valid text
 <
+Objects whose names start with a "." are hidden by default. If you want that
+they are displayed in the Object Browser, set the value of
+`vimrplugin_objbr_allnames` to `1`.
+
+when a `data.frame` appears in the Object Browser for the first time, its
+elements are immediately displayed, but the elements of a `list` are displayed
+only if it is explicitly opened. The options `vimrplugin_objbr_opendf` and
+`vimrplugin_objbr_openlist` control the initial status (either opened or
+closed) of, respectively, `data.frames` and `lists`. The options are ignored
+for `data.frames` and `lists` of libraries which are always started closed.
+
+If an object R's workspace has the attribute `"label"`, it is displayed in
+Nvim's Object Browser. If the `"label"` attribute is not of class
+`"character"`, and if  `vimrplugin_objbr_labelerr` is `1`, an error message is
+printed in the Object Browser.
 
-7.4. Vim as pager for R help~
+
+------------------------------------------------------------------------------
 							 *vimrplugin_vimpager*
 							 *vimrplugin_editor_w*
-							   *vimrplugin_help_w*
-7.4.1. Quick setup~
+							 *vimrplugin_help_w*
+6.5. Vim as pager for R help~
+
+6.5.1. Quick setup~
 
 If you do not want to see R documentation in a Vim's buffer, put in your
 |vimrc|:
 >
    let vimrplugin_vimpager = "no"
 <
+If you want to see R documentation in Vim, but are not satisfied with the way
+it works, please, read the subsection 6.5.2 below.
 
-7.4.2. Details and other options:~
+------------------------------------------------------------------------------
+6.5.2. Details and other options:~
 
-The plugin key bindings will remain active in the documentation buffer, and,
-thus, you will be able to send commands to R as you do while editing an R
-script.  You can, for example, use rh to jump to another R help
+The plugin key bindings will remain active in the documentation buffer
+allowing you to send commands to R as you would do do while editing an R
+script. You can, for example, use rh to jump to another R help
 document.
 
 The valid values of vimrplugin_vimpager are:
-   
-   "horizontal": Split the window horizontally.
-   "vertical"  : Split the window vertically if the editor width is large
-		 enough; otherwise, split the window horizontally and attempt
-		 to set the window height to at least 20 lines.
-		 This is the default.
+
    "tab"       : Show the help document in a new tab. If there is already a
-                 tab with an R help document, use it.
+                 tab with an R help document tab, use it.
+                 This is the default.
+   "vertical"  : Split the window vertically if the editor width is large
+                 enough; otherwise, split the window horizontally and attempt
+                 to set the window height to at least 20 lines.
+   "horizontal": Split the window horizontally.
    "tabnew"    : Show the help document in a new tab.
    "no"        : Do not show R documentation in Vim.
 
 The window will be considered large enough if it has more columns than
 vimrplugin_editor_w + vimrplugin_help_w. These variables control the minimum
 width of the editor window and the help window, and their default values are,
-respectively, 66 and 46.  Thus, if you want to have more control over Vim's
+respectively, 66 and 46. Thus, if you want to have more control over Vim's
 behavior while opening R's documentations, you will want to set different
 values to some variables in your |vimrc|, as in the example:
 >
@@ -759,71 +1294,38 @@ values to some variables in your |vimrc|, as in the example:
    let vimrplugin_editor_h = 60
 <
 
-7.5. Number of R processes (Linux/Unix only)~
-							*vimrplugin_nosingler*
-						  *vimrplugin_by_vim_instance*
-7.5.1 Using (G)Vim without the Conque Shell plugin or the Screen plugin~
-
-By default, all buffers of all (G)Vim instances send code to the same R process.
-If you prefer that each Vim buffer uses its own R process, put the following
-option in your |vimrc|:
->
-   let vimrplugin_nosingler = 1
-<
-If you prefer that each Vim instance calls its own R process and all of the
-instance's buffers send code to this R process while other Vim instances send
-code to other R processes then put the following in your |vimrc|:
->
-   let vimrplugin_by_vim_instance = 1
->
-The |vimrplugin_by_vim_instance| option requires that Vim is acting as a
-command server because the variable |v:servername| is used to make the name of
-the screen session which will run R. By default, GVim runs as server, but Vim
-does not. Hence, if you are using Vim you have either to start Vim with the
-argument --servername or use the screen.vim plugin which tries to restart Vim
-with the --servername argument. If you want to use more than nine GVim
-instances you will have to use the --servername argument because screen will
-not differentiate between the names "GVIM1" and "GVIM10".
-
-7.5.2 Using the Screen plugin~
-
-Both options are ignored when using Vim in a terminal emulator and using
-the Screen plugin. The plugin behaves as if the |vimrplugin_by_instance| was
-enabled.
-
-7.5.3 Using the Conque Shell plugin~
-
-By default, each Vim buffer sends code to its own R process. You can set
-|vimrplugin_by_vim_instance| value to 1 if you prefer that all buffers of each
-(G)Vim instance sends code to the same R process.  When using the Conque Shell
-plugin, there is no need of setting a Vim server because R will be running
-inside a Vim's buffer, and, thus, Vim has direct access to R's input and
-output. 
-
-The option |vimrplugin_nosingler| is ignored.
-
-
-7.6. Use 32 bit version of R (Windows and Mac OS X only)~
+------------------------------------------------------------------------------
 							     *vimrplugin_i386*
+6.6. Use 32 bit version of R (Windows and Mac OS X only)~
+
 If you are using a 64 bit Windows or a 64 bit Mac OS X, but prefer to run the
 32 bit version of R, put in your |vimrc|:
 >
    let vimrplugin_i386 = 1
 <
 
-7.7. R path~
+------------------------------------------------------------------------------
 							   *vimrplugin_r_path*
+6.7. R path~
+
 Vim will run the first R executable in the path. You can set an alternative R
 path in your |vimrc| as in the examples:
 >
-   let vimrplugin_r_path = "/path/2/my/preferred/R/version/bin"
-   let vimrplugin_r_path = "C:\\Program Files\\R\\R-2.12.0\\i386\\bin"
->
+   let vimrplugin_r_path = "/path/to/my/preferred/R/version/bin"
+   let vimrplugin_r_path = "C:\\Program Files\\R\\R-3.1.2\\bin\\i386"
+<
 On Windows, Vim will try to find the R install path in the Windows Registry.
 
+You can set a different R version for specific R scripts in your |vimrc|.
+Example:
+>
+   autocmd BufReadPre ~/old* let vimrplugin_r_path='~/app/R-2.8.1/bin'
+<
 
-7.8. Arguments to R~
+------------------------------------------------------------------------------
 							   *vimrplugin_r_args*
+6.8. Arguments to R~
+
 Set this option in your |vimrc| if you want to pass command line arguments to
 R at the startup. Example:
 >
@@ -834,306 +1336,246 @@ default value is "--sdi", but you may change it to "--mdi" if you do not like
 the SDI style of the graphical user interface.
 
 
-7.9. Time necessary to build list of objects for omni completion~
-							*vimrplugin_buildwait*
-If your system needs more than 120 seconds to build the list of objects for
-omni completion after you do the command |:RUpdateObjList|, then you should
-set the value of |vimrplugin_buildwait| to a higher value. Example:
->
-   let vimrplugin_buildwait = 240
+------------------------------------------------------------------------------
+						   *vimrplugin_start_libs*
+6.9. Omnicompletion and syntax highlight of R functions~
+
+The list of functions to be highlighted and the list of objects for
+omnicompletion are built dynamically as the libraries are loaded by R.
+However, you can set the value of vimrplugin_start_libs if you want that
+the functions and objects of specific packages are respectively highlighted
+and available for omnicompletion even if R is not running yet. By default,
+only the functions of vanilla R are always highlighted. Below is the default
+value of vimrplugin_start_libs:
 >
+   let vimrplugin_start_libs = "base,stats,graphics,grDevices,utils,methods"
+<
+
+------------------------------------------------------------------------------
+							*vimrplugin_routnotab*
+6.10. Options for .Rout file file type~
 
-7.10. More colorful syntax highlight of .Rout files~
-						   *vimrplugin_routmorecolors*
+After the command ao, Vim will save the current buffer if it has
+any pending changes, run `R CMD BATCH --no-restore --no-save` on the current
+file and show the resulting .Rout file in a new tab. If you prefer that the
+file is open in a new split window, put in your |vimrc|:
+>
+   let vimrplugin_routnotab = 1
+<
 By default, the R commands in .Rout files are highlighted with the color of
 comments, and only the output of commands has some of its elements highlighted
-(numbers, strings, index of vectors, warnings and errors). The same
-highlighting scheme is applied to the R Console when using the Conque Shell
-plugin to run R inside a Vim's buffer. For one hand, we do not need to
-highlight R commands in the Console if they were sent by the plugin from an R
-script buffer since we have the code highlighted in the script buffer and in
-the Console we want to pay attention to the output. A too colorful
-highlighting scheme would be distracting. On the other hand, if we were typing
-commands directly in the Console it would be beneficial to have the R syntax
-highlighted.
+(numbers, strings, index of vectors, warnings and errors).
 
 If you prefer that R commands in the R output are highlighted as they are in R
 scripts, put the following in your |vimrc|:
 >
-   let vimrplugin_routmorecolors = 1
-<
-
-7.11. How to automatically open the .Rout file~
-							*vimrplugin_routnotab*
-After the command \ao, Vim will save the current buffer if it has any pending
-changes, run "R CMD BATCH --no-restore --no-save" on the current file and show
-the resulting .Rout file in a new tab. If you prefer that the file is open in
-a new split window, put in your |vimrc|:
->
-   let vimrplugin_routnotab = 1
+   let Rout_more_colors = 1
 <
 
-7.12. Indent commented lines~
+------------------------------------------------------------------------------
 						 *vimrplugin_indent_commented*
-You can type \cc (where "\" is the ) to comment out a line or
-selected lines. If the line alredy starts with a comment string, it will be
-removed. After adding the comment string, the line will be reindented by
-default. To turn off the automatic indentation, put in your |vimrc|:
+                                                 *r_indent_ess_comments*
+						 *vimrplugin_rcomment_string*
+6.11. Indent commented lines~
+
+You can type xx to comment out a line or selected lines. If the
+line already starts with a comment string, it will be removed. After adding
+the comment string, the line will be reindented by default. To turn off the
+automatic indentation, put in your |vimrc|:
 >
    let vimrplugin_indent_commented = 0
 <
-What string wil be added to the beginning of the line depends on the values of
-vimrplugin_indent_commented and r_indent_ess_comments (see section 10.8 of
-this document), according to the table below:
+What string will be added to the beginning of the line depends on the values
+of vimrplugin_indent_commented and r_indent_ess_comments according to the
+table below (see |r-plugin-indenting|):
 >
    vimrplugin_indent_commented   r_indent_ess_comments   string
                  1                        0                #
-		 0                        1                #
-		 1                        1                ##
-		 0                        0                ###
-
-
-7.13. Sleep time (Windows only)~
-							*vimrplugin_sleeptime*
-The plugin gives to R a small amount of time to process the paste command when
-not using the Conque Shell plugin. The default value is 0.2 second, but you
-should experiment different values. The example show how to adjust the value
-of sleeptime in your |vimrc|:
->
-   let vimrplugin_sleeptime = 0.1
-<
-
-7.14. Screen configuration (Linux/Unix only)~
-						       *vimrplugin_noscreenrc*
-Vim runs screen with a special configuration file. If you want to use
-your own ~/.screenrc, put in your |vimrc|:
->
-   let vimrplugin_noscreenrc = 1
+                 0                        0                #
+                 1                        1                ##
+                 0                        1                ###
 <
-Below is a sample ~/.screenrc you may consider as a starting point to create
-your own:
+The string used to comment text with xc, xu,
+xx and o is defined by vimrplugin_rcomment_string.
+Example:
 >
-   msgwait 0
-   termcapinfo xterm* 'ti@:te@'
-   vbell off
-   term screen-256color
+   let vimrplugin_rcomment_string = "# "
 <
 
-7.15. Integration with screen.vim (Linux/Unix only)~
-						     *vimrplugin_screenplugin*
-						     *vimrplugin_screenvsplit*
-By default, Vim-R-plugin will use the screen.vim plugin if it is installed
-unless Conque Shell plugin is installed too.  If you prefer to use both
-Vim-R-plugin and screen plugin at the same time, download and install the
-screen.vim from:
-
-   http://www.vim.org/scripts/script.php?script_id=2711
+------------------------------------------------------------------------------
+						       *vimrplugin_notmuxconf*
+6.12. Tmux configuration (Linux/Unix only)~
 
-Start Vim and do the command rf. The screen plugin will split the
-terminal in two regions and will run R in one of them. Using both plugins 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 have the screen plugin installed but prefer do not integrate the it
-with the Vim-R-plugin you will need to add the following to your |vimrc|:
->
-   let vimrplugin_screenplugin = 0
-<
-The screen.vim plugin also supports tmux, which allows you to split the
-terminal vertically. Please read |screen-intro| and |screen-shell-vertical|
-for details.  By default, the Vim-R-plugin will tell the screen plugin to
-split the terminal horizontally. If you preffer to split it vertically,
-install tmux and put in your |vimrc|:
+GVim (or Vim running R in an external terminal emulator) runs Tmux with a
+specially built configuration file. If you want to use your own ~/.tmux.conf,
+put in your |vimrc|:
 >
-   let vimrplugin_screenvsplit = 1
-   let ScreenImpl = 'Tmux'
+   let vimrplugin_notmuxconf = 1
 <
-Note that the second line is an option of the screen plugin and that it is
-also possible to split the terminal vertically if using the correct version of
-the screen application (see |screen-shell-vertical|).
+If you opted for using your own configuration file, the plugin will write a
+minimum configuration which will set the value of four environment variables
+required for the communication with R and then source your own configuration
+file (~/.tmux.conf).
 
-Note: Read the screen's documentation, especially the section |screen-gotchas|
-(the E325 is caused by the presence of 'swapfile'). This problem will not
-happen if you start Vim from within a screen session, as in the example below.
-However, when starting Vim from within screen you will not be able to start a
-new R session after closing the first one with the \rq command. Moreover, you
-will have to manually switch from one screen region to another and kill them.
 
-A sample detachable session could be:
+------------------------------------------------------------------------------
+						  *vimrplugin_rconsole_height*
+                                                  *vimrplugin_vsplit*
+			                          *vimrplugin_rconsole_width*
+                                                  *vimrplugin_tmux_title*
+6.13. Integration with Tmux (Linux/Unix only)~
 
-  - Start Vim through screen:
-      screen vim theScript.R
-  - Use Vim to start an R session:
-      \rf
-  - Send code from Vim to R, and, then, detach Vim and R with d
-  - Some time latter reattach the screen session:
-      screen -r
-  - Type S to split the region,  to go the other region and
-    n until you get one region with Vim and the other with R.
-  - When you have finished to use Vim and R close them and type exit to
-    quit the screen session.
-
-Here are several useful screen shortcuts (please look at the screen man page
-for a complete list):
-
-          go from Vim to R and vice-versa
-  :resize N    set the height of the current window to N lines
-  n            switch to the next screen session
-  p            switch to the previous screen session
-  S            split the current region in two new ones
-  X            kill the current region
-  Esc          enter copy/scrollback mode
-  Esc               quit the copy/scrollback mode
-
-By default, screen waits briefly after it receives external commands and other
-default options may not be what you want. Please read screen documentation to
-know how to configure it (see also |vimrplugin_noscreenrc|).
-
-Note:  is the screen scape character, and it will not be passed to
-applications running under screen. To send  to either R or Vim you have
-to type a. You can also set a different escape character in your
-~/.screenrc (see |vimrplugin_noscreenrc|).
-
-
-7.16. Integration with Conque Shell plugin~
-						     *vimrplugin_conqueplugin*
-						     *vimrplugin_conquevsplit*
-						      *vimrplugin_conquesleep*
-The Conque Shell plugin is available at:
-
-   http://www.vim.org/scripts/script.php?script_id=2771
-
-By default, the Conque Shell plugin will be used if installed, unless you have
-vimrplugin_screenplugin = 1 in your |vimrc|.  If you installed the Conque
-Shell but don't want to use it with the Vim-R-plugin, then you should put in
-your |vimrc|:
->
-   let vimrplugin_conqueplugin = 0
-<
-By default, the window will be split horizontally. Put the following in your
-|vimrc| if you prefer to split the window vertically:
+These three options are valid only when Vim is started inside a Tmux session.
+In this case, when you type rf, the terminal will be split in two
+regions and R will run in one of them. By default, the Vim-R-plugin will tell
+Tmux to split the terminal window horizontally and you can set in your
+|vimrc| the initial number of lines of the Tmux pane running R as in the
+example below:
 >
-   let vimrplugin_conquevsplit = 1
+   let vimrplugin_rconsole_height = 15
 <
-Note: Nico Raffo's Conque Shell plugin is not perfect yet, but its use already
-has some advantages: the ability to edit R's output, and the syntax
-highlighting of the output. The three main problems of Conque Shell are due to
-Vim limitations: the lack of a feature that may be called InsertCharPre event,
-the impossibility of scrolling a buffer which is not being edited, and the use
-of the same variable, 'updatetime', to do both save swap files and trigger
-|CursorHold| events.
-
-As a consequence of the first limitation, Conque Shell sometimes gets confused
-while converting typed text to strings to be sent to the application running
-in a Vim buffer. With the current version of Conque Shell (2.0), on Windows,
-only ascii characters can be either sent to or typed in the Conque Term. On
-Linux or other system whose encoding is UTF-8, characters of any encoding can
-be sent to the Conque Term, but only Latin-1 characters can be typed directly
-in the Conque Term.
-
-The second limitation has a more obvious consequence: the shell buffer does
-not scroll when there is new output but it is not the currently active buffer.
-After a command is sent to the Conque buffer, the Conque Shell plugin waits
-100 milliseconds (on Linux) or 200 milliseconds (on Windows) before reading
-R's output. Longer values for the waiting time will increase the chances that
-the output of R commands will be immediately shown in the R Console. To set a
-different waiting time, change the value of vimrplugin_conquesleep in your
-|vimrc| as in the example:
+If you prefer to split it vertically:
 >
-   let vimrplugin_conquesleep = 300
+   let vimrplugin_vsplit = 1
 <
-To manually scroll the R Console buffer, put the following in your |vimrc|
-(replace  with your preferred key):
+In this case, you can choose the initial number of columns of R Console:
 >
-   nmap  :call RScrollTerm()
+   let vimrplugin_rconsole_width = 15
 <
-Then, you will be able to scroll the R Console buffer at any time by pressing the
- key in Normal mode. Of course, you should replace  with your
-preferred key.
-
-You may also want to put the following Conque options in your |vimrc| (look at
-the Conque Shell documentations for details):
+Tmux automatically renames window titles to the command currently running. The
+Vim-R-plugin sets the title of the window where Vim and R are running to
+"VimR". This title will be visible only if Tmux status bar is "on", and it is
+useful only if you have created new windows with the c command. You
+can change the value of vimrplugin_tmux_title to either set a different title
+or let Tmux set the title automatically. Examples:
 >
-   let ConqueTerm_CWInsert = 1
-   let ConqueTerm_Color = 0
-   let ConqueTerm_ReadUnfocused = 1
+   let vimrplugin_tmux_title = "Vim-R"
+   let vimrplugin_tmux_title = "automatic"
 <
-Note: The use of |ConqueTerm_ReadUnfocused| will set the value of 'updatetime'
-to 1000 milliseconds.
 
+------------------------------------------------------------------------------
+                                                      *vimrplugin_applescript*
+6.14. Integration with AppleScript (OS X only)~
 
-7.17. Integration with Apple Script (OS X only)~
-							*vimrplugin_applescript*
-In Mac OS X, the plugin will try to send commands to R gui using Apple Script
-if the Screen plugin and the Conque Shell plugin are not installed. If you
-prefer to have R running in an external terminal emulator, put in your
-|vimrc|:
+In Mac OS X, the plugin will try to send commands to R gui using AppleScript.
+If you prefer to run R in an external terminal emulator, put in your |vimrc|:
 >
    let vimrplugin_applescript = 0
 <
+If Vim is running inside Tmux, the terminal will be split in two regions.
+Otherwise, R will start in an external terminal emulator.
+
 
-7.18. Special R functions~
+------------------------------------------------------------------------------
 						      *vimrplugin_listmethods*
-						      *vimrplugin_specialplot*
-The R function args() list the arguments of a function, but not the arguments
+                                                      *vimrplugin_specialplot*
+6.15. Special R functions~
+
+The R function `args()` lists the arguments of a function, but not the arguments
 of its methods. If you want that the plugin calls the function
-.vim.list.args() after ra, you have to add to your |vimrc|:
+`vim.list.args()` after ra, you have to add to your |vimrc|:
 >
    let vimrplugin_listmethods = 1
 <
-By default, R makes a scatterplot of numeric vectors. The function .vim.plot()
+By default, R makes a scatterplot of numeric vectors. The function `vim.plot()`
 do both a histogram and a boxplot. The function can be called by the plugin
 after rg if you put the following line in your |vimrc|:
 >
    let vimrplugin_specialplot = 1
 <
 
-7.19. maxdeparse~
-						       *vimrplugin_maxdeparse*
-You can set the argument maxdeparse to be passed to R's source() function.
-Example:
+------------------------------------------------------------------------------
+						      *vimrplugin_source_args*
+6.16. Arguments to R source() function~
+
+When you send multiple lines of code to R (a selection of lines, a paragraph,
+code between two marks or a R chunk of code), the Vim-R-plugin saves the lines
+in a temporary file and, then, sends to R the command `source()` to read the
+temporary file.
+
+You can add arguments to be passed to R's `source()` function. Example:
 >
-   let vimrplugin_maxdeparse = 300
+   let vimrplugin_source_args = "max.deparse.length = 300"
 <
 
-7.20. LaTeX command~
-							 *vimrplugin_latexcmd*
+------------------------------------------------------------------------------
 						       *vimrplugin_sweaveargs*
-By default, Vim calls pdflatex to produce a pdf document from the .tex file
-produced by the R Sweave command. You can use the option vimrplugin_latexcmd
-to change this behavior. Example:
+						       *vimrplugin_latexcmd*
+						       *vimrplugin_latexmk*
+						       *vimrplugin_texerr*
+6.17. LaTeX options~
+
+To produce a pdf document from the .tex file generated by either `Sweave()` or
+`knit()` command, if vimrplugin_latexmk = 1 and both `latexmk` and `perl`
+(which is required to run `latexmk`) are installed and in the path, the vimcom
+package calls:
+>
+   latexmk -pdflatex="pdflatex -file-line-error -synctex=1" -pdf
+<
+Otherwise, it calls:
+>
+   pdflatex -file-line-error -synctex=1
+<
+You can use the options vimrplugin_latexcmd and vimrplugin_latexmk to change
+this behavior. Examples:
 >
+   let vimrplugin_latexmk = 0
    let vimrplugin_latexcmd = "latex"
+   let vimrplugin_latexcmd = 'latexmk -pdf -pdflatex="xelatex %O -synctex=1 %S"'
 <
-If you want to pass arguments do the Sweave() function, set the value of the
+By default, vimrplugin_latexmk is 0 on Windows and 1 on other systems.
+If you want to pass arguments to the `Sweave()` function, set the value of the
 vimrplugin_sweaveargs variable.
 
+If the value of `vimrplugin_texerr` is `1`, a summary of LaTeX errors
+and warnings are produced by the compilation of the .tex document into .pdf
+file will be output to R Console at the end of the compilation. So, you do not
+have to scroll the R Console seeking for these messages.
 
-7.21. Never unmake the R menu and tool bar buttons~
-						*vimrplugin_never_unmake_menu*
-Use this option if you want that the menu item R and the R related tool bar
-buttons are not deleted when you change from one buffer to another, for
-example, when go from an .R file to a .txt one:
+
+------------------------------------------------------------------------------
+						  *vimrplugin_rmd_environment*
+6.18. Rmd environment~
+
+When rendering an Rmd file, the code can be evaluated (and saved) in a
+specified environment.  The default value is `.GlobalEnv` which makes the
+objects stored in the Rmd file available on the R console.  If you do not want
+the  objects stored in the Rmd file to be available in the global environment,
+you can set
+>
+    let vimrplugin_rmd_environment = "new.env()"
+<
+
+------------------------------------------------------------------------------
+						*vimrplugin_never_unmake_menu*
+6.19. Never unmake the R menu~
+
+Use this option if you want that the "R" menu item in GVim is not deleted when
+you change from one buffer to another, for example, when going from an .R file
+to a .txt one:
 >
    let vimrplugin_never_unmake_menu = 1
 <
-When this options is enabled all menu items are created regardless of the file
-type.
+When this option is enabled all menu items are created regardless of the file
+type. If you have added R related tool bar buttons (see |r-plugin-toolbar|)
+the buttons also are created at the plugin startup and kept while you go to
+different file type buffers.
 
 
-7.22. Map 'r'~
+------------------------------------------------------------------------------
 							    *vimrplugin_map_r*
-Some users may already be familiar with the key bindings from earlier releases
-of the Vim-R-plugin. If the variable |vimrplugin_map_r| exists, the plugin
-will map the letter 'r' to send lines to R when there are visually selected
-lines, for compatibility with the original plugin. To activate this option,
-insert the following into |vimrc|:
+6.20. Map 'r'~
+
+If the variable |vimrplugin_map_r| exists, the plugin will map the letter 'r'
+to send lines to R when there are visually selected lines, for compatibility
+with the original plugin. To activate this option, insert the following into
+|vimrc|:
 >
    let vimrplugin_map_r = 1
 <
-You may want to add the following three lines to your |vimrc| which were in 
-the original plugin and will increase compatibility with code edited with
+You may want to add the following three lines to your |vimrc| which were in
+Johannes Ranke's plugin and will increase compatibility with code edited with
 Emacs:
 >
    set expandtab
@@ -1141,145 +1583,610 @@ Emacs:
    set tabstop=8
 <
 
+------------------------------------------------------------------------------
+							    *vimrplugin_ca_ck*
+6.21. Add ^A^K to the beginning of commands~
+
+When one types  in the R Console the cursor goes to the beginning of the
+line and when one types  the characters to the right of the cursor are
+deleted. This is useful to avoid characters left on the R Console being mixed
+with commands sent by Vim. However, sending  may be problematic if using
+Tmux. The Vim-R-plugin will add  to every command if you put
+in your |vimrc|:
+>
+   let vimrplugin_ca_ck = 1
+<
+
+------------------------------------------------------------------------------
+	                                                *vimrplugin_pdfviewer*
+                                                        *vimrplugin_openpdf*
+                                                        *vimrplugin_openhtml*
+6.22. Open PDF after processing rnoweb, rmd or rrst files~
+
+The plugin can automatically open the pdf file generated by pdflatex, after
+either `Sweave()` or `knit()`. This behavior is controlled by the variable
+|vimrplugin_openpdf| whose value may be 0 (do not open the pdf), 1 (open only
+the first time that pdflatex is called) or a number higher than 1 (always
+open the pdf). For example, if you want that the pdf application is started
+automatically but do not want the terminal (or GVim) losing focus every time
+that you generate the pdf, you should put in put in your |vimrc|:
+>
+   let vimrplugin_openpdf = 1
+<
+If you use Linux or other Unix and eventually use the system console (without
+the X server) you may want to put in your |vimrc|:
+>
+   if $DISPLAY != ""
+       let vimrplugin_openpdf = 1
+   endif
+<
+Note: If the pdf is already open, some pdf readers will automatically update
+the pdf; others will lock the pdf file and prevent R from successfully
+compiling it again. You can change the value of vimrplugin_pdfviewer in your
+|vimrc| to define what PDF viewer will be called. Example:
+>
+   let vimrplugin_pdfviewer = "zathura"
+<
+If editing an Rmd file, you can produce the html result with kh.
+The html file will be automatically opened if you put the following in your
+|vimrc|:
+>
+   let vimrplugin_openhtml = 1
+<
+
+------------------------------------------------------------------------------
+                                                     *vimrplugin_rrstcompiler*
+			                             *vimrplugin_strict_rst*
+                                                     *vimrplugin_rst2pdfpath*
+			                             *vimrplugin_rst2pdfargs*
+6.23. Support to RreStructuredText file~
+
+By default, the Vim-R-plugin sends the command `render_rst(strict=TRUE)` to R
+before using R's `knit()` function to convert an Rrst file into an rst one. If
+you prefer the non strict rst code, put the following in your |vimrc|:
+>
+   let vimrplugin_strict_rst = 0
+<
+You can also set the value of vimrplugin_rst2pdfpath (the path to rst2pdf
+application), vimrplugin_rrstcompiler (the compiler argument to be passed to R
+function knit2pdf), and vimrplugin_rst2pdfargs (further arguments to be passed
+to R function knit2pdf).
+
+
+------------------------------------------------------------------------------
+						 *vimrplugin_insert_mode_cmds*
+6.24. Allow R commands in insert mode~
+
+Vim-R commands are designed to work in insert mode as well as normal mode.
+However, depending on your , this can make it very difficult to
+write R packages or Sweave files.  For example, if  is set to the
+`\` character, typing `\dQuote` in a .Rd file tries to send the command!
+
+The option vimrplugin_insert_mode_cmds disables commands in insert mode.  To
+use it, add the following to your |vimrc|:
+>
+   let g:vimrplugin_insert_mode_cmds = 0
+<
+The default value is 1, for consistency with earlier versions.
+
+See also: |r-plugin-localleader|.
+
+
+------------------------------------------------------------------------------
+							 *vimrplugin_allnames*
+							 *vimrplugin_rmhidden*
+6.25. Show/remove hidden objects~
+
+Hidden objects are not included in the list of objects for omni completion. If
+you prefer to include them, put in your |vimrc|:
+>
+   let g:vimrplugin_allnames = 1
+<
+Hidden objects are removed from R workspace when you do rm. If
+you prefer to remove only visible objects, put in your |vimrc|:
+>
+   let g:vimrplugin_rmhidden = 0
+<
+
+------------------------------------------------------------------------------
+							   *vimrplugin_source*
+6.26. Source additional scripts~
+
+This variable should contain a comma separated list of Vim scripts to be
+sourced by the Vim-R-plugin. These scripts may provide additional
+functionality and/or change the behavior of the Vim-R-plugin. If you have such
+scripts, put in your |vimrc|:
+>
+   let vimrplugin_source = "~/path/to/MyScript.vim,/path/to/AnotherScript.vim"
+<
+Currently, there are only two scripts known to extend the Vim-R-plugin
+features:
+
+   Support to the devtools R package~
+   https://github.com/mllg/vim-devtools-plugin
+
+   Basic integration with GNU screen~
+   https://github.com/ssayols/screenR
+
+
+------------------------------------------------------------------------------
+							*vimrplugin_show_args*
+						   *vimrplugin_args_in_stline*
+6.28. Function arguments~
+
+If you want that Vim shows a preview window with the function arguments as you
+do omnicompletion, put in your |vimrc|:
+>
+   let vimrplugin_show_args = 1
+<
+The preview window is not shown by default because it is more convenient to
+run  to complete the function arguments. The preview window
+will be shown only if "preview" is also included in your 'completeopt'.
+
+If you want that function arguments are displayed in Vim's status line when
+you insert `(`, put in your |vimrc|:
+>
+   let vimrplugin_args_in_stline = 1
+<
+The status line is restored when `)` is typed. This option is useful only if
+the window has a status line. See |laststatus|. If the string with the list of
+arguments is longer than the status line width, the list is not displayed
+completely. This argument is incompatible with any plugin that changes the
+status line because it is always restored to the value that it had at Vim's
+startup. Functions of .GlobalEnv do not have their arguments displayed.
+
+
+------------------------------------------------------------------------------
+						      *vimrplugin_vimcom_wait*
+6.29. Time to wait for vimcom loading~
+
+The Vim-R-plugin waits 5000 milliseconds for vimcom package to be loaded
+during R startup. It then checks whether you are using the correct version of
+vimcom. If 5000 milliseconds is not enough to your R startup, then set a
+higher value for the variable in your |vimrc|. Example:
+>
+   let vimrplugin_vimcom_wait = 10000
+<
+
+------------------------------------------------------------------------------
+							   *vimrplugin_vim_wd*
+6.30 Start R in working directory of Vim~
+
+When you are editing an R file (.R, .Rnw, .Rd, .Rmd, .Rrst) and start R, the
+R package vimcom runs the command `setwd()` with the directory of the file
+being edited as argument, that is, the R working directory becomes the same
+directory of the R file. If you want R's working directory to be the same as
+Vim's working directory, put in your |vimrc|:
+>
+    let vimrplugin_vim_wd = 1
+<
+This option is useful only for those who did not enable 'autochdir'.
+
+If you prefer that the Vim-R-plugin does not set the working directory in any
+way, put in |vimrc|:
+>
+    let vimrplugin_vim_wd = -1
+<
+
+------------------------------------------------------------------------------
+						      *vimrplugin_after_start*
+6.31 System command to execute after R startup~
+
+If you want that Vim executes a command right after R startup, set the value
+of vimrplugin_after_start in your |vimrc|.
+
+For example, if you are using GVim and running R in the Gnome-terminal,
+`~/bin` is in your path, and you want to resize and change the positions of
+GVim and the Terminal windows, you may create a script `~/bin/after_R_start`
+with the following contents
+>
+   #!/bin/sh
+   wmctrl -F -r R -e 0,0,200,1200,800
+   wmctrl -r GVIM -e 0,300,40,1200,800
+<
+make the script executable, and put in your |vimrc|:
+>
+   if has("gui_running")
+       let vimrplugin_after_start = "after_R_start"
+   endif
+<
+On Mac OS X, if you are using MacVim and R.app, the `~/bin/after_R_start`
+contents might be:
+>
+   #!/bin/sh
+   osascript -e 'tell application "Terminal" to set the bounds of the front window to {0, 200, 1200, 1000}'
+   osascript -e 'tell application "MacVim" to set the bounds of the front window to {300, 40, 1500, 840}'
+<
+
+------------------------------------------------------------------------------
+						   *vimrplugin_user_maps_only*
+6.32 Only set key bindings that are user specified~
+
+The Vim-R-plugin sets many default key bindings.  The user can set custom
+key bindings (|r-plugin-key-bindings|).  If you wish the Vim-R-plugin to only
+set those key-bindings specified by the user, put in your vimrc:
+>
+    let vimrplugin_user_maps_only = 1
+<
+
+------------------------------------------------------------------------------
+							   *vimrplugin_tmpdir*
+							 *vimrplugin_compldir*
+6.33 Temporary files directories~
+
+You can change the directories where temporary files are created and
+stored by setting in your |vimrc| the values of vimrplugin_tmpdir and
+vimrplugin_compldir, as in the example below:
+>
+   let vimrplugin_tmpdir = "/dev/shm/R_tmp_dir"
+   let vimrplugin_compldir = "~/.cache/Vim-R-plugin"
+<
+The default paths of these directories depend on the operating system. If you
+want to know they are, while editing an R file, do in Normal mode:
+>
+   :echo g:rplugin_tmpdir
+   :echo g:rplugin_compldir
+<
+
+------------------------------------------------------------------------------
+9.34. Disable syntax highlight of R functions~
+
+If you want to disable the syntax highlight of R functions put in your
+|vimrc|:
+>
+   let R_hi_fun = 0
+<
+
+------------------------------------------------------------------------------
+							    *r-plugin-df-view*
+6.35 View a data.frame or matrix~
+
+The csv.vim plugin helps to visualize and edit csv files, and if it is not
+installed, the Vim-R-plugin will warn you about that when you do
+rv. If you do not want to install the csv.vim plugin, put in your
+|vimrc|:
+>
+   let vimrplugin_csv_warn = 0
+<
+If you rather prefer to see the table in a graphical viewer, you should set
+the value of vimrplugin_csv_app in your |vimrc|. Examples:
+>
+   let vimrplugin_csv_app = "localc"
+   let vimrplugin_csv_app = "c:/Program Files (x86)/LibreOffice 4/program/scalc.exe"
+<
+There is also the option of configuring the Vim-R-plugin to run an R command
+to display the data. Example:
+>
+   let vimrplugin_df_viewer = "relimp::showData(%s, font = 'Courier 14')"
+<
+The value of vimrplugin_df_viewer is a string and the substring `%s` is
+replaced by the name of the object under the cursor.
+
+
+------------------------------------------------------------------------------
+							    *r-plugin-SyncTeX*
+6.36 SyncTeX support~
+
+SyncTeX is a set of communication systems used by some PDF viewers and by some
+text editors which allow users to jump from a specific line in the text editor
+to the corresponding line in the PDF viewer and vice-versa. The Vim-R-plugin
+has support for Evince, Zathura and Okular SyncTeX systems.
+
+To completely disable SyncTeX support, put in your |vimrc|:
+>
+   let vimrplugin_synctex = 0
+<
+The application `wmctrl` is required to raise both the PDF viewer and Vim
+windows.
+
+No configuration is required if you use Evince and the knitr package, and
+single file Rnoweb documents. Otherwise, keep reading...
+
+If you use `Sweave()` rather than `knit()`, you must put in your Rnoweb
+document:
+>
+   \SweaveOpts{concordance=TRUE}
+<
+If you work with a master document and child subdocuments, each child
+subdocument (TeX and Rnoweb alike) should include the following line:
+>
+   % !Rnw root = master.Rnw
+<
+where `master.Rnw` must be replaced with the name of the actual master
+document.
+
+Note: The current knitr package (version 1.7) has at least two limitations:
+
+   - It has no SyncTeX support for child documents. The correspondence data
+     point to lines just below child chunks in the master document and not to
+     somewhere in the child documents themselves. See:
+     https://github.com/yihui/knitr/issues/225
+
+   - It only starts registering the concordance after the first chunk. So, it
+     is recommended that you put the first chunk of R code just after the
+     `\begin{document}` command.
+
+
+------------------------------------------------------------------------------
+6.36.1 Evince configuration~
+
+No configuration should be required.
+
+Note: If Evince is not started yet when you try to jump to the PDF document
+for the first time, it will start, but will not jump to desired line; you have
+to press gp again.
+
+
+------------------------------------------------------------------------------
+6.36.2 Okular configuration~
+
+You have to configure Okular to call Vim during backward searches.
+In Okular, click in:
+>
+   Settings
+   Configure Okular
+   Editor
+   Dropdown menu: Custom Text Editor
+         Command: vclientserver '%f' %l
+
+In the command above, replace `vim` with `gvim` if you use GVim.
+
+If Evince is not installed in your system, the Vim-R-plugin will automatically
+use Okular as the PDF viewer. Otherwise, you have to set the value of
+|vimrplugin_pdfviewer| to "okular":
+>
+   let vimrplugin_pdfviewer = "okular"
+<
+Note: If the PDF document is already open the first time that you jump to it,
+and if Okular was not started with the `--unique` argument, another instance
+of Okular will be started.
+
+
+------------------------------------------------------------------------------
+6.36.3 Zathura configuration~
+
+No configuration should be required if Evince is not installed. If evince is
+installed, put in your |vimrc|:
+>
+   let vimrplugin_pdfviewer = "zathura"
+<
+Zathura version must be >= 0.3.1.
+
+Note: If Zathura is not started yet when you try to jump to the PDF document
+for the first time, it will start, but will not jump to desired line; you have
+to press gp again.
+
+
+------------------------------------------------------------------------------
+6.36.4 Skim with MacVim configuration (Mac OS X)~
+
+You have to configure Skim to call `vclientserver` during backward searches.
+In Skim click in the drop down menu and fill the fields:
+>
+   Skim
+   Settings
+   Sync
+   Preset: Custom
+   Command: vclientserver
+   Arguments: '%file' %line
+<
+
+------------------------------------------------------------------------------
+6.36.5 Sumatra configuration (Windows)~
+
+No configuration is required.
+
+
 ==============================================================================
-8. Custom key bindings~
 						       *r-plugin-key-bindings*
+7. Custom key bindings~
+
 When creating custom key bindings for the Vim-R-plugin, it is necessary to
 create three maps for most functions because the way the function is called is
 different in each Vim mode. Thus, key bindings must be made for Normal mode,
-insert mode, and visual mode.
+Insert mode, and Visual mode.
 
 To customize a key binding you should put in your |vimrc| something like:
 >
-   nmap  RStart
-   imap  RStart
-   vmap  RStart
+   nmap sr RStart
+   imap sr RStart
+   vmap sr RStart
 <
-The above example shows how you can increase compatibility with old versions
-of the Vim-R-plugin, by changing the key binding used to start R from
-rf to the old default value, F2.
+The above example shows how to change key binding used to start R from
+rf to sr.
 
 Only the custom key bindings for Normal mode are shown in Vim's menu, but you
 can type |:map| to see the complete list of current mappings, and below is the
-list of the names for custom key bindings:
->
-   RBibTeX                    RESendFile                  RSendFunction
-   RCommentLine               RESendFunction              RSendLAndOpenNewOne
-   RClearAll                  RESendMBlock                RSendLine
-   RClearConsole              RESendParagraph             RSendMBlock
-   RClose                     RESendSelection             RSendParagraph
-   RCustomStart               RHelp                       RSendSelection
-   RDSendFunction             RListSpace                  RSetwd
-   RDSendLine                 RMakePDF                    RShowArgs
-   RDSendMBlock               RObjectNames                RShowEx
-   RDSendParagraph            RObjectPr                   RShowRout
-   RDSendSelection            RObjectStr                  RStart
-   REDSendFunction            RPlot                       RSummary
-   REDSendMBlock              RSPlot                      RSweave
-   REDSendParagraph           RSaveClose                  RUpdateObjBrowser
-   REDSendSelection           RSendFile                   RVanillaStart
-
+list of the names for custom key bindings (the prefix RE means "echo";
+RD, "cursor down"; RED, both "echo" and "down"):
+
+   Start/Close R~
+   RStart
+   RCustomStart
+   RClose
+   RSaveClose
+
+   Clear R console~
+   RClearAll
+   RClearConsole
+
+   Edit R code~
+   RSimpleComment
+   RSimpleUnComment
+   RToggleComment
+   RRightComment
+   RCompleteArgs
+   RIndent
+   RNextRChunk
+   RPreviousRChunk
+
+   Send line or part of it to R~
+   RSendLine
+   RDSendLine
+   RSendLAndOpenNewOne
+   RNLeftPart
+   RNRightPart
+   RILeftPart
+   RIRightPart
+   RDSendLineAndInsertOutput
+
+   Send code to R console~
+   RSendSelection
+   RESendSelection
+   RDSendSelection
+   REDSendSelection
+   RSendSelAndInsertOutput
+   RSendMBlock
+   RESendMBlock
+   RDSendMBlock
+   REDSendMBlock
+   RSendParagraph
+   RESendParagraph
+   RDSendParagraph
+   REDSendParagraph
+   RSendFunction
+   RESendFunction
+   RDSendFunction
+   REDSendFunction
+   RSendFile
+   RESendFile
+
+   Send command to R~
+   RHelp
+   RPlot
+   RSPlot
+   RShowArgs
+   RShowEx
+   RShowRout
+   RObjectNames
+   RObjectPr
+   RObjectStr
+   RViewDF
+   RSetwd
+   RSummary
+   RListSpace
+
+   Support to Sweave and knitr~
+   RSendChunk
+   RDSendChunk
+   RESendChunk
+   REDSendChunk
+   RSendChunkFH (from the first chunk to here)
+   RBibTeX    (Sweave)
+   RBibTeXK   (Knitr)
+   RSweave
+   RKnit
+   RMakeHTML
+   RMakePDF   (Sweave)
+   RMakePDFK  (Knitr)
+   RMakePDFKb (.Rmd, beamer)
+   RMakeODT   (.Rmd, Open document)
+   RMakeWord  (.Rmd, Word document)
+   RMakeRmd   (rmarkdown default)
+   RMakeAll   (rmarkdown all in yaml)
+   ROpenPDF
+   RSyncFor   (SyncTeX search forward)
+   RGoToTeX   (Got to LaTeX output)
+   RSpinFile
+   RNextRChunk
+   RPreviousRChunk
+
+   Object browser~
+   RUpdateObjBrowser
+   ROpenLists
+   RCloseLists
+
+The completion of function arguments only happens in Insert mode. To customize
+its keybind you should put in your |vimrc| something as in the example:
+>
+   imap  RCompleteArgs
 <
 The plugin also contains a function called RAction which allows you to build
 ad-hoc commands to R. This function takes the name of an R function such as
 "levels" or "table" and the word under the cursor, and passes them to R as a
-command. 
+command.
 
 For example, if your cursor is sitting on top of the object called gender and
 you call the RAction function, with an argument such as levels, Vim will pass
-the command levels(gender) to R, which will show you the levels of the object
-gender.
-
-To make it even easier to use this function, you could write a custom key
-binding that would allow you to rapidly get the levels of the object under
-your cursor. Add the following to your |vimrc| to have an easy way to pass R
-the levels command.
+the command `levels(gender)` to R, which will show you the levels of the
+object gender. To make it even easier to use this and other functions, you
+could write custom key bindings in your |vimrc|, as in the examples below:
 >
-   map rk :call RAction("levels")
+   map  rk :call RAction("levels")
+   map  t :call RAction("tail")
+   map  h :call RAction("head")
 <
-then (assuming that the local leader key is "\") if you type \rk R will
-receive the command
+If the command that you want to send does not require an R object as argument,
+you can create a shortcut to it by following the example:
 >
-   levels(myObject)
+   map  s :call g:SendCmdToR("search()")
 <
-You should replace rk with the key binding that you want to use
-and "levels" with the R function that you want to call.
+See also: |vimrplugin_source|.
 
 
 ==============================================================================
-9. Files~
 							      *r-plugin-files*
+8. License and files~
+
+The Vim-R-plugin is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2 of the License, or (at your option) any
+later version.
+
+The Vim-R-plugin is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+details.
+
+A copy of the GNU General Public License is available at
+http://www.r-project.org/Licenses/
+
+The files released with Vim runtime files are distributed under the Vim
+Charityware license.
+
 The following files are part of the plugin and should be in your ~/.vim
 directory after the installation:
 
-  
    autoload/rcomplete.vim
-   bitmaps/RClearAll.bmp
-   bitmaps/RClearAll.png
-   bitmaps/RClear.bmp
-   bitmaps/RClear.png
-   bitmaps/RClose.bmp
-   bitmaps/RClose.png
-   bitmaps/ricon.png
-   bitmaps/ricon.xbm
-   bitmaps/RListSpace.bmp
-   bitmaps/RListSpace.png
-   bitmaps/RSendBlock.bmp
-   bitmaps/RSendBlock.png
-   bitmaps/RSendFile.bmp
-   bitmaps/RSendFile.png
-   bitmaps/RSendFunction.bmp
-   bitmaps/RSendFunction.png
-   bitmaps/RSendLine.bmp
-   bitmaps/RSendLine.png
-   bitmaps/RSendParagraph.bmp
-   bitmaps/RSendParagraph.png
-   bitmaps/RSendSelection.bmp
-   bitmaps/RSendSelection.png
-   bitmaps/RStart.bmp
-   bitmaps/RStart.png
    doc/r-plugin.txt
    ftdetect/r.vim
-   ftplugin/rhelp.vim
-   ftplugin/rnoweb.vim
-   ftplugin/r.vim
+   ftplugin/r_rplugin.vim
    ftplugin/rbrowser.vim
-   indent/r.vim
-   indent/rhelp.vim
-   indent/rnoweb.vim
-   r-plugin/build_omniList.R
+   ftplugin/rdoc.vim
+   ftplugin/rhelp_rplugin.vim
+   ftplugin/rmd_rplugin.vim
+   ftplugin/rnoweb_rplugin.vim
+   ftplugin/rrst_rplugin.vim
    r-plugin/common_buffer.vim
    r-plugin/common_global.vim
-   r-plugin/etags2ctags.R
    r-plugin/functions.vim
-   r-plugin/omniList
-   r-plugin/vimbrowser.R
-   r-plugin/vimhelp.R
-   r-plugin/vimprint.R
-   r-plugin/vimSweave.R
+   r-plugin/gui_running.vim
+   r-plugin/osx.vim
    r-plugin/r.snippets
-   r-plugin/specialfuns.R
-   r-plugin/tex_indent.vim
-   r-plugin/vimActivate.js
-   r-plugin/windows.py
+   r-plugin/rmd.snippets
+   r-plugin/setcompldir.vim
+   r-plugin/synctex_evince_backward.py
+   r-plugin/synctex_evince_forward.py
+   r-plugin/windows.vim
    syntax/rbrowser.vim
+   syntax/rdoc.vim
    syntax/rout.vim
-   syntax/r.vim
 
-8 directories, 39 files
 
 ==============================================================================
-10. FAQ and tips~
 							       *r-plugin-tips*
+9. FAQ and tips~
 
-10.1. Is it possible to stop R from within Vim?~
+9.1. Is it possible to stop R from within Vim?~
 
-Sorry, it is not possible. You have to press ^C into R's terminal emulator.
+Yes. In Normal mode do `:RStop` and Vim will send SIGINT to R which is the
+same signal sent when you press CTRL-C into R's Console.
 
 
-10.2. Html help and custom pager~
+------------------------------------------------------------------------------
+9.2. Html help and custom pager~
 
-If you prefer to see help pages in a html browser, put in your ~/.Rprofile:
+If you prefer to see help pages in an html browser, put in your `~/.Rprofile`:
 >
    options(help_type = "html")
 <
@@ -1288,40 +2195,48 @@ and in your |vimrc| (see |vimrplugin_vimpager|):
    let vimrplugin_vimpager = "no"
 <
 
-10.3. How do marked blocks work?~
+------------------------------------------------------------------------------
 							  *r-plugin-showmarks*
-Vim allows several marks (bookmarks). The most commonly used marks are the
-lowercase alphabet letters.  If the cursor is between any two marks, the
-plugin will send all of the lines between them to R.
-  
-To make it easier to remember where blocks begin and end, we recommended that
-you use the ShowMarks plugin available at:
+9.3. How do marked blocks work?~
+
+Vim allows you to put several marks (bookmarks) in buffers (see |mark|). The
+most commonly used marks are the lowercase alphabet letters. If the cursor is
+between any two marks, the plugin will send the lines between them to R if you
+press bb. If the cursor is above the first mark, the plugin will
+send from the beginning of the file to the mark. If the cursor is below the
+last mark, the plugin will send from the mark to the end of the file. The mark
+above the cursor is included and the mark below is excluded from the block to
+be sent to R. To create a mark, press m in Normal mode.
+
+We recommended the use of either ShowMarks or vim-signature which show what
+lines have marks defined. The plugins are available at:
 
    http://www.vim.org/scripts/script.php?script_id=152
-  
-This plugin makes it possible to visually manage your marks. You may want to
-add the following two lines to your |vimrc| to customize ShowMarks behavior:
->
-   let marksCloseWhenSelected = 0
-   let showmarks_include = "abcdefghijklmnopqrstuvwxyz"
-<
+   https://github.com/kshenoy/vim-signature
 
-10.4. Use snipMate~
+
+------------------------------------------------------------------------------
 							   *r-plugin-snippets*
+9.4. Use snipMate~
+
 You probably will want to use the snipMate plugin to insert snippets of code
 in your R script. The plugin may be downloaded from:
 
    http://www.vim.org/scripts/script.php?script_id=2540
 
 The snipMate plugin does not come with snippets for R, but you can copy the
-r.snippets that ships with the Vim-R-plugin (look at the r-plugin directory)
-to the snippets directory. The file has only a few snippets, but it will help
-you to get started. If you usually edit rnoweb files, you may also want to
-create an rnoweb.snippet by concatenating both tex.snippets and r.snippets.
+files r.snippets and rmd.snippets that ship with the Vim-R-plugin (look at the
+r-plugin directory) to the snippets directory. The files have only a few
+snippets, but they will help you to get started. If you usually edit rnoweb
+files, you may also want to create an rnoweb.snippets by concatenating both
+tex.snippets and r.snippets. If you edit R documentation, you may want to
+create an rhelp.snippets
 
 
-10.5. Easier key bindings for most used commands~
+------------------------------------------------------------------------------
 							   *r-plugin-bindings*
+9.5. Easier key bindings for most used commands~
+
 The most used commands from Vim-R-plugin probably are "Send line" and "Send
 selection". You may find it a good idea to map them to the space bar in your
 |vimrc| (suggestion made by Iago Mosqueira):
@@ -1333,53 +2248,70 @@ You may also want to remap :
 
    http://stackoverflow.com/questions/2269005/how-can-i-change-the-keybinding-used-to-autocomplete-in-vim
 
+Note: Not all mappings work in all versions of Vim. Some mappings may not work
+on GVim on Windows, and others may not work on Vim running in a terminal
+emulator or in Linux Console. The use of ,  and  keys in
+mappings are particularly problematic. See:
+
+   https://github.com/jcfaria/Vim-R-plugin/issues/111
+
 
-10.6. Remap the ~
+------------------------------------------------------------------------------
 							*r-plugin-localleader*
+9.6. Remap the ~
+
 People writing Rnoweb documents may find it better to use a comma or other key
-as the  instead of the default backslash (see |maplocalleader|):
+as the  instead of the default backslash (see |maplocalleader|).
+For example, to change the  to a comma, put at the beginning of
+your |vimrc| (before any mapping command):
 >
    let maplocalleader = ","
 <
 
-10.7. Use a tags file to jump to function definitions~
+------------------------------------------------------------------------------
 							   *r-plugin-tagsfile*
+9.7. Use a tags file to jump to function definitions~
+
 Vim can jump to a function definition if it finds a "tags" file with the
-information about the place where the function is defined.  To generate the
-tags file, use the R function rtags(), which will build an Emacs tags file.
+information about the place where the function is defined. To generate the
+tags file, use the R function `rtags()`, which will build an Emacs tags file.
 If Vim was compiled with the feature |emacs_tags|, it will be able to read the
-tags file. Otherwise, you can use the function etags2ctags() from the script
-located at ~/.vim/r-plugin/etags2ctags.R to convert the Emacs tags file into a
-Vim's one. To jump to a function definition, put the cursor over the function
-name and hit CTRL-]. Please, read |tagsrch.txt| for details on how to use tags
-files, specially the section |tags-option|.
+tags file. Otherwise, you can use the vimcom function `etags2ctags()` to
+convert the Emacs tags file into a Vim's one. To jump to a function
+definition, put the cursor over the function name and hit CTRL-]. Please, read
+|tagsrch.txt| for details on how to use tags files, specially the section
+|tags-option|.
 
 You could, for example, download and unpack R's source code, start R inside
-the ~/.vim directory and do the following command:
+the ~/.vim directory and do the following commands:
 >
    rtags(path = "/path/to/R/source/code", recursive = TRUE, ofile = "RTAGS")
+   etags2ctags("RTAGS", "Rtags")
 <
 Then, you would quit R and do the following command in the terminal emulator:
 >
    ctags --languages=C,Fortran,Java,Tcl -R -f RsrcTags /path/to/R/source/code
 <
-Finally, you would put the following in your |vimrc|, inside an |autocmd-group|:
+Finally, you would put the following in your |vimrc|, optionally inside an
+|autocmd-group|:
 >
-   autocmd FileType r set tags+=~/.vim/RTAGS,~/.vim/RsrcTags
-   autocmd FileType rnoweb set tags+=~/.vim/RTAGS,~/.vim/RsrcTags
+   autocmd FileType r set tags+=~/.vim/Rtags,~/.vim/RsrcTags
+   autocmd FileType rnoweb set tags+=~/.vim/Rtags,~/.vim/RsrcTags
 <
-Note: While defining the autocmd, the RTAGS path must be put before RsrcTags.
+Note: While defining the autocmd, the Rtags path must be put before RsrcTags.
 
 Example on how to test whether your setup is ok:
 
-   1. Type "mapply()" in an R script and save the buffer.
+   1. Type `mapply()` in an R script and save the buffer.
    2. Press CTRL-] over "mapply" (Vim should jump to "mapply.R").
-   4. Locate the string "do_mapply", which is the name of a C function.
-   5. Press CTRL-] over "do_mapply" (Vim sould jump to "mapply.c").
+   3. Locate the string "do_mapply", which is the name of a C function.
+   4. Press CTRL-] over "do_mapply" (Vim sould jump to "mapply.c").
 
 
-10.8. Indenting setup~
+------------------------------------------------------------------------------
 							  *r-plugin-indenting*
+9.8. Indenting setup~
+
 Note: In Normal mode, type |==| to indent the current line and gg=G to format
 the entire buffer (see |gg|, |=| and |G| for details). These are Vim commands;
 they are not specific to R code.
@@ -1391,10 +2323,10 @@ If you prefer do not have the arguments of functions aligned, put in your
 >
    let r_indent_align_args = 0
 <
-By default, all lines beginning with a comment character, #, get the same
+By default, all lines beginning with a comment character, `#`, get the same
 indentation level of the normal R code. Users of Emacs/ESS may be used to have
-lines beginning with a single # indented in the 40th column, ## indented as R
-code, and ### not indented. If you prefer that lines beginning with comment
+lines beginning with a single `#` indented in the 40th column, `##` indented as R
+code, and `###` not indented. If you prefer that lines beginning with comment
 characters are aligned as they are by Emacs/ESS, put in your |vimrc|:
 >
    let r_indent_ess_comments = 1
@@ -1421,16 +2353,18 @@ Below is an example of indentation with and without this option enabled:
    }                                             }
 <
 Notes: (1) Not all code indented by Emacs/ESS will be indented by the
-	   Vim-R-plugin in the same way, and, in some circumstances it may be
-	   necessary to make changes in the code to get it properly indented
-	   by Vim (you may have to either put or remove braces and line
-	   breaks).
+           Vim-R-plugin in the same way, and, in some circumstances it may be
+           necessary to make changes in the code to get it properly indented
+           by Vim (you may have to either put or remove braces and line
+           breaks).
        (2) Indenting is not a file type plugin option. It is a feature defined
            in indent/r.vim. That is why it is documented in this section.
 
 
-10.9. Folding setup~
+------------------------------------------------------------------------------
 							    *r-plugin-folding*
+9.9. Folding setup~
+
 Vim has several methods of folding text (see |fold-methods| and
 |fold-commands|). To enable the syntax method of folding for R files, put in
 your |vimrc|:
@@ -1445,8 +2379,29 @@ prefer to start editing files with all folds open, put in your |vimrc|:
 Notes: (1) Enabling folding may slow down Vim. (2) Folding is not a file type
 plugin option. It is a feature defined in syntax/r.vim.
 
+Note: Indentation of R code is very slow because the indentation algorithm
+sometimes goes backwards looking for an opening parenthesis or brace or for
+the beginning of a `for`, `if` or `while` statement. This is necessary because
+the indentation level of a given line depends on the indentation level of the
+previous line, but the previous line is not always the line above. It's the
+line where the statement immediately above started. Of course someone may
+develop a better algorithm in the future.
+
+
+------------------------------------------------------------------------------
+9.10. Highlight chunk header as R code~
+
+By default, Vim will highlight chunk headers of RMarkdown and
+RreStructuredText with a single color. Chunk headers should contain valid R
+code when the code is processed by knitr, so you may want to highlight them as
+such. You can do this by putting in your |vimrc|:
+>
+   let rrst_syn_hl_chunk = 1
+   let rmd_syn_hl_chunk = 1
+<
 
-10.10. Automatically close parenthesis~
+------------------------------------------------------------------------------
+9.11. Automatically close parenthesis~
 
 Some people want Vim automatically inserting a closing parenthesis, bracket or
 brace when an open one has being typed. The page below explains how to achieve
@@ -1455,70 +2410,50 @@ this goal:
    http://vim.wikia.com/wiki/Automatically_append_closing_characters
 
 
-10.11. Automatic line breaks~
+------------------------------------------------------------------------------
+9.12. Automatic line breaks~
 
-By default, Vim breaks lines when you are typing if you reach the column
-defined by the 'textwidth' option. If you prefer that Vim does not break the R
-code automatically, breaking only comment lines, put in your |vimrc|:
+By default, while editing R code, Vim does not break lines when you are typing
+if you reach the column defined by the 'textwidth' option. If you prefer that
+Vim breaks the R code automatically put in your |vimrc|:
 >
-   autocmd FileType r setlocal formatoptions=cq
+   autocmd FileType r setlocal formatoptions+=t
 <
 
-10.12. Run your Makefile from within R~
+------------------------------------------------------------------------------
+9.13. Vim with 256 colors in a terminal emulator (Linux/Unix only)~
+
+If you want 256 colors support in Vim, install the package ncurses-term. Then
+put in your `~/.bashrc` the lines suggested at |r-plugin-bash-setup|.
+
+You have to search the internet for color schemes supporting 256 colors,
+download and copy them to ~/.vim/colors. You may use the command
+|:colorscheme| to try them one by one before setting your preference in your
+|vimrc|.
+
+
+------------------------------------------------------------------------------
+9.14. Run your Makefile from within R~
 
 Do you have many Rnoweb files included in a master tex or Rnoweb file and use
 a Makefile to build the pdf? You may consider it useful to put the following
 line in your |vimrc|:
 >
-   nmap sm :update:call SendCmdToR('system("make")')
+   nmap sm :update:call g:SendCmdToR('system("make")')
 <
 
-10.13. Group windows with compiz~
-
-If you are using Compiz, it may be easier to work with the plugin if the
-various related windows (editor, terminal, and graphics window) are grouped
-because they will be raised together when one of them receives the focus.  You
-may need CompizConfig Settings Manager installed to enable this feature (look
-at the "Window Management" section for "Group and Tab Windows").
-
-
-10.14. Why do I have to updated the Object Browser manually?~
-
-It is because Vim and R run as separate processes and, thus, it is not
-possible to Vim to know whether R is busy or not. If R was running as part of
-the text editor, as happens with JGR and RKward, which are linked to libR.so,
-it would be possible to wait for R to finish processing a command before
-sending to it a command to rebuild the list of objects for the Object Browser.
-This command should be sent after each line sent to R.  But if the
-Vim-R-plugin did this, the use of Vim would be blocked until R finished its
-processing. 
+------------------------------------------------------------------------------
+							   *r-plugin-Rprofile*
+9.15. Edit your ~/.Rprofile~
 
-
-10.15. Edit your ~/.Rprofile~
-
-You may want to edit your ~/.Rprofile. Two common options are the use of GVim
-as the text editor and the use of html help. Example for Linux with these two
-options and some others:
+You may want to edit your `~/.Rprofile` in addition to considering the
+suggestions of |r-plugin-R-setup| you may also want to put the following
+lines in your `~/.Rprofile` if you are using Linux:
 >
-   if (interactive()) {
-     local({
-        options(editor = 'gvim -f -c "set ft=r"')
-        options(warn = 1)
-        options(max.print = 999)
-        if(nchar(Sys.getenv("DISPLAY")) > 1){
-            options(help_type = "html")
-            grDevices::X11.options(width = 4.5, height = 4,
-	        xpos = 1000, ypos = 0, pointsize = 10)
-        } else {
-            options(help_type = "text")
-        }
-     })
-   }
+   grDevices::X11.options(width = 4.5, height = 4, ypos = 0,
+                          xpos = 1000, pointsize = 10)
 <
-The test for the environment variable DISPLAY is useful if you eventually use
-the plugin over ssh or on the Linux console.
-
-The X11.options() is used to choose the position and dimensions of the X11
+The `X11.options()` is used to choose the position and dimensions of the X11
 graphical device. You can also install the application wmctrl and create
 shortcuts in your desktop environment to the commands
 >
@@ -1532,95 +2467,508 @@ which can display R plots in a separate panel. Although we can not embed an R
 graphical device in Vim, we can at least make it always visible over the
 terminal emulator or the GVim window.
 
-An example for Windows:
->
-   if (interactive()) {
-     local({
-       options(editor = '"C:/Program Files (x86)/Vim/vim73/gvim.exe" "-c" "set filetype=r"')
-       options(help_type = "html")
-     })
-   }
-<
 
-10.16. Debugging R functions~
+------------------------------------------------------------------------------
+9.16. Debugging R functions~
 
 The Vim-R-Plugin does not have debugging facilities, but you may want to use
 the R package "debug":
 >
    install.packages("debug")
    library(debug)
-   mtrace(function)
+   mtrace(function_name)
 <
-Once the library is installed and loaded, you should use mtrace(function_name)
-to enable debugging a function. Then, the next time that the function is
-called it will enter in debugging mode. Once debugging a function, you can hit
- to evaluate the current line, go(n) to go to line n in the function
-and qqq() to quit the function (See debug's help for details).
+Once the library is installed and loaded, you should use `mtrace(function_name)`
+to enable the debugging of a function. Then, the next time that the function
+is called it will enter in debugging mode. Once debugging a function, you can
+hit  to evaluate the current line, `go(n)` to go to line `n` in the
+function and `qqq()` to quit the function (See debug's help for details). A
+useful tip is to click on the title bar of the debug window and choose "Always
+on top" or a similar option provided by your desktop manager.
+
+
+------------------------------------------------------------------------------
+							  *r-plugin-latex-box*
+9.17. Integration with LaTeX-Box~
+
+LaTeX-Box does not automatically recognize Rnoweb files as a valid LaTeX file.
+You have to tell LaTeX-BoX that the .tex file compiled by either `knitr()` or
+`Sweave()` is the main LaTeX file. You can do this in two ways. Suppose that
+your Rnoweb file is called report.Rnw... You can:
 
+    (1) Create an empty file called "report.tex.latexmain".
 
-10.17. Turn the R-plugin into a global plugin~
-							     *r-plugin-global*
-The Vim-R-plugin is a file type plugin. If you want its functionality
-available for all file types, then do one of the following:
+    or
 
-10.17.1. When using either GVim or Vim + Conque Shell plugin~
+    (2) Put in the first 5 lines of report.Rnw:
 
-Go to your ~/.vim/plugin directory and create a symbolic link to
-~/.vim/r-plugin/global_r_plugin.vim. That is, type the following
-in an terminal emulator:
+        % For LaTeX-Box: root = report.tex
+
+Of course you must run either `knitr()` or `Sweave()` before trying LaTeX-Box
+omnicompletion. Please, read LaTeX-Box documentation for more information.
+
+See also: |vimrplugin_latexcmd|.
+
+
+------------------------------------------------------------------------------
+							*r-plugin-quick-setup*
+9.18. Suggested setup for the Vim-R-plugin~
+
+Please, look at section |r-plugin-options| if you want information about the
+Vim-r-plugin customization.
+
+Here are some suggestions of configuration of Vim, Bash, Tmux and R. To
+understand what you are doing, and change the configuration to your taste,
+please read this document from the beginning.
+
+							*r-plugin-vimrc-setup*
+   ~/.vimrc~
 >
-   cd ~/.vim/plugin/
-   ln -s ../r-plugin/global_r_plugin.vim
+   " Minimum required configuration:
+   set nocompatible
+   syntax on
+   filetype plugin on
+   filetype indent on
+
+   " Change Leader and LocalLeader keys:
+   let maplocalleader = ","
+   let mapleader = ";"
+
+   " Use Ctrl+Space to do omnicompletion:
+   if has("gui_running")
+       inoremap  
+   else
+       inoremap  
+   endif
+
+   " Press the space bar to send lines and selection to R:
+   vmap  RDSendSelection
+   nmap  RDSendLine
+
+   " The lines below are suggestions for Vim in general and are not
+   " specific to the improvement of the Vim-R-plugin.
+
+   " Highlight the last searched pattern:
+   set hlsearch
+
+   " Show where the next pattern is as you type it:
+   set incsearch
+
+   " By default, Vim indents code by 8 spaces. Most people prefer 4
+   " spaces:
+   set sw=4
+
+   " Search "Vim colorscheme 256" in the internet and download color
+   " schemes that supports 256 colors in the terminal emulator. Then,
+   " uncomment the code below to set you color scheme:
+   "colorscheme not_defined
 <
-Then, typing rf will activate the plugin and start an R session.
-The rf shortcut is hardcoded in the global_r_plugin.vim script.
-If you prefer to use another shortcut, instead of creating a symbolic link,
-make a copy of the file to the ~/.vim/plugin directory and edit it. On
-Windows, you probably will have to make a copy of the file to the
-~/vimfiles/plugin directory.
 
-10.17.2. When using Vim + screen plugin (either screen or tmux)~
+							    *r-plugin-R-setup*
+   ~/.Rprofile~
+>
+   if(interactive()){
+       options(vimcom.verbose = 1)
+       # Load the required libraries:
+       library(colorout)
+       library(setwidth)
+
+       # Use the text based web browser w3m to navigate through R docs
+       # in Linux Console after help.start():
+       if(Sys.getenv("TMUX") != "" && Sys.getenv("DISPLAY") == "")
+	   options(browser = function(u) system(paste0("tmux new-window 'w3m ", u, "'")))
+   }
+<
 
-Put in your |vimrc| (replace  with the shortcut of your preference):
+							 *r-plugin-bash-setup*
+   ~/.bashrc (Linux, Mac OS X, and other Unix systems):~
 >
-   nmap  :runtime ftplugin/r.vim
+   # Change the TERM environment variable (to get 256 colors) even if you are
+   # accessing your system through ssh and using either Tmux or GNU Screen:
+   if [ "$TERM" = "xterm" ] || [ "$TERM" = "xterm-256color" ]
+   then
+       export TERM=xterm-256color
+       export HAS_256_COLORS=yes
+   fi
+   if [ "$TERM" = "screen" ] && [ "$HAS_256_COLORS" = "yes" ]
+   then
+       export TERM=screen-256color
+   fi
+
 <
-Press \rf to use R. Tha is, press  before AND after starting R
-with the shortcut rf (or any other key binding that you have
-defined in your |vimrc| as the shortcut to start R). The first time that 
-is pressed, the plugin's functions and key bindings are made available.
-However, when R is started, Vim is closed and restarted by the screen plugin,
-and the Vim-R-plugin functions and key bindings are lost. Consequently, the
-ftplugin/r.vim script must be sourced again by pressing  for the second
-time.
 
 
-10.18. Vim-LaTeX-suite and Rnoweb files~
+Finally, if you want to use vi key bindings in Bash or other shell:
 
-If you want to use the Vim-LaTeX-suite plugin with Rnoweb files, create a file
-named rnw.vim at ~/.vim/ftdetect with the following content:
+   ~/.inputrc~
 >
-   autocmd BufRead,BufNewFile *.Rnw set filetype=tex
-   autocmd BufRead,BufNewFile *.rnw set filetype=tex
+   set editing-mode vi
+   set keymap vi
+<
+
+------------------------------------------------------------------------------
+
+9.19. Syntax highlight of .Rout files~
+
+You can set the foreground colors of R output in your |vimrc|. The example
+below is for a terminal emulator that supports 256 colors (see |:highlight|):
+>
+   if &t_Co == 256
+       let rout_color_input    = 'ctermfg=247'
+       let rout_color_normal   = 'ctermfg=202'
+       let rout_color_number   = 'ctermfg=214'
+       let rout_color_integer  = 'ctermfg=214'
+       let rout_color_float    = 'ctermfg=214'
+       let rout_color_complex  = 'ctermfg=214'
+       let rout_color_negnum   = 'ctermfg=209'
+       let rout_color_negfloat = 'ctermfg=209'
+       let rout_color_date     = 'ctermfg=184'
+       let rout_color_true     = 'ctermfg=78'
+       let rout_color_false    = 'ctermfg=203'
+       let rout_color_inf      = 'ctermfg=39'
+       let rout_color_constant = 'ctermfg=179'
+       let rout_color_string   = 'ctermfg=172'
+       let rout_color_error    = 'ctermfg=15 ctermbg=1'
+       let rout_color_warn     = 'ctermfg=1'
+       let rout_color_index    = 'ctermfg=186'
+   endif
+<
+To know what number corresponds to your preferred color (among the 256
+possibilities), hover you mouse pointer over the table of colors made in R by
+the following command:
+>
+   library("colorout")
+   show256Colors()
+<
+If you prefer that R output is highlighted using you current |:colorscheme|,
+put in your |vimrc|:
+>
+   let rout_follow_colorscheme = 1
 <
 
 ==============================================================================
-11. News~
 							       *r-plugin-news*
+10. News~
+
+1.3.1 (2016-03-16)
+
+ * Require vimcom 1.3-1 and Vim >= 7.4.1579.
+
+1.3.0 (2016-03-12)
+
+ * Fix missing files in vimball: r-plugin/tmux.vim, r-plugin/tmux_split.vim
+   and r-plugin/extern_term.vim.
+
+1.2.9 (2016-03-11)
+
+ * Delete option vimrplugin_restart
+
+ * Use the +channel feature instead of +clientserver.
+
+1.2.8 (2016-02-20)
+
+ * New option (Windows only): vimrplugin_set_home_env.
+
+ * Fix bug on Windows: R starting minimized after trying to quit R minimized.
+
+1.2.7 (2015-11-27)
+
+ * Fix incompatibility with Tmux 2.1.
+
+1.2.6 (2015-06-12)
+
+ * Improve support for lazy load objects in the Object Browser.
+
+ * Remove option vimrplugin_vim_window (use $WINDOWID instead).
+
+ * Fix bug that prevented GVim 64 bit of finding libVimR.dll.
+
+1.2.5 (2015-05-06)
+
+ * New command to evaluate selection and get output in newtab: \so
+
+ * The command \ao no longer blocks Vim.
+
+ * New command (\rv) and new options (vimrplugin_csv_warn,
+   vimrplugin_csv_app and vimrplugin_df_viewer).
+
+ * Bring back the "echo" send commands because some users need them.
+
+1.2.4 (2015-04-22)
+
+ * Deleted r-plugin/global_R_plugin.vim. See:
+   https://github.com/jalvesaq/vimcmdline
+
+1.2.3 (2015-04-09)
+
+ * Official runtime files were deleted. See:
+   https://github.com/jalvesaq/R-Vim-runtime
+
+ * News options to control the Object Browser: vimrplugin_objbr_opendf,
+   vimrplugin_objbr_openlist, vimrplugin_objbr_allnames and
+   vimrplugin_objbr_labelerr.
+
+ * New option to control LaTeX compilation: vimrplugin_texerr.
+
+ * Fix setting of R working directory on Mac OS X.
+
+1.2.2 (2015-03-24)
+
+ * Remove option to start R with the --vanilla argument. See vimrplugin_r_args
+   for an alternative.
+
+ * Minor bug fixes.
+
+1.2.1 (2015-03-05)
+
+ * Minor bug fixes.
+
+ * New options: vimrplugin_after_start, vimrplugin_args_in_stline,
+   vimrplugin_save_win_pos and vimrplugin_arrange_windows.
+
+ * Remove option vimrplugin_maxdeparse, remove the "echo" send
+   commands and add the option vimrplugin_source_args.
+
+1.2 (2015-01-18)
+
+ * Remove support for Neovim. See: https://github.com/jalvesaq/Nvim-R
+
+ * Remove command :RpluginConfig.
+
+ * Remove option vimrplugin_Rterm.
+
+ * Change commands gn and gN to gn and gN.
+
+ * Change default value of vimrplugin_openpdf to 2.
+
+ * Options vimrplugin_sleeptime now should be in miliseconds.
+
+ * Replace option vimrplugin_external_ob with vimrplugin_tmux_ob.
+
+ * Rename vimrplugin_permanent_libs to vimrplugin_start_libs.
+
+ * Rename vimrplugin_routmorecolors to Rout_more_colors.
+
+ * New command: :RStop.
+
+ * No longer require +python feature; require +libcall instead.
+
+ * Support for SyncTeX on Windows and Mac OS X.
+
+ * New option: vimrplugin_latexmk
+
+1.1 (2014-11-13)
+
+ * Version update for Linux/Unix only. May not work on Windows or Mac.
+
+ * Minor bug fixes.
+
+ * The option vimrplugin_assign now accepts the values 0, 1 and 2.
+
+ * SyncTeX support (Evince, Okular and Zathura):
+   - New options: vimrplugin_synctex and vimrplugin_vim_window.
+   - Deprecated option: vimrplugin_openpdf_quietly
+
+1.0 (2014-07-02)
+
+ * The package now depends on vimcom (which is fully featured and is no longer
+   on CRAN).
+
+ * Neovim support.
+
+ * vimrplugin_openpdf now accepts three values: 0, 1 and 2.
+
+ * New command \o evaluates current line in R and inserts the output in the
+   script.
+
+ * New options: vimrplugin_vimcom_wait, vimrplugin_vim_wd, and
+   vimrplugin_tmux_title.
+
+ * Minor bug fixes.
+
+0.9.9.9 (2014-02-01)
+
+ * Minor bug fixes.
+
+ * Delete temporary files on VimLeave event.
+
+ * Support to R package slidify (thanks to Michael Lerch).
+
+ * New option: vimrplugin_rcomment_string.
+
+0.9.9.8 (2013-11-30)
+
+ * The list of objects for omnicompletion and the list of functions for syntax
+   highlight now are built dynamically. Deprecated commands and options:
+   :RUpdateObjList, :RAddLibToList, vimrplugin_buildwait. New option:
+   vimrplugin_permanent_libs.
+
+ * New options: vimrplugin_show_args.
+
+ * New command \ch: send to R Console all R code from the first chunk up to
+   this line.
+
+ * Remove toolbar icons (they still may be added back manually by interested
+   users).
+
+ * If latexmk is installed, use it by default to compile the pdf.
+
+0.9.9.7 (2013-11-06)
+
+ * Minor bug fixes.
+
+0.9.9.6 (2013-10-31)
+
+ * Minor bug fixes.
+
+0.9.9.5 (2013-10-12)
+
+ * Minor bug fixes.
+
+0.9.9.4 (2013-09-24)
+
+ * Minor bug fixes.
+ * The package now depends on vimcom.plus.
+ * The support to GNU Screen, VimShell and Conque Shell was dropped. The
+   screen plugin no longer is used.
+ * The delete command was removed from the Object Browser.
+ * New options: vimrplugin_vsplit, vimrplugin_rconsole_height and
+   vimrplugin_rconsole_width.
+ * New option: vimrplugin_restart.
+ * Show elements of S4 objects in the Object Browser.
+
+0.9.9.3 (2013-04-11)
+
+ * Minor bug fixes.
+ * New option: vimrplugin_source.
+
+0.9.9.2 (2013-02-01)
+
+ * Update vimcom version requirement to 0.9-7 (fix incompatibility with tcltk
+   package on Unix).
+ * Change the default value of vimrplugin_rmhidden to 0.
+ * New option for Windows: vimrplugin_Rterm.
+ * New simpler un/comment commands: xc and xu.
+ * Remove options vimrplugin_nosingler and vimrplugin_by_vim_instance.
+
+0.9.9.1 (2012-12-11)
+
+ * Enable mouse on Tmux again.
+
+0.9.9 (2012-12-03)
+
+ * New commands:  :Rinsert  and  :Rformat.
+ * Automatically update the Object Browser in GVim.
+ * On MS Windows, don't raise the R Console before sending CTRL-V to it.
+ * Search for vimcom in both IPv4 and IPv6 ports (thanks to Zé Loff for
+   writing the patch).
+
+0.9.8 (2012-10-13)
+
+ * Open PDF automatically after processing Rnoweb file if
+   vimrplugin_openpdf = 1 (thanks to Tomaz Ficko for suggesting the feature).
+   Open it quietly if vimrplugin_openpdf_quietly = 1.
+   Open it manually with \op.
+ * Open HTML automatically after processing either Rmd or Rrst file if
+   vimrplugin_openhtml = 1. Generate strict rst code if
+   vimrplugin_strict_rst = 1.
+ * Remove option vimrplugin_knitargs.
+ * Start last R if there is more than one installed on Windows (thanks to Alex
+   Zvoleff for reporting the bug and writing the patch).
+ * Alex Zvoleff added support to Rrst file type.
+ * michelk added support to Rmd file type.
+ * For Rnoweb, Rmd and Rrst file types, CTRL-X CTRL-A completes knitr chunk
+   options if the cursor is inside the chunk header.
+ * New option: vimrplugin_rmhidden.
+ * New option: vimrplugin_insert_mode_cmds (thanks to Charles R. Hogg III).
+ * New command  :RAddLibToList  to add the objects of specific libraries to
+   omnicompletion.
+ * Thanks to genrich and NagatoPain for other bug fixes and code improvements.
+ * New option: vimrplugin_assign_map. The option vimrplugin_underscore was
+   renamed to vimrplugin_assign
+
+0.9.7 (2012-05-04)
+
+ * Use the R package vimcom:
+     - Automatic update of the Object Browser when running R in a Tmux
+       session.
+     - The following options are now set on the vimcom R package and no longer
+       in the Vim-R-plugin: allnames, open_df, and open_list.
+     - New command in normal and visual modes when on the Object Browser: "d"
+       deletes objects and detach libraries. New option: vimrplugin_ob_sleep.
+ * New option, vimrplugin_external_ob, to open the Object Browser in a Tmux
+   pane in the external terminal running R.
+ * New command  :Rhelp (thanks for Nir Atias for suggesting the new feature).
+ * Remove the command  :RUpdateObjListAll  because Vim may not load the
+   syntax file if it is too big.
+ * Add support to knitr package.
+ * New command  :RSourceDir.
+ * New key bindings \r and \r.
+ * Correctly send selected blocks.
+
+0.9.6 (2011-12-13)
+
+ * Fix path to R source() command on Windows.
+ * New default value of vimrplugin_vimpager = "tab".
+ * New default value of vimrplugin_objbr_place = "editor,right"
+ * Autocompletion of function arguments with .
+
+0.9.5 (2011-12-07)
+
+ * Changed the way that blocks are sent to R.
+ * Added "terminal" to the list of known terminal emulators (thanks for "i5m"
+   for the patch).
+ * Use Tmux to start the Object Browser beside the R console if
+   vimrplugin_objbr_place =~ "console".
+ * The file r-plugin/omniList was renamed to r-plugin/omnils because its
+   field separator changed.
+
+111114 (2011-11-14)
+ * Changed key binding for commenting/uncommenting code from \cc to \xx.
+ * Added function SendChunkToR() and its corresponding key bindings:
+   \cc, \ce, \cd and \ca (thanks to Xavier Fernández i Marín for suggesting
+   the feature).
+ * New option (vimrplugin_ca_ck) was created to fix bug reported by Xavier
+   Fernández i Marín: spurious ^A^K being added to lines sent to R.
+ * Don't blink the menu and toolbar buttons when doing omni completion.
+ * Use Tmux to run R in an external terminal emulator.
+
+111014 (2011-10-14)
+ * Fixed spell check bug in R documentation files (.Rd).
+ * Fixed beep bug when sending commands to R.
+ * New option: vimrplugin_notmuxconf.
+ * Fixed bug when starting tmux before vim: the environment variable
+   VIMRPLUGIN_TMPDIR was not being set. Thanks to Michel Lang for reporting
+   the bug and helping to track its source, and thanks to Eric Dewoestine for
+   explaining how to fix the bug.
+ * Fixed bug in code indentation after unbalanced brackets and parenthesis
+   when r_indent_align_args = 0 (thanks to Chris Neff and Peng Yu for
+   reporting the bugs).
+ * Really make the use of AppleScript the default on OS X (thanks for Jason
+   for reporting the bug).
+
+110805 (2011-08-05)
+ * New option: vimrplugin_tmux.
+ * Set Tmux as the default instead of either GNU Screen or Conque Shell.
+ * Document Tmux as the preferred way of running the plugin on Linux.
+ * Vim-LaTeX-suite plugin can be used with Rnoweb files without any additional
+   configuration. The necessary code was added to the ftplugin/rnoweb.vim.
+ * Added count argument to normal mode commands gn and gN (thanks to Ivan
+   Bezerra for the suggestion).
 
 110614 (2011-06-14)
  * When doing the command \rh, the plugin tries to show the help for the
    method corresponding to the class of the object passed as argument to the
    function. The same with \rp (thanks to Thomas Scheike for suggesting the
    feature).
- * Removed scipt rpager.sh.
+ * Removed script rpager.sh.
  * Added script global_r_plugin.vim to allow the use of the plugin with any
    file type.
 
 110222 (2011-02-22)
  * Added syntax/rhelp.vim.
  * New command for rnoweb files: BibTeX current file (\sb).
- * New commands for the object browser: open visible lists (\r=) and close
+ * New commands for the Object Browser: open visible lists (\r=) and close
    visible lists (\r-).
  * Reorganization of the GUI menu.
 
@@ -1649,7 +2997,7 @@ named rnw.vim at ~/.vim/ftdetect with the following content:
  * Don't send "^@$" as part of a paragraph in rnoweb files (thanks to Fabio
    Correa for reporting the bug).
  * More useful warning message when PyWin32 isn't installed.
- * Initial support to Apple Script on Mac OS X (thanks to Vincent Nijs for
+ * Initial support to AppleScript on Mac OS X (thanks to Vincent Nijs for
    writing and testing the code).
 
 101121 (2010-11-21)
@@ -1774,7 +3122,7 @@ named rnw.vim at ~/.vim/ftdetect with the following content:
 100512 (2010-05-12)
  * Thanks to Tortonesi Mauro who wrote a patch to make the plugin work with
    pathogen.vim.
- * Added simple syntax hightlight for .Rout files.
+ * Added simple syntax highlight for .Rout files.
  * Increased the time limit of RUpdateObjList to two minutes.
  * Improvement in the syntax highlight based on code written by Zhuojun Chen.
  * Thanks to Scott Kostyshak who helped to improve the documentation.
@@ -1831,7 +3179,7 @@ named rnw.vim at ~/.vim/ftdetect with the following content:
  * Better word detection before calling R's help().
  * Fixed bug in underscore replacement.
  * Fixed small bug in code indentation.
- * Added scipt rpager.sh.
+ * Added script rpager.sh.
  * Added two new plugin options: no underscore replacement and fixed name for
    the pipe file instead of random one.
 
diff --git a/ftdetect/r.vim b/ftdetect/r.vim
index 9530e39..370fb96 100644
--- a/ftdetect/r.vim
+++ b/ftdetect/r.vim
@@ -14,3 +14,8 @@ autocmd BufNewFile,BufRead *.Rout set ft=rout
 autocmd BufNewFile,BufRead *.Rout.save set ft=rout
 autocmd BufNewFile,BufRead *.Rout.fail set ft=rout
 
+autocmd BufNewFile,BufRead *.Rrst set ft=rrst
+autocmd BufNewFile,BufRead *.rrst set ft=rrst
+
+autocmd BufNewFile,BufRead *.Rmd set ft=rmd
+autocmd BufNewFile,BufRead *.rmd set ft=rmd
diff --git a/ftplugin/r.vim b/ftplugin/r.vim
deleted file mode 100644
index 2ac9632..0000000
--- a/ftplugin/r.vim
+++ /dev/null
@@ -1,109 +0,0 @@
-"  This program is free software; you can redistribute it and/or modify
-"  it under the terms of the GNU General Public License as published by
-"  the Free Software Foundation; either version 2 of the License, or
-"  (at your option) any later version.
-"
-"  This program is distributed in the hope that it will be useful,
-"  but WITHOUT ANY WARRANTY; without even the implied warranty of
-"  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-"  GNU General Public License for more details.
-"
-"  A copy of the GNU General Public License is available at
-"  http://www.r-project.org/Licenses/
-
-"==========================================================================
-" ftplugin for R files
-"
-" Authors: Jakson Alves de Aquino 
-"          Jose Claudio Faria
-"          
-"          Based on previous work by Johannes Ranke
-"
-" Last Change: Tue Feb 08, 2011  09:31AM
-"
-" Please see doc/r-plugin.txt for usage details.
-"==========================================================================
-
-" Only do this when not yet done for this buffer
-if exists("b:did_r_ftplugin") || exists("disable_r_ftplugin")
-    finish
-endif
-
-" Don't load another plugin for this buffer
-let b:did_r_ftplugin = 1
-
-setlocal commentstring=#%s
-setlocal comments=b:#,b:##,b:###
-
-" Source scripts common to R, Rnoweb, Rhelp and rdoc files:
-runtime r-plugin/common_global.vim
-if exists("g:rplugin_failed")
-    finish
-endif
-
-" Some buffer variables common to R, Rnoweb, Rhelp and rdoc file need be
-" defined after the global ones:
-runtime r-plugin/common_buffer.vim
-
-" Run R CMD BATCH on current file and load the resulting .Rout in a split
-" window
-function! ShowRout()
-    let routfile = expand("%:r") . ".Rout"
-    if bufloaded(routfile)
-        exe "bunload " . routfile
-        call delete(routfile)
-    endif
-
-    " if not silent, the user will have to type 
-    silent update
-    if has("gui_win32")
-        let rcmd = 'Rcmd.exe BATCH --no-restore --no-save "' . expand("%") . '" "' . routfile . '"'
-    else
-        let rcmd = g:rplugin_R . " CMD BATCH --no-restore --no-save '" . expand("%") . "' '" . routfile . "'"
-    endif
-    echo "Please wait for: " . rcmd
-    let rlog = system(rcmd)
-    if v:shell_error && rlog != ""
-        call RWarningMsg('Error: "' . rlog . '"')
-        sleep 1
-    endif
-
-    if filereadable(routfile)
-        if g:vimrplugin_routnotab == 1
-            exe "split " . routfile
-        else
-            exe "tabnew " . routfile
-        endif
-    else
-        call RWarningMsg("The file '" . routfile . "' is not readable.")
-    endif
-endfunction
-
-
-"==========================================================================
-" Key bindings and menu items
-
-call RCreateStartMaps()
-call RCreateEditMaps()
-
-" Only .R files are sent to R
-call RCreateMaps("ni", 'RSendFile',     'aa', ':call SendFileToR("silent")')
-call RCreateMaps("ni", 'RESendFile',    'ae', ':call SendFileToR("echo")')
-call RCreateMaps("ni", 'RShowRout',     'ao', ':call ShowRout()')
-
-call RCreateSendMaps()
-call RControlMaps()
-call RCreateMaps("nvi", 'RSetwd',        'rd', ':call RSetWD()')
-
-" Sweave (cur file)
-"-------------------------------------
-if &filetype == "rnoweb"
-    call RCreateMaps("nvi", 'RSweave',      'sw', ':call RSweave()')
-    call RCreateMaps("nvi", 'RMakePDF',     'sp', ':call RMakePDF()')
-    call RCreateMaps("nvi", 'RIndent',      'si', ':call RnwToggleIndentSty()')
-endif
-
-
-" Menu R
-call MakeRMenu()
-
diff --git a/ftplugin/r_rplugin.vim b/ftplugin/r_rplugin.vim
new file mode 100644
index 0000000..3bd60fc
--- /dev/null
+++ b/ftplugin/r_rplugin.vim
@@ -0,0 +1,112 @@
+
+if exists("g:disable_r_ftplugin") || has("nvim")
+    finish
+endif
+
+runtime R/flag.vim
+if exists("g:NvimR_installed")
+    finish
+endif
+
+" Source scripts common to R, Rnoweb, Rhelp, Rmd, Rrst and rdoc files:
+runtime r-plugin/common_global.vim
+if exists("g:rplugin_failed")
+    finish
+endif
+
+" Some buffer variables common to R, Rnoweb, Rhelp, Rmd, Rrst and rdoc files
+" need be defined after the global ones:
+runtime r-plugin/common_buffer.vim
+
+if !exists("b:did_ftplugin") && !exists("g:rplugin_runtime_warn")
+    runtime ftplugin/r.vim
+    if !exists("b:did_ftplugin")
+        call RWarningMsgInp("Your runtime files seems to be outdated.\nSee: https://github.com/jalvesaq/R-Vim-runtime")
+    endif
+    let g:rplugin_runtime_warn = 1
+endif
+
+" Run R CMD BATCH on current file and load the resulting .Rout in a split
+" window
+function! ShowRout()
+    let b:routfile = expand("%:r") . ".Rout"
+    if bufloaded(b:routfile)
+        exe "bunload " . b:routfile
+        call delete(b:routfile)
+    endif
+
+    " if not silent, the user will have to type 
+    silent update
+
+    if has("win32") || has("win64")
+        let rcmd = 'Rcmd.exe BATCH --no-restore --no-save "' . expand("%") . '" "' . b:routfile . '"'
+    else
+        let rcmd = g:rplugin_R . " CMD BATCH --no-restore --no-save '" . expand("%") . "' '" . b:routfile . "'"
+    endif
+
+    " TODO: Run R as a job and don't wait for the output
+    echon "Please wait for: " . rcmd
+    redraw
+    let rlog = system(rcmd)
+    if v:shell_error && rlog != ""
+        call RWarningMsg('Error: "' . rlog . '"')
+        sleep 1
+    endif
+    if filereadable(b:routfile)
+        if g:vimrplugin_routnotab == 1
+            exe "split " . b:routfile
+        else
+            exe "tabnew " . b:routfile
+        endif
+        set filetype=rout
+    else
+        call RWarningMsg("The file '" . b:routfile . "' is not readable.")
+    endif
+endfunction
+
+" Convert R script into Rmd, md and, then, html.
+function! RSpin()
+    update
+    call g:SendCmdToR('require(knitr); .vim_oldwd <- getwd(); setwd("' . expand("%:p:h") . '"); spin("' . expand("%:t") . '"); setwd(.vim_oldwd); rm(.vim_oldwd)')
+endfunction
+
+" Default IsInRCode function when the plugin is used as a global plugin
+function! DefaultIsInRCode(vrb)
+    return 1
+endfunction
+
+let b:IsInRCode = function("DefaultIsInRCode")
+
+"==========================================================================
+" Key bindings and menu items
+
+call RCreateStartMaps()
+call RCreateEditMaps()
+
+" Only .R files are sent to R
+call RCreateMaps("ni", 'RSendFile',     'aa', ':call SendFileToR("silent")')
+call RCreateMaps("ni", 'RESendFile',    'ae', ':call SendFileToR("echo")')
+call RCreateMaps("ni", 'RShowRout',     'ao', ':call ShowRout()')
+
+" Knitr::spin
+" -------------------------------------
+call RCreateMaps("ni", 'RSpinFile',     'ks', ':call RSpin()')
+
+call RCreateSendMaps()
+call RControlMaps()
+call RCreateMaps("nvi", 'RSetwd',        'rd', ':call RSetWD()')
+
+
+" Menu R
+if has("gui_running")
+    runtime r-plugin/gui_running.vim
+    call MakeRMenu()
+endif
+
+call RSourceOtherScripts()
+
+if exists("b:undo_ftplugin")
+    let b:undo_ftplugin .= " | unlet! b:IsInRCode"
+else
+    let b:undo_ftplugin = "unlet! b:IsInRCode"
+endif
diff --git a/ftplugin/rbrowser.vim b/ftplugin/rbrowser.vim
index 86803aa..0239b88 100644
--- a/ftplugin/rbrowser.vim
+++ b/ftplugin/rbrowser.vim
@@ -1,35 +1,38 @@
-"  This program is free software; you can redistribute it and/or modify
-"  it under the terms of the GNU General Public License as published by
-"  the Free Software Foundation; either version 2 of the License, or
-"  (at your option) any later version.
-"
-"  This program is distributed in the hope that it will be useful,
-"  but WITHOUT ANY WARRANTY; without even the implied warranty of
-"  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-"  GNU General Public License for more details.
-"
-"  A copy of the GNU General Public License is available at
-"  http://www.r-project.org/Licenses/
-
-"==========================================================================
-" ftplugin for RBrowser files (created by the Vim-R-plugin)
-"
-" Author: Jakson Alves de Aquino 
-"          
-" Last Change: Sat Mar 19, 2011  10:35AM
-"==========================================================================
+" Vim filetype plugin file
+" Language: R Browser (generated by the Vim-R-plugin)
+" Maintainer: Jakson Alves de Aquino 
+
 
 " Only do this when not yet done for this buffer
-if exists("b:did_ftplugin")
+if exists("b:did_ftplugin") || has("nvim")
     finish
 endif
 
+runtime R/flag.vim
+if exists("g:NvimR_installed")
+    finish
+endif
+
+let g:rplugin_upobcnt = 0
+
 " Don't load another plugin for this buffer
 let b:did_ftplugin = 1
 
+let s:cpo_save = &cpo
+set cpo&vim
+
+" Source scripts common to R, Rnoweb, Rhelp and rdoc files:
+runtime r-plugin/common_global.vim
+
+" Some buffer variables common to R, Rnoweb, Rhelp and rdoc file need be
+" defined after the global ones:
+runtime r-plugin/common_buffer.vim
+
 setlocal noswapfile
-set buftype=nofile
+setlocal buftype=nofile
 setlocal nowrap
+setlocal iskeyword=@,48-57,_,.
+setlocal nolist
 
 if !exists("g:rplugin_hasmenu")
     let g:rplugin_hasmenu = 0
@@ -40,443 +43,118 @@ if !exists("g:rplugin_hasbrowsermenu")
     let g:rplugin_hasbrowsermenu = 0
 endif
 
-" Current cursor position in the object browser and in the library browser
-let g:rplugin_curbline = 1
-let g:rplugin_curbcol = 0
-let g:rplugin_curlline = 1
-let g:rplugin_curlcol = 0
-
 " Current view of the object browser: .GlobalEnv X loaded libraries
 let g:rplugin_curview = "GlobalEnv"
 
-" The list of objects in R's workspace is a dictionary. Each key in the
-" dictionary is a dictionary with at least the key 'class'. If the class is
-" "list", it will have the key 'items' (which lists the elements of the list).
-let b:workspace = {}
-
-" Dictionary storing flags indicating whether the elements of an R's list
-" must be shown in the object browser. By default, "data.frame" objects are
-" included in the dictionary with the flag 1, but other list objects are
-" inserted in the dictionary with the flag 0.
-if !exists("g:rplugin_opendict")
-    let g:rplugin_opendict = {}
-endif
-
-" Dictionary storing the order of the elements in a list. This is necessary
-" because Vim's dictionary stores the items in an "arbitrary" order.
-let b:list_order = {}
-
-let b:liblist = []
-
-function! RBrowserMakeLibDict()
-    let b:libdict = {}
-    let nobjs = len(g:rplugin_liblist)
-    let i = 0
-    while i < nobjs
-        let obj = split(g:rplugin_liblist[i], ';')
-        let curlib = obj[3]
-        let haslib = 0
-        for lib in b:liblist
-            if lib == obj[3]
-                let haslib = 1
-                break
-            endif
-        endfor
-        if haslib
-            let b:libdict[obj[3]] = {'class': "library", 'items': {}}
-            while curlib == obj[3]
-                if obj[2] == "list" || obj[2] == "data.frame"
-                    let b:libdict[obj[3]]['items'][obj[0]] = {'class': obj[2], 'items': {}}
-                    let curdf = obj[0]
-                    let lastdf = obj[0]
-                    let lo_element = "-" . curlib . "-" . curdf
-                    let b:list_order[lo_element] = []
-                    let g:rplugin_opendict[curdf] = 0
-                    let i += 1
-                    if i == nobjs
-                        break
-                    endif
-                    let obj = split(g:rplugin_liblist[i], ';')
-                    while stridx(obj[0], "$") > 0
-                        let [lastdf, lastcol] = split(obj[0], '\$')
-                        let b:libdict[curlib]['items'][curdf]['items'][lastcol] = {'class': obj[2]}
-                        call add(b:list_order[lo_element], lastcol)
-
-                        let i += 1
-                        if i == nobjs
-                            break
-                        endif
-                        let obj = split(g:rplugin_liblist[i], ';')
-                    endwhile
-                else
-                    let b:libdict[obj[3]]['items'][obj[0]] = {'class': obj[2]}
-                    let i += 1
-                    if i == nobjs
-                        break
-                    endif
-                endif
-                let obj = split(g:rplugin_liblist[i], ';')
-            endwhile
-        else
-            while curlib == obj[3]
-                let i += 1
-                if i == nobjs
-                    break
-                endif
-                let obj = split(g:rplugin_liblist[i], ';')
-            endwhile
-        endif
-    endwhile
-endfunction
-
-function! RBrowserMakeLine(key, prefix, curlist)
-    exe "let curkey = g:rplugin_curdict['" . a:key . "']"
-    let cls = curkey['class']
-    if has("conceal")
-        if cls == "list" || cls == "data.frame"
-            let line = a:prefix . '[#' . a:key . '	'
-        elseif cls == "numeric"
-            let line = a:prefix . '{#' . a:key . '	'
-        elseif cls == "character"
-            let line = a:prefix . '"#' . a:key . '	'
-        elseif cls == "factor"
-            let line = a:prefix . "'#" . a:key . '	'
-        elseif cls == "function"
-            let line = a:prefix . '(#' . a:key . '	'
-        elseif cls == "logical"
-            let line = a:prefix . '%#' . a:key . '	'
-        elseif cls == "library"
-            let line = a:prefix . '##' . a:key . '	'
-        elseif cls == "flow-control"
-            let line = a:prefix . '!#' . a:key . '	'
-        else
-            let line = a:prefix . '=#' . a:key . '	'
-        endif
+function! UpdateOB(what)
+    if a:what == "both"
+        let wht = g:rplugin_curview
     else
-        if cls == "list" || cls == "data.frame"
-            let line = a:prefix . '[' . a:key . '	'
-        elseif cls == "numeric"
-            let line = a:prefix . '{' . a:key . '	'
-        elseif cls == "character"
-            let line = a:prefix . '"' . a:key . '	'
-        elseif cls == "factor"
-            let line = a:prefix . "'" . a:key . '	'
-        elseif cls == "function"
-            let line = a:prefix . '(' . a:key . '	'
-        elseif cls == "logical"
-            let line = a:prefix . '%' . a:key . '	'
-        elseif cls == "library"
-            let line = a:prefix . '#' . a:key . '	'
-        elseif cls == "flow-control"
-            let line = a:prefix . '!' . a:key . '	'
-        else
-            let line = a:prefix . '=' . a:key . '	'
-        endif
+        let wht = a:what
     endif
-
-    if has("conceal") && g:rplugin_curobjlevel == 0
-        let line = " " . line
+    if g:rplugin_curview != wht
+        return "curview != what"
     endif
-
-    " If the object's label exists, then append it to the end of the line
-    let thekeys = keys(curkey)
-    for subkey in thekeys
-        if subkey == "label"
-            let line = line . curkey['label']
-        endif
-    endfor
-    let lnr = line("$") + 1
-    call setline(lnr, line)
-
-    " If the object is a data.frame, show its columns
-    if cls == "data.frame" || cls == "list" || cls == "library"
-        let whattodo = "addkey"
-        for i in keys(g:rplugin_opendict)
-            if i == a:key
-                if g:rplugin_opendict[a:key] == 0
-                    return
-                else
-                    let whattodo = "show elements"
-                    break
-                endif
-            endif
-        endfor
-        if whattodo == "addkey"
-            if cls == "data.frame" || cls == "list"
-                echoerr "rbrowser.vim: unregistered data.frame or list!"
-            else
-                let g:rplugin_opendict[a:key] = 0
-            endif
-        endif
-        if g:rplugin_opendict[a:key] == 0
-            return
-        endif
-
-        if &encoding == "utf-8"
-            let strL = " └─"
-            let strT = " ├─"
-            let strI = " │ "
-        else
-            let strL = " `-"
-            let strT = " |-"
-            let strI = " | "
-        endif
-
-        if has("conceal")
-            let strL = strL . " "
-            let strT = strT . " "
-            let strI = strI . " "
-            let g:rplugin_curobjlevel += 1
-        endif
-
-        if a:prefix =~ strL
-            let newprefix = substitute(a:prefix, strL, "   ", "")
-        else
-            let newprefix = substitute(a:prefix, strT, strI, "") 
-        endif
-        let newprefix = newprefix . strT
-        let olddict = g:rplugin_curdict
-        let g:rplugin_curdict = curkey['items']
-        let curlist = a:curlist . "-" . a:key
-        if cls == "library"
-            let thesubkeys = sort(keys(g:rplugin_curdict))
-        else
-            let thesubkeys = b:list_order[curlist]
-        endif
-        let nkeys = len(thesubkeys)
-        let i = 0
-        for key in thesubkeys
-            let i += 1
-            if i < nkeys
-                call RBrowserMakeLine(key, newprefix, curlist)
-            else
-                let newprefix = substitute(newprefix, strT, strL, "")
-                call RBrowserMakeLine(key, newprefix, curlist)
-            endif
-        endfor
-        let g:rplugin_curdict = olddict
+    if g:rplugin_upobcnt
+        echoerr "OB called twice"
+        return "OB called twice"
     endif
-endfunction
-
-function! RBrowserAddItemToList(key, curlist)
-    exe "let curkey = g:rplugin_curdict['" . a:key . "']"
-    let cls = curkey['class']
-
-    " If the object is a data.frame, show its columns
-    if cls == "data.frame" || cls == "list"
-        let whattodo = "addkey"
-        for i in keys(g:rplugin_opendict)
-            if i == a:key
-                let whattodo = "nothing"
-                break
-            endif
-        endfor
-        if whattodo == "addkey"
-            if cls == "data.frame"
-                let g:rplugin_opendict[a:key] = g:vimrplugin_open_df
-            else
-                if cls == "list"
-                    let g:rplugin_opendict[a:key] = g:vimrplugin_open_list
-                else
-                    let g:rplugin_opendict[a:key] = 0
-                endif
-            endif
+    let g:rplugin_upobcnt = 1
+
+    let rplugin_switchedbuf = 0
+    if g:vimrplugin_tmux_ob == 0
+        redir => s:bufl
+        silent buffers
+        redir END
+        if s:bufl !~ "Object_Browser"
+            let g:rplugin_upobcnt = 0
+            return "Object_Browser not listed"
+        endif
+        if exists("g:rplugin_curbuf") && g:rplugin_curbuf != "Object_Browser"
+            let savesb = &switchbuf
+            set switchbuf=useopen,usetab
+            sil noautocmd sb Object_Browser
+            let rplugin_switchedbuf = 1
         endif
-
-        let olddict = g:rplugin_curdict
-        let g:rplugin_curdict = curkey['items']
-        let curlist = a:curlist . "-" . a:key
-        let thesubkeys = b:list_order[curlist]
-        let nkeys = len(thesubkeys)
-        let i = 0
-        for key in thesubkeys
-            let i += 1
-            if i < nkeys
-                call RBrowserAddItemToList(key, curlist)
-            else
-                call RBrowserAddItemToList(key, curlist)
-            endif
-        endfor
-        let g:rplugin_curdict = olddict
-    endif
-endfunction
-
-function! RBrowserFillCloseList()
-    let thekeys = sort(keys(b:workspace))
-    for key in thekeys
-        let s:curlist = ""
-        let g:rplugin_curobjlevel = 0
-        let g:rplugin_curdict = b:workspace
-        call RBrowserAddItemToList(key, "")
-    endfor
-endfunction
-
-function! RBrowserShowGE(fromother)
-    let g:rplugin_curview = "GlobalEnv"
-    if a:fromother == 0
-        let g:rplugin_curbline = line(".")
-        let g:rplugin_curbcol = col(".")
     endif
 
     setlocal modifiable
-    sil normal! ggdG
-    call setline(1, ".GlobalEnv | Libraries")
-    call setline(2, "")
-    let thekeys = sort(keys(b:workspace))
-    for key in thekeys
-        let s:curlist = ""
-        let g:rplugin_curobjlevel = 0
-        let g:rplugin_curdict = b:workspace
-        call RBrowserMakeLine(key, "  ", "")
-    endfor
-    call cursor(g:rplugin_curbline, g:rplugin_curbcol)
-    setlocal nomodifiable
-endfunction
-
-function! RBrowserShowLibs(fromother)
-    let g:rplugin_curview = "libraries"
-    if a:fromother == 0
-        let g:rplugin_curlline = line(".")
-        let g:rplugin_curlcol = col(".")
+    let curline = line(".")
+    let curcol = col(".")
+    if !exists("curline")
+        let curline = 3
     endif
-
-    if !exists("b:libdict")
-        call RBrowserMakeLibDict()
+    if !exists("curcol")
+        let curcol = 1
     endif
-
-    setlocal modifiable
+    let save_unnamed_reg = @@
     sil normal! ggdG
-    call setline(1, "Libraries | .GlobalEnv")
-    call setline(2, "")
-
-    " Fill the object browser
-    let thekeys = sort(keys(b:libdict))
-    for key in thekeys
-        let s:curlist = ""
-        let g:rplugin_curobjlevel = 0
-        let g:rplugin_curdict = b:libdict
-        call RBrowserMakeLine(key, "  ", "")
-    endfor
-
-    " Warn about libraries not present when :RUpdateObjList was run
-    let hasmissing = 0
-    let misslibs = []
-    for lib in b:liblist
-        if search('#' . lib, "wn") == 0
-            let hasmissing += 1
-            call add(misslibs, lib)
-        endif
-    endfor
-    if hasmissing
-        call setline(line("$") + 1, "")
-        call setline(line("$") + 1, "Warning:")
-        call setline(line("$") + 1, "The following")
-        if hasmissing == 1
-            call setline(line("$") + 1, "library is loaded")
-            call setline(line("$") + 1, "but is not in the")
-        else
-            call setline(line("$") + 1, "libraries are loaded")
-            call setline(line("$") + 1, "but are not in the")
-        endif
-        call setline(line("$") + 1, "omniList:")
-        call setline(line("$") + 1, "")
-        for lib in misslibs
-            call setline(line("$") + 1, "   " . lib)
-        endfor
-        call setline(line("$") + 1, "")
-        call setline(line("$") + 1, "Please read the Vim-R-plugin")
-        call setline(line("$") + 1, "documentation:")
-        call setline(line("$") + 1, "")
-        call setline(line("$") + 1, "  :h :RUpdateObjList")
-        call setline(line("$") + 1, "")
-        call setline(line("$") + 1, "to know how to show all loaded")
-        call setline(line("$") + 1, "libraries in the Object Browser.")
-    endif
-
-    call cursor(g:rplugin_curlline, g:rplugin_curlcol)
-    setlocal nomodifiable
-endfunction
-
-function! RBrowserFill(fromother)
-    if g:rplugin_curview == "libraries"
-        call RBrowserShowLibs(a:fromother)
+    let @@ = save_unnamed_reg 
+    if wht == "GlobalEnv"
+        let fcntt = readfile(g:rplugin_tmpdir . "/globenv_" . $VIMINSTANCEID)
     else
-        call RBrowserShowGE(a:fromother)
+        let fcntt = readfile(g:rplugin_tmpdir . "/liblist_" . $VIMINSTANCEID)
     endif
-    echon
+    call setline(1, fcntt)
+    call cursor(curline, curcol)
+    if bufname("%") =~ "Object_Browser" || b:rplugin_extern_ob
+        setlocal nomodifiable
+    endif
+    if rplugin_switchedbuf
+        exe "sil noautocmd sb " . g:rplugin_curbuf
+        exe "set switchbuf=" . savesb
+    endif
+    let g:rplugin_upobcnt = 0
+    return "End of UpdateOB()"
 endfunction
 
 function! RBrowserDoubleClick()
-    echon
     " Toggle view: Objects in the workspace X List of libraries
     if line(".") == 1
         if g:rplugin_curview == "libraries"
-            call RBrowserShowGE(1)
+            let g:rplugin_curview = "GlobalEnv"
+            call SendToVimCom("\004G RBrowserDoubleClick")
         else
-            call RBrowserShowLibs(1)
+            let g:rplugin_curview = "libraries"
+            call SendToVimCom("\004L RBrowserDoubleClick")
         endif
         return
     endif
 
     " Toggle state of list or data.frame: open X closed
-    let key = RBrowserGetName(0)
-    for i in keys(g:rplugin_opendict)
-        if i == key
-            let g:rplugin_opendict[key] = !g:rplugin_opendict[key]
-            call RBrowserFill(0)
-            break
+    let key = RBrowserGetName(0, 1)
+    if g:rplugin_curview == "GlobalEnv"
+        if getline(".") =~ "&#.*\t"
+            call SendToVimCom("\006&" . key)
+        else
+            call SendToVimCom("\006" . key)
         endif
-    endfor
-    echon
-endfunction
-
-function! RBrowserOpenCloseLists(status)
-    if ! buflisted("Object_Browser")
-        call RWarningMsg('There is no "Object_Browser" buffer.')
-        return
-    endif
-
-    let switchedbuf = 0
-    if g:rplugin_curbuf != "Object_Browser"
-        let savesb = &switchbuf
-        set switchbuf=useopen,usetab
-        sil noautocmd sb Object_Browser
-        let switchedbuf = 1
-    endif
-
-    for key in keys(g:rplugin_opendict)
-        let g:rplugin_opendict[key] = a:status
-    endfor
-    call RBrowserFill(0)
-
-    if switchedbuf
-        exe "sil noautocmd sb " . g:rplugin_curbuf
-        exe "set switchbuf=" . savesb
+    else
+        let key = substitute(key, '`', '', "g") 
+        if key !~ "^package:"
+            let key = "package:" . RBGetPkgName() . '-' . key
+        endif
+        call SendToVimCom("\006" . key)
     endif
-    echon
 endfunction
 
 function! RBrowserRightClick()
-    echon
     if line(".") == 1
         return
     endif
 
-    let key = RBrowserGetName(1)
+    let key = RBrowserGetName(1, 0)
     if key == ""
         return
     endif
 
     let line = getline(".")
+    if line =~ "^   ##"
+        return
+    endif
     let isfunction = 0
-    if has("conceal")
-        if line =~ "(#.*\t"
-            let isfunction = 1
-        endif
-    else
-        if line =~ "(.*\t"
-            let isfunction = 1
-        endif
+    if line =~ "(#.*\t"
+        let isfunction = 1
     endif
 
     if g:rplugin_hasbrowsermenu == 1
@@ -500,29 +178,55 @@ function! RBrowserRightClick()
     let g:rplugin_hasbrowsermenu = 1
 endfunction
 
+function! RBGetPkgName()
+    let lnum = line(".")
+    while lnum > 0
+        let line = getline(lnum)
+        if line =~ '.*##[0-9a-zA-Z\.]*\t'
+            let line = substitute(line, '.*##\(.*\)\t', '\1', "")
+            return line
+        endif
+        let lnum -= 1
+    endwhile
+    return ""
+endfunction
+
 function! RBrowserFindParent(word, curline, curpos)
     let curline = a:curline
     let curpos = a:curpos
     while curline > 1 && curpos >= a:curpos
         let curline -= 1
         let line = substitute(getline(curline), "	.*", "", "")
-        if has("conceal")
-            let curpos = stridx(line, '[#')
-        else
-            let curpos = stridx(line, '[')
-        endif
+        let curpos = stridx(line, '[#')
         if curpos == -1
-            let curpos = a:curpos
+            let curpos = stridx(line, '<#')
+            if curpos == -1
+                let curpos = a:curpos
+            endif
         endif
     endwhile
 
+    if g:rplugin_curview == "GlobalEnv"
+        let spacelimit = 3
+    else
+        if s:isutf8
+            let spacelimit = 10
+        else
+            let spacelimit = 6
+        endif
+    endif
     if curline > 1
-        if has("conceal")
-            let word = substitute(line, '.*[#', "", "") . '$' . a:word
+        let line = substitute(line, '^.\{-}\(.\)#', '\1#', "")
+        let line = substitute(line, '^ *', '', "")
+        if line =~ " " || line =~ '^.#[0-9]'
+            let line = substitute(line, '\(.\)#\(.*\)$', '\1#`\2`', "")
+        endif
+        if line =~ '<#'
+            let word = substitute(line, '.*<#', "", "") . '@' . a:word
         else
-            let word = substitute(line, '.*[', "", "") . '$' . a:word
+            let word = substitute(line, '.*\[#', "", "") . '$' . a:word
         endif
-        if curpos != s:spacelimit
+        if curpos != spacelimit
             let word = RBrowserFindParent(word, line("."), curpos)
         endif
         return word
@@ -534,118 +238,127 @@ function! RBrowserFindParent(word, curline, curpos)
     return ""
 endfunction
 
-function! RBrowserGetName(complete)
-    let curpos = col(".")
+function! RBrowserCleanTailTick(word, cleantail, cleantick)
+    let nword = a:word
+    if a:cleantick
+        let nword = substitute(nword, "`", "", "g")
+    endif
+    if a:cleantail
+        let nword = substitute(nword, '[\$@]$', '', '')
+        let nword = substitute(nword, '[\$@]`$', '`', '')
+    endif
+    return nword
+endfunction
 
+function! RBrowserGetName(cleantail, cleantick)
     let line = getline(".")
     if line =~ "^$"
-        return
+        return ""
     endif
 
-    " Is the object a top level one (curpos == 2)?
-    if has("conceal")
-        let delim = ['{#', '[#', '(#', '"#', "'#", '%#', '=#']
-        let word = substitute(line, '^\W*#\{-1,}\(.*\)\t.*', '\1', "")
-    else
-        let tabpos = stridx(getline("."), "	")
-        if curpos > tabpos
-            return
-        endif
-        let delim = ['{', '[', '(', '"', "'", '%', '=']
-        let word = expand("")
-    endif
+    let curpos = stridx(line, "#")
+    let word = substitute(line, '.\{-}\(.#\)\(.\{-}\)\t.*', '\2\1', '')
+    let word = substitute(word, '\[#$', '$', '')
+    let word = substitute(word, '<#$', '@', '')
+    let word = substitute(word, '.#$', '', '')
 
     if word =~ ' ' || word =~ '^[0-9]'
         let word = '`' . word . '`'
     endif
 
-    if a:complete == 0
-        return word
-    endif
-
-    for i in delim
-        let curpos = stridx(line, i)
-        if curpos != -1
-            break
-        endif
-    endfor
-    if curpos == -1
-        return ""
-    endif
-
-    let s:spacelimit = 2
-    if has("conceal")
-        let s:spacelimit += 1
-    endif
-    if g:rplugin_curview == "libraries"
-        if &encoding == "utf-8"
-            let s:spacelimit += 7
+    if (g:rplugin_curview == "GlobalEnv" && curpos == 4) || (g:rplugin_curview == "libraries" && curpos == 3)
+        " top level object
+        let word = substitute(word, '\$\[\[', '[[', "g")
+        let word = RBrowserCleanTailTick(word, a:cleantail, a:cleantick)
+        if g:rplugin_curview == "libraries"
+            return "package:" . substitute(word, "#", "", "")
         else
-            let s:spacelimit += 3
+            return word
         endif
-    endif
-
-    if curpos == s:spacelimit
-        " top level object
-        return word
     else
-        if curpos > s:spacelimit
-            " Find the parent data.frame or list
-            let word = RBrowserFindParent(word, line("."), curpos)
-            " Unnamed objects of lists
-            if word =~ '\$\[\[[0-9]*\]\]'
-                let word = substitute(word, '\$\[\[\([0-9]*\)\]\]', '[[\1]]', "g")
+        if g:rplugin_curview == "libraries"
+            if s:isutf8
+                if curpos == 11
+                    let word = RBrowserCleanTailTick(word, a:cleantail, a:cleantick)
+                    let word = substitute(word, '\$\[\[', '[[', "g")
+                    return word
+                endif
+            elseif curpos == 7
+                let word = RBrowserCleanTailTick(word, a:cleantail, a:cleantick)
+                let word = substitute(word, '\$\[\[', '[[', "g")
+                return word
             endif
+        endif
+        if curpos > 4
+            " Find the parent data.frame or list
+            let word = RBrowserFindParent(word, line("."), curpos - 1)
+            let word = RBrowserCleanTailTick(word, a:cleantail, a:cleantick)
+            let word = substitute(word, '\$\[\[', '[[', "g")
             return word
         else
             " Wrong object name delimiter: should never happen.
-            let msg = "R-plugin Error: (curpos = " . curpos . ") < (spacelimit = " . s:spacelimit . ") " . word
+            let msg = "R-plugin Error: (curpos = " . curpos . ") " . word
             echoerr msg
             return ""
         endif
     endif
 endfunction
 
-function! MakeRBrowserMenu()
-    let g:rplugin_curbuf = bufname("%")
-    if g:rplugin_hasmenu == 1
-        return
+function! ObBrBufUnload()
+    if g:vimrplugin_tmux_ob
+        if exists("g:rplugin_editor_sname")
+            call system("tmux select-pane -t " . g:rplugin_vim_pane)
+        endif
+    elseif g:rplugin_vimcomport
+        call SendToVimCom("\004Stop updating info [OB BufUnload].")
     endif
-    menutranslate clear
-    call RControlMenu()
-    call RBrowserMenu()
 endfunction
 
-function! UnMakeRBrowserMenu()
-    if g:rplugin_curview == "libraries"
-        let g:rplugin_curlline = line(".")
-        let g:rplugin_curlcol = col(".")
-    else
-        let g:rplugin_curbline = line(".")
-        let g:rplugin_curbcol = col(".")
-    endif
-    if !has("gui_running") || g:rplugin_hasmenu == 0 || g:vimrplugin_never_unmake_menu == 1 || &previewwindow
-        return
-    endif
-    aunmenu R
-    let g:rplugin_hasmenu = 0
+function! SourceObjBrLines()
+    exe "source " . substitute(g:rplugin_tmpdir, ' ', '\\ ', 'g') . "/objbrowserInit"
 endfunction
 
-nmap   :call RBrowserDoubleClick()
-nmap  <2-LeftMouse> :call RBrowserDoubleClick()
-nmap   :call RBrowserRightClick()
+nmap   :call RBrowserDoubleClick()
+nmap  <2-LeftMouse> :call RBrowserDoubleClick()
+nmap   :call RBrowserRightClick()
 
-call RControlMenu()
 call RControlMaps()
-call RBrowserMenu()
 
 setlocal winfixwidth
 setlocal bufhidden=wipe
 
-let s:thisbuffname = substitute(bufname("%"), '\.', '', "g")
-let s:thisbuffname = substitute(s:thisbuffname, ' ', '', "g")
-exe "augroup " . s:thisbuffname
-au BufEnter  call MakeRBrowserMenu()
-au BufLeave  call UnMakeRBrowserMenu()
-exe "augroup END"
+if has("gui_running")
+    runtime r-plugin/gui_running.vim
+    call RControlMenu()
+    call RBrowserMenu()
+endif
+
+au BufEnter  stopinsert
+
+if g:vimrplugin_tmux_ob
+    " Fix problems caused by some plugins
+    if exists("g:loaded_surround") && mapcheck("ds", "n") != ""
+        nunmap ds
+    endif
+    if exists("g:loaded_showmarks ")
+        autocmd! ShowMarks
+    endif
+endif
+au BufUnload  call ObBrBufUnload()
+
+let s:envstring = tolower($LC_MESSAGES . $LC_ALL . $LANG)
+if s:envstring =~ "utf-8" || s:envstring =~ "utf8"
+    let s:isutf8 = 1
+else
+    let s:isutf8 = 0
+endif
+unlet s:envstring
+
+call setline(1, ".GlobalEnv | Libraries")
+
+call RSourceOtherScripts()
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
 
+" vim: sw=4
diff --git a/ftplugin/rdoc.vim b/ftplugin/rdoc.vim
index 1b3d865..423f1d5 100644
--- a/ftplugin/rdoc.vim
+++ b/ftplugin/rdoc.vim
@@ -1,36 +1,23 @@
-"  This program is free software; you can redistribute it and/or modify
-"  it under the terms of the GNU General Public License as published by
-"  the Free Software Foundation; either version 2 of the License, or
-"  (at your option) any later version.
-"
-"  This program is distributed in the hope that it will be useful,
-"  but WITHOUT ANY WARRANTY; without even the implied warranty of
-"  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-"  GNU General Public License for more details.
-"
-"  A copy of the GNU General Public License is available at
-"  http://www.r-project.org/Licenses/
+" Vim filetype plugin file
+" Language: R Documentation (generated by the Vim-R-plugin)
+" Maintainer: Jakson Alves de Aquino 
 
-"==========================================================================
-" ftplugin for R files
-"
-" Authors: Jakson Alves de Aquino 
-"          Jose Claudio Faria
-"          
-"          Based on previous work by Johannes Ranke
-"
-" Last Change: Sat Feb 05, 2011  08:08AM
-"
-" Please see doc/r-plugin.txt for usage details.
-"==========================================================================
 
 " Only do this when not yet done for this buffer
-if exists("b:did_rdoc_ftplugin") || exists("disable_r_ftplugin")
+if exists("b:did_ftplugin") || has("nvim")
+    finish
+endif
+
+runtime R/flag.vim
+if exists("g:NvimR_installed")
     finish
 endif
 
 " Don't load another plugin for this buffer
-let b:did_rdoc_ftplugin = 1
+let b:did_ftplugin = 1
+
+let s:cpo_save = &cpo
+set cpo&vim
 
 " Source scripts common to R, Rnoweb, Rhelp and rdoc files:
 runtime r-plugin/common_global.vim
@@ -39,6 +26,86 @@ runtime r-plugin/common_global.vim
 " defined after the global ones:
 runtime r-plugin/common_buffer.vim
 
+setlocal iskeyword=@,48-57,_,.
+
+" Prepare R documentation output to be displayed by Vim
+function! FixRdoc()
+    let lnr = line("$")
+    for ii in range(1, lnr)
+        call setline(ii, substitute(getline(ii), "_\010", "", "g"))
+    endfor
+
+    " Mark the end of Examples
+    let ii = search("^Examples:$", "nw")
+    if ii
+        if getline("$") !~ "^###$"
+            let lnr = line("$") + 1
+            call setline(lnr, '###')
+        endif
+    endif
+
+    " Add a tab character at the end of the Arguments section to mark its end.
+    let ii = search("^Arguments:$", "nw")
+    if ii
+        " A space after 'Arguments:' is necessary for correct syntax highlight
+        " of the first argument
+        call setline(ii, "Arguments: ")
+        let doclength = line("$")
+        let ii += 2
+        let lin = getline(ii)
+        while lin !~ "^[A-Z].*:$" && ii < doclength
+            let ii += 1
+            let lin = getline(ii)
+        endwhile
+        if ii < doclength
+            let ii -= 1
+            if getline(ii) =~ "^$"
+                call setline(ii, "\t")
+            endif
+        endif
+    endif
+
+    " Add a tab character at the end of the Usage section to mark its end.
+    let ii = search("^Usage:$", "nw")
+    if ii
+        let doclength = line("$")
+        let ii += 2
+        let lin = getline(ii)
+        while lin !~ "^[A-Z].*:" && ii < doclength
+            let ii += 1
+            let lin = getline(ii)
+        endwhile
+        if ii < doclength
+            let ii -= 1
+            if getline(ii) =~ "^ *$"
+                call setline(ii, "\t")
+            endif
+        endif
+    endif
+
+    normal! gg
+
+    " Clear undo history
+    let old_undolevels = &undolevels
+    set undolevels=-1
+    exe "normal a \\"
+    let &undolevels = old_undolevels
+    unlet old_undolevels
+endfunction
+
+function! RdocIsInRCode(vrb)
+    let exline = search("^Examples:$", "bncW")
+    if exline > 0 && line(".") > exline
+        return 1
+    else
+        if a:vrb
+            call RWarningMsg('Not in the "Examples" section.')
+        endif
+        return 0
+    endif
+endfunction
+
+let b:IsInRCode = function("RdocIsInRCode")
 
 "==========================================================================
 " Key bindings and menu items
@@ -47,10 +114,34 @@ call RCreateSendMaps()
 call RControlMaps()
 
 " Menu R
-call MakeRMenu()
+if has("gui_running")
+    runtime r-plugin/gui_running.vim
+    call MakeRMenu()
+endif
+
+call RSourceOtherScripts()
+
+function! RDocExSection()
+    let ii = search("^Examples:$", "nW")
+    if ii == 0
+        call RWarningMsg("No example section below.")
+        return
+    else
+        call cursor(ii+1, 1)
+    endif
+endfunction
+
+nmap  ge :call RDocExSection()
+nmap  q :q
 
 setlocal bufhidden=wipe
 setlocal noswapfile
 set buftype=nofile
 autocmd VimResized  let g:vimrplugin_newsize = 1
+call FixRdoc()
+autocmd FileType rdoc call FixRdoc()
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
 
+" vim: sw=4
diff --git a/ftplugin/rhelp.vim b/ftplugin/rhelp.vim
deleted file mode 100644
index d308800..0000000
--- a/ftplugin/rhelp.vim
+++ /dev/null
@@ -1,92 +0,0 @@
-"  This program is free software; you can redistribute it and/or modify
-"  it under the terms of the GNU General Public License as published by
-"  the Free Software Foundation; either version 2 of the License, or
-"  (at your option) any later version.
-"
-"  This program is distributed in the hope that it will be useful,
-"  but WITHOUT ANY WARRANTY; without even the implied warranty of
-"  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-"  GNU General Public License for more details.
-"
-"  A copy of the GNU General Public License is available at
-"  http://www.r-project.org/Licenses/
-
-"==========================================================================
-" ftplugin for R files
-"
-" Authors: Jakson Alves de Aquino 
-"          Jose Claudio Faria
-"          
-"          Based on previous work by Johannes Ranke
-"
-" Last Change: Sat Feb 05, 2011  09:18AM
-"
-" Please see doc/r-plugin.txt for usage details.
-"==========================================================================
-
-" Only do this when not yet done for this buffer
-if exists("b:did_rhelp_ftplugin") || exists("disable_r_ftplugin")
-    finish
-endif
-
-" Don't load another plugin for this buffer
-let b:did_rhelp_ftplugin = 1
-
-" Source scripts common to R, Rnoweb, Rhelp and rdoc files:
-runtime r-plugin/common_global.vim
-if exists("g:rplugin_failed")
-    finish
-endif
-
-" Some buffer variables common to R, Rnoweb, Rhelp and rdoc file need be
-" defined after the global ones:
-runtime r-plugin/common_buffer.vim
-
-" Run R CMD BATCH on current file and load the resulting .Rout in a split
-" window
-function! ShowRout()
-    let routfile = expand("%:r") . ".Rout"
-    if bufloaded(routfile)
-        exe "bunload " . routfile
-        call delete(routfile)
-    endif
-
-    " if not silent, the user will have to type 
-    silent update
-    if has("gui_win32")
-        let rcmd = 'Rcmd.exe BATCH --no-restore --no-save "' . expand("%") . '" "' . routfile . '"'
-    else
-        let rcmd = g:rplugin_R . " CMD BATCH --no-restore --no-save '" . expand("%") . "' '" . routfile . "'"
-    endif
-    echo "Please wait for: " . rcmd
-    let rlog = system(rcmd)
-    if v:shell_error && rlog != ""
-        call RWarningMsg('Error: "' . rlog . '"')
-        sleep 1
-    endif
-
-    if filereadable(routfile)
-        if g:vimrplugin_routnotab == 1
-            exe "split " . routfile
-        else
-            exe "tabnew " . routfile
-        endif
-    else
-        call RWarningMsg("The file '" . routfile . "' is not readable.")
-    endif
-endfunction
-
-
-"==========================================================================
-" Key bindings and menu items
-
-call RCreateStartMaps()
-call RCreateEditMaps()
-call RCreateSendMaps()
-call RControlMaps()
-call RCreateMaps("nvi", 'RSetwd',        'rd', ':call RSetWD()')
-
-" Menu R
-call MakeRMenu()
-
-
diff --git a/ftplugin/rhelp_rplugin.vim b/ftplugin/rhelp_rplugin.vim
new file mode 100644
index 0000000..66fbcd4
--- /dev/null
+++ b/ftplugin/rhelp_rplugin.vim
@@ -0,0 +1,104 @@
+
+if exists("g:disable_r_ftplugin") || has("nvim")
+    finish
+endif
+
+runtime R/flag.vim
+if exists("g:NvimR_installed")
+    finish
+endif
+
+" Source scripts common to R, Rnoweb, Rhelp and rdoc files:
+runtime r-plugin/common_global.vim
+if exists("g:rplugin_failed")
+    finish
+endif
+
+" Some buffer variables common to R, Rnoweb, Rhelp and rdoc file need be
+" defined after the global ones:
+runtime r-plugin/common_buffer.vim
+
+if !exists("b:did_ftplugin") && !exists("g:rplugin_runtime_warn")
+    runtime ftplugin/rhelp.vim
+    if !exists("b:did_ftplugin")
+        call RWarningMsgInp("Your runtime files seems to be outdated.\nSee: https://github.com/jalvesaq/R-Vim-runtime")
+        let g:rplugin_runtime_warn = 1
+    endif
+endif
+
+function! RhelpIsInRCode(vrb)
+    let lastsec = search('^\\[a-z][a-z]*{', "bncW")
+    let secname = getline(lastsec)
+    if line(".") > lastsec && (secname =~ '^\\usage{' || secname =~ '^\\examples{' || secname =~ '^\\dontshow{' || secname =~ '^\\dontrun{' || secname =~ '^\\donttest{' || secname =~ '^\\testonly{')
+        return 1
+    else
+        if a:vrb
+            call RWarningMsg("Not inside an R section.")
+        endif
+        return 0
+    endif
+endfunction
+
+function! RhelpComplete(findstart, base)
+    if a:findstart
+        let line = getline('.')
+        let start = col('.') - 1
+        while start > 0 && (line[start - 1] =~ '\w' || line[start - 1] == '\')
+            let start -= 1
+        endwhile
+        return start
+    else
+        let resp = []
+        let hwords = ['\Alpha', '\Beta', '\Chi', '\Delta', '\Epsilon',
+                    \ '\Eta', '\Gamma', '\Iota', '\Kappa', '\Lambda', '\Mu', '\Nu',
+                    \ '\Omega', '\Omicron', '\Phi', '\Pi', '\Psi', '\R', '\Rdversion',
+                    \ '\Rho', '\S4method', '\Sexpr', '\Sigma', '\Tau', '\Theta', '\Upsilon',
+                    \ '\Xi', '\Zeta', '\acronym', '\alias', '\alpha', '\arguments',
+                    \ '\author', '\beta', '\bold', '\chi', '\cite', '\code', '\command',
+                    \ '\concept', '\cr', '\dQuote', '\delta', '\deqn', '\describe',
+                    \ '\description', '\details', '\dfn', '\docType', '\dontrun', '\dontshow',
+                    \ '\donttest', '\dots', '\email', '\emph', '\encoding', '\enumerate',
+                    \ '\env', '\epsilon', '\eqn', '\eta', '\examples', '\file', '\format',
+                    \ '\gamma', '\ge', '\href', '\iota', '\item', '\itemize', '\kappa',
+                    \ '\kbd', '\keyword', '\lambda', '\ldots', '\le',
+                    \ '\link', '\linkS4class', '\method', '\mu', '\name', '\newcommand',
+                    \ '\note', '\nu', '\omega', '\omicron', '\option', '\phi', '\pi',
+                    \ '\pkg', '\preformatted', '\psi', '\references', '\renewcommand', '\rho',
+                    \ '\sQuote', '\samp', '\section', '\seealso', '\sigma', '\source',
+                    \ '\special', '\strong', '\subsection', '\synopsis', '\tab', '\tabular',
+                    \ '\tau', '\testonly', '\theta', '\title', '\upsilon', '\url', '\usage',
+                    \ '\value', '\var', '\verb', '\xi', '\zeta']
+        for word in hwords
+            if word =~ '^' . escape(a:base, '\')
+                call add(resp, {'word': word})
+            endif
+        endfor
+        return resp
+    endif
+endfunction
+
+let b:IsInRCode = function("RhelpIsInRCode")
+let b:rplugin_nonr_omnifunc = "RhelpComplete"
+
+"==========================================================================
+" Key bindings and menu items
+
+call RCreateStartMaps()
+call RCreateEditMaps()
+call RCreateSendMaps()
+call RControlMaps()
+call RCreateMaps("nvi", 'RSetwd',        'rd', ':call RSetWD()')
+
+" Menu R
+if has("gui_running")
+    runtime r-plugin/gui_running.vim
+    call MakeRMenu()
+endif
+
+call RSourceOtherScripts()
+
+if exists("b:undo_ftplugin")
+    let b:undo_ftplugin .= " | unlet! b:IsInRCode"
+else
+    let b:undo_ftplugin = "unlet! b:IsInRCode"
+endif
diff --git a/ftplugin/rmd_rplugin.vim b/ftplugin/rmd_rplugin.vim
new file mode 100644
index 0000000..e454634
--- /dev/null
+++ b/ftplugin/rmd_rplugin.vim
@@ -0,0 +1,175 @@
+
+if exists("g:disable_r_ftplugin") || has("nvim")
+    finish
+endif
+
+runtime R/flag.vim
+if exists("g:NvimR_installed")
+    finish
+endif
+
+" Source scripts common to R, Rrst, Rnoweb, Rhelp and Rdoc:
+runtime r-plugin/common_global.vim
+if exists("g:rplugin_failed")
+    finish
+endif
+
+" Some buffer variables common to R, Rmd, Rrst, Rnoweb, Rhelp and Rdoc need to
+" be defined after the global ones:
+runtime r-plugin/common_buffer.vim
+
+if !exists("b:did_ftplugin") && !exists("g:rplugin_runtime_warn")
+    runtime ftplugin/rmd.vim
+    if !exists("b:did_ftplugin")
+        call RWarningMsgInp("Your runtime files seems to be outdated.\nSee: https://github.com/jalvesaq/R-Vim-runtime")
+        let g:rplugin_runtime_warn = 1
+    endif
+endif
+
+function! RmdIsInRCode(vrb)
+    let chunkline = search("^[ \t]*```[ ]*{r", "bncW")
+    let docline = search("^[ \t]*```$", "bncW")
+    if chunkline > docline && chunkline != line(".")
+        return 1
+    else
+        if a:vrb
+            call RWarningMsg("Not inside an R code chunk.")
+        endif
+        return 0
+    endif
+endfunction
+
+function! RmdPreviousChunk() range
+    let rg = range(a:firstline, a:lastline)
+    let chunk = len(rg)
+    for var in range(1, chunk)
+        let curline = line(".")
+        if RmdIsInRCode(0)
+            let i = search("^[ \t]*```[ ]*{r", "bnW")
+            if i != 0
+                call cursor(i-1, 1)
+            endif
+        endif
+        let i = search("^[ \t]*```[ ]*{r", "bnW")
+        if i == 0
+            call cursor(curline, 1)
+            call RWarningMsg("There is no previous R code chunk to go.")
+            return
+        else
+            call cursor(i+1, 1)
+        endif
+    endfor
+    return
+endfunction
+
+function! RmdNextChunk() range
+    let rg = range(a:firstline, a:lastline)
+    let chunk = len(rg)
+    for var in range(1, chunk)
+        let i = search("^[ \t]*```[ ]*{r", "nW")
+        if i == 0
+            call RWarningMsg("There is no next R code chunk to go.")
+            return
+        else
+            call cursor(i+1, 1)
+        endif
+    endfor
+    return
+endfunction
+
+function! RMakeRmd(t)
+    update
+
+    if a:t == "odt"
+        if has("win32") || has("win64")
+            let g:rplugin_soffbin = "soffice.exe"
+        else
+            let g:rplugin_soffbin = "soffice"
+        endif
+        if !executable(g:rplugin_soffbin)
+            call RWarningMsg("Is Libre Office installed? Cannot convert into ODT: '" . g:rplugin_soffbin . "' not found.")
+            return
+        endif
+    endif
+
+    let rmddir = expand("%:p:h")
+    if has("win32") || has("win64")
+        let rmddir = substitute(rmddir, '\\', '/', 'g')
+    endif
+    if a:t == "default"
+        let rcmd = 'vim.interlace.rmd("' . expand("%:t") . '", rmddir = "' . rmddir . '"'
+    else
+        let rcmd = 'vim.interlace.rmd("' . expand("%:t") . '", outform = "' . a:t .'", rmddir = "' . rmddir . '"'
+    endif
+    if (g:vimrplugin_openhtml  == 0 && a:t == "html_document") || (g:vimrplugin_openpdf == 0 && (a:t == "pdf_document" || a:t == "beamer_presentation" || a:t == "word_document"))
+        let rcmd .= ", view = FALSE"
+    endif
+    let rcmd = rcmd . ', envir = ' . g:vimrplugin_rmd_environment . ')'
+    call g:SendCmdToR(rcmd)
+endfunction
+
+" Send Rmd chunk to R
+function! SendRmdChunkToR(e, m)
+    if RmdIsInRCode(0) == 0
+        call RWarningMsg("Not inside an R code chunk.")
+        return
+    endif
+    let chunkline = search("^[ \t]*```[ ]*{r", "bncW") + 1
+    let docline = search("^[ \t]*```", "ncW") - 1
+    let lines = getline(chunkline, docline)
+    let ok = RSourceLines(lines, a:e)
+    if ok == 0
+        return
+    endif
+    if a:m == "down"
+        call RmdNextChunk()
+    endif
+endfunction
+
+let b:IsInRCode = function("RmdIsInRCode")
+let b:PreviousRChunk = function("RmdPreviousChunk")
+let b:NextRChunk = function("RmdNextChunk")
+let b:SendChunkToR = function("SendRmdChunkToR")
+
+"==========================================================================
+" Key bindings and menu items
+
+call RCreateStartMaps()
+call RCreateEditMaps()
+call RCreateSendMaps()
+call RControlMaps()
+call RCreateMaps("nvi", 'RSetwd',        'rd', ':call RSetWD()')
+
+" Only .Rmd files use these functions:
+call RCreateMaps("nvi", 'RKnit',          'kn', ':call RKnit()')
+call RCreateMaps("nvi", 'RMakeRmd',       'kr', ':call RMakeRmd("default")')
+call RCreateMaps("nvi", 'RMakePDFK',      'kp', ':call RMakeRmd("pdf_document")')
+call RCreateMaps("nvi", 'RMakePDFKb',     'kl', ':call RMakeRmd("beamer_presentation")')
+call RCreateMaps("nvi", 'RMakeWord',      'kw', ':call RMakeRmd("word_document")')
+call RCreateMaps("nvi", 'RMakeHTML',      'kh', ':call RMakeRmd("html_document")')
+call RCreateMaps("nvi", 'RMakeODT',       'ko', ':call RMakeRmd("odt")')
+call RCreateMaps("ni",  'RSendChunk',     'cc', ':call b:SendChunkToR("silent", "stay")')
+call RCreateMaps("ni",  'RESendChunk',    'ce', ':call b:SendChunkToR("echo", "stay")')
+call RCreateMaps("ni",  'RDSendChunk',    'cd', ':call b:SendChunkToR("silent", "down")')
+call RCreateMaps("ni",  'REDSendChunk',   'ca', ':call b:SendChunkToR("echo", "down")')
+call RCreateMaps("n",  'RNextRChunk',     'gn', ':call b:NextRChunk()')
+call RCreateMaps("n",  'RPreviousRChunk', 'gN', ':call b:PreviousRChunk()')
+
+" Menu R
+if has("gui_running")
+    runtime r-plugin/gui_running.vim
+    call MakeRMenu()
+endif
+
+let g:rplugin_has_pandoc = 0
+let g:rplugin_has_soffice = 0
+
+call RSetPDFViewer()
+
+call RSourceOtherScripts()
+
+if exists("b:undo_ftplugin")
+    let b:undo_ftplugin .= " | unlet! b:IsInRCode b:PreviousRChunk b:NextRChunk b:SendChunkToR"
+else
+    let b:undo_ftplugin = "unlet! b:IsInRCode b:PreviousRChunk b:NextRChunk b:SendChunkToR"
+endif
diff --git a/ftplugin/rnoweb.vim b/ftplugin/rnoweb.vim
deleted file mode 100644
index 2f51316..0000000
--- a/ftplugin/rnoweb.vim
+++ /dev/null
@@ -1,156 +0,0 @@
-"  This program is free software; you can redistribute it and/or modify
-"  it under the terms of the GNU General Public License as published by
-"  the Free Software Foundation; either version 2 of the License, or
-"  (at your option) any later version.
-"
-"  This program is distributed in the hope that it will be useful,
-"  but WITHOUT ANY WARRANTY; without even the implied warranty of
-"  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-"  GNU General Public License for more details.
-"
-"  A copy of the GNU General Public License is available at
-"  http://www.r-project.org/Licenses/
-
-"==========================================================================
-" ftplugin for R files
-"
-" Authors: Jakson Alves de Aquino 
-"          Jose Claudio Faria
-"          
-" Last Change: Sun May 22, 2011  08:27AM
-"==========================================================================
-
-" Only do this when not yet done for this buffer
-if exists("b:did_rnoweb_ftplugin") || exists("disable_r_ftplugin")
-    finish
-endif
-
-" Don't load another plugin for this buffer
-let b:did_rnoweb_ftplugin = 1
-
-" Enable syntax highlight of LaTeX errors in R Console (if using Conque
-" Shell)
-let syn_rout_latex = 1
-
-" Source scripts common to R, Rnoweb, Rhelp and rdoc files:
-runtime r-plugin/common_global.vim
-if exists("g:rplugin_failed")
-    finish
-endif
-
-" Some buffer variables common to R, Rnoweb, Rhelp and rdoc file need be
-" defined after the global ones:
-runtime r-plugin/common_buffer.vim
-
-setlocal iskeyword=@,48-57,_,.
-
-function! RWriteChunk()
-    if getline(".") =~ "^\\s*$" && RnwIsInRCode() == 0
-        call setline(line("."), "<<>>=")
-        exe "normal! o@"
-        exe "normal! 0kl"
-    else
-        exe "normal! a<"
-    endif
-endfunction
-
-function! RnwIsInRCode()
-    let chunkline = search("^<<", "bncW")
-    let docline = search("^@", "bncW")
-    if chunkline > docline
-        return 1
-    else
-        return 0
-    endif
-endfunction
-
-function! RnwPreviousChunk()
-    echon
-    let curline = line(".")
-    if RnwIsInRCode()
-        let i = search("^<<.*$", "bnW")
-        if i != 0
-            call cursor(i-1, 1)
-        endif
-    endif
-
-    let i = search("^<<.*$", "bnW")
-    if i == 0
-        call cursor(curline, 1)
-        call RWarningMsg("There is no previous R code chunk to go.")
-    else
-        call cursor(i+1, 1)
-    endif
-    return
-endfunction
-
-function! RnwNextChunk()
-    echon
-    let i = search("^<<.*$", "nW")
-    if i == 0
-        call RWarningMsg("There is no next R code chunk to go.")
-    else
-        call cursor(i+1, 1)
-    endif
-    return
-endfunction
-
-" Sweave and compile the current buffer content
-function! RMakePDF(bibtex)
-    update
-    call RSetWD()
-    let pdfcmd = "source('" . g:rplugin_home . "/r-plugin/vimSweave.R') ; .vim.Sweave('" . expand("%:t") . "'"
-
-    if g:vimrplugin_latexcmd != "pdflatex"
-        let pdfcmd = pdfcmd . ", latexcmd = '" . g:vimrplugin_latexcmd . "'"
-    endif
-
-    if a:bibtex == "bibtex"
-        let pdfcmd = pdfcmd . ", bibtex = TRUE"
-    endif
-
-    if exists("g:vimrplugin_sweaveargs")
-        let pdfcmd = pdfcmd . ", " . g:vimrplugin_sweaveargs
-    endif
-
-    let pdfcmd = pdfcmd . ")"
-    let ok = SendCmdToR(pdfcmd)
-    if ok == 0
-        return
-    endif
-    echon
-endfunction  
-
-" Sweave the current buffer content
-function! RSweave()
-    update
-    call RSetWD()
-    call SendCmdToR('Sweave("' . expand("%:t") . '")')
-    echon
-endfunction
-
-if g:vimrplugin_rnowebchunk == 1
-    " Write code chunck in rnoweb files
-    imap  < :call RWriteChunk()a
-endif
-
-"==========================================================================
-" Key bindings and menu items
-
-call RCreateStartMaps()
-call RCreateEditMaps()
-call RCreateSendMaps()
-call RControlMaps()
-call RCreateMaps("nvi", 'RSetwd',        'rd', ':call RSetWD()')
-
-" Only .Rnw files use these functions:
-call RCreateMaps("nvi", 'RSweave',      'sw', ':call RSweave()')
-call RCreateMaps("nvi", 'RMakePDF',     'sp', ':call RMakePDF("nobib")')
-call RCreateMaps("nvi", 'RBibTeX',      'sb', ':call RMakePDF("bibtex")')
-call RCreateMaps("nvi", 'RIndent',      'si', ':call RnwToggleIndentSty()')
-nmap  gn :call RnwNextChunk()
-nmap  gN :call RnwPreviousChunk()
-
-" Menu R
-call MakeRMenu()
-
diff --git a/ftplugin/rnoweb_rplugin.vim b/ftplugin/rnoweb_rplugin.vim
new file mode 100644
index 0000000..151ef5e
--- /dev/null
+++ b/ftplugin/rnoweb_rplugin.vim
@@ -0,0 +1,663 @@
+
+if exists("g:disable_r_ftplugin") || has("nvim")
+    finish
+endif
+
+runtime R/flag.vim
+if exists("g:NvimR_installed")
+    finish
+endif
+
+" Source scripts common to R, Rnoweb, Rhelp and Rdoc:
+runtime r-plugin/common_global.vim
+if exists("g:rplugin_failed")
+    finish
+endif
+
+" Some buffer variables common to R, Rnoweb, Rhelp and Rdoc need to be defined
+" after the global ones:
+runtime r-plugin/common_buffer.vim
+
+if !exists("b:did_ftplugin") && !exists("g:rplugin_runtime_warn")
+    runtime ftplugin/rnoweb.vim
+    if !exists("b:did_ftplugin")
+        call RWarningMsgInp("Your runtime files seems to be outdated.\nSee: https://github.com/jalvesaq/R-Vim-runtime")
+        let g:rplugin_runtime_warn = 1
+    endif
+endif
+
+if has("win32") || has("win64")
+    call RSetDefaultValue("g:vimrplugin_latexmk", 0)
+else
+    call RSetDefaultValue("g:vimrplugin_latexmk", 1)
+endif
+if !exists("g:rplugin_has_latexmk")
+    if g:vimrplugin_latexmk && executable("latexmk") && executable("perl")
+        let g:rplugin_has_latexmk = 1
+    else
+        let g:rplugin_has_latexmk = 0
+    endif
+endif
+
+function! RWriteChunk()
+    if getline(".") =~ "^\\s*$" && RnwIsInRCode(0) == 0
+        call setline(line("."), "<<>>=")
+        exe "normal! o@"
+        exe "normal! 0kl"
+    else
+        exe "normal! a<"
+    endif
+endfunction
+
+function! RnwIsInRCode(vrb)
+    let chunkline = search("^<<", "bncW")
+    let docline = search("^@", "bncW")
+    if chunkline > docline && chunkline != line(".")
+        return 1
+    else
+        if a:vrb
+            call RWarningMsg("Not inside an R code chunk.")
+        endif
+        return 0
+    endif
+endfunction
+
+function! RnwPreviousChunk() range
+    let rg = range(a:firstline, a:lastline)
+    let chunk = len(rg)
+    for var in range(1, chunk)
+        let curline = line(".")
+        if RnwIsInRCode(0)
+            let i = search("^<<.*$", "bnW")
+            if i != 0
+                call cursor(i-1, 1)
+            endif
+        endif
+        let i = search("^<<.*$", "bnW")
+        if i == 0
+            call cursor(curline, 1)
+            call RWarningMsg("There is no previous R code chunk to go.")
+            return
+        else
+            call cursor(i+1, 1)
+        endif
+    endfor
+    return
+endfunction
+
+function! RnwNextChunk() range
+    let rg = range(a:firstline, a:lastline)
+    let chunk = len(rg)
+    for var in range(1, chunk)
+        let i = search("^<<.*$", "nW")
+        if i == 0
+            call RWarningMsg("There is no next R code chunk to go.")
+            return
+        else
+            call cursor(i+1, 1)
+        endif
+    endfor
+    return
+endfunction
+
+
+" Because this function delete files, it will not be documented.
+" If you want to try it, put in your vimrc:
+"
+" let vimrplugin_rm_knit_cache = 1
+"
+" If don't want to answer the question about deleting files, and
+" if you trust this code more than I do, put in your vimrc:
+"
+" let vimrplugin_ask_rm_knitr_cache = 0
+"
+" Note that if you have the string "cache.path=" in more than one place only
+" the first one above the cursor position will be found. The path must be
+" surrounded by quotes; if it's an R object, it will not be recognized.
+function! RKnitRmCache()
+    let lnum = search('\\s*=', 'bnwc')
+    if lnum == 0
+        let pathdir = "cache/"
+    else
+        let pathregexpr = '.*\\s*=\s*[' . "'" . '"]\(.\{-}\)[' . "'" . '"].*'
+        let pathdir = substitute(getline(lnum), pathregexpr, '\1', '')
+        if pathdir !~ '/$'
+            let pathdir .= '/'
+        endif
+    endif
+    if exists("g:vimrplugin_ask_rm_knitr_cache") && g:vimrplugin_ask_rm_knitr_cache == 0
+        let cleandir = 1
+    else
+        call inputsave()
+        let answer = input('Delete all files from "' . pathdir . '"? [y/n]: ')
+        call inputrestore()
+        if answer == "y"
+            let cleandir = 1
+        else
+            let cleandir = 0
+        endif
+    endif
+    normal! :
+    if cleandir
+        call g:SendCmdToR('rm(list=ls(all.names=TRUE)); unlink("' . pathdir . '*")')
+    endif
+endfunction
+
+" knit the current buffer content
+function! RKnitRnw()
+    update
+    let rnwdir = expand("%:p:h")
+    if has("win32") || has("win64")
+        let rnwdir = substitute(rnwdir, '\\', '/', 'g')
+    endif
+    if g:vimrplugin_synctex == 0
+        call g:SendCmdToR('vim.interlace.rnoweb("' . expand("%:t") . '", rnwdir = "' . rnwdir . '", buildpdf = FALSE, synctex = FALSE)')
+    else
+        call g:SendCmdToR('vim.interlace.rnoweb("' . expand("%:t") . '", rnwdir = "' . rnwdir . '", buildpdf = FALSE)')
+    endif
+endfunction
+
+" Sweave and compile the current buffer content
+function! RMakePDF(bibtex, knit)
+    if g:rplugin_vimcomport == 0
+        call RWarningMsg("The vimcom package is required to make and open the PDF.")
+    endif
+    update
+    let rnwdir = expand("%:p:h")
+    if has("win32") || has("win64")
+        let rnwdir = substitute(rnwdir, '\\', '/', 'g')
+    endif
+    let pdfcmd = 'vim.interlace.rnoweb("' . expand("%:t") . '", rnwdir = "' . rnwdir . '"'
+
+    if a:knit == 0
+        let pdfcmd = pdfcmd . ', knit = FALSE'
+    endif
+
+    if g:rplugin_has_latexmk == 0
+        let pdfcmd = pdfcmd . ', latexmk = FALSE'
+    endif
+
+    if g:vimrplugin_latexcmd != "default"
+        let pdfcmd = pdfcmd . ", latexcmd = '" . g:vimrplugin_latexcmd . "'"
+    endif
+
+    if g:vimrplugin_synctex == 0
+        let pdfcmd = pdfcmd . ", synctex = FALSE"
+    endif
+
+    if a:bibtex == "bibtex"
+        let pdfcmd = pdfcmd . ", bibtex = TRUE"
+    endif
+
+    if g:vimrplugin_openpdf == 0
+        let pdfcmd = pdfcmd . ", view = FALSE"
+    else
+        if g:vimrplugin_openpdf == 1
+            if b:pdf_is_open == 0
+                let b:pdf_is_open = 1
+            else
+                let pdfcmd = pdfcmd . ", view = FALSE"
+            endif
+        endif
+    endif
+
+    if a:knit == 0 && exists("g:vimrplugin_sweaveargs")
+        let pdfcmd = pdfcmd . ", " . g:vimrplugin_sweaveargs
+    endif
+
+    let pdfcmd = pdfcmd . ")"
+    let ok = g:SendCmdToR(pdfcmd)
+    if ok == 0
+        return
+    endif
+endfunction
+
+" Send Sweave chunk to R
+function! RnwSendChunkToR(e, m)
+    if RnwIsInRCode(0) == 0
+        call RWarningMsg("Not inside an R code chunk.")
+        return
+    endif
+    let chunkline = search("^<<", "bncW") + 1
+    let docline = search("^@", "ncW") - 1
+    let lines = getline(chunkline, docline)
+    let ok = RSourceLines(lines, a:e)
+    if ok == 0
+        return
+    endif
+    if a:m == "down"
+        call RnwNextChunk()
+    endif
+endfunction
+
+" Sweave the current buffer content
+function! RSweave()
+    update
+    let rnwdir = expand("%:p:h")
+    if has("win32") || has("win64")
+        let rnwdir = substitute(rnwdir, '\\', '/', 'g')
+    endif
+    let scmd = 'vim.interlace.rnoweb("' . expand("%:t") . '", rnwdir = "' . rnwdir . '", knit = FALSE, buildpdf = FALSE'
+    if exists("g:vimrplugin_sweaveargs")
+        let scmd .= ', ' . g:vimrplugin_sweaveargs
+    endif
+    if g:vimrplugin_synctex == 0
+        let scmd .= ", synctex = FALSE"
+    endif
+    call g:SendCmdToR(scmd . ')')
+endfunction
+
+if g:vimrplugin_rnowebchunk == 1
+    " Write code chunk in rnoweb files
+    inoremap  < :call RWriteChunk()a
+endif
+
+" Pointers to functions whose purposes are the same in rnoweb, rrst, rmd,
+" rhelp and rdoc and which are called at common_global.vim
+let b:IsInRCode = function("RnwIsInRCode")
+let b:PreviousRChunk = function("RnwPreviousChunk")
+let b:NextRChunk = function("RnwNextChunk")
+let b:SendChunkToR = function("RnwSendChunkToR")
+
+let b:pdf_is_open = 0
+
+
+"==========================================================================
+" Key bindings and menu items
+
+call RCreateStartMaps()
+call RCreateEditMaps()
+call RCreateSendMaps()
+call RControlMaps()
+call RCreateMaps("nvi", 'RSetwd',        'rd', ':call RSetWD()')
+
+" Only .Rnw files use these functions:
+call RCreateMaps("nvi", 'RSweave',      'sw', ':call RSweave()')
+call RCreateMaps("nvi", 'RMakePDF',     'sp', ':call RMakePDF("nobib", 0)')
+call RCreateMaps("nvi", 'RBibTeX',      'sb', ':call RMakePDF("bibtex", 0)')
+if exists("g:vimrplugin_rm_knit_cache") && g:vimrplugin_rm_knit_cache == 1
+    call RCreateMaps("nvi", 'RKnitRmCache', 'kr', ':call RKnitRmCache()')
+endif
+call RCreateMaps("nvi", 'RKnit',        'kn', ':call RKnitRnw()')
+call RCreateMaps("nvi", 'RMakePDFK',    'kp', ':call RMakePDF("nobib", 1)')
+call RCreateMaps("nvi", 'RBibTeXK',     'kb', ':call RMakePDF("bibtex", 1)')
+call RCreateMaps("nvi", 'RIndent',      'si', ':call RnwToggleIndentSty()')
+call RCreateMaps("ni",  'RSendChunk',   'cc', ':call b:SendChunkToR("silent", "stay")')
+call RCreateMaps("ni",  'RESendChunk',  'ce', ':call b:SendChunkToR("echo", "stay")')
+call RCreateMaps("ni",  'RDSendChunk',  'cd', ':call b:SendChunkToR("silent", "down")')
+call RCreateMaps("ni",  'REDSendChunk', 'ca', ':call b:SendChunkToR("echo", "down")')
+call RCreateMaps("nvi", 'ROpenPDF',     'op', ':call ROpenPDF("Get Master")')
+if g:vimrplugin_synctex
+    call RCreateMaps("ni",  'RSyncFor',     'gp', ':call SyncTeX_forward()')
+    call RCreateMaps("ni",  'RGoToTeX',     'gt', ':call SyncTeX_forward(1)')
+endif
+call RCreateMaps("n",  'RNextRChunk',     'gn', ':call b:NextRChunk()')
+call RCreateMaps("n",  'RPreviousRChunk', 'gN', ':call b:PreviousRChunk()')
+
+" Menu R
+if has("gui_running")
+    runtime r-plugin/gui_running.vim
+    call MakeRMenu()
+endif
+
+"==========================================================================
+" SyncTeX support:
+
+function! SyncTeX_GetMaster()
+    if filereadable(expand("%:t:r") . "-concordance.tex")
+        return [expand("%:t:r"), "."]
+    endif
+
+    let ischild = search('% *!Rnw *root *=', 'bwn')
+    if ischild
+        let mfile = substitute(getline(ischild), '.*% *!Rnw *root *= *\(.*\) *', '\1', '')
+        if mfile =~ "/"
+            let mdir = substitute(mfile, '\(.*\)/.*', '\1', '')
+            let mfile = substitute(mfile, '.*/', '', '')
+            if mdir == '..'
+                let mdir = expand("%:p:h:h")
+            endif
+        else
+            let mdir = "."
+        endif
+        let basenm = substitute(mfile, '\....$', '', '')
+        return [basenm, mdir]
+    endif
+
+    " Maybe this buffer is a master Rnoweb not compiled yet.
+    return [expand("%:t:r"), "."]
+endfunction
+
+" See http://www.stats.uwo.ca/faculty/murdoch/9864/Sweave.pdf page 25
+function! SyncTeX_readconc(basenm)
+    let texidx = 0
+    let rnwidx = 0
+    let ntexln = len(readfile(a:basenm . ".tex"))
+    let lstexln = range(1, ntexln)
+    let lsrnwf = range(1, ntexln)
+    let lsrnwl = range(1, ntexln)
+    let conc = readfile(a:basenm . "-concordance.tex")
+    let idx = 0
+    let maxidx = len(conc)
+    while idx < maxidx && texidx < ntexln && conc[idx] =~ "Sconcordance"
+        let texf = substitute(conc[idx], '\\Sconcordance{concordance:\(.\{-}\):.*', '\1', "g")
+        let rnwf = substitute(conc[idx], '\\Sconcordance{concordance:.\{-}:\(.\{-}\):.*', '\1', "g")
+        let idx += 1
+        let concnum = ""
+        while idx < maxidx && conc[idx] !~ "Sconcordance"
+            let concnum = concnum . conc[idx]
+            let idx += 1
+        endwhile
+        let concnum = substitute(concnum, '%', '', 'g')
+        let concnum = substitute(concnum, '}', '', '')
+        let concl = split(concnum)
+        let ii = 0
+        let maxii = len(concl) - 2
+        let rnwl = str2nr(concl[0])
+        let lsrnwl[texidx] = rnwl
+        let lsrnwf[texidx] = rnwf
+        let texidx += 1
+        while ii < maxii && texidx < ntexln
+            let ii += 1
+            let lnrange = range(1, concl[ii])
+            let ii += 1
+            for iii in lnrange
+                if  texidx >= ntexln
+                    break
+                endif
+                let rnwl += concl[ii]
+                let lsrnwl[texidx] = rnwl
+                let lsrnwf[texidx] = rnwf
+                let texidx += 1
+            endfor
+        endwhile
+    endwhile
+    return {"texlnum": lstexln, "rnwfile": lsrnwf, "rnwline": lsrnwl}
+endfunction
+
+function! GoToBuf(rnwbn, rnwf, basedir, rnwln)
+    if bufname("%") != a:rnwbn
+        if bufloaded(a:basedir . '/' . a:rnwf)
+            let savesb = &switchbuf
+            set switchbuf=useopen,usetab
+            exe "sb " . substitute(a:basedir . '/' . a:rnwf, ' ', '\\ ', 'g')
+            exe "set switchbuf=" . savesb
+        elseif bufloaded(a:rnwf)
+            let savesb = &switchbuf
+            set switchbuf=useopen,usetab
+            exe "sb " . substitute(a:rnwf, ' ', '\\ ', 'g')
+            exe "set switchbuf=" . savesb
+        else
+            if filereadable(a:basedir . '/' . a:rnwf)
+                exe "tabnew " . substitute(a:basedir . '/' . a:rnwf, ' ', '\\ ', 'g')
+            elseif filereadable(a:rnwf)
+                exe "tabnew " . substitute(a:rnwf, ' ', '\\ ', 'g')
+            else
+                call RWarningMsg('Could not find either "' . a:rnwbn . ' or "' . a:rnwf . '" in "' . a:basedir . '".')
+                return 0
+            endif
+        endif
+    endif
+    exe a:rnwln
+    redraw
+    return 1
+endfunction
+
+function! SyncTeX_backward(fname, ln)
+    let flnm = substitute(a:fname, '/\./', '/', '')      " Okular
+    let basenm = substitute(flnm, "\....$", "", "")   " Delete extension
+    if basenm =~ "/"
+        let basedir = substitute(basenm, '\(.*\)/.*', '\1', '')
+    else
+        let basedir = '.'
+    endif
+    if filereadable(basenm . "-concordance.tex")
+        if !filereadable(basenm . ".tex")
+            call RWarningMsg('SyncTeX [Vim-R-plugin]: "' . basenm . '.tex" not found.')
+            return
+        endif
+        let concdata = SyncTeX_readconc(basenm)
+        let texlnum = concdata["texlnum"]
+        let rnwfile = concdata["rnwfile"]
+        let rnwline = concdata["rnwline"]
+        let rnwln = 0
+        for ii in range(len(texlnum))
+            if texlnum[ii] >= a:ln
+                let rnwf = rnwfile[ii]
+                let rnwln = rnwline[ii]
+                break
+            endif
+        endfor
+        if rnwln == 0
+            call RWarningMsg("Could not find Rnoweb source line.")
+            return
+        endif
+    else
+        if filereadable(basenm . ".Rnw") || filereadable(basenm . ".rnw")
+            call RWarningMsg('SyncTeX [Vim-R-plugin]: "' . basenm . '-concordance.tex" not found.')
+            return
+        elseif filereadable(flnm)
+            let rnwf = flnm
+            let rnwln = a:ln
+        else
+            call RWarningMsg("Could not find '" . basenm . ".Rnw'.")
+        endif
+    endif
+
+    let rnwbn = substitute(rnwf, '.*/', '', '')
+    let rnwf = substitute(rnwf, '^\./', '', '')
+
+    if GoToBuf(rnwbn, rnwf, basedir, rnwln)
+        if g:rplugin_has_wmctrl && v:windowid != 0
+            call system("wmctrl -ia " . v:windowid)
+        elseif has("gui_running")
+            call foreground()
+        endif
+    endif
+endfunction
+
+function! SyncTeX_forward(...)
+    let basenm = expand("%:t:r")
+    let lnum = 0
+    let rnwf = expand("%:t")
+
+    let olddir = getcwd()
+    if olddir != expand("%:p:h")
+        exe "cd " . substitute(expand("%:p:h"), ' ', '\\ ', 'g')
+    endif
+
+    if filereadable(basenm . "-concordance.tex")
+        let lnum = line(".")
+    else
+        let ischild = search('% *!Rnw *root *=', 'bwn')
+        if ischild
+            let mfile = substitute(getline(ischild), '.*% *!Rnw *root *= *\(.*\) *', '\1', '')
+            let basenm = substitute(mfile, '\....$', '', '')
+            if filereadable(basenm . "-concordance.tex")
+                let mlines = readfile(mfile)
+                for ii in range(len(mlines))
+                    " Sweave has detailed child information
+                    if mlines[ii] =~ 'SweaveInput.*' . bufname("%")
+                        let lnum = line(".")
+                        break
+                    endif
+                    " Knitr does not include detailed child information
+                    if mlines[ii] =~ '<<.*child *=.*' . bufname("%") . '["' . "']"
+                        let lnum = ii + 1
+                        let rnwf = substitute(mfile, '.*/', '', '')
+                        break
+                    endif
+                endfor
+                if lnum == 0
+                    call RWarningMsg('Could not find "child=' . bufname("%") . '" in ' . mfile . '.')
+                    exe "cd " . substitute(olddir, ' ', '\\ ', 'g')
+                    return
+                endif
+            else
+                call RWarningMsg('Vim-R-plugin [SyncTeX]: "' . basenm . '-concordance.tex" not found.')
+                exe "cd " . substitute(olddir, ' ', '\\ ', 'g')
+                return
+            endif
+        else
+            call RWarningMsg('SyncTeX [Vim-R-plugin]: "' . basenm . '-concordance.tex" not found.')
+            exe "cd " . substitute(olddir, ' ', '\\ ', 'g')
+            return
+        endif
+    endif
+
+    if !filereadable(basenm . ".tex")
+        call RWarningMsg('"' . basenm . '.tex" not found.')
+        exe "cd " . substitute(olddir, ' ', '\\ ', 'g')
+        return
+    endif
+    let concdata = SyncTeX_readconc(basenm)
+    let texlnum = concdata["texlnum"]
+    let rnwfile = concdata["rnwfile"]
+    let rnwline = concdata["rnwline"]
+    let texln = 0
+    for ii in range(len(texlnum))
+        if rnwfile[ii] =~ rnwf && rnwline[ii] >= lnum
+            let texln = texlnum[ii]
+            break
+        endif
+    endfor
+
+    if texln == 0
+        call RWarningMsg("Error: did not find LaTeX line.")
+        exe "cd " . substitute(olddir, ' ', '\\ ', 'g')
+        return
+    endif
+    if basenm =~ '/'
+        let basedir = substitute(basenm, '\(.*\)/.*', '\1', '')
+        let basenm = substitute(basenm, '.*/', '', '')
+        exe "cd " . substitute(basedir, ' ', '\\ ', 'g')
+    else
+        let basedir = ''
+    endif
+
+    if a:0 && a:1
+        call GoToBuf(basenm . ".tex", basenm . ".tex", basedir, texln)
+        exe "cd " . substitute(olddir, ' ', '\\ ', 'g')
+        return
+    endif
+
+    if !filereadable(basenm . ".pdf")
+        call RWarningMsg('SyncTeX forward cannot be done because the file "' . basenm . '.pdf" is missing.')
+        exe "cd " . substitute(olddir, ' ', '\\ ', 'g')
+        return
+    endif
+    if !filereadable(basenm . ".synctex.gz")
+        call RWarningMsg('SyncTeX forward cannot be done because the file "' . basenm . '.synctex.gz" is missing.')
+        if g:vimrplugin_latexcmd != "default" && g:vimrplugin_latexcmd !~ "synctex"
+            call RWarningMsg('Note: The string "-synctex=1" is not in your vimrplugin_latexcmd. Please check your vimrc.')
+        endif
+        exe "cd " . substitute(olddir, ' ', '\\ ', 'g')
+        return
+    endif
+
+    if g:rplugin_pdfviewer == "okular"
+        call system("okular --unique " . basenm . ".pdf#src:" . texln . substitute(expand("%:p:h"), ' ', '\\ ', 'g') . "/./" . substitute(basenm, ' ', '\\ ', 'g') . ".tex 2> /dev/null >/dev/null &")
+    elseif g:rplugin_pdfviewer == "evince"
+        call system("python " . g:rplugin_home . "/r-plugin/synctex_evince_forward.py '" . basenm . ".pdf' " . texln . " '" . basenm . ".tex' 2> /dev/null >/dev/null &")
+        if g:rplugin_has_wmctrl
+            call system("wmctrl -a '" . basenm . ".pdf'")
+        endif
+    elseif g:rplugin_pdfviewer == "zathura"
+        if system("wmctrl -xl") =~ 'Zathura.*' . basenm . '.pdf' && g:rplugin_zathura_pid[basenm] != 0
+            if g:rplugin_has_dbussend
+                let result = system('dbus-send --print-reply --session --dest=org.pwmt.zathura.PID-' . g:rplugin_zathura_pid[basenm] . ' /org/pwmt/zathura org.pwmt.zathura.SynctexView string:"' . basenm . '.tex' . '" uint32:' . texln . ' uint32:1')
+            else
+                let result = system("zathura --synctex-forward=" . texln . ":1:" . basenm . ".tex --synctex-pid=" . g:rplugin_zathura_pid[basenm] . " " . basenm . ".pdf")
+            endif
+            if v:shell_error
+                let g:rplugin_zathura_pid[basenm] = 0
+                call RWarningMsg(result)
+            endif
+        else
+            let g:rplugin_zathura_pid[basenm] = 0
+            call RStart_Zathura(basenm)
+        endif
+        call system("wmctrl -a '" . basenm . ".pdf'")
+    elseif g:rplugin_pdfviewer == "sumatra"
+        if g:rplugin_sumatra_path != "" || FindSumatra()
+            silent exe '!start "' . g:rplugin_sumatra_path . '" -reuse-instance -forward-search ' . basenm . '.tex ' . texln .
+                        \ ' -inverse-search "vclientserver.exe %%f %%l" ' . basenm . '.pdf"'
+        endif
+    elseif g:rplugin_pdfviewer == "skim"
+        " This command is based on macvim-skim
+        call system(g:macvim_skim_app_path . '/Contents/SharedSupport/displayline -r ' . texln . ' "' . basenm . '.pdf" "' . basenm . '.tex" 2> /dev/null >/dev/null &')
+    else
+        call RWarningMsg('SyncTeX support for "' . g:rplugin_pdfviewer . '" not implemented.')
+    endif
+    exe "cd " . substitute(olddir, ' ', '\\ ', 'g')
+endfunction
+
+function! SyncTeX_SetPID(spid)
+    exe 'autocmd VimLeave * call system("kill ' . a:spid . '")'
+endfunction
+
+function! Run_EvinceBackward()
+    let olddir = getcwd()
+    if olddir != expand("%:p:h")
+        try
+            exe "cd " . substitute(expand("%:p:h"), ' ', '\\ ', 'g')
+        catch /.*/
+            return
+        endtry
+    endif
+    let [basenm, basedir] = SyncTeX_GetMaster()
+    if basedir != '.'
+        exe "cd " . substitute(basedir, ' ', '\\ ', 'g')
+    endif
+    let did_evince = 0
+    if !exists("g:rplugin_evince_list")
+        let g:rplugin_evince_list = []
+    else
+        for bb in g:rplugin_evince_list
+            if bb == basenm
+                let did_evince = 1
+                break
+            endif
+        endfor
+    endif
+    if !did_evince
+        call add(g:rplugin_evince_list, basenm)
+        call job_start(["python",
+                    \ g:rplugin_home . "/r-plugin/synctex_evince_backward.py",
+                    \ basenm . ".pdf"],
+                    \ {'out_cb': 'ROnJobStdout', 'err_cb': "ROnJobStderr"})
+    endif
+    exe "cd " . substitute(olddir, ' ', '\\ ', 'g')
+endfunction
+
+call RSetPDFViewer()
+if g:rplugin_pdfviewer != "none"
+    if g:rplugin_pdfviewer == "zathura"
+        let s:this_master = SyncTeX_GetMaster()[0]
+        let s:key_list = keys(g:rplugin_zathura_pid)
+        let s:has_key = 0
+        for kk in s:key_list
+            if kk == s:this_master
+                let s:has_key = 1
+                break
+            endif
+        endfor
+        if s:has_key == 0
+            let g:rplugin_zathura_pid[s:this_master] = 0
+        endif
+        unlet s:this_master
+        unlet s:key_list
+        unlet s:has_key
+    endif
+    if g:vimrplugin_synctex && g:rplugin_pdfviewer == "evince" && $DISPLAY != ""
+        call Run_EvinceBackward()
+    endif
+endif
+
+call RSourceOtherScripts()
+
+if exists("b:undo_ftplugin")
+    let b:undo_ftplugin .= " | unlet! b:IsInRCode b:PreviousRChunk b:NextRChunk b:SendChunkToR"
+else
+    let b:undo_ftplugin = "unlet! b:IsInRCode b:PreviousRChunk b:NextRChunk b:SendChunkToR"
+endif
diff --git a/ftplugin/rrst_rplugin.vim b/ftplugin/rrst_rplugin.vim
new file mode 100644
index 0000000..0ae8cd5
--- /dev/null
+++ b/ftplugin/rrst_rplugin.vim
@@ -0,0 +1,210 @@
+
+if exists("g:disable_r_ftplugin") || has("nvim")
+    finish
+endif
+
+runtime R/flag.vim
+if exists("g:NvimR_installed")
+    finish
+endif
+
+" Source scripts common to R, Rrst, Rnoweb, Rhelp and Rdoc:
+runtime r-plugin/common_global.vim
+if exists("g:rplugin_failed")
+    finish
+endif
+
+" Some buffer variables common to R, Rrst, Rnoweb, Rhelp and Rdoc need to be
+" defined after the global ones:
+runtime r-plugin/common_buffer.vim
+
+if !exists("b:did_ftplugin") && !exists("g:rplugin_runtime_warn")
+    runtime ftplugin/rrst.vim
+    if !exists("b:did_ftplugin")
+        call RWarningMsgInp("Your runtime files seems to be outdated.\nSee: https://github.com/jalvesaq/R-Vim-runtime")
+        let g:rplugin_runtime_warn = 1
+    endif
+endif
+
+function! RrstIsInRCode(vrb)
+    let chunkline = search("^\\.\\. {r", "bncW")
+    let docline = search("^\\.\\. \\.\\.", "bncW")
+    if chunkline > docline && chunkline != line(".")
+        return 1
+    else
+        if a:vrb
+            call RWarningMsg("Not inside an R code chunk.")
+        endif
+        return 0
+    endif
+endfunction
+
+function! RrstPreviousChunk() range
+    let rg = range(a:firstline, a:lastline)
+    let chunk = len(rg)
+    for var in range(1, chunk)
+        let curline = line(".")
+        if RrstIsInRCode(0)
+            let i = search("^\\.\\. {r", "bnW")
+            if i != 0
+                call cursor(i-1, 1)
+            endif
+        endif
+        let i = search("^\\.\\. {r", "bnW")
+        if i == 0
+            call cursor(curline, 1)
+            call RWarningMsg("There is no previous R code chunk to go.")
+            return
+        else
+            call cursor(i+1, 1)
+        endif
+    endfor
+    return
+endfunction
+
+function! RrstNextChunk() range
+    let rg = range(a:firstline, a:lastline)
+    let chunk = len(rg)
+    for var in range(1, chunk)
+        let i = search("^\\.\\. {r", "nW")
+        if i == 0
+            call RWarningMsg("There is no next R code chunk to go.")
+            return
+        else
+            call cursor(i+1, 1)
+        endif
+    endfor
+    return
+endfunction
+
+function! RMakeHTMLrrst(t)
+    call RSetWD()
+    update
+    if g:rplugin_has_rst2pdf == 0
+        if executable("rst2pdf")
+            let g:rplugin_has_rst2pdf = 1
+        else
+            call RWarningMsg("Is 'rst2pdf' application installed? Cannot convert into HTML/ODT: 'rst2pdf' executable not found.")
+            return
+        endif
+    endif
+
+    let rcmd = 'require(knitr)'
+    if g:vimrplugin_strict_rst
+        let rcmd = rcmd . '; render_rst(strict=TRUE)'
+    endif
+    let rcmd = rcmd . '; knit("' . expand("%:t") . '")'
+
+    if a:t == "odt"
+        let rcmd = rcmd . '; system("rst2odt ' . expand("%:r:t") . ".rst " . expand("%:r:t") . '.odt")'
+    else
+        let rcmd = rcmd . '; system("rst2html ' . expand("%:r:t") . ".rst " . expand("%:r:t") . '.html")'
+    endif
+
+    if g:vimrplugin_openhtml && a:t == "html"
+        let rcmd = rcmd . '; browseURL("' . expand("%:r:t") . '.html")'
+    endif
+    call g:SendCmdToR(rcmd)
+endfunction
+
+function! RMakePDFrrst()
+    if g:rplugin_vimcomport == 0
+        call RWarningMsg("The vimcom package is required to make and open the PDF.")
+    endif
+    update
+    call RSetWD()
+    if g:rplugin_has_rst2pdf == 0
+        if exists("g:vimrplugin_rst2pdfpath") && executable(g:vimrplugin_rst2pdfpath)
+            let g:rplugin_has_rst2pdf = 1
+        elseif executable("rst2pdf")
+            let g:rplugin_has_rst2pdf = 1
+        else
+            call RWarningMsg("Is 'rst2pdf' application installed? Cannot convert into PDF: 'rst2pdf' executable not found.")
+            return
+        endif
+    endif
+
+    let rrstdir = expand("%:p:h")
+    if has("win32") || has("win64")
+        let rrstdir = substitute(rrstdir, '\\', '/', 'g')
+    endif
+    let pdfcmd = 'vim.interlace.rrst("' . expand("%:t") . '", rrstdir = "' . rrstdir . '"'
+    if exists("g:vimrplugin_rrstcompiler")
+        let pdfcmd = pdfcmd . ", compiler='" . g:vimrplugin_rrstcompiler . "'"
+    endif
+    if exists("g:vimrplugin_knitargs")
+        let pdfcmd = pdfcmd . ", " . g:vimrplugin_knitargs
+    endif
+    if exists("g:vimrplugin_rst2pdfpath")
+        let pdfcmd = pdfcmd . ", rst2pdfpath='" . g:vimrplugin_rst2pdfpath . "'"
+    endif
+    if exists("g:vimrplugin_rst2pdfargs")
+        let pdfcmd = pdfcmd . ", " . g:vimrplugin_rst2pdfargs
+    endif
+    let pdfcmd = pdfcmd . ")"
+    let ok = g:SendCmdToR(pdfcmd)
+    if ok == 0
+        return
+    endif
+endfunction
+
+" Send Rrst chunk to R
+function! SendRrstChunkToR(e, m)
+    if RrstIsInRCode(0) == 0
+        call RWarningMsg("Not inside an R code chunk.")
+        return
+    endif
+    let chunkline = search("^\\.\\. {r", "bncW") + 1
+    let docline = search("^\\.\\. \\.\\.", "ncW") - 1
+    let lines = getline(chunkline, docline)
+    let ok = RSourceLines(lines, a:e)
+    if ok == 0
+        return
+    endif
+    if a:m == "down"
+        call RrstNextChunk()
+    endif
+endfunction
+
+let b:IsInRCode = function("RrstIsInRCode")
+let b:PreviousRChunk = function("RrstPreviousChunk")
+let b:NextRChunk = function("RrstNextChunk")
+let b:SendChunkToR = function("SendRrstChunkToR")
+
+"==========================================================================
+" Key bindings and menu items
+
+call RCreateStartMaps()
+call RCreateEditMaps()
+call RCreateSendMaps()
+call RControlMaps()
+call RCreateMaps("nvi", 'RSetwd',        'rd', ':call RSetWD()')
+
+" Only .Rrst files use these functions:
+call RCreateMaps("nvi", 'RKnit',          'kn', ':call RKnit()')
+call RCreateMaps("nvi", 'RMakePDFK',      'kp', ':call RMakePDFrrst()')
+call RCreateMaps("nvi", 'RMakeHTML',      'kh', ':call RMakeHTMLrrst("html")')
+call RCreateMaps("nvi", 'RMakeODT',       'ko', ':call RMakeHTMLrrst("odt")')
+call RCreateMaps("nvi", 'RIndent',        'si', ':call RrstToggleIndentSty()')
+call RCreateMaps("ni",  'RSendChunk',     'cc', ':call b:SendChunkToR("silent", "stay")')
+call RCreateMaps("ni",  'RESendChunk',    'ce', ':call b:SendChunkToR("echo", "stay")')
+call RCreateMaps("ni",  'RDSendChunk',    'cd', ':call b:SendChunkToR("silent", "down")')
+call RCreateMaps("ni",  'REDSendChunk',   'ca', ':call b:SendChunkToR("echo", "down")')
+call RCreateMaps("n",  'RNextRChunk',     'gn', ':call b:NextRChunk()')
+call RCreateMaps("n",  'RPreviousRChunk', 'gN', ':call b:PreviousRChunk()')
+
+" Menu R
+if has("gui_running")
+    runtime r-plugin/gui_running.vim
+    call MakeRMenu()
+endif
+
+let g:rplugin_has_rst2pdf = 0
+
+call RSourceOtherScripts()
+
+if exists("b:undo_ftplugin")
+    let b:undo_ftplugin .= " | unlet! b:IsInRCode b:PreviousRChunk b:NextRChunk b:SendChunkToR"
+else
+    let b:undo_ftplugin = "unlet! b:IsInRCode b:PreviousRChunk b:NextRChunk b:SendChunkToR"
+endif
diff --git a/indent/r.vim b/indent/r.vim
deleted file mode 100644
index b6787a2..0000000
--- a/indent/r.vim
+++ /dev/null
@@ -1,476 +0,0 @@
-" Vim indent file
-" Language:	R
-" Author:	Jakson Alves de Aquino 
-" URL:		http://www.vim.org/scripts/script.php?script_id=2628
-" Last Change:	Tue Feb 08, 2011  10:03AM
-
-
-" Only load this indent file when no other was loaded.
-if exists("b:did_r_indent")
-    finish
-endif
-let b:did_r_indent = 1
-
-setlocal indentkeys=0{,0},:,!^F,o,O,e
-setlocal indentexpr=GetRIndent()
-
-" Only define the function once.
-if exists("*GetRIndent")
-    finish
-endif
-
-" Options to make the indentation more similar to Emacs/ESS:
-if !exists("g:r_indent_align_args")
-    let g:r_indent_align_args = 1
-endif
-if !exists("g:r_indent_ess_comments")
-    let g:r_indent_ess_comments = 0
-endif
-if !exists("g:r_indent_comment_column")
-    let g:r_indent_comment_column = 40
-endif
-if ! exists("g:r_indent_ess_compatible")
-    let g:r_indent_ess_compatible = 0
-endif
-
-function s:RDelete_quotes(line)
-    let i = 0
-    let j = 0
-    let line1 = ""
-    let llen = strlen(a:line)
-    while i < llen
-        if a:line[i] == '"'
-            let i += 1
-            let line1 = line1 . 's'
-            while !(a:line[i] == '"' && ((i > 1 && a:line[i-1] == '\' && a:line[i-2] == '\') || a:line[i-1] != '\')) && i < llen
-                let i += 1
-            endwhile
-            if a:line[i] == '"'
-                let i += 1
-            endif
-        else
-            if a:line[i] == "'"
-                let i += 1
-                let line1 = line1 . 's'
-                while !(a:line[i] == "'" && ((i > 1 && a:line[i-1] == '\' && a:line[i-2] == '\') || a:line[i-1] != '\')) && i < llen
-                    let i += 1
-                endwhile
-                if a:line[i] == "'"
-                    let i += 1
-                endif
-            else
-                if a:line[i] == "`"
-                    let i += 1
-                    let line1 = line1 . 's'
-                    while a:line[i] != "`" && i < llen
-                        let i += 1
-                    endwhile
-                    if a:line[i] == "`"
-                        let i += 1
-                    endif
-                endif
-            endif
-        endif
-        if i == llen
-            break
-        endif
-        let line1 = line1 . a:line[i]
-        let j += 1
-        let i += 1
-    endwhile
-    return line1
-endfunction
-
-" Convert foo(bar()) int foo()
-function s:RDelete_parens(line)
-    if s:Get_paren_balance(a:line, "(", ")") != 0
-        return a:line
-    endif
-    let i = 0
-    let j = 0
-    let line1 = ""
-    let llen = strlen(a:line)
-    while i < llen
-        let line1 = line1 . a:line[i]
-        if a:line[i] == '('
-            let nop = 1
-            while nop > 0 && i < llen
-                let i += 1
-                if a:line[i] == ')'
-                    let nop -= 1
-                else
-                    if a:line[i] == '('
-                        let nop += 1 
-                    endif
-                endif
-            endwhile
-            let line1 = line1 . a:line[i]
-        endif
-        let i += 1
-    endwhile
-    return line1
-endfunction
-
-function! s:Get_paren_balance(line, o, c)
-    let line2 = substitute(a:line, a:o, "", "g")
-    let openp = strlen(a:line) - strlen(line2)
-    let line3 = substitute(line2, a:c, "", "g")
-    let closep = strlen(line2) - strlen(line3)
-    return openp - closep
-endfunction
-
-function! s:Get_matching_brace(linenr, o, c, delbrace)
-    let line = SanitizeRLine(getline(a:linenr))
-    if a:delbrace == 1
-        let line = substitute(line, '{$', "", "")
-    endif
-    let pb = s:Get_paren_balance(line, a:o, a:c)
-    let i = a:linenr
-    while pb != 0 && i > 1
-        let i -= 1
-        let pb += s:Get_paren_balance(SanitizeRLine(getline(i)), a:o, a:c)
-    endwhile
-    return i
-endfunction
-
-" This function is buggy because there 'if's without 'else'
-" It must be rewritten relying more on indentation
-function! s:Get_matching_if(linenr, delif)
-"    let filenm = expand("%")
-"    call writefile([filenm], "/tmp/matching_if_" . a:linenr)
-    let line = SanitizeRLine(getline(a:linenr))
-    if a:delif
-        let line = substitute(line, "if", "", "g")
-    endif
-    let elsenr = 0
-    let i = a:linenr
-    let ifhere = 0
-    while i > 0
-        let line2 = substitute(line, '\', "xxx", "g")
-        let elsenr += strlen(line) - strlen(line2)
-        if line =~ '.*\s*if\s*()' || line =~ '.*\s*if\s*()'
-            let elsenr -= 1
-            if elsenr == 0
-                let ifhere = i
-                break
-            endif
-        endif
-        let i -= 1
-        let line = SanitizeRLine(getline(i))
-    endwhile
-    if ifhere
-        return ifhere
-    else
-        return a:linenr
-    endif
-endfunction
-
-function! s:Get_last_paren_idx(line, o, c, pb)
-    let blc = a:pb
-    let line = substitute(a:line, '\t', s:curtabstop, "g")
-    let theidx = -1
-    let llen = strlen(line)
-    let idx = 0
-    while idx < llen
-        if line[idx] == a:o
-            let blc -= 1
-            if blc == 0
-                let theidx = idx
-            endif
-        else
-            if line[idx] == a:c
-                let blc += 1
-            endif
-        endif
-        let idx += 1
-    endwhile
-    return theidx + 1
-endfunction
-
-" Get previous relevant line. Search back until getting a line that isn't
-" comment or blank
-function s:Get_prev_line(lineno)
-    let lnum = a:lineno - 1
-    let data = getline( lnum )
-    while lnum > 0 && (data =~ '^\s*#' || data =~ '^\s*$')
-        let lnum = lnum - 1
-        let data = getline( lnum )
-    endwhile
-    return lnum
-endfunction
-
-" This function is also used by r-plugin/common_global.vim
-" Delete from '#' to the end of the line, unless the '#' is inside a string.
-function SanitizeRLine(line)
-    let newline = s:RDelete_quotes(a:line)
-    let newline = s:RDelete_parens(newline)
-    let newline = substitute(newline, '#.*', "", "")
-    let newline = substitute(newline, '\s*$', "", "")
-    return newline
-endfunction
-
-function GetRIndent()
-
-    let clnum = line(".")    " current line
-
-    let cline = getline(clnum)
-    if cline =~ '^\s*#'
-        if g:r_indent_ess_comments == 1
-            if cline =~ '^\s*###'
-                return 0
-            endif
-            if cline !~ '^\s*##'
-                return g:r_indent_comment_column
-            endif
-        endif
-    endif
-
-    let cline = SanitizeRLine(cline)
-
-    if cline =~ '^\s*}' || cline =~ '^\s*}\s*)$'
-        let indline = s:Get_matching_brace(clnum, '{', '}', 1)
-        if indline > 0 && indline != clnum
-            let iline = SanitizeRLine(getline(indline))
-            if s:Get_paren_balance(iline, "(", ")") == 0 || iline =~ '(\s*{$'
-                return indent(indline)
-            else
-                let indline = s:Get_matching_brace(indline, '(', ')', 1)
-                return indent(indline)
-            endif
-        endif
-    endif
-
-    " Find the first non blank line above the current line
-    let lnum = s:Get_prev_line(clnum)
-    " Hit the start of the file, use zero indent.
-    if lnum == 0
-        return 0
-    endif
-
-    let line = SanitizeRLine(getline(lnum))
-
-    if &filetype == "rhelp"
-        if cline =~ '^\\dontshow{' || cline =~ '^\\dontrun{' || cline =~ '^\\donttest{' || cline =~ '^\\testonly{'
-            return 0
-        endif
-        if line =~ '^\\examples{' || line =~ '^\\usage{' || line =~ '^\\dontshow{' || line =~ '^\\dontrun{' || line =~ '^\\donttest{' || line =~ '^\\testonly{'
-            return 0
-        endif
-        if line =~ '^\\method{.*}{.*}(.*'
-            let line = substitute(line, '^\\method{\(.*\)}{.*}', '\1', "")
-        endif
-    endif
-
-    if cline =~ '^\s*{'
-        if g:r_indent_ess_compatible && line =~ ')$'
-            let nlnum = lnum
-            let nline = line
-            while s:Get_paren_balance(nline, '(', ')') < 0
-                let nlnum = s:Get_prev_line(nlnum)
-                let nline = SanitizeRLine(getline(nlnum)) . nline
-            endwhile
-            if nline =~ '^\s*function\s*(' && indent(nlnum) == &sw
-                return 0
-            endif
-        endif
-        if s:Get_paren_balance(line, "(", ")") == 0
-            return indent(lnum)
-        endif
-    endif
-
-    " line is an incomplete command:
-    if line =~ '\<\(if\|while\|for\|function\)\s*()$' || line =~ '\]$' || cline =~ '^\s*[,&|\-\*+<>]')
-            return indent(lnum)
-        endif
-
-        if pb > 0
-            if &filetype == "rhelp"
-                let ind = s:Get_last_paren_idx(line, '(', ')', pb)
-            else
-                let ind = s:Get_last_paren_idx(getline(lnum), '(', ')', pb)
-            endif
-            return ind
-        endif
-
-        if pb < 0 && line =~ '.*[,&|\-\*+<>]$'
-            let lnum = s:Get_prev_line(lnum)
-            while pb < 1 && lnum > 0
-                let line = SanitizeRLine(getline(lnum))
-                let line = substitute(line, '\t', s:curtabstop, "g")
-                let ind = strlen(line)
-                while ind > 0
-                    if line[ind] == ')'
-                        let pb -= 1
-                    else
-                        if line[ind] == '('
-                            let pb += 1
-                        endif
-                    endif
-                    if pb == 1
-                        return ind + 1
-                    endif
-                    let ind -= 1
-                endwhile
-                let lnum -= 1
-            endwhile
-            return 0
-        endif
-
-        if bb > 0
-            let ind = s:Get_last_paren_idx(getline(lnum), '[', ']', bb)
-            return ind
-        endif
-    endif
-
-    let post_block = 0
-    if line =~ '}$'
-        let lnum = s:Get_matching_brace(lnum, '{', '}', 0)
-        let line = SanitizeRLine(getline(lnum))
-        if lnum > 0 && line =~ '^\s*{'
-            let lnum = s:Get_prev_line(lnum)
-            let line = SanitizeRLine(getline(lnum))
-        endif
-        let pb = s:Get_paren_balance(line, '(', ')')
-        let post_block = 1
-    endif
-
-    let post_fun = 0
-    if pb < 0 && line !~ ')\s*[,&|\-\*+<>]$'
-        let post_fun = 1
-        while pb < 0 && lnum > 0
-            let lnum -= 1
-            let linepiece = SanitizeRLine(getline(lnum))
-            let pb += s:Get_paren_balance(linepiece, "(", ")")
-            let line = linepiece . line
-        endwhile
-        if line =~ '{$' && post_block == 0
-            return indent(lnum) + &sw
-        endif
-
-        " Now we can do some tests again
-        if cline =~ '^\s*{'
-            return indent(lnum)
-        endif
-        if post_block == 0
-            let newl = SanitizeRLine(line)
-            if newl =~ '\<\(if\|while\|for\|function\)\s*()$' || newl =~ '\ 0
-            let lnum -= 1
-            let linepiece = SanitizeRLine(getline(lnum))
-            let bb += s:Get_paren_balance(linepiece, "[", "]")
-            let line = linepiece . line
-        endwhile
-        let line = s:RDelete_parens(line)
-    endif
-
-    let plnum = s:Get_prev_line(lnum)
-    let ppost_else = 0
-    if plnum > 0
-        let pline = SanitizeRLine(getline(plnum))
-        let ppost_block = 0
-        if pline =~ '}$'
-            let ppost_block = 1
-            let plnum = s:Get_matching_brace(plnum, '{', '}', 0)
-            let pline = SanitizeRLine(getline(plnum))
-            if pline =~ '^\s*{$' && plnum > 0
-                let plnum = s:Get_prev_line(plnum)
-                let pline = SanitizeRLine(getline(plnum))
-            endif
-        endif
-
-        if pline =~ 'else$'
-            let ppost_else = 1
-            let plnum = s:Get_matching_if(plnum, 0)
-            let pline = SanitizeRLine(getline(plnum))
-        endif
-
-        if pline =~ '^\s*else\s*if\s*('
-            let pplnum = s:Get_prev_line(plnum)
-            let ppline = SanitizeRLine(getline(pplnum))
-            while ppline =~ '^\s*else\s*if\s*(' || ppline =~ '^\s*if\s*()\s*\S$'
-                let plnum = pplnum
-                let pline = ppline
-                let pplnum = s:Get_prev_line(plnum)
-                let ppline = SanitizeRLine(getline(pplnum))
-            endwhile
-            while ppline =~ '\<\(if\|while\|for\|function\)\s*()$' || ppline =~ '\ 0
-                let plnum -= 1
-                let linepiece = SanitizeRLine(getline(plnum))
-                let ppb += s:Get_paren_balance(linepiece, "(", ")")
-                let pline = linepiece . pline
-            endwhile
-            let pline = s:RDelete_parens(pline)
-        endif
-    endif
-
-    let ind = indent(lnum)
-    let pind = indent(plnum)
-
-    if ind == pind || (ind == (pind  + &sw) && pline =~ '{$' && ppost_else == 0)
-        return ind
-    endif
-
-    while pind < ind && plnum > 0
-        let ind = pind
-        let plnum = s:Get_prev_line(plnum)
-        let pline = getline(plnum)
-        while pline =~ '^\s*else'
-            let plnum = s:Get_matching_if(plnum, 1)
-            let pline = getline(plnum)
-        endwhile
-        let pind = indent(plnum)
-        if ind == (pind  + &sw) && pline =~ '{$'
-            return ind
-        endif
-    endwhile
-
-    return ind
-
-endfunction
-
-" vim: sw=4
diff --git a/indent/rhelp.vim b/indent/rhelp.vim
deleted file mode 100644
index d159d76..0000000
--- a/indent/rhelp.vim
+++ /dev/null
@@ -1,112 +0,0 @@
-" Vim indent file
-" Language:	R Documentation (Help), *.Rd
-" Author:	Jakson Alves de Aquino 
-" URL:		http://www.vim.org/scripts/script.php?script_id=2628
-" Last Change:	Sun Feb 06, 2011  04:22PM
-
-
-" Only load this indent file when no other was loaded.
-if exists("b:did_rhelp_indent")
-    finish
-endif
-let b:did_rhelp_indent = 1
-
-setlocal indentkeys=0{,0},:,!^F,o,O,e
-setlocal indentexpr=GetRHelpIndent()
-
-" Only define the function once.
-if exists("*GetRHelpIndent")
-    finish
-endif
-
-runtime indent/r.vim
-
-setlocal noautoindent
-setlocal nocindent
-setlocal nosmartindent
-setlocal nolisp
-
-setlocal indentkeys=0{,0},:,!^F,o,O,e
-setlocal indentexpr=GetCorrectRHelpIndent()
-
-function s:SanitizeRHelpLine(line)
-    let newline = substitute(a:line, '\\\\', "x", "g")
-    let newline = substitute(newline, '\\{', "x", "g")
-    let newline = substitute(newline, '\\}', "x", "g")
-    let newline = substitute(newline, '\\%', "x", "g")
-    let newline = substitute(newline, '%.*', "", "")
-    let newline = substitute(newline, '\s*$', "", "")
-    return newline
-endfunction
-
-function GetRHelpIndent()
-
-    let clnum = line(".")    " current line
-    if clnum == 1
-        return 0
-    endif
-    let cline = getline(clnum)
-
-    if cline =~ '^\s*}\s*$'
-        let i = clnum
-        let bb = -1
-        while bb != 0 && i > 1
-            let i -= 1
-            let line = s:SanitizeRHelpLine(getline(i))
-            let line2 = substitute(line, "{", "", "g")
-            let openb = strlen(line) - strlen(line2)
-            let line3 = substitute(line2, "}", "", "g")
-            let closeb = strlen(line2) - strlen(line3)
-            let bb += openb - closeb
-        endwhile
-        return indent(i)
-    endif
-
-    if cline =~ '^\s*#ifdef\>' || cline =~ '^\s*#endif\>'
-        return 0
-    endif
-
-    let lnum = clnum - 1
-    let line = getline(lnum)
-    if line =~ '^\s*#ifdef\>' || line =~ '^\s*#endif\>'
-        let lnum -= 1
-        let line = getline(lnum)
-    endif
-    while lnum > 1 && (line =~ '^\s*$' || line =~ '^#ifdef' || line =~ '^#endif')
-        let lnum -= 1
-        let line = getline(lnum)
-    endwhile
-    if lnum == 1
-        return 0
-    endif
-    let line = s:SanitizeRHelpLine(line)
-    let line2 = substitute(line, "{", "", "g")
-    let openb = strlen(line) - strlen(line2)
-    let line3 = substitute(line2, "}", "", "g")
-    let closeb = strlen(line2) - strlen(line3)
-    let bb = openb - closeb
-
-    let ind = indent(lnum) + (bb * &sw)
-
-    if line =~ '^\s*}\s*$'
-        let ind = indent(lnum)
-    endif
-
-    if ind < 0
-        return 0
-    endif
-
-    return ind
-endfunction
-
-function GetCorrectRHelpIndent()
-    let lastsection = search('^\\[a-z]*{', "bncW")
-    let secname = getline(lastsection)
-    if secname =~ '^\\usage{' || secname =~ '^\\examples{' || secname =~ '^\\dontshow{' || secname =~ '^\\dontrun{' || secname =~ '^\\donttest{' || secname =~ '^\\testonly{' || secname =~ '^\\method{.*}{.*}('
-        return GetRIndent()
-    else
-        return GetRHelpIndent()
-    endif
-endfunction
-
-" vim: sw=4
diff --git a/indent/rnoweb.vim b/indent/rnoweb.vim
deleted file mode 100644
index d5ed606..0000000
--- a/indent/rnoweb.vim
+++ /dev/null
@@ -1,36 +0,0 @@
-" Vim indent file
-" Language:	Rnoweb
-" Author:	Jakson Alves de Aquino 
-" URL:		http://www.vim.org/scripts/script.php?script_id=2628
-" Last Change:	Fri Feb 04, 2011  05:10PM
-
-
-" Only load this indent file when no other was loaded.
-if exists("b:did_rnoweb_indent")
-  finish
-endif
-let b:did_rnoweb_indent = 1
-
-
-
-runtime indent/r.vim
-runtime r-plugin/tex_indent.vim
-
-setlocal indentkeys=0{,0},!^F,o,O,e,},=\bibitem,=\item
-setlocal indentexpr=GetRnowebIndent()
-
-if exists("*GetRnowebIndent")
-  finish
-endif
-
-function GetRnowebIndent()
-    if getline(".") =~ "^<<.*>>=$"
-	return 0
-    endif
-    if search("^<<", "bncW") > search("^@", "bncW")
-	return GetRIndent()
-    else
-	return GetTeXIndent2()
-    endif
-endfunction
-
diff --git a/list_for_vimball b/list_for_vimball
new file mode 100644
index 0000000..0740a65
--- /dev/null
+++ b/list_for_vimball
@@ -0,0 +1,27 @@
+autoload/rcomplete.vim
+doc/r-plugin.txt
+ftdetect/r.vim
+ftplugin/r_rplugin.vim
+ftplugin/rbrowser.vim
+ftplugin/rdoc.vim
+ftplugin/rhelp_rplugin.vim
+ftplugin/rmd_rplugin.vim
+ftplugin/rnoweb_rplugin.vim
+ftplugin/rrst_rplugin.vim
+syntax/rbrowser.vim
+syntax/rdoc.vim
+syntax/rout.vim
+r-plugin/common_buffer.vim
+r-plugin/common_global.vim
+r-plugin/r.snippets
+r-plugin/rmd.snippets
+r-plugin/synctex_evince_backward.py
+r-plugin/synctex_evince_forward.py
+r-plugin/functions.vim
+r-plugin/gui_running.vim
+r-plugin/osx.vim
+r-plugin/setcompldir.vim
+r-plugin/windows.vim
+r-plugin/extern_term.vim
+r-plugin/tmux.vim
+r-plugin/tmux_split.vim
diff --git a/r-plugin/build_omniList.R b/r-plugin/build_omniList.R
deleted file mode 100644
index 206bf56..0000000
--- a/r-plugin/build_omniList.R
+++ /dev/null
@@ -1,174 +0,0 @@
-#  This program is free software; you can redistribute it and/or modify
-#  it under the terms of the GNU General Public License as published by
-#  the Free Software Foundation; either version 2 of the License, or
-#  (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  A copy of the GNU General Public License is available at
-#  http://www.r-project.org/Licenses/
-
-### Jakson Alves de Aquino
-### Tue, January 18, 2011
-
-
-# Build Omni List
-.vim.bol <- function(omnilist, what = "loaded", allnames = FALSE) {
-
-  vim.list.args2 <- function(ff){ 
-    knownGenerics <- c(names(.knownS3Generics),
-      tools:::.get_internal_S3_generics()) # from methods()
-    ff.pat <- gsub('\\?', '\\\\?', ff)
-    ff.pat <- gsub('\\*', '\\\\*', ff.pat)
-    ff.pat <- gsub('\\(', '\\\\(', ff.pat)
-    ff.pat <- gsub('\\[', '\\\\[', ff.pat)
-    ff.pat <- gsub('\\{', '\\\\{', ff.pat)
-    ff.pat <- gsub('\\|', '\\\\|', ff.pat)
-    ff.pat <- gsub('\\+', '\\\\+', ff.pat)
-    keyf <- paste("^", ff.pat, "$", sep="")
-    is.generic <- (length(grep(keyf, knownGenerics)) > 0)
-    if(is.generic){
-      if(length(methods(ff)) > 0){
-	return("Generic Method")
-      }
-    }
-
-    ff.formals <- formals(ff)
-    if(is.null(ff.formals)){
-      return("No arguments")
-    } else {
-      ff.args <- capture.output(args(ff))
-      len <- length(ff.args) - 1
-      ff.args <- ff.args[1:len]
-      ff.args[1] <- sub("function \\(", "", ff.args[1])
-      ff.args[len] <- sub("\\) $", "", ff.args[len])
-      ff.args <- sub("^    ", "", ff.args)
-      ff.args <- paste(ff.args, collapse = "\t")
-      return(ff.args)
-    }
-  }
-
-  # Only recent versions of R have the grepl() function. We can replace
-  # vim.grepl() with grepl() in the near future.
-  vim.grepl <- function(pattern, x){
-    res <- grep(pattern, x)
-    if(length(res) == 0){
-      return(FALSE)
-    } else {
-      return(TRUE)
-    }
-  }
-
-  vim.omni.line <- function(x, envir, printenv, curlevel){
-    if(curlevel == 0){
-      xx <- get(x, envir)
-    } else {
-      x.clean <- gsub("$", "", x, fixed = TRUE)
-      x.clean <- gsub("_", "", x.clean, fixed = TRUE)
-      haspunct <- vim.grepl("[[:punct:]]", x.clean)
-      if(haspunct[1]){
-	ok <- vim.grepl("[[:alnum:]]\\.[[:alnum:]]", x.clean)
-	if(ok[1]){
-	  haspunct  <- FALSE
-	  haspp <- vim.grepl("[[:punct:]][[:punct:]]", x.clean)
-	  if(haspp[1]) haspunct <- TRUE
-	}
-      }
-
-      # No support for names with spaces
-      if(vim.grepl(" ", x)){
-	haspunct <- TRUE
-      }
-
-      if(haspunct[1]){
-	xx <- NULL
-      } else {
-	xx <- try(eval(parse(text=x)), silent = TRUE)
-	if(class(xx)[1] == "try-error"){
-	  xx <- NULL
-	}
-      }
-    }
-
-    if(is.null(xx)){
-      x.group <- " "
-      x.class <- "unknown"
-    } else {
-      if(x == "break" || x == "next" || x == "for" || x == "if" || x == "repeat" || x == "while"){
-	x.group <- "flow-control"
-	x.class <- "flow-control"
-      } else {
-	if(is.function(xx)) x.group <- "function"
-	else if(is.numeric(xx)) x.group <- "numeric"
-	else if(is.factor(xx)) x.group <- "factor"
-	else if(is.character(xx)) x.group <- "character"
-	else if(is.logical(xx)) x.group <- "logical"
-	else if(is.data.frame(xx)) x.group <- "data.frame"
-	else if(is.list(xx)) x.group <- "list"
-	else x.group <- " "
-	x.class <- class(xx)[1]
-      }
-    }
-
-    if(x.group == "function"){
-      if(curlevel == 0){
-	cat(x, ";", "function;function", ";", printenv, ";", vim.list.args2(x), "\n", sep="")
-      } else {
-	# some libraries have function as list elements
-	cat(x, ";", "function;function", ";", printenv, ";", "Unknown arguments", "\n", sep="")
-      }
-    } else {
-      if(is.list(xx)){
-	if(curlevel == 0){
-	  cat(x, ";", x.class, ";", x.group, ";", printenv, ";", "Not a function", "\n", sep="")
-	} else {
-	  cat(x, ";", x.class, ";", " ", ";", printenv, ";", "Not a function", "\n", sep="")
-	}
-      } else {
-	cat(x, ";", x.class, ";", x.group, ";", printenv, ";", "Not a function", "\n", sep="")
-      }
-    }
-
-    if(is.list(xx) && curlevel == 0){
-      obj.names <- names(xx)
-      curlevel <- curlevel + 1
-      if(length(xx) > 0){
-	for(k in obj.names){
-	  vim.omni.line(paste(x, "$", k, sep=""), envir, printenv, curlevel)
-	}
-      }
-    }
-  }
-
-  # Begin of .vim.bol()
-  vim.OutDec <- options("OutDec")[[1]]
-  options(OutDec = ".")
-  if(what == "installed"){
-    cat("Loading all installed packages...\n")
-    for(vim.pack in installed.packages()[, "Package"]){
-      library(vim.pack, character.only = TRUE)
-    }
-  }
-  noGlobalEnv <- vim.grepl("/r-plugin/omniList", omnilist)
-  if(noGlobalEnv){
-    cat("Building file with list of objects in", what, "packages for omni completion and Object Browser...\n")
-  }
-  envnames <- search()
-  sink(omnilist, append = FALSE)
-  for(curenv in envnames){
-    if((curenv == ".GlobalEnv" && noGlobalEnv) | (curenv != ".GlobalEnv" && noGlobalEnv == FALSE)) next
-    obj.list <- objects(curenv, all.names = allnames)
-    envir <- sub("package:", "", curenv)
-    l <- length(obj.list)
-    if(l > 0){
-      for(obj in obj.list) vim.omni.line(obj, curenv, envir, 0)
-    }
-  }
-  sink()
-  options(OutDec = vim.OutDec)
-  unlink(paste(omnilist, ".locked", sep = ""))
-}
-
diff --git a/r-plugin/common_buffer.vim b/r-plugin/common_buffer.vim
index 635abd2..46bda40 100644
--- a/r-plugin/common_buffer.vim
+++ b/r-plugin/common_buffer.vim
@@ -19,91 +19,49 @@
 "          
 "          Based on previous work by Johannes Ranke
 "
-" Last Change: Mon Feb 07, 2011  08:07PM
-"
 " Please see doc/r-plugin.txt for usage details.
 "==========================================================================
 
 
 " Set completion with CTRL-X CTRL-O to autoloaded function.
 if exists('&ofu')
-  setlocal ofu=rcomplete#CompleteR
+    if &filetype == "rnoweb" || &filetype == "rrst" || &filetype == "rmd"
+        let b:rplugin_nonr_omnifunc = &omnifunc
+    endif
+    if &filetype == "r" || &filetype == "rnoweb" || &filetype == "rdoc" || &filetype == "rhelp" || &filetype == "rrst" || &filetype == "rmd"
+        setlocal omnifunc=rcomplete#CompleteR
+    endif
 endif
 
-" Automatically rebuild the file listing .GlobalEnv objects for omni
-" completion if the user press  and we know that the file either was
-" not created yet or is outdated.
-let b:needsnewomnilist = 0
+" This isn't the Object Browser running externally
+let b:rplugin_extern_ob = 0
 
 " Set the name of the Object Browser caption if not set yet
 let s:tnr = tabpagenr()
 if !exists("b:objbrtitle")
-  if s:tnr == 1
-    let b:objbrtitle = "Object_Browser"
-  else
-    let b:objbrtitle = "Object_Browser" . s:tnr
-  endif
-  unlet s:tnr
+    if s:tnr == 1
+        let b:objbrtitle = "Object_Browser"
+    else
+        let b:objbrtitle = "Object_Browser" . s:tnr
+    endif
+    unlet s:tnr
 endif
 
+let g:rplugin_lastft = &filetype
 
-" Initialize some local variables if Conque shell was already started
-if (g:vimrplugin_by_vim_instance || g:vimrplugin_nosingler == 0) && exists("g:rplugin_objbrtitle")
-  if g:vimrplugin_conqueplugin
-    let b:conqueshell = g:rplugin_conqueshell
-    let b:conque_bufname = g:rplugin_conque_bufname
-  endif
-  let b:objbrtitle = g:rplugin_objbrtitle
+if !exists("g:SendCmdToR")
+    let g:SendCmdToR = function('SendCmdToR_fake')
 endif
 
-" Make the file name of files to be sourced
-let b:bname = expand("%:t")
-let b:bname = substitute(b:bname, " ", "",  "g")
-if exists("*getpid") " getpid() was introduced in Vim 7.1.142
-  let b:rsource = $VIMRPLUGIN_TMPDIR . "/Rsource-" . getpid() . "-" . b:bname
-else
-  let b:randnbr = system("echo $RANDOM")
-  let b:randnbr = substitute(b:randnbr, "\n", "", "")
-  if strlen(b:randnbr) == 0
-    let b:randnbr = "NoRandom"
-  endif
-  let b:rsource = $VIMRPLUGIN_TMPDIR . "/Rsource-" . b:randnbr . "-" . b:bname
-  unlet b:randnbr
+" Were new libraries loaded by R?
+if !exists("b:rplugin_new_libs")
+    let b:rplugin_new_libs = 0
 endif
-unlet b:bname
-
-" Special screenrc file
-let b:scrfile = " "
-
-if g:vimrplugin_nosingler == 1
-  " Make a random name for the screen session
-  let b:screensname = "vimrplugin-" . g:rplugin_userlogin . "-" . localtime()
-else
-  " Make a unique name for the screen session
-  let b:screensname = "vimrplugin-" . g:rplugin_userlogin
+" When using as a global plugin for non R files, RCheckLibList will not exist
+if exists("*RCheckLibList")
+    autocmd BufEnter  call RCheckLibList()
 endif
 
-" Make a unique name for the screen process for each Vim instance:
-if g:vimrplugin_by_vim_instance == 1
-  let s:sname = substitute(v:servername, " ", "-", "g")
-  if s:sname == "" && g:vimrplugin_conqueplugin == 0
-    call RWarningMsg("The option vimrplugin_by_vim_instance requires a servername. Please read the documentation.")
-    let g:vimrplugin_by_vim_instance = 0
-    sleep 2
-  else
-    " For screen GVIM and GVIM1 are the same string.
-    let s:sname = substitute(s:sname, "GVIM$", "GVIM0", "g")
-    let b:screensname = "vimrplugin-" . g:rplugin_userlogin . "-" . s:sname
-  endif
-  unlet s:sname
+if g:vimrplugin_assign == 3
+    iabb  _ <-
 endif
-
-let s:thisbuffname = substitute(bufname("%"), '\.', '', "g")
-let s:thisbuffname = substitute(s:thisbuffname, ' ', '', "g")
-exe "augroup " . s:thisbuffname
-  au FileType  call MakeRMenu()
-  au BufEnter  call RBufEnter()
-  au BufLeave  call UnMakeRMenu()
-exe "augroup END"
-unlet s:thisbuffname
-
diff --git a/r-plugin/common_global.vim b/r-plugin/common_global.vim
index 66481d5..97e05cd 100644
--- a/r-plugin/common_global.vim
+++ b/r-plugin/common_global.vim
@@ -14,13 +14,9 @@
 "==========================================================================
 " Authors: Jakson Alves de Aquino 
 "          Jose Claudio Faria
-"          
-"          Based on previous work by Johannes Ranke
 "
-" Last Change: Fri Jun 03, 2011  04:47PM
-"
-" Purposes of this file: Create all functions and commands and Set the
-" value of all global variables  and some buffer variables.for r,
+" Purposes of this file: Create all functions and commands and set the
+" value of all global variables and some buffer variables.for r,
 " rnoweb, rhelp, rdoc, and rbrowser files
 "
 " Why not an autoload script? Because autoload was designed to store
@@ -47,6 +43,29 @@ function RWarningMsg(wmsg)
     echohl Normal
 endfunction
 
+function RWarningMsgInp(wmsg)
+    let savedlz = &lazyredraw
+    if savedlz == 0
+        set lazyredraw
+    endif
+    let savedsm = &shortmess
+    set shortmess-=T
+    echohl WarningMsg
+    call input(a:wmsg . " [Press  to continue] ")
+    echohl Normal
+    if savedlz == 0
+        set nolazyredraw
+    endif
+    let &shortmess = savedsm
+endfunction
+
+if !exists("*job_getchannel") || !has("patch-7.4.1579")
+    call RWarningMsgInp("The Vim-R-plugin requires Vim >= 7.4.1579 with both +channel and +job features enabled.")
+    let g:rplugin_failed = 1
+    finish
+endif
+
+
 " Set default value of some variables:
 function RSetDefaultValue(var, val)
     if !exists(a:var)
@@ -55,13 +74,15 @@ function RSetDefaultValue(var, val)
 endfunction
 
 function ReplaceUnderS()
-    if (&filetype == "rnoweb" || &filetype == "tex") && RnwIsInRCode() == 0
+    if &filetype != "r" && b:IsInRCode(0) == 0
         let isString = 1
     else
+        let save_unnamed_reg = @@
         let j = col(".")
         let s = getline(".")
-        if j > 3 && s[j-3] == "<" && s[j-2] == "-" && s[j-1] == " "
+        if g:vimrplugin_assign == 1 && g:vimrplugin_assign_map == "_" && j > 3 && s[j-3] == "<" && s[j-2] == "-" && s[j-1] == " "
             exe "normal! 3h3xr_"
+            let @@ = save_unnamed_reg
             return
         endif
         let isString = 0
@@ -71,22 +92,325 @@ function ReplaceUnderS()
         else
             if synName == "rString"
                 let isString = 1
-                if s[j-1] == '"' || s[j-1] == "'"
+                if s[j-1] == '"' || s[j-1] == "'" && g:vimrplugin_assign == 1
                     let synName = synIDattr(synID(line("."), j-2, 1), "name")
                     if synName == "rString" || synName == "rSpecial"
                         let isString = 0
                     endif
                 endif
+            else
+                if g:vimrplugin_assign == 2
+                    if s[j-1] != "_" && !(j > 3 && s[j-3] == "<" && s[j-2] == "-" && s[j-1] == " ")
+                        let isString = 1
+                    elseif j > 3 && s[j-3] == "<" && s[j-2] == "-" && s[j-1] == " "
+                        exe "normal! 3h3xr_a_"
+                        let @@ = save_unnamed_reg
+                        return
+                    else
+                        if j == len(s)
+                            exe "normal! 1x"
+                            let @@ = save_unnamed_reg
+                        else
+                            exe "normal! 1xi <- "
+                            let @@ = save_unnamed_reg
+                            return
+                        endif
+                    endif
+                endif
             endif
         endif
     endif
     if isString
-        exe "normal! a_"
+        exe "normal! a" . g:vimrplugin_assign_map
     else
         exe "normal! a <- "
     endif
 endfunction
 
+function ReadEvalReply()
+    let reply = "No reply"
+    let haswaitwarn = 0
+    let ii = 0
+    while ii < 20
+        sleep 100m
+        if filereadable($VIMRPLUGIN_TMPDIR . "/eval_reply")
+            let tmp = readfile($VIMRPLUGIN_TMPDIR . "/eval_reply")
+            if len(tmp) > 0
+                let reply = tmp[0]
+                break
+            endif
+        endif
+        let ii += 1
+        if ii == 2
+            echon "\rWaiting for reply"
+            let haswaitwarn = 1
+        endif
+    endwhile
+    if haswaitwarn
+        echon "\r                 "
+        redraw
+    endif
+    if reply == "No reply" || reply =~ "^Error" || reply == "INVALID" || reply == "ERROR" || reply == "EMPTY" || reply == "NO_ARGS" || reply == "NOT_EXISTS" || reply == ""
+        return "R error: " . reply
+    else
+        return reply
+    endif
+endfunction
+
+function CompleteChunkOptions()
+    let cline = getline(".")
+    let cpos = getpos(".")
+    let idx1 = cpos[2] - 2
+    let idx2 = cpos[2] - 1
+    while cline[idx1] =~ '\w' || cline[idx1] == '.' || cline[idx1] == '_'
+        let idx1 -= 1
+    endwhile
+    let idx1 += 1
+    let base = strpart(cline, idx1, idx2 - idx1)
+    let rr = []
+    if strlen(base) == 0
+        let newbase = '.'
+    else
+        let newbase = '^' . substitute(base, "\\$$", "", "")
+    endif
+
+    let ktopt = ["eval=;TRUE", "echo=;TRUE", "results=;'markup|asis|hold|hide'",
+                \ "warning=;TRUE", "error=;TRUE", "message=;TRUE", "split=;FALSE",
+                \ "include=;TRUE", "strip.white=;TRUE", "tidy=;FALSE", "tidy.opts=; ",
+                \ "prompt=;FALSE", "comment=;'##'", "highlight=;TRUE", "background=;'#F7F7F7'",
+                \ "cache=;FALSE", "cache.path=;'cache/'", "cache.vars=; ",
+                \ "cache.lazy=;TRUE", "cache.comments=; ", "dependson=;''",
+                \ "autodep=;FALSE", "fig.path=; ", "fig.keep=;'high|none|all|first|last'",
+                \ "fig.show=;'asis|hold|animate|hide'", "dev=; ", "dev.args=; ",
+                \ "fig.ext=; ", "dpi=;72", "fig.width=;7", "fig.height=;7",
+                \ "out.width=;'7in'", "out.height=;'7in'", "out.extra=; ",
+                \ "resize.width=; ", "resize.height=; ", "fig.align=;'left|right|center'",
+                \ "fig.env=;'figure'", "fig.cap=;''", "fig.scap=;''", "fig.lp=;'fig:'",
+                \ "fig.pos=;''", "fig.subcap=; ", "fig.process=; ", "interval=;1",
+                \ "aniopts=;'controls.loop'", "code=; ", "ref.label=; ",
+                \ "child=; ", "engine=;'R'", "opts.label=;''", "purl=;TRUE",
+                \ 'R.options=; ']
+    if &filetype == "rnoweb"
+        let ktopt += ["external=;TRUE", "sanitize=;FALSE", "size=;'normalsize'"]
+    endif
+    if &filetype == "rmd" || &filetype == "rrst"
+        let ktopt += ["fig.retina=;1"]
+        if &filetype == "rmd"
+            let ktopt += ["collapse=;FALSE"]
+        endif
+    endif
+    call sort(ktopt)
+
+    for kopt in ktopt
+        if kopt =~ newbase
+            let tmp1 = split(kopt, ";")
+            let tmp2 = {'word': tmp1[0], 'menu': tmp1[1]}
+            call add(rr, tmp2)
+        endif
+    endfor
+    call complete(idx1 + 1, rr)
+endfunction
+
+function IsFirstRArg(lnum, cpos)
+    let line = getline(a:lnum)
+    let ii = a:cpos[2] - 2
+    let cchar = line[ii]
+    while ii > 0 && cchar != '('
+        let cchar = line[ii]
+        if cchar == ','
+            return 0
+        endif
+        let ii -= 1
+    endwhile
+    return 1
+endfunction
+
+function RCompleteArgs()
+    let line = getline(".")
+    if (&filetype == "rnoweb" && line =~ "^<<.*>>=$") || (&filetype == "rmd" && line =~ "^``` *{r.*}$") || (&filetype == "rrst" && line =~ "^.. {r.*}$") || (&filetype == "r" && line =~ "^#\+")
+        call CompleteChunkOptions()
+        return ''
+    endif
+
+    let lnum = line(".")
+    let cpos = getpos(".")
+    let idx = cpos[2] - 2
+    let idx2 = cpos[2] - 2
+    call cursor(lnum, cpos[2] - 1)
+    if line[idx2] == ' ' || line[idx2] == ',' || line[idx2] == '('
+        let idx2 = cpos[2]
+        let argkey = ''
+    else
+        let idx1 = idx2
+        while line[idx1] =~ '\w' || line[idx1] == '.' || line[idx1] == '_'
+            let idx1 -= 1
+        endwhile
+        let idx1 += 1
+        let argkey = strpart(line, idx1, idx2 - idx1 + 1)
+        let idx2 = cpos[2] - strlen(argkey)
+    endif
+
+    let np = 1
+    let nl = 0
+
+    while np != 0 && nl < 10
+        if line[idx] == '('
+            let np -= 1
+        elseif line[idx] == ')'
+            let np += 1
+        endif
+        if np == 0
+            call cursor(lnum, idx)
+            let rkeyword0 = RGetKeyWord()
+            let objclass = RGetFirstObjClass(rkeyword0)
+            let rkeyword = '^' . rkeyword0 . "\x06"
+            call cursor(cpos[1], cpos[2])
+
+            " If R is running, use it
+            if string(g:SendCmdToR) != "function('SendCmdToR_fake')"
+                call delete(g:rplugin_tmpdir . "/eval_reply")
+                let msg = 'vimcom:::vim.args("'
+                if objclass == ""
+                    let msg = msg . rkeyword0 . '", "' . argkey . '"'
+                else
+                    let msg = msg . rkeyword0 . '", "' . argkey . '", objclass = ' . objclass
+                endif
+                if rkeyword0 == "library" || rkeyword0 == "require"
+                    let isfirst = IsFirstRArg(lnum, cpos)
+                else
+                    let isfirst = 0
+                endif
+                if isfirst
+                    let msg = msg . ', firstLibArg = TRUE)'
+                else
+                    let msg = msg . ')'
+                endif
+                call SendToVimCom("\x08" . $VIMINSTANCEID . msg)
+
+                if g:rplugin_vimcomport > 0
+                    let g:rplugin_lastev = ReadEvalReply()
+                    if g:rplugin_lastev !~ "^R error: "
+                        let args = []
+                        if g:rplugin_lastev[0] == "\x04" && len(split(g:rplugin_lastev, "\x04")) == 1
+                            return ''
+                        endif
+                        let tmp0 = split(g:rplugin_lastev, "\x04")
+                        let tmp = split(tmp0[0], "\x09")
+                        if(len(tmp) > 0)
+                            for id in range(len(tmp))
+                                let tmp2 = split(tmp[id], "\x07")
+                                if tmp2[0] == '...' || isfirst
+                                    let tmp3 = tmp2[0]
+                                else
+                                    let tmp3 = tmp2[0] . " = "
+                                endif
+                                if len(tmp2) > 1
+                                    call add(args,  {'word': tmp3, 'menu': tmp2[1]})
+                                else
+                                    call add(args,  {'word': tmp3, 'menu': ' '})
+                                endif
+                            endfor
+                            if len(args) > 0 && len(tmp0) > 1
+                                call add(args, {'word': ' ', 'menu': tmp0[1]})
+                            endif
+                            call complete(idx2, args)
+                        endif
+                        return ''
+                    endif
+                endif
+            endif
+
+            " If R isn't running, use the prebuilt list of objects
+            let flines = g:rplugin_globalenvlines + g:rplugin_omni_lines
+            for omniL in flines
+                if omniL =~ rkeyword && omniL =~ "\x06function\x06function\x06"
+                    let tmp1 = split(omniL, "\x06")
+                    if len(tmp1) < 5
+                        return ''
+                    endif
+                    let info = tmp1[4]
+                    let argsL = split(info, "\x09")
+                    let args = []
+                    for id in range(len(argsL))
+                        let newkey = '^' . argkey
+                        let tmp2 = split(argsL[id], "\x07")
+                        if (argkey == '' || tmp2[0] =~ newkey) && tmp2[0] !~ "No arguments"
+                            if tmp2[0] != '...'
+                                let tmp2[0] = tmp2[0] . " = "
+                            endif
+                            if len(tmp2) == 2
+                                let tmp3 = {'word': tmp2[0], 'menu': tmp2[1]}
+                            else
+                                let tmp3 = {'word': tmp2[0], 'menu': ''}
+                            endif
+                            call add(args, tmp3)
+                        endif
+                    endfor
+                    call complete(idx2, args)
+                    return ''
+                endif
+            endfor
+            break
+        endif
+        let idx -= 1
+        if idx <= 0
+            let lnum -= 1
+            if lnum == 0
+                break
+            endif
+            let line = getline(lnum)
+            let idx = strlen(line)
+            let nl +=1
+        endif
+    endwhile
+    call cursor(cpos[1], cpos[2])
+    return ''
+endfunction
+
+function RGetFL(mode)
+    if a:mode == "normal"
+        let fline = line(".")
+        let lline = line(".")
+    else
+        let fline = line("'<")
+        let lline = line("'>")
+    endif
+    if fline > lline
+        let tmp = lline
+        let lline = fline
+        let fline = tmp
+    endif
+    return [fline, lline]
+endfunction
+
+function IsLineInRCode(vrb, line)
+    let save_cursor = getpos(".")
+    call setpos(".", [0, a:line, 1, 0])
+    let isR = b:IsInRCode(a:vrb)
+    call setpos('.', save_cursor)
+    return isR
+endfunction
+
+function RSimpleCommentLine(mode, what)
+    let [fline, lline] = RGetFL(a:mode)
+    let cstr = g:vimrplugin_rcomment_string
+    if (&filetype == "rnoweb"|| &filetype == "rhelp") && IsLineInRCode(0, fline) == 0
+        let cstr = "%"
+    elseif (&filetype == "rmd" || &filetype == "rrst") && IsLineInRCode(0, fline) == 0
+        return
+    endif
+
+    if a:what == "c"
+        for ii in range(fline, lline)
+            call setline(ii, cstr . getline(ii))
+        endfor
+    else
+        for ii in range(fline, lline)
+            call setline(ii, substitute(getline(ii), "^" . cstr, "", ""))
+        endfor
+    endif
+endfunction
+
 function RCommentLine(lnum, ind, cmt)
     let line = getline(a:lnum)
     call cursor(a:lnum, 0)
@@ -111,43 +435,23 @@ function RCommentLine(lnum, ind, cmt)
 endfunction
 
 function RComment(mode)
-    echon
     let cpos = getpos(".")
-    if a:mode == "selection"
-        let fline = line("'<")
-        let lline = line("'>")
-    else
-        let fline = line(".")
-        let lline = fline
-    endif
+    let [fline, lline] = RGetFL(a:mode)
 
     " What comment string to use?
-    call cursor(fline, 0)
-    let isRcode = 1
-    if &filetype == "rnoweb" && RnwIsInRCode() == 0
-        let isRcode = 0
-    endif
-    if &filetype == "rhelp"
-        let lastsection = search('^\\[a-z]*{', "bncW")
-        let secname = getline(lastsection)
-        if secname =~ '^\\usage{' || secname =~ '^\\examples{' || secname =~ '^\\dontshow{' || secname =~ '^\\dontrun{' || secname =~ '^\\donttest{' || secname =~ '^\\testonly{'
-            let isRcode = 1
+    if g:r_indent_ess_comments
+        if g:vimrplugin_indent_commented
+            let cmt = '##'
         else
-            let isRcode = 0
+            let cmt = '###'
         endif
-    endif
-    if isRcode == 0
-        let cmt = '%'
     else
-        if g:r_indent_ess_comments
-            if g:vimrplugin_indent_commented
-                let cmt = '##'
-            else
-                let cmt = '###'
-            endif
-        else
-            let cmt = '#'
-        endif
+        let cmt = '#'
+    endif
+    if (&filetype == "rnoweb" || &filetype == "rhelp") && IsLineInRCode(0, fline) == 0
+        let cmt = "%"
+    elseif (&filetype == "rmd" || &filetype == "rrst") && IsLineInRCode(0, fline) == 0
+        return
     endif
 
     let lnum = fline
@@ -170,7 +474,6 @@ function RComment(mode)
 endfunction
 
 function MovePosRCodeComment(mode)
-    echon
     if a:mode == "selection"
         let fline = line("'<")
         let lline = line("'>")
@@ -217,7 +520,7 @@ function MovePosRLineComment(lnum, cpos)
             let ok = 0
         endif
         if ok == 0
-            call RWarningMsg("Not inside a R code chunk.")
+            call RWarningMsg("Not inside an R code chunk.")
             return
         endif
     endif
@@ -231,7 +534,7 @@ function MovePosRLineComment(lnum, cpos)
             let ok = 0
         endif
         if ok == 0
-            call RWarningMsg("Not inside a R code section.")
+            call RWarningMsg("Not inside an R code section.")
             return
         endif
     endif
@@ -261,453 +564,465 @@ function CountBraces(line)
     return result
 endfunction
 
-function RnwPreviousChunk()
-    echon
-    let curline = line(".")
-    if RnwIsInRCode()
-        let i = search("^<<.*$", "bnW")
-        if i != 0
-            call cursor(i-1, 1)
+function CleanOxygenLine(line)
+    let cline = a:line
+    if cline =~ "^\s*#\\{1,2}'"
+        let synName = synIDattr(synID(line("."), col("."), 1), "name")
+        if synName == "rOExamples"
+            let cline = substitute(cline, "^\s*#\\{1,2}'", "", "")
         endif
     endif
-
-    let i = search("^<<.*$", "bnW")
-    if i == 0
-        call cursor(curline, 1)
-        call RWarningMsg("There is no previous R code chunk to go.")
-    else
-        call cursor(i+1, 1)
-    endif
-    return
+    return cline
 endfunction
 
-function RnwNextChunk()
-    echon
-    let linenr = search("^<<.*", "nW")
-    if linenr == 0
-        call RWarningMsg("There is no next R code chunk to go.")
-    else
-        let linenr += 1
-        call cursor(linenr, 1)
+function CleanCurrentLine()
+    let curline = substitute(getline("."), '^\s*', "", "")
+    if &filetype == "r"
+        let curline = CleanOxygenLine(curline)
     endif
-    return
+    return curline
 endfunction
 
 " Skip empty lines and lines whose first non blank char is '#'
 function GoDown()
     if &filetype == "rnoweb"
         let curline = getline(".")
-        let fc = curline[0]
-        if fc == '@'
+        if curline[0] == '@'
             call RnwNextChunk()
             return
         endif
+    elseif &filetype == "rmd"
+        let curline = getline(".")
+        if curline =~ '^```$'
+            call RmdNextChunk()
+            return
+        endif
+    elseif &filetype == "rrst"
+        let curline = getline(".")
+        if curline =~ '^\.\. \.\.$'
+            call RrstNextChunk()
+            return
+        endif
     endif
 
     let i = line(".") + 1
     call cursor(i, 1)
-    let curline = substitute(getline("."), '^\s*', "", "")
-    let fc = curline[0]
+    let curline = CleanCurrentLine()
     let lastLine = line("$")
-    while i < lastLine && (fc == '#' || strlen(curline) == 0)
+    while i < lastLine && (curline[0] == '#' || strlen(curline) == 0)
         let i = i + 1
         call cursor(i, 1)
-        let curline = substitute(getline("."), '^\s*', "", "")
-        let fc = curline[0]
+        let curline = CleanCurrentLine()
     endwhile
 endfunction
 
-function RWriteScreenRC()
-    let b:scrfile = $VIMRPLUGIN_TMPDIR . "/" . b:screensname . ".screenrc"
-    if g:vimrplugin_nosingler == 1
-        let scrtitle = 'hardstatus string "' . expand("%:t") . '"'
-    else
-        let scrtitle = "hardstatus string R"
+function DelayedFillLibList()
+    autocmd! RStarting
+    augroup! RStarting
+        let g:rplugin_starting_R = 0
+        if exists("g:rplugin_fillrliblist_called") && g:rplugin_fillrliblist_called
+            let g:rplugin_fillrliblist_called = 0
+            call FillRLibList()
+        endif
+    augroup END
+endfunction
+
+function IsSendCmdToRFake()
+    if string(g:SendCmdToR) != "function('SendCmdToR_fake')"
+        if exists("g:maplocalleader")
+            call RWarningMsg("As far as I know, R is already running. Did you quit it from within Vim (" . g:maplocalleader . "rq if not remapped)?")
+        else
+            call RWarningMsg("As far as I know, R is already running. Did you quit it from within Vim (\\rq if not remapped)?")
+        endif
+        return 1
     endif
-    let scrtxt = ["msgwait 1", "hardstatus lastline", scrtitle,
-                \ "caption splitonly", 'caption string "Vim-R-plugin"',
-                \ "termcapinfo xterm* 'ti@:te@'", 'vbell off']
-    call writefile(scrtxt, b:scrfile)
-    let scrrc = "-c " . b:scrfile
-    return scrrc
+    return 0
 endfunction
 
 " Start R
 function StartR(whatr)
-    " Change to buffer's directory before starting R
-    lcd %:p:h
+    call writefile([], g:rplugin_tmpdir . "/globenv_" . $VIMINSTANCEID)
+    call writefile([], g:rplugin_tmpdir . "/liblist_" . $VIMINSTANCEID)
+    call delete(g:rplugin_tmpdir . "/libnames_" . $VIMINSTANCEID)
 
-    if a:whatr =~ "vanilla"
-        let g:rplugin_r_args = "--vanilla"
+    if $R_DEFAULT_PACKAGES == ""
+        let $R_DEFAULT_PACKAGES = "datasets,utils,grDevices,graphics,stats,methods,vimcom"
+    elseif $R_DEFAULT_PACKAGES !~ "vimcom"
+        let $R_DEFAULT_PACKAGES .= ",vimcom"
+    endif
+
+    if g:vimrplugin_objbr_opendf
+        let start_options = ['options(vimcom.opendf = TRUE)']
     else
-        if a:whatr =~ "custom"
-            call inputsave()
-            let g:rplugin_r_args = input('Enter parameters for R: ')
-            call inputrestore()
-        else
-            let g:rplugin_r_args = g:vimrplugin_r_args
-        endif
+        let start_options = ['options(vimcom.opendf = FALSE)']
+    endif
+    if g:vimrplugin_objbr_openlist
+        let start_options += ['options(vimcom.openlist = TRUE)']
+    else
+        let start_options += ['options(vimcom.openlist = FALSE)']
+    endif
+    if g:vimrplugin_objbr_allnames
+        let start_options += ['options(vimcom.allnames = TRUE)']
+    else
+        let start_options += ['options(vimcom.allnames = FALSE)']
     endif
+    if g:vimrplugin_texerr
+        let start_options += ['options(vimcom.texerrs = TRUE)']
+    else
+        let start_options += ['options(vimcom.texerrs = FALSE)']
+    endif
+    if g:vimrplugin_objbr_labelerr
+        let start_options += ['options(vimcom.labelerr = TRUE)']
+    else
+        let start_options += ['options(vimcom.labelerr = FALSE)']
+    endif
+    if g:vimrplugin_vimpager == "no"
+        let start_options += ['options(vimcom.vimpager = FALSE)']
+    else
+        let start_options += ['options(vimcom.vimpager = TRUE)']
+    endif
+    let start_options += ['if(utils::packageVersion("vimcom") != "1.3.1") warning("Your version of Vim-R-plugin requires vimcom-1.3-1.", call. = FALSE)']
 
-    if has("gui_macvim") && g:vimrplugin_applescript && g:vimrplugin_screenplugin == 0 && g:vimrplugin_conqueplugin == 0
-        if isdirectory("/Applications/R64.app") && g:vimrplugin_i386 == 0
-            let rcmd = "/Applications/R64.app"
-        else
-            let rcmd = "/Applications/R.app"
+    let rwd = ""
+    if g:vimrplugin_vim_wd == 0
+        let rwd = expand("%:p:h")
+    elseif g:vimrplugin_vim_wd == 1
+        let rwd = getcwd()
+    endif
+    if rwd != ""
+        if has("win32")
+            let rwd = substitute(rwd, '\\', '/', 'g')
         endif
-        if g:rplugin_r_args != " "
-            let rcmd = rcmd . " " . g:rplugin_r_args
+        if has("win32") && &encoding == "utf-8"
+            let start_options += ['.vim.rwd <- "' . rwd . '"']
+            let start_options += ['Encoding(.vim.rwd) <- "UTF-8"']
+            let start_options += ['setwd(.vim.rwd)']
+            let start_options += ['rm(.vim.rwd)']
+        else
+            let start_options += ['setwd("' . rwd . '")']
         endif
-        call system("open " . rcmd)
-        lcd -
+    endif
+    call writefile(start_options, g:rplugin_tmpdir . "/start_options.R")
+
+    if !exists("g:vimrplugin_r_args")
+        let b:rplugin_r_args = " "
+    else
+        let b:rplugin_r_args = g:vimrplugin_r_args
+    endif
+
+    if a:whatr =~ "custom"
+        call inputsave()
+        let b:rplugin_r_args = input('Enter parameters for R: ')
+        call inputrestore()
+    endif
+
+    let g:rplugin_starting_R = 1
+
+    if g:vimrplugin_applescript
+        call StartR_OSX()
         return
     endif
 
-    if has("gui_win32")
-        if g:vimrplugin_conqueplugin == 0
-            exe s:py . " StartRPy()"
-            lcd -
-            return
-        else
-            let g:rplugin_R = "Rterm.exe"
-        endif
+    if has("win32") || has("win64")
+        call StartR_Windows()
+        return
+    endif
+
+    if g:vimrplugin_only_in_tmux && $TMUX_PANE == ""
+        call RWarningMsg("Not inside Tmux.")
+        return
+    endif
+
+    if IsSendCmdToRFake()
+        return
     endif
 
-    if g:rplugin_r_args == " "
+    if b:rplugin_r_args == " "
         let rcmd = g:rplugin_R
     else
-        let rcmd = g:rplugin_R . " " . g:rplugin_r_args
+        let rcmd = g:rplugin_R . " " . b:rplugin_r_args
     endif
 
-    if g:vimrplugin_screenplugin
-        if g:vimrplugin_screenvsplit
-            if exists(":ScreenShellVertical") == 2
-                exec 'ScreenShellVertical ' . rcmd
-            else
-                call RWarningMsg("The screen plugin version >= 1.1 is required to split the window vertically.")
-                call input("Press  to continue. ")
-                exec 'ScreenShell ' . rcmd
-            endif
-        else
-            exec 'ScreenShell ' . rcmd
-        endif
-    elseif g:vimrplugin_conqueplugin
-        if exists("b:conque_bufname")
-            if bufloaded(substitute(b:conque_bufname, "\\", "", "g"))
-                call RWarningMsg("This buffer already has a Conque Shell.")
-                lcd -
-                return
-            endif
-        endif
+    if g:rplugin_do_tmux_split
+        call StartR_TmuxSplit(rcmd)
+    else
+        call StartR_ExternalTerm(rcmd)
+    endif
+endfunction
 
-        if g:vimrplugin_by_vim_instance == 1 && exists("g:ConqueTerm_BufName") && bufloaded(substitute(g:ConqueTerm_BufName, "\\", "", "g"))
-            call RWarningMsg("This Vim instance already has a Conque Shell.")
-            lcd -
-            return
-        endif
+" Send SIGINT to R
+function StopR()
+    if g:rplugin_r_pid
+        call system("kill -s SIGINT " . g:rplugin_r_pid)
+    endif
+endfunction
 
-        let savesb = &switchbuf
-        set switchbuf=useopen,usetab
-        if g:vimrplugin_conquevsplit == 1
-            let l:sr = &splitright
-            set splitright
-            let b:conqueshell = conque_term#open(rcmd, ['vsplit'], 1)
-            let &splitright = l:sr
+function WaitVimComStart()
+    if b:rplugin_r_args =~ "vanilla"
+        return 0
+    endif
+    if g:vimrplugin_vimcom_wait < 300
+        g:vimrplugin_vimcom_wait = 300
+    endif
+    redraw
+    echo "Waiting vimcom loading..."
+    sleep 300m
+    let ii = 300
+    let waitmsg = 0
+    while !filereadable(g:rplugin_tmpdir . "/vimcom_running_" . $VIMINSTANCEID) && ii < g:vimrplugin_vimcom_wait
+        let ii = ii + 200
+        sleep 200m
+    endwhile
+    echon "\r                              "
+    redraw
+    sleep 100m
+    if filereadable(g:rplugin_tmpdir . "/vimcom_running_" . $VIMINSTANCEID)
+        let vr = readfile(g:rplugin_tmpdir . "/vimcom_running_" . $VIMINSTANCEID)
+        let g:rplugin_vimcom_version = vr[0]
+        let g:rplugin_vimcom_home = vr[1]
+        let g:rplugin_vimcomport = vr[2]
+        let g:rplugin_r_pid = vr[3]
+        let $RCONSOLE = vr[4]
+        if has("win64")
+            let g:rplugin_vclntsrvr = g:rplugin_vimcom_home . "/bin/x64/vclientserver.exe"
+            let g:rplugin_vimcom_lib = g:rplugin_vimcom_home . "/bin/x64/libVimR.dll"
+        elseif has("win32")
+            let g:rplugin_vclntsrvr = g:rplugin_vimcom_home . "/bin/i386/vclientserver.exe"
+            let g:rplugin_vimcom_lib = g:rplugin_vimcom_home . "/bin/i386/libVimR.dll"
         else
-            let b:conqueshell = conque_term#open(rcmd, ['belowright split'], 1)
+            let g:rplugin_vclntsrvr = g:rplugin_vimcom_home . "/bin/vclientserver"
         endif
 
-        if b:conqueshell['idx'] == 1
-            let b:objbrtitle = "Object_Browser"
+        if isdirectory(g:rplugin_vimcom_home . "/bin/x64")
+            let vimcom_bin_dir = g:rplugin_vimcom_home . "/bin/x64"
+        elseif isdirectory(g:rplugin_vimcom_home . "/bin/i386")
+            let vimcom_bin_dir = g:rplugin_vimcom_home . "/bin/i386"
         else
-            let b:objbrtitle = "Object_Browser" . b:conqueshell['idx']
+            let vimcom_bin_dir = g:rplugin_vimcom_home . "/bin"
         endif
-        let b:conque_bufname = g:ConqueTerm_BufName
-
-        " Copy the values of some local variables that will be inherited
-        let g:tmp_conqueshell = b:conqueshell
-        let g:tmp_conque_bufname = b:conque_bufname
-        let g:tmp_objbrtitle = b:objbrtitle
-
-        exe "sil noautocmd sb " . b:conque_bufname
-
-        " Inheritance of some local variables
-        let b:conqueshell = g:tmp_conqueshell
-        let b:conque_bufname = g:tmp_conque_bufname
-        let b:objbrtitle = g:tmp_objbrtitle
-
-        if g:vimrplugin_by_vim_instance == 1
-            let g:rplugin_conqueshell = b:conqueshell
-            let g:rplugin_conque_bufname = b:conque_bufname
-            let g:rplugin_objbrtitle = b:objbrtitle
+        if $PATH !~ vimcom_bin_dir
+            if has("win32")
+                let $PATH = vimcom_bin_dir . ';' . $PATH
+            else
+                let $PATH = vimcom_bin_dir . ':' . $PATH
+            endif
         endif
 
-        unlet g:tmp_conqueshell
-        unlet g:tmp_conque_bufname
-        unlet g:tmp_objbrtitle
-
-        exe "setlocal syntax=rout"
-        exe "sil noautocmd sb " . g:rplugin_curbuf
-        exe "set switchbuf=" . savesb
-    else
-        if g:vimrplugin_noscreenrc == 1
-            let scrrc = " "
-        else
-            let scrrc = RWriteScreenRC()
-        endif
-        " Some terminals want quotes (see screen.vim)
-        if g:rplugin_termcmd =~ "gnome-terminal" || g:rplugin_termcmd =~ "xfce4-terminal" || g:rplugin_termcmd =~ "iterm"
-            let opencmd = printf("%s 'screen %s -d -RR -S %s %s' &", g:rplugin_termcmd, scrrc, b:screensname, rcmd)
+        if filereadable(g:rplugin_vclntsrvr)
+            " Set vimcom port in the vclientserver
+            let $VIMCOMPORT = g:rplugin_vimcomport
+            " Set RConsole window ID in vclientserver to ArrangeWindows()
+            if has("win32")
+                if $RCONSOLE == "0"
+                    call RWarningMsg("vimcom did not save R window ID")
+                endif
+                if $WINDOWID == ""
+                    if v:windowid == 0
+                        call RWarningMsg("GVim did not define $WINDOWID")
+                    else
+                        let $WINDOWID = v:windowid
+                    endif
+                endif
+            endif
+            let vcs_job = job_start([g:rplugin_vclntsrvr],
+                        \ {'out_cb': 'ROnJobStdout', 'err_cb': "ROnJobStderr"})
+            let g:rplugin_channel = job_getchannel(vcs_job)
         else
-            let opencmd = printf("%s screen %s -d -RR -S %s %s &", g:rplugin_termcmd, scrrc, b:screensname, rcmd)
+            call RWarningMsgInp('Could not find "' . g:rplugin_vclntsrvr . '".')
         endif
-        let rlog = system(opencmd)
-        if v:shell_error
-            call RWarningMsg(rlog)
-            lcd -
-            return
+        if g:rplugin_vimcom_version != "1.3.1"
+            call RWarningMsg('This version of Vim-R-plugin requires vimcom 1.3-1.')
+            sleep 1
         endif
-    endif
+        call delete(g:rplugin_tmpdir . "/vimcom_running_" . $VIMINSTANCEID)
 
-    " Go back to original directory:
-    lcd -
-    echon
-endfunction
 
-" Open an Object Browser window
-function RObjBrowser()
-    " Only opens the Object Browser if R is running
-    if g:vimrplugin_screenplugin && !exists("g:ScreenShellSend")
-        return
-    endif
-    if g:vimrplugin_conqueplugin && !exists("b:conque_bufname")
-        return
-    endif
+        if g:rplugin_do_tmux_split
+            " Environment variables persists across Tmux windows.
+            " Unset VIMRPLUGIN_TMPDIR to avoid vimcom loading its C library
+            " when R was not started by Vim:
+            call system("tmux set-environment -u VIMRPLUGIN_TMPDIR")
+        endif
+        call delete(g:rplugin_tmpdir . "/start_options.R")
 
-    " R builds the Object Browser contents.
-    let lockfile = $VIMRPLUGIN_TMPDIR . "/objbrowser" . "lock"
-    call writefile(["Wait!"], lockfile)
-    if g:vimrplugin_allnames == 1
-        call SendCmdToR("source('" . g:rplugin_home . "/r-plugin/vimbrowser.R') ; .vim.browser(TRUE)")
+        " Vim may crash when the syntax highlight is changed while the window
+        " is being resized, although only if the R syntax is included in
+        " another filetype. To guarantee a safer startup, we delay the
+        " highlight of functions for all cases:
+        augroup RStarting
+            autocmd!
+            autocmd CursorMoved  call DelayedFillLibList()
+            autocmd CursorMovedI  call DelayedFillLibList()
+        augroup END
+
+        return 1
     else
-        call SendCmdToR("source('" . g:rplugin_home . "/r-plugin/vimbrowser.R') ; .vim.browser()")
+        call RWarningMsg("The package vimcom wasn't loaded yet.")
+        sleep 500m
+        return 0
     endif
-    sleep 50m
-    let i = 0 
-    while filereadable(lockfile)
-        let i = i + 1
-        sleep 50m
-        if i == 40
-            call delete(lockfile)
-            call RWarningMsg("No longer waiting for Object Browser to finish...")
-            if exists("g:rplugin_r_output")
-                echo g:rplugin_r_output
-            endif
-            sleep 2
-            return
-        endif
-    endwhile
+endfunction
 
-    let g:rplugin_origbuf = bufname("%")
+function StartObjBrowser_Vim()
+    let wmsg = ""
+    call SendToVimCom("\002" . g:rplugin_myport)
 
     " Either load or reload the Object Browser
     let savesb = &switchbuf
     set switchbuf=useopen,usetab
     if bufloaded(b:objbrtitle)
         exe "sb " . b:objbrtitle
+        let wmsg = ""
     else
         " Copy the values of some local variables that will be inherited
         let g:tmp_objbrtitle = b:objbrtitle
-        let g:tmp_screensname = b:screensname
+        let g:tmp_tmuxsname = g:rplugin_tmuxsname
         let g:tmp_curbufname = bufname("%")
 
-        if g:vimrplugin_conqueplugin == 1
-            " Copy the values of some local variables that will be inherited
-            let g:tmp_conqueshell = b:conqueshell
-            let g:tmp_conque_bufname = b:conque_bufname
-
-            if g:vimrplugin_objbr_place =~ "console"
-                exe "sil sb " . b:conque_bufname
-                normal! G0
-            endif
-        endif
-
         let l:sr = &splitright
-        if g:vimrplugin_objbr_place =~ "right"
-            set splitright
-        else
+        if g:vimrplugin_objbr_place =~ "left"
             set nosplitright
+        else
+            set splitright
         endif
-        exe "vsplit " . b:objbrtitle
+        sil exe "vsplit " . b:objbrtitle
         let &splitright = l:sr
-        exe "vertical resize " . g:vimrplugin_objbr_w
-        set filetype=rbrowser
+        sil exe "vertical resize " . g:vimrplugin_objbr_w
+        sil set filetype=rbrowser
 
         " Inheritance of some local variables
-        if g:vimrplugin_conqueplugin == 1
-            let b:conqueshell = g:tmp_conqueshell
-            let b:conque_bufname = g:tmp_conque_bufname
-            unlet g:tmp_conqueshell
-            unlet g:tmp_conque_bufname
-        endif
-        let b:screensname = g:tmp_screensname
+        let g:rplugin_tmuxsname = g:tmp_tmuxsname
         let b:objbrtitle = g:tmp_objbrtitle
         let b:rscript_buffer = g:tmp_curbufname
         unlet g:tmp_objbrtitle
-        unlet g:tmp_screensname
+        unlet g:tmp_tmuxsname
         unlet g:tmp_curbufname
-
+        sleep 50m
     endif
+    if wmsg != ""
+        call RWarningMsg(wmsg)
+        sleep 200m
+    endif
+endfunction
 
-
-    let objbr = $VIMRPLUGIN_TMPDIR . "/objbrowser"
-    let i = 1
-    while !filereadable(objbr)
-        sleep 100m
-        if i == 20
-            exe "sb " . g:rplugin_origbuf
-            exe "set switchbuf=" . savesb
-            return
-        endif
-    endwhile
-    setlocal modifiable
-    let curline = line(".")
-    let curcol = col(".")
-    normal! ggdG
-    exe "source " . objbr
-    if exists("b:libdict")
-        unlet b:libdict
-    endif
-    call RBrowserFillCloseList()
-    call RBrowserFill(0)
-    setlocal nomodified
-    call cursor(curline, curcol)
-    redraw
-    exe "sb " . g:rplugin_origbuf
-    exe "set switchbuf=" . savesb
-endfunction
-
-" Scroll conque term buffer (called by CursorHold event)
-function RScrollTerm()
-    if &ft != "r" && &ft != "rnoweb" && &ft != "rhelp" && &ft != "rdoc"
+" Open an Object Browser window
+function RObjBrowser()
+    " Only opens the Object Browser if R is running
+    if string(g:SendCmdToR) == "function('SendCmdToR_fake')"
+        call RWarningMsg("The Object Browser can be opened only if R is running.")
         return
     endif
-    if !exists("b:conque_bufname")
+
+    if g:rplugin_running_objbr == 1
+        " Called twice due to BufEnter event
         return
     endif
 
-    let savesb = &switchbuf
-    set switchbuf=useopen,usetab
-    exe "sil noautocmd sb " . b:conque_bufname
+    let g:rplugin_running_objbr = 1
 
-    call b:conqueshell.read(50)
-    normal! G0
+    if !b:rplugin_extern_ob
+        if g:vimrplugin_tmux_ob
+            call StartObjBrowser_Tmux()
+        else
+            call StartObjBrowser_Vim()
+        endif
+    endif
+    let g:rplugin_running_objbr = 0
+    return
+endfunction
 
-    exe "sil noautocmd sb " . g:rplugin_curbuf
-    exe "set switchbuf=" . savesb
+function RBrOpenCloseLs(stt)
+    call SendToVimCom("\007" . a:stt)
 endfunction
 
-" Function to send commands
-" return 0 on failure and 1 on success
-function SendCmdToR(cmd)
-    " ^K clean from cursor to the right and ^U clean from cursor to the left
-    let cmd = "\013" . "\025" . a:cmd
-
-    if has("gui_win32") && g:vimrplugin_conqueplugin == 0
-        let cmd = cmd . "\n"
-        let slen = len(cmd)
-        let str = ""
-        for i in range(0, slen)
-            let str = str . printf("\\x%02X", char2nr(cmd[i]))
-        endfor
-        exe s:py . " SendToRPy(b'" . str . "')"
-        silent exe '!start WScript "' . g:rplugin_jspath . '" "' . expand("%") . '"'
-        " call RestoreClipboardPy()
-        return 1
+function SendToVimCom(cmd)
+    if g:rplugin_vimcomport == 0
+        call RWarningMsg("VimCom port is unknown.")
+        call RWarningMsg(a:cmd)
+        return
     endif
+    call ch_sendraw(g:rplugin_channel, "\002" . a:cmd . "\n")
+endfunction
 
-    if g:vimrplugin_screenplugin
-        if !exists("g:ScreenShellSend")
-            call RWarningMsg("Did you already start R?")
-            return 0
-        endif
-        call g:ScreenShellSend(cmd)
-        return 1
-    elseif g:vimrplugin_conqueplugin
-        if !exists("b:conque_bufname")
-            if g:vimrplugin_by_vim_instance
-                if exists("g:rplugin_conqueshell")
-                    let b:conqueshell = g:rplugin_conqueshell
-                    let b:conque_bufname = g:rplugin_conque_bufname
-                    let b:objbrtitle = g:rplugin_objbrtitle
-                else
-                    call RWarningMsg("This buffer does not have a Conque Shell yet.")
-                    return 0
-                endif
-            else
-                call RWarningMsg("Did you already start R?")
-                return 0
-            endif
-        endif
-
-        " Is the Conque buffer hidden or deleted?
-        if !bufloaded(substitute(b:conque_bufname, "\\", "", "g"))
-            call RWarningMsg("Could not find Conque Shell buffer.")
-            return 0
-        endif
-
-        " Code provided by Nico Raffo: use an aggressive sb option
-        let savesb = &switchbuf
-        set switchbuf=useopen,usetab
+function RSetMyPort(p)
+    let g:rplugin_myport = a:p
+    let $VIMR_PORT = a:p
+    if &filetype == "rbrowser" && g:rplugin_do_tmux_split
+        call SendToVimCom("\002" . g:rplugin_myport)
+    elseif g:rplugin_vimcomport
+        call SendToVimCom("\001" . g:rplugin_myport)
+    endif
+endfunction
 
-        " jump to terminal buffer
-        if bufwinnr(substitute(b:conque_bufname, "\\", "", "g")) < 0
-            " The buffer either was hidden by the user with the  :q  command or is
-            " in another tab
-            exe "sil noautocmd belowright split " . b:conque_bufname
-        else
-            exe "sil noautocmd sb " . b:conque_bufname
-        endif
+function RFormatCode() range
+    if g:rplugin_vimcomport == 0
+        return
+    endif
 
-        " write variable content to terminal
-        call b:conqueshell.writeln(cmd)
-        exe "sleep " . g:vimrplugin_conquesleep . "m"
-        call b:conqueshell.read(50)
-        normal! G0
+    let lns = getline(a:firstline, a:lastline)
+    call writefile(lns, g:rplugin_tmpdir . "/unformatted_code")
+    let wco = &textwidth
+    if wco == 0
+        let wco = 78
+    elseif wco < 20
+        let wco = 20
+    elseif wco > 180
+        let wco = 180
+    endif
+    call delete(g:rplugin_tmpdir . "/eval_reply")
+    call SendToVimCom("\x08" . $VIMINSTANCEID . 'formatR::tidy_source("' . g:rplugin_tmpdir . '/unformatted_code", file = "' . g:rplugin_tmpdir . '/formatted_code", width.cutoff = ' . wco . ')')
+    let g:rplugin_lastev = ReadEvalReply()
+    if g:rplugin_lastev =~ "^R error: "
+        call RWarningMsg(g:rplugin_lastev)
+        return
+    endif
+    let lns = readfile(g:rplugin_tmpdir . "/formatted_code")
+    silent exe a:firstline . "," . a:lastline . "delete"
+    call append(a:firstline - 1, lns)
+    echo (a:lastline - a:firstline + 1) . " lines formatted."
+endfunction
 
-        " jump back to code buffer
-        exe "sil noautocmd sb " . g:rplugin_curbuf
-        exe "set switchbuf=" . savesb
-        return 1
+function RInsert(...)
+    if g:rplugin_vimcomport == 0
+        return
     endif
 
-    if has("gui_macvim") && g:vimrplugin_applescript && g:vimrplugin_screenplugin == 0 && g:vimrplugin_conqueplugin == 0
-        if isdirectory("/Applications/R64.app") && g:vimrplugin_i386 == 0
-            let rcmd = "R64"
-        else
-            let rcmd = "R"
+    call delete(g:rplugin_tmpdir . "/eval_reply")
+    call delete(g:rplugin_tmpdir . "/Rinsert")
+    call SendToVimCom("\x08" . $VIMINSTANCEID . 'capture.output(' . a:1 . ', file = "' . g:rplugin_tmpdir . '/Rinsert")')
+    let g:rplugin_lastev = ReadEvalReply()
+    if g:rplugin_lastev =~ "^R error: "
+        call RWarningMsg(g:rplugin_lastev)
+        return 0
+    else
+        if a:0 == 2 && a:2 == "newtab"
+            tabnew
+            set ft=rout
         endif
-
-        " for some reason it doesn't like "\025"
-        let cmd = a:cmd
-        let cmd = substitute(cmd, "\\", '\\\', 'g')
-        let cmd = substitute(cmd, '"', '\\"', "g")
-        let cmd = substitute(cmd, "'", "'\\\\''", "g")
-        call system("osascript -e 'tell application \"".rcmd."\" to cmd \"" . cmd . "\"'")
+        silent exe "read " . substitute(g:rplugin_tmpdir, ' ', '\\ ', 'g') . "/Rinsert"
         return 1
     endif
+endfunction
 
-    " Send the command to R running in an external terminal emulator
-    let str = substitute(cmd, "'", "'\\\\''", "g")
-    let scmd = 'screen -S ' . b:screensname . " -X stuff '" . str . "\'"
-    let rlog = system(scmd)
-    if v:shell_error
-        let rlog = substitute(rlog, '\n', ' ', 'g')
-        let rlog = substitute(rlog, '\r', ' ', 'g')
-        call RWarningMsg(rlog)
-        return 0
+function SendLineToRAndInsertOutput()
+    let lin = getline(".")
+    if RInsert("print(" . lin . ")")
+        let curpos = getpos(".")
+        " comment the output
+        let ilines = readfile(g:rplugin_tmpdir . "/Rinsert")
+        for iln in ilines
+            call RSimpleCommentLine("normal", "c")
+            normal! j
+        endfor
+        call setpos(".", curpos)
     endif
-    return 1
+endfunction
+
+" Function to send commands
+" return 0 on failure and 1 on success
+function SendCmdToR_fake(cmd)
+    call RWarningMsg("Did you already start R?")
+    return 0
 endfunction
 
 " Get the word either under or after the cursor.
@@ -717,6 +1032,9 @@ function RGetKeyWord()
     let save_cursor = getpos(".")
     let curline = line(".")
     let line = getline(curline)
+    if strlen(line) == 0
+        return ""
+    endif
     " line index starts in 0; cursor index starts in 1:
     let i = col(".") - 1
     while i > 0 && "({[ " =~ line[i]
@@ -724,57 +1042,114 @@ function RGetKeyWord()
         let i -= 1
     endwhile
     let save_keyword = &iskeyword
-    setlocal iskeyword=@,48-57,_,.,$
+    setlocal iskeyword=@,48-57,_,.,$,@-@
     let rkeyword = expand("")
     exe "setlocal iskeyword=" . save_keyword
     call setpos(".", save_cursor)
     return rkeyword
 endfunction
 
-" Send sources to R
-function RSourceLines(lines, e)
-    call writefile(a:lines, b:rsource)
-    if a:e == "echo"
-        if exists("g:vimrplugin_maxdeparse")
-            let rcmd = 'source("' . b:rsource . '", echo=TRUE, max.deparse=' . g:vimrplugin_maxdeparse . ')'
+function GetROutput(outf)
+    if a:outf =~ g:rplugin_tmpdir
+        let tnum = 1
+        while bufexists("so" . tnum)
+            let tnum += 1
+        endwhile
+        exe 'tabnew so' . tnum
+        exe 'read ' . substitute(a:outf, " ", '\\ ', 'g')
+        set filetype=rout
+        setlocal buftype=nofile
+        setlocal noswapfile
+    else
+        exe 'tabnew ' . substitute(a:outf, " ", '\\ ', 'g')
+    endif
+    normal! gT
+    redraw
+endfunction
+
+function RViewDF(oname)
+    if exists("g:vimrplugin_csv_app")
+        if !executable(g:vimrplugin_csv_app)
+            call RWarningMsg('vimrplugin_csv_app ("' . g:vimrplugin_csv_app . '") is not executable')
+            return
+        endif
+        normal! :
+        call system('cp "' . g:rplugin_tmpdir . '/Rinsert" "' . a:oname . '.csv"')
+        if has("win32") || has("win64")
+            silent exe '!start "' . g:vimrplugin_csv_app . '" "' . a:oname . '.csv"'
         else
-            let rcmd = 'source("' . b:rsource . '", echo=TRUE)'
+            call system(g:vimrplugin_csv_app . ' "' . a:oname . '.csv" >/dev/null 2>/dev/null &')
         endif
-    else
-        let rcmd = 'source("' . b:rsource . '")'
+        return
+    endif
+    echo 'Opening "' . a:oname . '.csv"'
+    silent exe 'tabnew ' . a:oname . '.csv'
+    silent 1,$d
+    silent exe 'read ' . substitute(g:rplugin_tmpdir, " ", '\\ ', 'g') . '/Rinsert'
+    silent 1d
+    set filetype=csv
+    set nomodified
+    redraw
+    if !exists(":CSVTable") && g:vimrplugin_csv_warn
+        call RWarningMsg("csv.vim is not installed (http://www.vim.org/scripts/script.php?script_id=2830)")
+    endif
+endfunction
+
+function GetSourceArgs(e)
+    let sargs = ""
+    if g:vimrplugin_source_args != ""
+        let sargs = ", " . g:vimrplugin_source_args
+    endif
+    if a:e == "echo"
+        let sargs .= ', echo=TRUE'
+    endif
+    return sargs
+endfunction
+
+" Send sources to R
+function RSourceLines(...)
+    let lines = a:1
+    if &filetype == "rrst"
+        let lines = map(copy(lines), 'substitute(v:val, "^\\.\\. \\?", "", "")')
+    endif
+    if &filetype == "rmd"
+        let lines = map(copy(lines), 'substitute(v:val, "^(\\`\\`)\\?", "", "")')
     endif
-    let ok = SendCmdToR(rcmd)
+    call writefile(lines, g:rplugin_rsource)
+
+    if a:0 == 3 && a:3 == "NewtabInsert"
+        call SendToVimCom("\x08" . $VIMINSTANCEID . 'vimcom:::vim_capture_source_output("' . g:rplugin_rsource . '", "' . g:rplugin_tmpdir . '/Rinsert")')
+        return 1
+    endif
+
+    let sargs = GetSourceArgs(a:2)
+    let rcmd = 'base::source("' . g:rplugin_rsource . '"' . sargs . ')'
+    let ok = g:SendCmdToR(rcmd)
     return ok
 endfunction
 
 " Send file to R
 function SendFileToR(e)
-    echon
-    let b:needsnewomnilist = 1
-    let lines = getline("1", line("$"))
-    let ok = RSourceLines(lines, a:e)
-    if  ok == 0
-        return
+    update
+    let fpath = expand("%:p")
+    if has("win32")
+        let fpath = substitute(fpath, "\\", "/", "g")
     endif
+    let sargs = GetSourceArgs(a:e)
+    call g:SendCmdToR('base::source("' . fpath .  '"' . sargs . ')')
 endfunction
 
 " Send block to R
-" Adapted of the plugin marksbrowser
+" Adapted from marksbrowser plugin
 " Function to get the marks which the cursor is between
 function SendMBlockToR(e, m)
-    if &filetype == "rnoweb" && RnwIsInRCode() == 0
-        call RWarningMsg("Not inside a R code chunk.")
-        return
-    endif
-    if &filetype == "rdoc" && search("^Examples:$", "bncW") == 0
-        call RWarningMsg('Not in the "Examples" section.')
+    if &filetype != "r" && b:IsInRCode(1) == 0
         return
     endif
 
-    let b:needsnewomnilist = 1
     let curline = line(".")
-    let lineA = -1
-    let lineB = line("$") + 1
+    let lineA = 1
+    let lineB = line("$")
     let maxmarks = strlen(s:all_marks)
     let n = 0
     while n < maxmarks
@@ -789,10 +1164,13 @@ function SendMBlockToR(e, m)
         endif
         let n = n + 1
     endwhile
-    if lineA == -1 || lineB == (line("$") + 1)
-        call RWarningMsg("The cursor is not between two marks!")
+    if lineA == 1 && lineB == (line("$"))
+        call RWarningMsg("The file has no mark!")
         return
     endif
+    if lineB < line("$")
+        let lineB -= 1
+    endif
     let lines = getline(lineA, lineB)
     let ok = RSourceLines(lines, a:e)
     if ok == 0
@@ -801,23 +1179,17 @@ function SendMBlockToR(e, m)
     if a:m == "down" && lineB != line("$")
         call cursor(lineB, 1)
         call GoDown()
-    endif  
-    echon
+    endif
 endfunction
 
 " Send functions to R
 function SendFunctionToR(e, m)
-    echon
-    if &filetype == "rnoweb" && RnwIsInRCode() == 0
-        call RWarningMsg("Not inside a R code chunk.")
-        return
-    endif
-    if &filetype == "rdoc" && search("^Examples:$", "bncW") == 0
-        call RWarningMsg('Not in the "Examples" section.')
+    if &filetype != "r" && b:IsInRCode(1) == 0
         return
     endif
 
-    let b:needsnewomnilist = 1
+    let startline = line(".")
+    let save_cursor = getpos(".")
     let line = SanitizeRLine(getline("."))
     let i = line(".")
     while i > 0 && line !~ "function"
@@ -825,6 +1197,7 @@ function SendFunctionToR(e, m)
         let line = SanitizeRLine(getline(i))
     endwhile
     if i == 0
+        call RWarningMsg("Begin of function not found.")
         return
     endif
     let functionline = i
@@ -833,6 +1206,7 @@ function SendFunctionToR(e, m)
         let line = SanitizeRLine(getline(i))
     endwhile
     if i == 0
+        call RWarningMsg("The function assign operator  <-  was not found.")
         return
     endif
     let firstline = i
@@ -844,6 +1218,7 @@ function SendFunctionToR(e, m)
         let line = SanitizeRLine(getline(i))
     endwhile
     if i == tt
+        call RWarningMsg("The function opening brace was not found.")
         return
     endif
     let nb = CountBraces(line)
@@ -853,9 +1228,18 @@ function SendFunctionToR(e, m)
         let nb += CountBraces(line)
     endwhile
     if nb != 0
+        call RWarningMsg("The function closing brace was not found.")
         return
     endif
     let lastline = i
+
+    if startline > lastline
+        call setpos(".", [0, firstline - 1, 1])
+        call SendFunctionToR(a:e, a:m)
+        call setpos(".", save_cursor)
+        return
+    endif
+
     let lines = getline(firstline, lastline)
     let ok = RSourceLines(lines, a:e)
     if  ok == 0
@@ -865,39 +1249,83 @@ function SendFunctionToR(e, m)
         call cursor(lastline, 1)
         call GoDown()
     endif
-    echon
 endfunction
 
 " Send selection to R
-function SendSelectionToR(e, m)
-    echon
-    if &filetype == "rnoweb" && RnwIsInRCode() == 0
-        call RWarningMsg("Not inside a R code chunk.")
-        return
-    endif
-    if &filetype == "rdoc" && search("^Examples:$", "bncW") == 0
-        call RWarningMsg('Not in the "Examples" section.')
-        return
+function SendSelectionToR(...)
+    if &filetype != "r"
+        if b:IsInRCode(0) == 0
+            if (&filetype == "rnoweb" && getline(".") !~ "\\Sexpr{") || (&filetype == "rmd" && getline(".") !~ "`r ") || (&filetype == "rrst" && getline(".") !~ ":r:`")
+                call RWarningMsg("Not inside an R code chunk.")
+                return
+            endif
+        endif
     endif
 
-    let b:needsnewomnilist = 1
     if line("'<") == line("'>")
         let i = col("'<") - 1
         let j = col("'>") - i
         let l = getline("'<")
         let line = strpart(l, i, j)
-        let ok = SendCmdToR(line)
-        if ok && a:m =~ "down"
+        let line = CleanOxygenLine(line)
+        let ok = g:SendCmdToR(line)
+        if ok && a:2 =~ "down"
             call GoDown()
         endif
         return
     endif
+
     let lines = getline("'<", "'>")
-    let ok = RSourceLines(lines, a:e)
+
+    if visualmode() == "\"
+        let lj = line("'<")
+        let cj = col("'<")
+        let lk = line("'>")
+        let ck = col("'>")
+        if cj > ck
+            let bb = ck - 1
+            let ee = cj - ck + 1
+        else
+            let bb = cj - 1
+            let ee = ck - cj + 1
+        endif
+        if cj > len(getline(lj)) || ck > len(getline(lk))
+            for idx in range(0, len(lines) - 1)
+                let lines[idx] = strpart(lines[idx], bb)
+            endfor
+        else
+            for idx in range(0, len(lines) - 1)
+                let lines[idx] = strpart(lines[idx], bb, ee)
+            endfor
+        endif
+    else
+        let i = col("'<") - 1
+        let j = col("'>")
+        let lines[0] = strpart(lines[0], i)
+        let llen = len(lines) - 1
+        let lines[llen] = strpart(lines[llen], 0, j)
+    endif
+
+    let curpos = getpos(".")
+    let curline = line("'<")
+    for idx in range(0, len(lines) - 1)
+        call setpos(".", [0, curline, 1, 0])
+        let lines[idx] = CleanOxygenLine(lines[idx])
+        let curline += 1
+    endfor
+    call setpos(".", curpos)
+
+    if a:0 == 3 && a:3 == "NewtabInsert"
+        let ok = RSourceLines(lines, a:1, "NewtabInsert")
+    else
+        let ok = RSourceLines(lines, a:1)
+    endif
+
     if ok == 0
         return
     endif
-    if a:m == "down"
+
+    if a:2 == "down"
         call GoDown()
     else
         normal! gv
@@ -906,16 +1334,10 @@ endfunction
 
 " Send paragraph to R
 function SendParagraphToR(e, m)
-    if &filetype == "rnoweb" && RnwIsInRCode() == 0
-        call RWarningMsg("Not inside a R code chunk.")
-        return
-    endif
-    if &filetype == "rdoc" && search("^Examples:$", "bncW") == 0
-        call RWarningMsg('Not in the "Examples" section.')
+    if &filetype != "r" && b:IsInRCode(1) == 0
         return
     endif
 
-    let b:needsnewomnilist = 1
     let i = line(".")
     let c = col(".")
     let max = line("$")
@@ -927,6 +1349,9 @@ function SendParagraphToR(e, m)
         if &filetype == "rnoweb" && line =~ "^@$"
             let j -= 1
             break
+        elseif &filetype == "rmd" && line =~ "^[ \t]*```$"
+            let j -= 1
+            break
         endif
         if line =~ '^\s*$'
             break
@@ -947,13 +1372,81 @@ function SendParagraphToR(e, m)
     else
         call cursor(i, c)
     endif
-    echon
 endfunction
 
-" Send current line to R. Don't go down if called by .
+" Send R code from the first chunk up to current line
+function SendFHChunkToR()
+    if &filetype == "rnoweb"
+        let begchk = "^<<.*>>=\$"
+        let endchk = "^@"
+        let chdchk = "^<<.*child *= *"
+    elseif &filetype == "rmd"
+        let begchk = "^[ \t]*```[ ]*{r"
+        let endchk = "^[ \t]*```$"
+        let chdchk = "^```.*child *= *"
+    elseif &filetype == "rrst"
+        let begchk = "^\\.\\. {r"
+        let endchk = "^\\.\\. \\.\\."
+        let chdchk = "^\.\. {r.*child *= *"
+    else
+        " Should never happen
+        call RWarningMsg('Strange filetype (SendFHChunkToR): "' . &filetype '"')
+    endif
+
+    let codelines = []
+    let here = line(".")
+    let curbuf = getline(1, "$")
+    let idx = 0
+    while idx < here
+        if curbuf[idx] =~ begchk
+            " Child R chunk
+            if curbuf[idx] =~ chdchk
+                " First run everything up to child chunk and reset buffer
+                call RSourceLines(codelines, "silent")
+                let codelines = []
+
+                " Next run child chunk and continue
+                call KnitChild(curbuf[idx], 'stay')
+                let idx += 1
+                " Regular R chunk
+            else
+                let idx += 1
+                while curbuf[idx] !~ endchk && idx < here
+                    let codelines += [curbuf[idx]]
+                    let idx += 1
+                endwhile
+            endif
+        else
+            let idx += 1
+        endif
+    endwhile
+    call RSourceLines(codelines, "silent")
+endfunction
+
+function KnitChild(line, godown)
+    let nline = substitute(a:line, '.*child *= *', "", "")
+    let cfile = substitute(nline, nline[0], "", "")
+    let cfile = substitute(cfile, nline[0] . '.*', "", "")
+    if filereadable(cfile)
+        let ok = g:SendCmdToR("require(knitr); knit('" . cfile . "', output=" . g:rplugin_null . ")")
+        if a:godown =~ "down"
+            call cursor(line(".")+1, 1)
+            call GoDown()
+        endif
+    else
+        call RWarningMsg("File not found: '" . cfile . "'")
+    endif
+endfunction
+
+" Send current line to R.
 function SendLineToR(godown)
-    echon
     let line = getline(".")
+    if strlen(line) == 0
+        if a:godown =~ "down"
+            call GoDown()
+        endif
+        return
+    endif
 
     if &filetype == "rnoweb"
         if line =~ "^@$"
@@ -962,8 +1455,45 @@ function SendLineToR(godown)
             endif
             return
         endif
-        if RnwIsInRCode() == 0
-            call RWarningMsg("Not inside a R code chunk.")
+        if line =~ "^<<.*child *= *"
+            call KnitChild(line, a:godown)
+            return
+        endif
+        if RnwIsInRCode(1) == 0
+            return
+        endif
+    endif
+
+    if &filetype == "rmd"
+        if line =~ "^```$"
+            if a:godown =~ "down"
+                call GoDown()
+            endif
+            return
+        endif
+        if line =~ "^```.*child *= *"
+            call KnitChild(line, a:godown)
+            return
+        endif
+        let line = substitute(line, "^(\\`\\`)\\?", "", "")
+        if RmdIsInRCode(1) == 0
+            return
+        endif
+    endif
+
+    if &filetype == "rrst"
+        if line =~ "^\.\. \.\.$"
+            if a:godown =~ "down"
+                call GoDown()
+            endif
+            return
+        endif
+        if line =~ "^\.\. {r.*child *= *"
+            call KnitChild(line, a:godown)
+            return
+        endif
+        let line = substitute(line, "^\\.\\. \\?", "", "")
+        if RrstIsInRCode(1) == 0
             return
         endif
     endif
@@ -972,17 +1502,23 @@ function SendLineToR(godown)
         if getline(1) =~ '^The topic'
             let topic = substitute(line, '.*::', '', "")
             let package = substitute(line, '::.*', '', "")
-            call ShowRDoc(topic, package)
+            call AskRDoc(topic, package, 1)
             return
         endif
-        if search("^Examples:$", "bncW") == 0
-            call RWarningMsg('Not in the "Examples" section.')
+        if RdocIsInRCode(1) == 0
             return
         endif
     endif
 
-    let b:needsnewomnilist = 1
-    let ok = SendCmdToR(line)
+    if &filetype == "rhelp" && RhelpIsInRCode(1) == 0
+        return
+    endif
+
+    if &filetype == "r"
+        let line = CleanOxygenLine(line)
+    endif
+
+    let ok = g:SendCmdToR(line)
     if ok
         if a:godown =~ "down"
             call GoDown()
@@ -994,19 +1530,37 @@ function SendLineToR(godown)
     endif
 endfunction
 
-" Clear the console screen
-function RClearConsole()
-    if has("gui_win32") && g:vimrplugin_conqueplugin == 0
-        exe s:py . " RClearConsolePy()"
-        silent exe '!start WScript "' . g:rplugin_jspath . '" "' . expand("%") . '"'
+function RSendPartOfLine(direction, correctpos)
+    let lin = getline(".")
+    let idx = col(".") - 1
+    if a:correctpos
+        call cursor(line("."), idx)
+    endif
+    if a:direction == "right"
+        let rcmd = strpart(lin, idx)
     else
-        call SendCmdToR("\014")
+        let rcmd = strpart(lin, 0, idx + 1)
+    endif
+    call g:SendCmdToR(rcmd)
+endfunction
+
+" Clear the console screen
+function RClearConsole(...)
+    if has("win32")
+        call ch_sendraw(g:rplugin_channel, "\006\n")
+        call foreground()
+    elseif !g:vimrplugin_applescript
+        call g:SendCmdToR("\014")
     endif
 endfunction
 
 " Remove all objects
 function RClearAll()
-    let ok = SendCmdToR("rm(list=ls())")
+    if g:vimrplugin_rmhidden
+        call g:SendCmdToR("rm(list=ls(all.names = TRUE))")
+    else
+        call g:SendCmdToR("rm(list=ls())")
+    endif
     sleep 500m
     call RClearConsole()
 endfunction
@@ -1014,154 +1568,90 @@ endfunction
 "Set working directory to the path of current buffer
 function RSetWD()
     let wdcmd = 'setwd("' . expand("%:p:h") . '")'
-    if has("gui_win32")
+    if has("win32") || has("win64")
         let wdcmd = substitute(wdcmd, "\\", "/", "g")
     endif
-    let ok = SendCmdToR(wdcmd)
-    if ok == 0
-        return
-    endif
-    echon
+    call g:SendCmdToR(wdcmd)
+    sleep 100m
 endfunction
 
-" Quit R
-function RQuit(how)
-    if a:how == "save"
-        call SendCmdToR('quit(save = "yes")')
-        sleep 1
-    else
-        call SendCmdToR('quit(save = "no")')
-        sleep 250m
-    endif
-    if g:vimrplugin_screenplugin && exists(':ScreenQuit')
-        ScreenQuit
-    elseif g:vimrplugin_conqueplugin
-        sleep 200m
-        exe "sil bdelete " . b:conque_bufname
-        unlet b:conque_bufname
-        unlet b:conqueshell
+function ClearRInfo()
+    if exists("g:rplugin_rconsole_pane")
+        unlet g:rplugin_rconsole_pane
     endif
 
-    if exists("g:rplugin_objbrtitle")
-        unlet g:rplugin_objbrtitle
-        if exists("g:rplugin_conqueshell")
-            unlet g:rplugin_conqueshell
-            unlet g:rplugin_conque_bufname
-        endif
+    call delete(g:rplugin_tmpdir . "/globenv_" . $VIMINSTANCEID)
+    call delete(g:rplugin_tmpdir . "/liblist_" . $VIMINSTANCEID)
+    call delete(g:rplugin_tmpdir . "/libnames_" . $VIMINSTANCEID)
+    call delete(g:rplugin_tmpdir . "/GlobalEnvList_" . $VIMINSTANCEID)
+    call delete(g:rplugin_tmpdir . "/vimcom_running_" . $VIMINSTANCEID)
+    call delete(g:rplugin_tmpdir . "/rconsole_hwnd_" . $VIMR_SECRET)
+    let g:SendCmdToR = function('SendCmdToR_fake')
+    let g:rplugin_r_pid = 0
+    let g:rplugin_vimcomport = 0
+
+    if g:rplugin_do_tmux_split && g:vimrplugin_tmux_title != "automatic" && g:vimrplugin_tmux_title != ""
+        call system("tmux set automatic-rename on")
     endif
 
     if bufloaded(b:objbrtitle)
         exe "bunload! " . b:objbrtitle
+        sleep 30m
     endif
-    echon
 endfunction
 
-" Tell R to create a list of objects file listing all currently available
-" objects in its environment. The file is necessary for omni completion.
-function BuildROmniList(env, what)
-    if a:env =~ "GlobalEnv"
-        let rtf = g:rplugin_globalenvfname
-        let b:needsnewomnilist = 0
+" Quit R
+function RQuit(how)
+    if exists("b:quit_command")
+        let qcmd = b:quit_command
     else
-        let rtf = g:rplugin_omnifname
-    endif
-    let lockfile = rtf . ".locked"
-    call writefile(["Wait!"], lockfile)
-    let omnilistcmd = 'source("' . g:rplugin_home . '/r-plugin/build_omniList.R") ; .vim.bol("' . rtf . '"'
-    if a:env == "libraries" && a:what == "installed"
-        let omnilistcmd = omnilistcmd . ', what = "installed"'
+        if a:how == "save"
+            let qcmd = 'quit(save = "yes")'
+        else
+            let qcmd = 'quit(save = "no")'
+        endif
     endif
-    if g:vimrplugin_allnames == 1
-        let omnilistcmd = omnilistcmd . ', allnames = TRUE'
+
+    if g:vimrplugin_save_win_pos
+        " SaveWinPos
+        call ch_sendraw(g:rplugin_channel, "\004" . $VIMR_COMPLDIR . "\n")
     endif
-    let omnilistcmd = omnilistcmd . ')'
-    let ok = SendCmdToR(omnilistcmd)
-    if ok == 0
-        return
+
+    call g:SendCmdToR(qcmd)
+    if g:rplugin_do_tmux_split && a:how == "save"
+        sleep 200m
     endif
 
-    " Wait while R is writing the list of objects into the file
     sleep 50m
-    let i = 0 
-    let s = 0
-    while filereadable(lockfile)
-        let s = s + 1
-        if s == 4 && a:env !~ "GlobalEnv"
-            let s = 0
-            let i = i + 1
-            let k = g:vimrplugin_buildwait - i
-            let themsg = "\rPlease, wait! [" . i . ":" . k . "]"
-            echon themsg
-        endif
-        sleep 250m
-        if i == g:vimrplugin_buildwait
-            call delete(lockfile)
-            call RWarningMsg("No longer waiting. See  :h vimrplugin_buildwait  for details.")
-            return
-        endif
-    endwhile
-
-    if a:env == "GlobalEnv"
-        let g:rplugin_globalenvlines = readfile(g:rplugin_globalenvfname)
-    endif
-    if i > 2
-        echon "\rFinished in " . i . " seconds."
-    endif
-endfunction
-
-function RBuildSyntaxFile(what)
-    call BuildROmniList("libraries", a:what)
-    sleep 1
-    let g:rplugin_liblist = readfile(g:rplugin_omnifname)
-    let res = []
-    let nf = 0
-    let funlist = ""
-    for line in g:rplugin_liblist
-        let obj = split(line, ";")
-        if obj[2] == "function"
-            if obj[0] !~ '[[:punct:]]' || (obj[0] =~ '\.[a-zA-Z]' && obj[0] !~ '[[:punct:]][[:punct:]]')
-                let nf += 1
-                let funlist = funlist . " " . obj[0]
-                if nf == 7
-                    let line = "syn keyword rFunction " . funlist
-                    call add(res, line)
-                    let nf = 0
-                    let funlist = ""
-                endif
-            endif
-        endif
-    endfor
-    if nf > 0
-        let line = "syn keyword rFunction " . funlist
-        call add(res, line)
+    if g:rplugin_do_tmux_split
+        call CloseExternalOB()
     endif
-    call writefile(res, g:rplugin_uservimfiles . "/r-plugin/functions.vim")
-    if &filetype == "rbrowser"
-        let savesb = &switchbuf
-        set switchbuf=useopen,usetab
-        exe "sb " . b:rscript_buffer
-        unlet b:current_syntax
-        exe "runtime syntax/r.vim"
-        exe "sb " . b:objbrtitle
-        exe "set switchbuf=" . savesb
-        if g:rplugin_curview == "libraries"
-            unlet b:libdict
-            call RBrowserShowLibs(0)
-        endif
+    call ClearRInfo()
+endfunction
+
+" knit the current buffer content
+function RKnit()
+    update
+    if has("win32") || has("win64")
+        call g:SendCmdToR('require(knitr); .vim_oldwd <- getwd(); setwd("' . substitute(expand("%:p:h"), '\\', '/', 'g') . '"); knit("' . expand("%:t") . '"); setwd(.vim_oldwd); rm(.vim_oldwd)')
     else
-        unlet b:current_syntax
-        exe "runtime syntax/r.vim"
+        call g:SendCmdToR('require(knitr); .vim_oldwd <- getwd(); setwd("' . expand("%:p:h") . '"); knit("' . expand("%:t") . '"); setwd(.vim_oldwd); rm(.vim_oldwd)')
     endif
 endfunction
 
-function SetRTextWidth()
-    if !bufloaded(s:rdoctitle) || g:vimrplugin_newsize == 1
-        " Bug fix for Vim < 7.2.318
-        if !has("gui_win32")
-            let curlang = v:lang
-            language C
+function SetRTextWidth(rkeyword)
+    if g:vimrplugin_vimpager == "tabnew"
+        let s:rdoctitle = a:rkeyword . "\\ (help)"
+    else
+        let s:tnr = tabpagenr()
+        if g:vimrplugin_vimpager != "tab" && s:tnr > 1
+            let s:rdoctitle = "R_doc" . s:tnr
+        else
+            let s:rdoctitle = "R_doc"
         endif
-
+        unlet s:tnr
+    endif
+    if !bufloaded(s:rdoctitle) || g:vimrplugin_newsize == 1
         let g:vimrplugin_newsize = 0
 
         " s:vimpager is used to calculate the width of the R help documentation
@@ -1169,26 +1659,24 @@ function SetRTextWidth()
         let s:vimpager = g:vimrplugin_vimpager
 
         let wwidth = winwidth(0)
-        if wwidth <= (g:vimrplugin_help_w + g:vimrplugin_editor_w)
-            let s:vimpager = "horizontal"
-        endif
 
-        if g:vimrplugin_vimpager == "tab" || g:vimrplugin_vimpager == "tabnew"
+        " Not enough room to split vertically
+        if g:vimrplugin_vimpager == "vertical" && wwidth <= (g:vimrplugin_help_w + g:vimrplugin_editor_w)
             let s:vimpager = "horizontal"
         endif
 
-        if s:vimpager != "vertical"
-            "Default help_text_width:
+        if s:vimpager == "horizontal"
+            " Use the window width (at most 80 columns)
+            let htwf = (wwidth > 80) ? 88.1 : ((wwidth - 1) / 0.9)
+        elseif g:vimrplugin_vimpager == "tab" || g:vimrplugin_vimpager == "tabnew"
+            let wwidth = &columns
             let htwf = (wwidth > 80) ? 88.1 : ((wwidth - 1) / 0.9)
         else
-            " Not enough room to split vertically
-
             let min_e = (g:vimrplugin_editor_w > 80) ? g:vimrplugin_editor_w : 80
             let min_h = (g:vimrplugin_help_w > 73) ? g:vimrplugin_help_w : 73
 
             if wwidth > (min_e + min_h)
-                " The editor window is large enough to be splitted as either >80+73 or
-                " the user defined minimum values
+                " The editor window is large enough to be split
                 let s:hwidth = min_h
             elseif wwidth > (min_e + g:vimrplugin_help_w)
                 " The help window must have less than min_h columns
@@ -1201,25 +1689,23 @@ function SetRTextWidth()
         endif
         let htw = printf("%f", htwf)
         let g:rplugin_htw = substitute(htw, "\\..*", "", "")
-        if !has("gui_win32")
-            exe "language " . curlang
-        endif
+        let g:rplugin_htw = g:rplugin_htw - (&number || &relativenumber) * &numberwidth
     endif
 endfunction
 
-function RGetClassFor(rkeyword)
-    let classfor = ""
+function RGetFirstObjClass(rkeyword)
+    let firstobj = ""
     let line = substitute(getline("."), '#.*', '', "")
     let begin = col(".")
     if strlen(line) > begin
         let piece = strpart(line, begin)
-        while piece !~ '^' . a:rkeyword
+        while piece !~ '^' . a:rkeyword && begin >= 0
             let begin -= 1
             let piece = strpart(line, begin)
         endwhile
         let line = piece
         if line !~ '^\k*\s*('
-            return classfor
+            return firstobj
         endif
         let begin = 1
         let linelen = strlen(line)
@@ -1229,7 +1715,7 @@ function RGetClassFor(rkeyword)
         let begin += 1
         let line = strpart(line, begin)
         let line = substitute(line, '^\s*', '', "")
-        if line =~ '^\k*\s*(' || line =~ '^\k*\s*=\s*\k*\s*('
+        if (line =~ '^\k*\s*(' || line =~ '^\k*\s*=\s*\k*\s*(') && line !~ '[.*('
             let idx = 0
             while line[idx] != '('
                 let idx += 1
@@ -1253,174 +1739,428 @@ function RGetClassFor(rkeyword)
                     let len = strlen(line)
                 endif
             endwhile
-            let classfor = strpart(line, 0, idx)
+            let firstobj = strpart(line, 0, idx)
+        elseif line =~ '^\(\k\|\$\)*\s*[' || line =~ '^\(k\|\$\)*\s*=\s*\(\k\|\$\)*\s*[.*('
+            let idx = 0
+            while line[idx] != '['
+                let idx += 1
+            endwhile
+            let idx += 1
+            let nparen = 1
+            let len = strlen(line)
+            let lnum = line(".")
+            while nparen != 0
+                if line[idx] == '['
+                    let nparen += 1
+                else
+                    if line[idx] == ']'
+                        let nparen -= 1
+                    endif
+                endif
+                let idx += 1
+                if idx == len
+                    let lnum += 1
+                    let line = line . substitute(getline(lnum), '#.*', '', "")
+                    let len = strlen(line)
+                endif
+            endwhile
+            let firstobj = strpart(line, 0, idx)
         else
-            let classfor = substitute(line, ').*', '', "")
-            let classfor = substitute(classfor, ',.*', '', "")
-            let classfor = substitute(classfor, ' .*', '', "")
+            let firstobj = substitute(line, ').*', '', "")
+            let firstobj = substitute(firstobj, ',.*', '', "")
+            let firstobj = substitute(firstobj, ' .*', '', "")
+        endif
+    endif
+
+    " Fix some problems
+    if firstobj =~ '^"' && firstobj !~ '"$'
+        let firstobj = firstobj . '"'
+    elseif firstobj =~ "^'" && firstobj !~ "'$"
+        let firstobj = firstobj . "'"
+    endif
+    if firstobj =~ "^'" && firstobj =~ "'$"
+        let firstobj = substitute(firstobj, "^'", '"', "")
+        let firstobj = substitute(firstobj, "'$", '"', "")
+    endif
+    if firstobj =~ '='
+        let firstobj = "eval(expression(" . firstobj . "))"
+    endif
+
+    let objclass = ""
+    call SendToVimCom("\x08" . $VIMINSTANCEID . "vimcom:::vim.getclass(" . firstobj . ")")
+    if g:rplugin_vimcomport > 0
+        let g:rplugin_lastev = ReadEvalReply()
+        if g:rplugin_lastev !~ "^R error: "
+            let objclass = '"' . g:rplugin_lastev . '"'
         endif
     endif
-    return classfor
+
+    return objclass
 endfunction
 
 " Show R's help doc in Vim's buffer
 " (based  on pydoc plugin)
-function ShowRDoc(rkeyword, package)
+function AskRDoc(rkeyword, package, getclass)
     if filewritable(g:rplugin_docfile)
         call delete(g:rplugin_docfile)
     endif
 
-    let classfor = ""
+    let objclass = ""
     if bufname("%") =~ "Object_Browser"
         let savesb = &switchbuf
         set switchbuf=useopen,usetab
         exe "sb " . b:rscript_buffer
         exe "set switchbuf=" . savesb
     else
-        if a:package == ""
-            let classfor = RGetClassFor(a:rkeyword)
+        if a:getclass
+            let objclass = RGetFirstObjClass(a:rkeyword)
         endif
     endif
 
-    if classfor =~ '='
-        let classfor = "eval(expression(" . classfor . "))"
+    call SetRTextWidth(a:rkeyword)
+
+    if objclass == "" && a:package == ""
+        let rcmd = 'vimcom:::vim.help("' . a:rkeyword . '", ' . g:rplugin_htw . 'L)'
+    elseif a:package != ""
+        let rcmd = 'vimcom:::vim.help("' . a:rkeyword . '", ' . g:rplugin_htw . 'L, package="' . a:package  . '")'
+    else
+        let rcmd = 'vimcom:::vim.help("' . a:rkeyword . '", ' . g:rplugin_htw . 'L, ' . objclass . ')'
     endif
 
-    if g:vimrplugin_vimpager == "tabnew"
-        let s:rdoctitle = a:rkeyword . "\\ (help)" 
+    call SendToVimCom("\x08" . $VIMINSTANCEID . rcmd)
+endfunction
+
+" This function is called by vimcom
+function ShowRDoc(rkeyword)
+    let rkeyw = a:rkeyword
+    if a:rkeyword =~ "^MULTILIB"
+        let msgs = split(a:rkeyword)
+        " Vim cannot receive message from vimcom before replying to this message
+        let flines = ['',
+                    \ 'The topic "' . msgs[-1] . '" was found in more than one library.',
+                    \ 'Press  over one of them to see the R documentation:',
+                    \ '']
+        for idx in range(1, len(msgs) - 2)
+            let flines += [ '   ' . msgs[idx] ]
+        endfor
+        call writefile(flines, g:rplugin_docfile)
+        let rkeyw = msgs[-1]
+    endif
+
+    " If the help command was triggered in the R Console, jump to Vim pane
+    if g:rplugin_do_tmux_split && !g:rplugin_running_rhelp
+        let slog = system("tmux select-pane -t " . g:rplugin_vim_pane)
+        if v:shell_error
+            call RWarningMsg(slog)
+        endif
+    endif
+    let g:rplugin_running_rhelp = 0
+
+    if bufname("%") =~ "Object_Browser"
+        let savesb = &switchbuf
+        set switchbuf=useopen,usetab
+        exe "sb " . b:rscript_buffer
+        exe "set switchbuf=" . savesb
+    endif
+    call SetRTextWidth(rkeyw)
+
+    " Local variables that must be inherited by the rdoc buffer
+    let g:tmp_tmuxsname = g:rplugin_tmuxsname
+    let g:tmp_objbrtitle = b:objbrtitle
+
+    let rdoccaption = substitute(s:rdoctitle, '\', '', "g")
+    if a:rkeyword =~ "R History"
+        let rdoccaption = "R_History"
+        let s:rdoctitle = "R_History"
+    endif
+    if bufloaded(rdoccaption)
+        let curtabnr = tabpagenr()
+        let savesb = &switchbuf
+        set switchbuf=useopen,usetab
+        exe "sb ". s:rdoctitle
+        exe "set switchbuf=" . savesb
+        if g:vimrplugin_vimpager == "tabnew"
+            exe "tabmove " . curtabnr
+        endif
     else
-        let s:tnr = tabpagenr()
-        if g:vimrplugin_vimpager != "tab" && s:tnr > 1
-            let s:rdoctitle = "R_doc" . s:tnr
+        if g:vimrplugin_vimpager == "tab" || g:vimrplugin_vimpager == "tabnew"
+            exe 'tabnew ' . s:rdoctitle
+        elseif s:vimpager == "vertical"
+            let l:sr = &splitright
+            set splitright
+            exe s:hwidth . 'vsplit ' . s:rdoctitle
+            let &splitright = l:sr
+        elseif s:vimpager == "horizontal"
+            exe 'split ' . s:rdoctitle
+            if winheight(0) < 20
+                resize 20
+            endif
         else
-            let s:rdoctitle = "R_doc"
+            echohl WarningMsg
+            echomsg 'Invalid vimrplugin_vimpager value: "' . g:vimrplugin_vimpager . '". Valid values are: "tab", "vertical", "horizontal", "tabnew" and "no".'
+            echohl Normal
+            return
         endif
-        unlet s:tnr
     endif
 
-    call SetRTextWidth()
+    setlocal modifiable
+    let g:rplugin_curbuf = bufname("%")
 
-    call writefile(['Wait...'], g:rplugin_docfile . "lock")
-    if classfor == ""
-        if a:package == ""
-            call SendCmdToR("source('" . g:rplugin_home . "/r-plugin/vimhelp.R') ; .vim.help('" . a:rkeyword . "', " . g:rplugin_htw . "L)")
+    " Inheritance of local variables from the script buffer
+    let b:objbrtitle = g:tmp_objbrtitle
+    let g:rplugin_tmuxsname = g:tmp_tmuxsname
+    unlet g:tmp_objbrtitle
+    unlet g:tmp_tmuxsname
+
+    let save_unnamed_reg = @@
+    sil normal! ggdG
+    let fcntt = readfile(g:rplugin_docfile)
+    call setline(1, fcntt)
+    if a:rkeyword =~ "R History"
+        set filetype=r
+        call cursor(1, 1)
+    elseif a:rkeyword =~ "^MULTILIB"
+        syn match Special ''
+        exe 'syn match String /"' . rkeyw . '"/'
+        for idx in range(1, len(msgs) - 2)
+            exe "syn match PreProc '^   " . msgs[idx] . "'"
+        endfor
+        exe 'nmap   :call AskRDoc("' . rkeyw . '", expand(""), 0)'
+        redraw
+        call cursor(5, 4)
+    else
+        set filetype=rdoc
+        call cursor(1, 1)
+    endif
+    let @@ = save_unnamed_reg
+    setlocal nomodified
+    redraw
+    stopinsert
+endfunction
+
+function ROpenPDF(path)
+    if a:path == "Get Master"
+        let tmpvar = SyncTeX_GetMaster()
+        let pdfpath = tmpvar[1] . '/' . tmpvar[0] . '.pdf'
+    else
+        let pdfpath = a:path
+    endif
+    let basenm = substitute(substitute(pdfpath, '.*/', '', ''), '\.pdf$', '', '')
+
+    let olddir = getcwd()
+    if olddir != expand("%:p:h")
+        exe "cd " . substitute(expand("%:p:h"), ' ', '\\ ', 'g')
+    endif
+
+    if !filereadable(basenm . ".pdf")
+        call RWarningMsg('File not found: "' . basenm . '.pdf".')
+        exe "cd " . substitute(olddir, ' ', '\\ ', 'g')
+        return
+    endif
+    if g:rplugin_pdfviewer == "none"
+        call RWarningMsg("Could not find a PDF viewer, and vimrplugin_pdfviewer is not defined.")
+    else
+        if g:rplugin_pdfviewer == "okular"
+            let pcmd = "okular --unique '" .  pdfpath . "' 2>/dev/null >/dev/null &"
+            call system(pcmd)
+        elseif g:rplugin_pdfviewer == "zathura"
+            if system("wmctrl -xl") =~ 'Zathura.*' . basenm . '.pdf' && g:rplugin_zathura_pid[basenm] != 0
+                call system("wmctrl -a '" . basenm . ".pdf'")
+            else
+                let g:rplugin_zathura_pid[basenm] = 0
+                call RStart_Zathura(basenm)
+            endif
+            exe "cd " . substitute(olddir, ' ', '\\ ', 'g')
+            return
+        elseif g:rplugin_pdfviewer == "sumatra" && (g:rplugin_sumatra_path != "" || FindSumatra())
+            silent exe '!start "' . g:rplugin_sumatra_path . '" -reuse-instance -inverse-search "vclientserver.exe ' . "\\%f \\%l" . '" "' . basenm . '.pdf"'
+            exe "cd " . substitute(olddir, ' ', '\\ ', 'g')
+            return
+        elseif g:rplugin_pdfviewer == "skim"
+            call system(g:macvim_skim_app_path . '/Contents/MacOS/Skim "' . basenm . '.pdf" 2> /dev/null >/dev/null &')
         else
-            call SendCmdToR("source('" . g:rplugin_home . "/r-plugin/vimhelp.R') ; .vim.help('" . a:rkeyword . "', " . g:rplugin_htw . "L, package = '" . a:package . "')")
+            let pcmd = g:rplugin_pdfviewer . " '" . pdfpath . "' 2>/dev/null >/dev/null &"
+            call system(pcmd)
+        endif
+        if g:rplugin_has_wmctrl
+            call system("wmctrl -a '" . basenm . ".pdf'")
         endif
+    endif
+    exe "cd " . substitute(olddir, ' ', '\\ ', 'g')
+endfunction
+
+function RStart_Zathura(basenm)
+    let a2 = 'a2 = "vclientserver ' . "'%{input}' %{line}" . '"'
+    let pycode = ["# -*- coding: " . &encoding . " -*-",
+                \ "import subprocess",
+                \ "import os",
+                \ "import sys",
+                \ "FNULL = open(os.devnull, 'w')",
+                \ "a1 = '--synctex-editor-command'",
+                \ a2,
+                \ "a3 = '" . a:basenm . ".pdf'",
+                \ "zpid = subprocess.Popen(['zathura', a1, a2, a3], stdout = FNULL, stderr = FNULL).pid",
+                \ "sys.stdout.write(str(zpid))" ]
+    call writefile(pycode, g:rplugin_tmpdir . "/start_zathura.py")
+    let pid = system("python '" . g:rplugin_tmpdir . "/start_zathura.py" . "'")
+    if pid == 0
+        call RWarningMsg("Failed to run Zathura: " . substitute(pid, "\n", " ", "g"))
     else
-        call SendCmdToR("source('" . g:rplugin_home . "/r-plugin/vimhelp.R') ; .vim.help('" . a:rkeyword . "', " . g:rplugin_htw . "L, " . classfor . ")")
+        let g:rplugin_zathura_pid[a:basenm] = pid
     endif
-    sleep 50m
+    call delete(g:rplugin_tmpdir . "/start_zathura.py")
+endfunction
 
-    let i = 0
-    while filereadable(g:rplugin_docfile . "lock") && i < 40
-        sleep 50m
-        let i += 1
-    endwhile
-    if i == 40
-        echohl WarningMsg
-        echomsg "Waited too much time..."
-        echohl Normal
-        return
+function RSetPDFViewer()
+    if exists("g:vimrplugin_pdfviewer") && g:vimrplugin_pdfviewer != "none"
+        let g:rplugin_pdfviewer = tolower(g:vimrplugin_pdfviewer)
+    else
+        " Try to guess what PDF viewer is used:
+        if has("win32") || has("win64")
+            let g:rplugin_pdfviewer = "sumatra"
+        elseif g:rplugin_is_darwin
+            let g:rplugin_pdfviewer = "skim"
+        elseif executable("zathura")
+            let g:rplugin_pdfviewer = "zathura"
+        elseif executable("evince")
+            let g:rplugin_pdfviewer = "evince"
+        elseif executable("okular")
+            let g:rplugin_pdfviewer = "okular"
+        else
+            let g:rplugin_pdfviewer = "none"
+            if $R_PDFVIEWER == ""
+                let pdfvl = ["xdg-open"]
+            else
+                let pdfvl = [$R_PDFVIEWER, "xdg-open"]
+            endif
+            " List from R configure script:
+            let pdfvl += ["xpdf", "gv", "gnome-gv", "ggv", "kpdf", "gpdf", "kghostview,", "acroread", "acroread4"]
+            for prog in pdfvl
+                if executable(prog)
+                    let g:rplugin_pdfviewer = prog
+                    break
+                endif
+            endfor
+        endif
+    endif
+
+    if executable("wmctrl")
+        let g:rplugin_has_wmctrl = 1
+    else
+        let g:rplugin_has_wmctrl = 0
+    endif
+
+    if g:rplugin_pdfviewer == "zathura"
+        if g:rplugin_has_wmctrl == 0
+            let g:rplugin_pdfviewer = "none"
+            call RWarningMsgInp("The application wmctrl must be installed to use Zathura as PDF viewer.")
+        else
+            if executable("dbus-send")
+                let g:rplugin_has_dbussend = 1
+            else
+                let g:rplugin_has_dbussend = 0
+            endif
+        endif
+    endif
+endfunction
+
+function RSourceDirectory(...)
+    if has("win32") || has("win64")
+        let dir = substitute(a:1, '\\', '/', "g")
+    else
+        let dir = a:1
+    endif
+    if dir == ""
+        call g:SendCmdToR("vim.srcdir()")
+    else
+        call g:SendCmdToR("vim.srcdir('" . dir . "')")
     endif
+endfunction
 
-    " Local variables that must be inherited by the rdoc buffer
-    let g:tmp_screensname = b:screensname
-    let g:tmp_objbrtitle = b:objbrtitle
-    if g:vimrplugin_conqueplugin == 1
-        let g:tmp_conqueshell = b:conqueshell
-        let g:tmp_conque_bufname = b:conque_bufname
+function RAskHelp(...)
+    if a:1 == ""
+        call g:SendCmdToR("help.start()")
+        return
     endif
-
-    let rdoccaption = substitute(s:rdoctitle, '\', '', "g")
-    if bufloaded(rdoccaption)
-        let curtabnr = tabpagenr()
-        let savesb = &switchbuf
-        set switchbuf=useopen,usetab
-        exe "sb ". s:rdoctitle
-        exe "set switchbuf=" . savesb
-        if g:vimrplugin_vimpager == "tabnew"
-            exe "tabmove " . curtabnr
-        endif
+    if g:vimrplugin_vimpager != "no"
+        call AskRDoc(a:1, "", 0)
     else
-        if g:vimrplugin_vimpager == "tab" || g:vimrplugin_vimpager == "tabnew"
-            exe 'tabnew ' . s:rdoctitle
-        elseif s:vimpager == "vertical"
-            let l:sr = &splitright
-            set splitright
-            exe s:hwidth . 'vsplit ' . s:rdoctitle
-            let &splitright = l:sr
-        elseif s:vimpager == "horizontal"
-            exe 'split ' . s:rdoctitle
-            if winheight(0) < 20
-                resize 20
+        call g:SendCmdToR("help(" . a:1. ")")
+    endif
+endfunction
+
+function DisplayArgs()
+    if &filetype == "r" || b:IsInRCode(0)
+        let rkeyword = RGetKeyWord()
+        let s:sttl_str = g:rplugin_status_line
+        let fargs = "Not a function"
+        for omniL in g:rplugin_omni_lines
+            if omniL =~ '^' . rkeyword . "\x06"
+                let tmp = split(omniL, "\x06")
+                if len(tmp) < 5
+                    break
+                else
+                    let fargs = rkeyword . '(' . tmp[4] . ')'
+                endif
             endif
-        else
-            echohl WarningMsg
-            echomsg "Invalid vimrplugin_vimpager value: '" . g:vimrplugin_vimpager . "'"
-            echohl Normal
-            return
+        endfor
+        if fargs !~ "Not a function"
+            let fargs = substitute(fargs, "NO_ARGS", '', 'g')
+            let fargs = substitute(fargs, "\x07", '=', 'g')
+            let s:sttl_str = substitute(fargs, "\x09", ', ', 'g')
+            silent set statusline=%!RArgsStatusLine()
         endif
     endif
+    exe "normal! a("
+endfunction
 
-    set filetype=rdoc
-    setlocal modifiable
-    let g:rplugin_curbuf = bufname("%")
+function RArgsStatusLine()
+    return s:sttl_str
+endfunction
 
-    " Inheritance of local variables from the script buffer
-    let b:objbrtitle = g:tmp_objbrtitle
-    let b:screensname = g:tmp_screensname
-    unlet g:tmp_objbrtitle
-    if g:vimrplugin_conqueplugin == 1
-        let b:conqueshell = g:tmp_conqueshell
-        let b:conque_bufname = g:tmp_conque_bufname
-        unlet g:tmp_conqueshell
-        unlet g:tmp_conque_bufname
-    endif
-
-    normal! ggdG
-    exe "read " . g:rplugin_docfile
-    let lnr = line("$")
-    for i in range(1, lnr)
-        call setline(i, substitute(getline(i), "_\010", "", "g"))
-    endfor
-    let has_ex = search("^Examples:$")
-    if has_ex
-        let lnr = line("$") + 1
-        call setline(lnr, '###')
-    endif
-    normal! ggdd
-    setlocal nomodified
-    setlocal nomodifiable
+function RestoreStatusLine()
+    exe 'set statusline=' . substitute(g:rplugin_status_line, ' ', '\\ ', 'g')
+    normal! a)
 endfunction
 
 function PrintRObject(rkeyword)
     if bufname("%") =~ "Object_Browser"
-        let classfor = ""
+        let objclass = ""
     else
-        let classfor = RGetClassFor(a:rkeyword)
+        let objclass = RGetFirstObjClass(a:rkeyword)
     endif
-    if classfor == ""
-        call SendCmdToR("print(" . a:rkeyword . ")")
+    if objclass == ""
+        call g:SendCmdToR("print(" . a:rkeyword . ")")
     else
-        call SendCmdToR("source('" . g:rplugin_home . "/r-plugin/vimprint.R') ; .vim.print('" . a:rkeyword . "', " . classfor . ")")
+        call g:SendCmdToR('vim.print("' . a:rkeyword . '", ' . objclass . ")")
     endif
 endfunction
 
 " Call R functions for the word under cursor
 function RAction(rcmd)
-    echon
     if &filetype == "rbrowser"
-        let rkeyword = RBrowserGetName(1)
+        let rkeyword = RBrowserGetName(1, 0)
     else
         let rkeyword = RGetKeyWord()
     endif
     if strlen(rkeyword) > 0
         if a:rcmd == "help"
-            if g:vimrplugin_vimpager != "no"
-                call ShowRDoc(rkeyword, "")
+            if g:vimrplugin_vimpager == "no"
+                call g:SendCmdToR("help(" . rkeyword . ")")
             else
-                call SendCmdToR("help(" . rkeyword . ")")
+                if !b:rplugin_extern_ob
+                    let g:rplugin_running_rhelp = 1
+                endif
+                if bufname("%") =~ "Object_Browser" || b:rplugin_extern_ob
+                    if g:rplugin_curview == "libraries"
+                        let pkg = RBGetPkgName()
+                    else
+                        let pkg = ""
+                    endif
+                    call AskRDoc(rkeyword, pkg, 0)
+                    return
+                endif
+                call AskRDoc(rkeyword, "", 1)
             endif
             return
         endif
@@ -1429,26 +2169,42 @@ function RAction(rcmd)
             return
         endif
         let rfun = a:rcmd
-        if a:rcmd == "args" && g:vimrplugin_listmethods == 1
-            let rfun = "source('" . g:rplugin_home . "/r-plugin/specialfuns.R') ; .vim.list.args"
+        if a:rcmd == "args"
+            if g:vimrplugin_listmethods == 1
+                call g:SendCmdToR('vim.list.args("' . rkeyword . '")')
+            else
+                call g:SendCmdToR('args("' . rkeyword . '")')
+            endif
+            return
         endif
         if a:rcmd == "plot" && g:vimrplugin_specialplot == 1
-            let rfun = "source('" . g:rplugin_home . "/r-plugin/specialfuns.R') ; .vim.plot"
+            let rfun = "vim.plot"
         endif
-        let raction = rfun . "(" . rkeyword . ")"
-        let ok = SendCmdToR(raction)
-        if ok == 0
+        if a:rcmd == "plotsumm"
+            if g:vimrplugin_specialplot == 1
+                let raction = "vim.plot(" . rkeyword . "); summary(" . rkeyword . ")"
+            else
+                let raction = "plot(" . rkeyword . "); summary(" . rkeyword . ")"
+            endif
+            call g:SendCmdToR(raction)
+            return
+        endif
+        if a:rcmd == "viewdf"
+            if exists("g:vimrplugin_df_viewer")
+                call g:SendCmdToR(printf(g:vimrplugin_df_viewer, rkeyword))
+            else
+                echo "Wait..."
+                call delete(g:rplugin_tmpdir . "/Rinsert")
+                call SendToVimCom("\x08" . $VIMINSTANCEID . 'vimcom:::vim_viewdf("' . rkeyword . '")')
+            endif
             return
         endif
+
+        let raction = rfun . "(" . rkeyword . ")"
+        call g:SendCmdToR(raction)
     endif
 endfunction
 
-if exists('g:maplocalleader')
-    let s:tll = '' . g:maplocalleader
-else
-    let s:tll = '\\'
-endif
-
 redir => s:ikblist
 silent imap
 redir END
@@ -1515,84 +2271,19 @@ function RVMapCmd(plug)
     endfor
 endfunction
 
-function RCreateMenuItem(type, label, plug, combo, target)
-    if a:type =~ '0'
-        let tg = a:target . '0'
-        let il = 'i'
-    else
-        let tg = a:target . ''
-        let il = 'a'
-    endif
-    if a:type =~ "n"
-        if hasmapto(a:plug, "n")
-            let boundkey = RNMapCmd(a:plug)
-            exec 'nmenu &R.' . a:label . '' . boundkey . ' ' . tg
-        else
-            exec 'nmenu &R.' . a:label . s:tll . a:combo . ' ' . tg
-        endif
-    endif
-    if a:type =~ "v"
-        if hasmapto(a:plug, "v")
-            let boundkey = RVMapCmd(a:plug)
-            exec 'vmenu &R.' . a:label . '' . boundkey . ' ' . '' . tg
-        else
-            exec 'vmenu &R.' . a:label . s:tll . a:combo . ' ' . '' . tg
-        endif
-    endif
-    if a:type =~ "i"
-        if hasmapto(a:plug, "i")
-            let boundkey = RIMapCmd(a:plug)
-            exec 'imenu &R.' . a:label . '' . boundkey . ' ' . '' . tg . il
-        else
-            exec 'imenu &R.' . a:label . s:tll . a:combo . ' ' . '' . tg . il
-        endif
-    endif
-endfunction
-
-function RBrowserMenu()
-    call RCreateMenuItem("nvi", 'Object\ browser.Show/Update', 'RUpdateObjBrowser', 'ro', ':call RObjBrowser()')
-    call RCreateMenuItem("nvi", 'Object\ browser.Expand\ (all\ lists)', 'ROpenLists', 'r=', ':call RBrowserOpenCloseLists(1)')
-    call RCreateMenuItem("nvi", 'Object\ browser.Collapse\ (all\ lists)', 'RCloseLists', 'r-', ':call RBrowserOpenCloseLists(0)')
-    if &filetype == "rbrowser"
-        imenu R.Object\ browser.Toggle\ (cur)Enter :call RBrowserDoubleClick()
-        nmenu R.Object\ browser.Toggle\ (cur)Enter :call RBrowserDoubleClick()
-    endif
-endfunction
-
-function RControlMenu()
-    call RCreateMenuItem("nvi", 'Command.List\ space', 'RListSpace', 'rl', ':call SendCmdToR("ls()")')
-    call RCreateMenuItem("nvi", 'Command.Clear\ console\ screen', 'RClearConsole', 'rr', ':call RClearConsole()')
-    call RCreateMenuItem("nvi", 'Command.Clear\ all', 'RClearAll', 'rm', ':call RClearAll()')
-    "-------------------------------
-    menu R.Command.-Sep1- 
-    call RCreateMenuItem("nvi", 'Command.Print\ (cur)', 'RObjectPr', 'rp', ':call RAction("print")')
-    call RCreateMenuItem("nvi", 'Command.Names\ (cur)', 'RObjectNames', 'rn', ':call RAction("names")')
-    call RCreateMenuItem("nvi", 'Command.Structure\ (cur)', 'RObjectStr', 'rt', ':call RAction("str")')
-    "-------------------------------
-    menu R.Command.-Sep2- 
-    call RCreateMenuItem("nvi", 'Command.Arguments\ (cur)', 'RShowArgs', 'ra', ':call RAction("args")')
-    call RCreateMenuItem("nvi", 'Command.Example\ (cur)', 'RShowEx', 're', ':call RAction("example")')
-    call RCreateMenuItem("nvi", 'Command.Help\ (cur)', 'RHelp', 'rh', ':call RAction("help")')
-    "-------------------------------
-    menu R.Command.-Sep3- 
-    call RCreateMenuItem("nvi", 'Command.Summary\ (cur)', 'RSummary', 'rs', ':call RAction("summary")')
-    call RCreateMenuItem("nvi", 'Command.Plot\ (cur)', 'RPlot', 'rg', ':call RAction("plot")')
-    call RCreateMenuItem("nvi", 'Command.Plot\ and\ summary\ (cur)', 'RSPlot', 'rb', ':call RAction("plot"):call RAction("summary")')
-    let g:rplugin_hasmenu = 1
-endfunction
-
 function RControlMaps()
     " List space, clear console, clear all
     "-------------------------------------
-    call RCreateMaps("nvi", 'RListSpace',    'rl', ':call SendCmdToR("ls()"):echon')
+    call RCreateMaps("nvi", 'RListSpace',    'rl', ':call g:SendCmdToR("ls()")')
     call RCreateMaps("nvi", 'RClearConsole', 'rr', ':call RClearConsole()')
     call RCreateMaps("nvi", 'RClearAll',     'rm', ':call RClearAll()')
 
     " Print, names, structure
     "-------------------------------------
     call RCreateMaps("nvi", 'RObjectPr',     'rp', ':call RAction("print")')
-    call RCreateMaps("nvi", 'RObjectNames',  'rn', ':call RAction("names")')
+    call RCreateMaps("nvi", 'RObjectNames',  'rn', ':call RAction("vim.names")')
     call RCreateMaps("nvi", 'RObjectStr',    'rt', ':call RAction("str")')
+    call RCreateMaps("nvi", 'RViewDF',    'rv', ':call RAction("viewdf")')
 
     " Arguments, example, help
     "-------------------------------------
@@ -1604,13 +2295,13 @@ function RControlMaps()
     "-------------------------------------
     call RCreateMaps("nvi", 'RSummary',      'rs', ':call RAction("summary")')
     call RCreateMaps("nvi", 'RPlot',         'rg', ':call RAction("plot")')
-    call RCreateMaps("nvi", 'RSPlot',        'rb', ':call RAction("plot"):call RAction("summary")')
+    call RCreateMaps("nvi", 'RSPlot',        'rb', ':call RAction("plotsumm")')
 
     " Build list of objects for omni completion
     "-------------------------------------
     call RCreateMaps("nvi", 'RUpdateObjBrowser', 'ro', ':call RObjBrowser()')
-    call RCreateMaps("nvi", 'ROpenLists',        'r=', ':call RBrowserOpenCloseLists(1)')
-    call RCreateMaps("nvi", 'RCloseLists',       'r-', ':call RBrowserOpenCloseLists(0)')
+    call RCreateMaps("nvi", 'ROpenLists',        'r=', ':call RBrOpenCloseLs(1)')
+    call RCreateMaps("nvi", 'RCloseLists',       'r-', ':call RBrOpenCloseLs(0)')
 endfunction
 
 
@@ -1633,264 +2324,27 @@ function RCreateMaps(type, plug, combo, target)
     endif
     if a:type =~ "n"
         if hasmapto(a:plug, "n")
-            exec 'noremap  ' . a:plug . ' ' . tg
-        else
-            exec 'noremap  ' . a:combo . ' ' . tg
+            exec 'noremap  ' . a:plug . ' ' . tg
+        elseif g:vimrplugin_user_maps_only == 0
+            exec 'noremap  ' . a:combo . ' ' . tg
         endif
     endif
     if a:type =~ "v"
         if hasmapto(a:plug, "v")
-            exec 'vnoremap  ' . a:plug . ' ' . tg
-        else
-            exec 'vnoremap  ' . a:combo . ' ' . tg
+            exec 'vnoremap  ' . a:plug . ' ' . tg
+        elseif g:vimrplugin_user_maps_only == 0
+            exec 'vnoremap  ' . a:combo . ' ' . tg
         endif
     endif
-    if a:type =~ "i"
+    if g:vimrplugin_insert_mode_cmds == 1 && a:type =~ "i"
         if hasmapto(a:plug, "i")
-            exec 'inoremap  ' . a:plug . ' ' . tg . il
-        else
-            exec 'inoremap  ' . a:combo . ' ' . tg . il
+            exec 'inoremap  ' . a:plug . ' ' . tg . il
+        elseif g:vimrplugin_user_maps_only == 0
+            exec 'inoremap  ' . a:combo . ' ' . tg . il
         endif
     endif
 endfunction
 
-function MakeRMenu()
-    if g:rplugin_hasmenu == 1 || !has("gui_running")
-        return
-    endif
-
-    " Do not translate "File":
-    menutranslate clear
-
-    "----------------------------------------------------------------------------
-    " Start/Close
-    "----------------------------------------------------------------------------
-    call RCreateMenuItem("nvi", 'Start/Close.Start\ R\ (default)', 'RStart', 'rf', ':call StartR("R")')
-    call RCreateMenuItem("nvi", 'Start/Close.Start\ R\ --vanilla', 'RVanillaStart', 'rv', ':call StartR("vanilla")')
-    call RCreateMenuItem("nvi", 'Start/Close.Start\ R\ (custom)', 'RCustomStart', 'rc', ':call StartR("custom")')
-    "-------------------------------
-    menu R.Start/Close.-Sep1- 
-    call RCreateMenuItem("nvi", 'Start/Close.Close\ R\ (no\ save)', 'RClose', 'rq', ":call SendCmdToR('quit(save = \"no\")')")
-
-    "----------------------------------------------------------------------------
-    " Send
-    "----------------------------------------------------------------------------
-    if &filetype == "r" || g:vimrplugin_never_unmake_menu
-        call RCreateMenuItem("ni", 'Send.File', 'RSendFile', 'aa', ':call SendFileToR("silent")')
-        call RCreateMenuItem("ni", 'Send.File\ (echo)', 'RESendFile', 'ae', ':call SendFileToR("echo")')
-        call RCreateMenuItem("ni", 'Send.File\ (open\ \.Rout)', 'RShowRout', 'ao', ':call ShowRout()')
-    endif
-    "-------------------------------
-    menu R.Send.-Sep1- 
-    call RCreateMenuItem("ni", 'Send.Block\ (cur)', 'RSendMBlock', 'bb', ':call SendMBlockToR("silent", "stay")')
-    call RCreateMenuItem("ni", 'Send.Block\ (cur,\ echo)', 'RESendMBlock', 'be', ':call SendMBlockToR("echo", "stay")')
-    call RCreateMenuItem("ni", 'Send.Block\ (cur,\ down)', 'RDSendMBlock', 'bd', ':call SendMBlockToR("silent", "down")')
-    call RCreateMenuItem("ni", 'Send.Block\ (cur,\ echo\ and\ down)', 'REDSendMBlock', 'ba', ':call SendMBlockToR("echo", "down")')
-    "-------------------------------
-    menu R.Send.-Sep2- 
-    call RCreateMenuItem("ni", 'Send.Function\ (cur)', 'RSendFunction', 'ff', ':call SendFunctionToR("silent", "stay")')
-    call RCreateMenuItem("ni", 'Send.Function\ (cur,\ echo)', 'RESendFunction', 'fe', ':call SendFunctionToR("echo", "stay")')
-    call RCreateMenuItem("ni", 'Send.Function\ (cur\ and\ down)', 'RDSendFunction', 'fd', ':call SendFunctionToR("silent", "down")')
-    call RCreateMenuItem("ni", 'Send.Function\ (cur,\ echo\ and\ down)', 'REDSendFunction', 'fa', ':call SendFunctionToR("echo", "down")')
-    "-------------------------------
-    menu R.Send.-Sep3- 
-    call RCreateMenuItem("v", 'Send.Selection', 'RSendSelection', 'ss', ':call SendSelectionToR("silent", "stay")')
-    call RCreateMenuItem("v", 'Send.Selection\ (echo)', 'RESendSelection', 'se', ':call SendSelectionToR("echo", "stay")')
-    call RCreateMenuItem("v", 'Send.Selection\ (and\ down)', 'RDSendSelection', 'sd', ':call SendSelectionToR("silent", "down")')
-    call RCreateMenuItem("v", 'Send.Selection\ (echo\ and\ down)', 'REDSendSelection', 'sa', ':call SendSelectionToR("echo", "down")')
-    "-------------------------------
-    menu R.Send.-Sep4- 
-    call RCreateMenuItem("ni", 'Send.Paragraph', 'RSendParagraph', 'pp', ':call SendParagraphToR("silent", "stay")')
-    call RCreateMenuItem("ni", 'Send.Paragraph\ (echo)', 'RESendParagraph', 'pe', ':call SendParagraphToR("echo", "stay")')
-    call RCreateMenuItem("ni", 'Send.Paragraph\ (and\ down)', 'RDSendParagraph', 'pd', ':call SendParagraphToR("silent", "down")')
-    call RCreateMenuItem("ni", 'Send.Paragraph\ (echo\ and\ down)', 'REDSendParagraph', 'pa', ':call SendParagraphToR("echo", "down")')
-    "-------------------------------
-    menu R.Send.-Sep5- 
-    call RCreateMenuItem("ni0", 'Send.Line', 'RSendLine', 'l', ':call SendLineToR("stay")')
-    call RCreateMenuItem("ni0", 'Send.Line\ (and\ down)', 'RDSendLine', 'd', ':call SendLineToR("down")')
-    call RCreateMenuItem("i", 'Send.Line\ (and\ new\ one)', 'RSendLAndOpenNewOne', 'q', ':call SendLineToR("newline")')
-
-    "----------------------------------------------------------------------------
-    " Control
-    "----------------------------------------------------------------------------
-    call RControlMenu()
-    "-------------------------------
-    menu R.Command.-Sep5- 
-    if &filetype != "rdoc"
-        call RCreateMenuItem("nvi", 'Command.Set\ working\ directory\ (cur\ file\ path)', 'RSetwd', 'rd', ':call RSetWD()')
-    endif
-    "-------------------------------
-    if &filetype == "rnoweb" || g:vimrplugin_never_unmake_menu
-        menu R.Command.-Sep6- 
-        call RCreateMenuItem("nvi", 'Command.Sweave\ (cur\ file)', 'RSweave', 'sw', ':call RSweave()')
-        call RCreateMenuItem("nvi", 'Command.Sweave\ and\ PDF\ (cur\ file)', 'RMakePDF', 'sp', ':call RMakePDF("nobib")')
-        call RCreateMenuItem("nvi", 'Command.Sweave,\ BibTeX\ and\ PDF\ (cur\ file)', 'RMakePDF', 'sb', ':call RMakePDF("bibtex")')
-    endif
-    "-------------------------------
-    menu R.Command.-Sep6a- 
-    if &filetype == "r" || &filetype == "rnoweb" || g:vimrplugin_never_unmake_menu
-        nmenu R.Command.Build\ tags\ file\ (cur\ dir):RBuildTags :call SendCmdToR('rtags(ofile = "TAGS")')
-        imenu R.Command.Build\ tags\ file\ (cur\ dir):RBuildTags :call SendCmdToR('rtags(ofile = "TAGS")')a
-    endif
-
-    menu R.-Sep7- 
-
-    "----------------------------------------------------------------------------
-    " Edit
-    "----------------------------------------------------------------------------
-    if &filetype == "r" || &filetype == "rnoweb" || &filetype == "rhelp" || g:vimrplugin_never_unmake_menu
-        if g:vimrplugin_underscore == 1
-            imenu R.Edit.Insert\ \"\ <-\ \"_ :call ReplaceUnderS()a
-        endif
-        menu R.Edit.-Sep71- 
-        nmenu R.Edit.Indent\ (line)== ==
-        vmenu R.Edit.Indent\ (selected\ lines)= =
-        nmenu R.Edit.Indent\ (whole\ buffer)gg=G gg=G
-        menu R.Edit.-Sep72- 
-        call RCreateMenuItem("ni", 'Edit.Comment/Uncomment\ (line/sel)', 'RCommentLine', 'cc', ':call RComment("normal")')
-        call RCreateMenuItem("v", 'Edit.Comment/Uncomment\ (line/sel)', 'RCommentLine', 'cc', ':call RComment("selection")')
-        call RCreateMenuItem("ni", 'Edit.Add/Align\ right\ comment\ (line,\ sel)', 'RRightComment', ';', ':call MovePosRCodeComment("normal")')
-        call RCreateMenuItem("v", 'Edit.Add/Align\ right\ comment\ (line,\ sel)', 'RRightComment', ';', ':call MovePosRCodeComment("selection")')
-        if &filetype == "rnoweb" || g:vimrplugin_never_unmake_menu
-            menu R.Edit.-Sep73- 
-            nmenu R.Edit.Go\ (next\ R\ chunk)gn :call RnwNextChunk()
-            nmenu R.Edit.Go\ (previous\ R\ chunk)gN :call RnwPreviousChunk()
-        endif
-    endif
-
-    "----------------------------------------------------------------------------
-    " Object Browser
-    "----------------------------------------------------------------------------
-    call RBrowserMenu()
-
-    "----------------------------------------------------------------------------
-    " Syntax
-    "----------------------------------------------------------------------------
-    nmenu R.Syntax.Build\ omniList\ (loaded):RUpdateObjList :call RBuildSyntaxFile("loaded")
-    imenu R.Syntax.Build\ omniList\ (loaded):RUpdateObjList :call RBuildSyntaxFile("loaded")a
-    nmenu R.Syntax.Build\ omniList\ (installed):RUpdateObjListAll :call RBuildSyntaxFile("installed")
-    imenu R.Syntax.Build\ omniList\ (installed):RUpdateObjListAll :call RBuildSyntaxFile("installed")a
-
-    "----------------------------------------------------------------------------
-    " Help
-    "----------------------------------------------------------------------------
-    menu R.-Sep8- 
-    amenu R.Help\ (plugin).Overview :help r-plugin-overview
-    amenu R.Help\ (plugin).Main\ features :help r-plugin-features
-    amenu R.Help\ (plugin).Installation :help r-plugin-installation
-    amenu R.Help\ (plugin).Use :help r-plugin-use
-    amenu R.Help\ (plugin).How\ the\ plugin\ works :help r-plugin-functioning
-    amenu R.Help\ (plugin).Known\ bugs\ and\ workarounds :help r-plugin-known-bugs
-
-    amenu R.Help\ (plugin).Options.Underscore\ and\ Rnoweb\ code :help vimrplugin_underscore
-    amenu R.Help\ (plugin).Options.Object\ Browser :help vimrplugin_objbr_place
-    if !has("gui_win32")
-        amenu R.Help\ (plugin).Options.Terminal\ emulator :help vimrplugin_term
-        amenu R.Help\ (plugin).Options.Vim\ as\ pager\ for\ R\ help :help vimrplugin_vimpager
-        amenu R.Help\ (plugin).Options.Number\ of\ R\ processes :help vimrplugin_nosingler
-        amenu R.Help\ (plugin).Options.Screen\ configuration :help vimrplugin_noscreenrc
-        amenu R.Help\ (plugin).Options.Screen\ plugin :help vimrplugin_screenplugin
-    endif
-    if !has("gui_macvim")
-        amenu R.Help\ (plugin).Options.Integration\ with\ Apple\ Script :help vimrplugin_applescript
-    endif
-    amenu R.Help\ (plugin).Options.Conque\ Shell\ plugin :help vimrplugin_conqueplugin
-    if has("gui_win32")
-        amenu R.Help\ (plugin).Options.Use\ 32\ bit\ version\ of\ R :help vimrplugin_i386
-        amenu R.Help\ (plugin).Options.Sleep\ time :help vimrplugin_sleeptime
-    endif
-    amenu R.Help\ (plugin).Options.R\ path :help vimrplugin_r_path
-    amenu R.Help\ (plugin).Options.Arguments\ to\ R :help vimrplugin_r_args
-    amenu R.Help\ (plugin).Options.Time\ building\ omniList :help vimrplugin_buildwait
-    amenu R.Help\ (plugin).Options.Syntax\ highlighting\ of\ \.Rout\ files :help vimrplugin_routmorecolors
-    amenu R.Help\ (plugin).Options.Automatically\ open\ the\ \.Rout\ file :help vimrplugin_routnotab
-    amenu R.Help\ (plugin).Options.Special\ R\ functions :help vimrplugin_listmethods
-    amenu R.Help\ (plugin).Options.Indent\ commented\ lines :help vimrplugin_indent_commented
-    amenu R.Help\ (plugin).Options.maxdeparse :help vimrplugin_maxdeparse
-    amenu R.Help\ (plugin).Options.LaTeX\ command :help vimrplugin_latexcmd
-    amenu R.Help\ (plugin).Options.Never\ unmake\ the\ R\ menu :help vimrplugin_never_unmake_menu
-
-    amenu R.Help\ (plugin).Custom\ key\ bindings :help r-plugin-key-bindings
-    amenu R.Help\ (plugin).Files :help r-plugin-files
-    amenu R.Help\ (plugin).FAQ\ and\ tips.All\ tips :help r-plugin-tips
-    amenu R.Help\ (plugin).FAQ\ and\ tips.Indenting\ setup :help r-plugin-indenting
-    amenu R.Help\ (plugin).FAQ\ and\ tips.Folding\ setup :help r-plugin-folding
-    amenu R.Help\ (plugin).FAQ\ and\ tips.Remap\ LocalLeader :help r-plugin-localleader
-    amenu R.Help\ (plugin).FAQ\ and\ tips.Customize\ key\ bindings :help r-plugin-bindings
-    amenu R.Help\ (plugin).FAQ\ and\ tips.SnipMate :help r-plugin-snippets
-    amenu R.Help\ (plugin).FAQ\ and\ tips.Highlight\ marks :help r-plugin-showmarks
-    amenu R.Help\ (plugin).FAQ\ and\ tips.Global\ plugin :help r-plugin-global
-    amenu R.Help\ (plugin).FAQ\ and\ tips.Jump\ to\ function\ definitions :help r-plugin-tagsfile
-    amenu R.Help\ (plugin).News :help r-plugin-news
-
-    amenu R.Help\ (R) :call SendCmdToR("help.start()")
-
-    "----------------------------------------------------------------------------
-    " ToolBar
-    "----------------------------------------------------------------------------
-    " Buttons
-    amenu ToolBar.RStart :call StartR("R")
-    amenu ToolBar.RClose :call SendCmdToR('quit(save = "no")')
-    "---------------------------
-    if &filetype == "r" || g:vimrplugin_never_unmake_menu
-        nmenu ToolBar.RSendFile :call SendFileToR("echo")
-        imenu ToolBar.RSendFile :call SendFileToR("echo")
-    endif
-    nmenu ToolBar.RSendBlock :call SendMBlockToR("echo", "down")
-    imenu ToolBar.RSendBlock :call SendMBlockToR("echo", "down")
-    nmenu ToolBar.RSendFunction :call SendFunctionToR("echo", "down")
-    imenu ToolBar.RSendFunction :call SendFunctionToR("echo", "down")
-    vmenu ToolBar.RSendSelection :call SendSelectionToR("echo", "down")
-    nmenu ToolBar.RSendParagraph :call SendParagraphToR("echo", "down")
-    imenu ToolBar.RSendParagraph :call SendParagraphToR("echo", "down")
-    nmenu ToolBar.RSendLine :call SendLineToR("down")
-    imenu ToolBar.RSendLine :call SendLineToR("down")
-    "---------------------------
-    nmenu ToolBar.RListSpace :call SendCmdToR("ls()")
-    imenu ToolBar.RListSpace :call SendCmdToR("ls()")
-    nmenu ToolBar.RClear :call RClearConsole()
-    imenu ToolBar.RClear :call RClearConsole()
-    nmenu ToolBar.RClearAll :call RClearAll()
-    imenu ToolBar.RClearAll :call RClearAll()
-
-    " Hints
-    tmenu ToolBar.RStart Start R (default)
-    tmenu ToolBar.RClose Close R (no save)
-    if &filetype == "r" || g:vimrplugin_never_unmake_menu
-        tmenu ToolBar.RSendFile Send file (echo)
-    endif
-    tmenu ToolBar.RSendBlock Send block (cur, echo and down)
-    tmenu ToolBar.RSendFunction Send function (cur, echo and down)
-    tmenu ToolBar.RSendSelection Send selection (cur, echo and down)
-    tmenu ToolBar.RSendParagraph Send paragraph (cur, echo and down)
-    tmenu ToolBar.RSendLine Send line (cur and down)
-    tmenu ToolBar.RListSpace List objects
-    tmenu ToolBar.RClear Clear the console screen
-    tmenu ToolBar.RClearAll Remove objects from workspace and clear the console screen
-    let g:rplugin_hasmenu = 1
-endfunction
-
-function UnMakeRMenu()
-    if !has("gui_running") || g:rplugin_hasmenu == 0 || g:vimrplugin_never_unmake_menu == 1 || &previewwindow
-        return
-    endif
-    aunmenu R
-    aunmenu ToolBar.RClearAll
-    aunmenu ToolBar.RClear
-    aunmenu ToolBar.RListSpace
-    aunmenu ToolBar.RSendLine
-    aunmenu ToolBar.RSendSelection
-    aunmenu ToolBar.RSendParagraph
-    aunmenu ToolBar.RSendFunction
-    aunmenu ToolBar.RSendBlock
-    if &filetype == "r"
-        aunmenu ToolBar.RSendFile
-    endif
-    aunmenu ToolBar.RClose
-    aunmenu ToolBar.RStart
-    let g:rplugin_hasmenu = 0
-endfunction
-
 
 function SpaceForRGrDevice()
     let savesb = &switchbuf
@@ -1898,7 +2352,7 @@ function SpaceForRGrDevice()
     let l:sr = &splitright
     set splitright
     37vsplit Space_for_Graphics
-    set nomodifiable
+    setlocal nomodifiable
     setlocal noswapfile
     set buftype=nofile
     set nowrap
@@ -1912,7 +2366,6 @@ function RCreateStartMaps()
     " Start
     "-------------------------------------
     call RCreateMaps("nvi", 'RStart',        'rf', ':call StartR("R")')
-    call RCreateMaps("nvi", 'RVanillaStart', 'rv', ':call StartR("vanilla")')
     call RCreateMaps("nvi", 'RCustomStart',  'rc', ':call StartR("custom")')
 
     " Close
@@ -1925,13 +2378,26 @@ endfunction
 function RCreateEditMaps()
     " Edit
     "-------------------------------------
-    call RCreateMaps("ni", 'RCommentLine',   'cc', ':call RComment("normal")')
-    call RCreateMaps("v", 'RCommentLine',   'cc', ':call RComment("selection")')
+    call RCreateMaps("ni", 'RToggleComment',   'xx', ':call RComment("normal")')
+    call RCreateMaps("v", 'RToggleComment',   'xx', ':call RComment("selection")')
+    call RCreateMaps("ni", 'RSimpleComment',   'xc', ':call RSimpleCommentLine("normal", "c")')
+    call RCreateMaps("v", 'RSimpleComment',   'xc', ':call RSimpleCommentLine("selection", "c")')
+    call RCreateMaps("ni", 'RSimpleUnComment',   'xu', ':call RSimpleCommentLine("normal", "u")')
+    call RCreateMaps("v", 'RSimpleUnComment',   'xu', ':call RSimpleCommentLine("selection", "u")')
     call RCreateMaps("ni", 'RRightComment',   ';', ':call MovePosRCodeComment("normal")')
     call RCreateMaps("v", 'RRightComment',    ';', ':call MovePosRCodeComment("selection")')
     " Replace 'underline' with '<-'
-    if g:vimrplugin_underscore == 1
-        imap  _ :call ReplaceUnderS()a
+    if g:vimrplugin_assign == 1 || g:vimrplugin_assign == 2
+        silent exe 'inoremap  ' . g:vimrplugin_assign_map . ' :call ReplaceUnderS()a'
+    endif
+    if g:vimrplugin_args_in_stline
+        inoremap  ( :call DisplayArgs()a
+        inoremap  ) :call RestoreStatusLine()a
+    endif
+    if hasmapto("RCompleteArgs", "i")
+        inoremap  RCompleteArgs =RCompleteArgs()
+    else
+        inoremap   =RCompleteArgs()
     endif
 endfunction
 
@@ -1956,6 +2422,7 @@ function RCreateSendMaps()
     call RCreateMaps("v", 'RESendSelection',  'se', ':call SendSelectionToR("echo", "stay")')
     call RCreateMaps("v", 'RDSendSelection',  'sd', ':call SendSelectionToR("silent", "down")')
     call RCreateMaps("v", 'REDSendSelection', 'sa', ':call SendSelectionToR("echo", "down")')
+    call RCreateMaps('v', 'RSendSelAndInsertOutput', 'so', ':call SendSelectionToR("echo", "stay", "NewtabInsert")')
 
     " Paragraph
     "-------------------------------------
@@ -1964,26 +2431,104 @@ function RCreateSendMaps()
     call RCreateMaps("ni", 'RDSendParagraph',  'pd', ':call SendParagraphToR("silent", "down")')
     call RCreateMaps("ni", 'REDSendParagraph', 'pa', ':call SendParagraphToR("echo", "down")')
 
+    if &filetype == "rnoweb" || &filetype == "rmd" || &filetype == "rrst"
+        call RCreateMaps("ni", 'RSendChunkFH', 'ch', ':call SendFHChunkToR()')
+    endif
+
     " *Line*
     "-------------------------------------
-    call RCreateMaps("ni0", 'RSendLine', 'l', ':call SendLineToR("stay")')
+    call RCreateMaps("ni", 'RSendLine', 'l', ':call SendLineToR("stay")')
     call RCreateMaps('ni0', 'RDSendLine', 'd', ':call SendLineToR("down")')
+    call RCreateMaps('ni0', 'RDSendLineAndInsertOutput', 'o', ':call SendLineToRAndInsertOutput()')
+    call RCreateMaps('v', 'RDSendLineAndInsertOutput', 'o', ':call RWarningMsg("This command does not work over a selection of lines.")')
     call RCreateMaps('i', 'RSendLAndOpenNewOne', 'q', ':call SendLineToR("newline")')
+    call RCreateMaps('n', 'RNLeftPart', 'r', ':call RSendPartOfLine("left", 0)')
+    call RCreateMaps('n', 'RNRightPart', 'r', ':call RSendPartOfLine("right", 0)')
+    call RCreateMaps('i', 'RILeftPart', 'r', 'l:call RSendPartOfLine("left", 1)')
+    call RCreateMaps('i', 'RIRightPart', 'r', 'l:call RSendPartOfLine("right", 1)')
 
     " For compatibility with Johannes Ranke's plugin
     if g:vimrplugin_map_r == 1
-        vnoremap  r :call SendSelectionToR("silent", "down")
+        vnoremap  r :call SendSelectionToR("silent", "down")
     endif
 endfunction
 
 function RBufEnter()
-    call MakeRMenu()
     let g:rplugin_curbuf = bufname("%")
+    if has("gui_running")
+        if &filetype != g:rplugin_lastft
+            call UnMakeRMenu()
+            if &filetype == "r" || &filetype == "rnoweb" || &filetype == "rmd" || &filetype == "rrst" || &filetype == "rdoc" || &filetype == "rbrowser" || &filetype == "rhelp"
+                if &filetype == "rbrowser"
+                    call MakeRBrowserMenu()
+                else
+                    call MakeRMenu()
+                endif
+            endif
+        endif
+        if &buftype != "nofile" || (&buftype == "nofile" && &filetype == "rbrowser")
+            let g:rplugin_lastft = &filetype
+        endif
+    endif
+endfunction
+
+function RVimLeave()
+    call delete(g:rplugin_rsource)
+    call delete(g:rplugin_tmpdir . "/start_options.R")
+    call delete(g:rplugin_tmpdir . "/eval_reply")
+    call delete(g:rplugin_tmpdir . "/formatted_code")
+    call delete(g:rplugin_tmpdir . "/GlobalEnvList_" . $VIMINSTANCEID)
+    call delete(g:rplugin_tmpdir . "/globenv_" . $VIMINSTANCEID)
+    call delete(g:rplugin_tmpdir . "/liblist_" . $VIMINSTANCEID)
+    call delete(g:rplugin_tmpdir . "/libnames_" . $VIMINSTANCEID)
+    call delete(g:rplugin_tmpdir . "/objbrowserInit")
+    call delete(g:rplugin_tmpdir . "/Rdoc")
+    call delete(g:rplugin_tmpdir . "/Rinsert")
+    call delete(g:rplugin_tmpdir . "/tmux.conf")
+    call delete(g:rplugin_tmpdir . "/unformatted_code")
+    call delete(g:rplugin_tmpdir . "/vimbol_finished")
+    call delete(g:rplugin_tmpdir . "/vimcom_running_" . $VIMINSTANCEID)
+    call delete(g:rplugin_tmpdir . "/rconsole_hwnd_" . $VIMR_SECRET)
+    call delete(g:rplugin_tmpdir . "/openR'")
+    if executable("rmdir")
+        call system("rmdir '" . g:rplugin_tmpdir . "'")
+    endif
+endfunction
+
+function RSourceOtherScripts()
+    if exists("g:vimrplugin_source")
+        let flist = split(g:vimrplugin_source, ",")
+        for fl in flist
+            if fl =~ " "
+                call RWarningMsgInp("Invalid file name (empty spaces are not allowed): '" . fl . "'")
+            else
+                exe "source " . escape(fl, ' \')
+            endif
+        endfor
+    endif
 endfunction
 
-command RUpdateObjList :call RBuildSyntaxFile("loaded")
-command RUpdateObjListAll :call RBuildSyntaxFile("installed")
-command RBuildTags :call SendCmdToR('rtags(ofile = "TAGS")')
+function ROnJobStdout(job_id, msg)
+    let cmd = substitute(a:msg, '\n', '', 'g')
+    let cmd = substitute(cmd, '\r', '', 'g')
+    if cmd =~ "^call " || cmd =~ "^let "
+        exe cmd
+    else
+        call RWarningMsg('[Job] Unknown command: "' . cmd . '"')
+    endif
+endfunction
+
+function ROnJobStderr(job_id, msg)
+    call RWarningMsg('[Job] ' . substitute(a:msg, '\n', ' ', 'g'))
+endfunction
+
+command -nargs=1 -complete=customlist,RLisObjs Rinsert :call RInsert()
+command -range=% Rformat ,:call RFormatCode()
+command RBuildTags :call g:SendCmdToR('rtags(ofile = "TAGS")')
+command -nargs=? -complete=customlist,RLisObjs Rhelp :call RAskHelp()
+command -nargs=? -complete=dir RSourceDir :call RSourceDirectory()
+command RStop :call StopR()
+
 
 "==========================================================================
 " Global variables
@@ -1991,281 +2536,217 @@ command RBuildTags :call SendCmdToR('rtags(ofile = "TAGS")')
 "             rplugin_    for internal parameters
 "==========================================================================
 
+if !exists("g:rplugin_compldir")
+    runtime r-plugin/setcompldir.vim
+endif
+
+
+if exists("g:vimrplugin_tmpdir")
+    let g:rplugin_tmpdir = expand(g:vimrplugin_tmpdir)
+else
+    if has("win32") || has("win64")
+        if isdirectory($TMP)
+            let g:rplugin_tmpdir = $TMP . "/r-plugin-" . g:rplugin_userlogin
+        elseif isdirectory($TEMP)
+            let g:rplugin_tmpdir = $TEMP . "/r-plugin-" . g:rplugin_userlogin
+        else
+            let g:rplugin_tmpdir = g:rplugin_uservimfiles . "/r-plugin/tmp"
+        endif
+        let g:rplugin_tmpdir = substitute(g:rplugin_tmpdir, "\\", "/", "g")
+    else
+        if isdirectory($TMPDIR)
+            if $TMPDIR =~ "/$"
+                let g:rplugin_tmpdir = $TMPDIR . "r-plugin-" . g:rplugin_userlogin
+            else
+                let g:rplugin_tmpdir = $TMPDIR . "/r-plugin-" . g:rplugin_userlogin
+            endif
+        elseif isdirectory("/tmp")
+            let g:rplugin_tmpdir = "/tmp/r-plugin-" . g:rplugin_userlogin
+        else
+            let g:rplugin_tmpdir = g:rplugin_uservimfiles . "/r-plugin/tmp"
+        endif
+    endif
+endif
+
+let $VIMRPLUGIN_TMPDIR = g:rplugin_tmpdir
+if !isdirectory(g:rplugin_tmpdir)
+    call mkdir(g:rplugin_tmpdir, "p", 0700)
+endif
+
+" Make the file name of files to be sourced
+let g:rplugin_rsource = g:rplugin_tmpdir . "/Rsource-" . getpid()
+
+let g:rplugin_is_darwin = system("uname") =~ "Darwin"
+
 " Variables whose default value is fixed
 call RSetDefaultValue("g:vimrplugin_map_r",             0)
-call RSetDefaultValue("g:vimrplugin_open_df",           1)
-call RSetDefaultValue("g:vimrplugin_open_list",         0)
 call RSetDefaultValue("g:vimrplugin_allnames",          0)
-call RSetDefaultValue("g:vimrplugin_underscore",        1)
+call RSetDefaultValue("g:vimrplugin_rmhidden",          0)
+call RSetDefaultValue("g:vimrplugin_assign",            1)
+call RSetDefaultValue("g:vimrplugin_assign_map",    "'_'")
+call RSetDefaultValue("g:vimrplugin_args_in_stline",    0)
 call RSetDefaultValue("g:vimrplugin_rnowebchunk",       1)
-call RSetDefaultValue("g:vimrplugin_i386",              0)
-call RSetDefaultValue("g:vimrplugin_applescript",       1)
-call RSetDefaultValue("g:vimrplugin_screenvsplit",      0)
-call RSetDefaultValue("g:vimrplugin_conquevsplit",      0)
+call RSetDefaultValue("g:vimrplugin_strict_rst",        1)
+call RSetDefaultValue("g:vimrplugin_openpdf",           2)
+call RSetDefaultValue("g:vimrplugin_synctex",           1)
+call RSetDefaultValue("g:vimrplugin_openhtml",          0)
+call RSetDefaultValue("g:vimrplugin_vim_wd",            0)
+call RSetDefaultValue("g:vimrplugin_source_args",    "''")
+call RSetDefaultValue("g:vimrplugin_after_start",    "''")
+call RSetDefaultValue("g:vimrplugin_vsplit",            0)
+call RSetDefaultValue("g:vimrplugin_csv_warn",          1)
+call RSetDefaultValue("g:vimrplugin_rconsole_width",   -1)
+call RSetDefaultValue("g:vimrplugin_rconsole_height",  15)
+call RSetDefaultValue("g:vimrplugin_tmux_title", "'VimR'")
 call RSetDefaultValue("g:vimrplugin_listmethods",       0)
 call RSetDefaultValue("g:vimrplugin_specialplot",       0)
-call RSetDefaultValue("g:vimrplugin_nosingler",         0)
-call RSetDefaultValue("g:vimrplugin_noscreenrc",        0)
-call RSetDefaultValue("g:vimrplugin_routnotab",         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)
 call RSetDefaultValue("g:vimrplugin_objbr_w",          40)
-call RSetDefaultValue("g:vimrplugin_buildwait",       120)
-call RSetDefaultValue("g:vimrplugin_indent_commented",  1)
-call RSetDefaultValue("g:vimrplugin_by_vim_instance",   0)
+call RSetDefaultValue("g:vimrplugin_objbr_opendf",      1)
+call RSetDefaultValue("g:vimrplugin_objbr_openlist",    0)
+call RSetDefaultValue("g:vimrplugin_objbr_allnames",    0)
+call RSetDefaultValue("g:vimrplugin_texerr",            1)
+call RSetDefaultValue("g:vimrplugin_objbr_labelerr",    1)
+call RSetDefaultValue("g:vimrplugin_i386",              0)
+call RSetDefaultValue("g:vimrplugin_vimcom_wait",    5000)
+call RSetDefaultValue("g:vimrplugin_show_args",         0)
 call RSetDefaultValue("g:vimrplugin_never_unmake_menu", 0)
-call RSetDefaultValue("g:vimrplugin_vimpager",       "'vertical'")
-call RSetDefaultValue("g:vimrplugin_latexcmd", "'pdflatex'")
-call RSetDefaultValue("g:vimrplugin_objbr_place", "'console,right'")
+call RSetDefaultValue("g:vimrplugin_insert_mode_cmds",  1)
+call RSetDefaultValue("g:vimrplugin_source",         "''")
+call RSetDefaultValue("g:vimrplugin_vimpager",      "'tab'")
+call RSetDefaultValue("g:vimrplugin_objbr_place",     "'script,right'")
+call RSetDefaultValue("g:vimrplugin_user_maps_only", 0)
+call RSetDefaultValue("g:vimrplugin_latexcmd", "'default'")
+call RSetDefaultValue("g:vimrplugin_rmd_environment", "'.GlobalEnv'")
+call RSetDefaultValue("g:vimrplugin_indent_commented",  1)
 
-if has("gui_win32")
-    call RSetDefaultValue("g:vimrplugin_conquesleep",     200)
-else
-    call RSetDefaultValue("g:vimrplugin_conquesleep",     100)
+" This option is used in syntax/r.vim which is not part of Vim-R-plugin
+call RSetDefaultValue("g:R_hi_fun", 1)
+if !g:R_hi_fun
+    " Declare empty function to be called by vimcom
+    function FillRLibList()
+    endfunction
 endif
 
-" g:rplugin_home should be the directory where the r-plugin files are.  For
-" users following the installation instructions it will be at ~/.vim or
-" ~/vimfiles, that is, the same value of g:rplugin_uservimfiles. However the
-" variables will have different values if the plugin is installed somewhere
-" else in the runtimepath.
-let g:rplugin_home = expand(":h:h")
-
-" g:rplugin_uservimfiles must be a writable directory. It will be g:rplugin_home
-" unless it's not writable. Then it wil be ~/.vim or ~/vimfiles.
-if filewritable(g:rplugin_home) == 2
-    let g:rplugin_uservimfiles = g:rplugin_home
+if !exists("g:r_indent_ess_comments")
+    let g:r_indent_ess_comments = 0
+endif
+if g:r_indent_ess_comments
+    if g:vimrplugin_indent_commented
+        call RSetDefaultValue("g:vimrplugin_rcomment_string", "'## '")
+    else
+        call RSetDefaultValue("g:vimrplugin_rcomment_string", "'### '")
+    endif
 else
-    let g:rplugin_uservimfiles = split(&runtimepath, ",")[0]
+    call RSetDefaultValue("g:vimrplugin_rcomment_string", "'# '")
 endif
 
-" Start with an empty list of objects in the workspace
-let g:rplugin_globalenvlines = []
-
-" From changelog.vim, with bug fixed by "Si" ("i5ivem")
-" Windows logins can include domain, e.g: 'DOMAIN\Username', need to remove
-" the backslash from this as otherwise cause file path problems.
-let g:rplugin_userlogin = substitute(system('whoami'), "\\", "-", "")
-
-if v:shell_error
-    let g:rplugin_userlogin = 'unknown'
+if has("win32") || has("win64")
+    call RSetDefaultValue("g:vimrplugin_Rterm",           0)
+    call RSetDefaultValue("g:vimrplugin_save_win_pos",    1)
+    call RSetDefaultValue("g:vimrplugin_arrange_windows", 1)
 else
-    let newuline = stridx(g:rplugin_userlogin, "\n")
-    if newuline != -1
-        let g:rplugin_userlogin = strpart(g:rplugin_userlogin, 0, newuline)
-    endif
-    unlet newuline
+    let g:vimrplugin_Rterm = 0
+    call RSetDefaultValue("g:vimrplugin_save_win_pos",    0)
+    call RSetDefaultValue("g:vimrplugin_arrange_windows", 0)
 endif
 
-if has("gui_win32")
-    let vimrplugin_screenplugin = 0
-    " python has priority over python3, unless ConqueTerm_PyVersion == 3
-    if has("python")
-        let s:py = "py"
-    else
-        if has("python3")
-            let s:py = "py3"
-        else
-            let s:py = ""
-        endif
-    endif
-    if has("python3") && exists("g:ConqueTerm_PyVersion") && g:ConqueTerm_PyVersion == 3
-        let s:py = "py3"
-    endif
+" The C code in VimCom/src/apps/vimr.c to send strings to RTerm is not working:
+let g:vimrplugin_Rterm = 0
 
-    if s:py == ""
-        call RWarningMsg("Python interface must be enabled to run Vim-R-Plugin.")
-        call RWarningMsg("Please do  ':h r-plugin-installation'  for details.")
-        call input("Press  to continue. ")
-        let g:rplugin_failed = 1
-        finish
-    endif
-    exe s:py . "file " . substitute(g:rplugin_home, " ", '\ ', "g") . '\r-plugin\windows.py' 
-    let g:rplugin_jspath = g:rplugin_home . "\\r-plugin\\vimActivate.js"
-    let g:rplugin_home = substitute(g:rplugin_home, "\\", "/", "g")
-    let g:rplugin_uservimfiles = substitute(g:rplugin_uservimfiles, "\\", "/", "g")
-    if !exists("g:rplugin_rpathadded")
-        if exists("g:vimrplugin_r_path")
-            let $PATH = g:vimrplugin_r_path . ";" . $PATH
-            let g:rplugin_Rgui = g:vimrplugin_r_path . "\\Rgui.exe"
-        else
-            exe s:py . " GetRPathPy()"
-            if s:rinstallpath == "Not found"
-                call RWarningMsg('Could not find R path in Windows Registry.')
-                call input("Press  to continue. ")
-                let g:rplugin_failed = 1
-                finish
-            endif
-            if isdirectory(s:rinstallpath . '\bin\i386')
-                if !isdirectory(s:rinstallpath . '\bin\x64')
-                    let g:vimrplugin_i386 = 1
-                endif
-                if g:vimrplugin_i386
-                    let $PATH = s:rinstallpath . '\bin\i386;' . $PATH
-                    let g:rplugin_Rgui = s:rinstallpath . '\bin\i386\Rgui.exe'
-                else
-                    let $PATH = s:rinstallpath . '\bin\x64;' . $PATH
-                    let g:rplugin_Rgui = s:rinstallpath . '\bin\x64\Rgui.exe'
-                endif
-            else
-                let $PATH = s:rinstallpath . '\bin;' . $PATH
-                let g:rplugin_Rgui = s:rinstallpath . '\bin\Rgui.exe'
-            endif
-            unlet s:rinstallpath
-        endif
-        let g:rplugin_rpathadded = 1
-    endif
-    let g:rplugin_R = "Rgui.exe"
-    let g:vimrplugin_term_cmd = "none"
-    let g:vimrplugin_term = "none"
-    let g:vimrplugin_noscreenrc = 1
-    if !exists("g:vimrplugin_r_args")
-        let g:vimrplugin_r_args = "--sdi"
-    endif
-    if !exists("g:vimrplugin_sleeptime")
-        let g:vimrplugin_sleeptime = 0.02
-    endif
-else
-    if !executable('screen') && !exists("g:ConqueTerm_Version")
-        if has("python") || has("python3")
-            call RWarningMsg("Please, install either the 'screen' application or the 'Conque Shell' plugin to enable the Vim-R-plugin.")
-        else
-            call RWarningMsg("Please, install the 'screen' application to enable the Vim-R-plugin.")
-        endif
-        call input("Press  to continue. ")
+" Look for invalid options
+let objbrplace = split(g:vimrplugin_objbr_place, ",")
+let obpllen = len(objbrplace) - 1
+if obpllen > 1
+    call RWarningMsgInp("Too many options for vimrplugin_objbr_place.")
+    let g:rplugin_failed = 1
+    finish
+endif
+for idx in range(0, obpllen)
+    if objbrplace[idx] != "console" && objbrplace[idx] != "script" && objbrplace[idx] != "left" && objbrplace[idx] != "right"
+        call RWarningMsgInp('Invalid option for vimrplugin_objbr_place: "' . objbrplace[idx] . '". Valid options are: console or script and right or left."')
         let g:rplugin_failed = 1
         finish
     endif
-    if exists("g:vimrplugin_r_path")
-        let g:rplugin_R = g:vimrplugin_r_path . "/R"
-    else
-        let g:rplugin_R = "R"
-    endif
-    if !exists("g:vimrplugin_r_args")
-        let g:vimrplugin_r_args = " "
-    endif
-endif
+endfor
+unlet objbrplace
+unlet obpllen
 
-if isdirectory("/tmp")
-    let $VIMRPLUGIN_TMPDIR = "/tmp/r-plugin-" . g:rplugin_userlogin
-else
-    let $VIMRPLUGIN_TMPDIR = g:rplugin_uservimfiles . "/r-plugin"
-endif
 
-if !isdirectory($VIMRPLUGIN_TMPDIR)
-    call mkdir($VIMRPLUGIN_TMPDIR, "p", 0700)
-endif
+" ^K (\013) cleans from cursor to the right and ^U (\025) cleans from cursor
+" to the left. However, ^U causes a beep if there is nothing to clean. The
+" solution is to use ^A (\001) to move the cursor to the beginning of the line
+" before sending ^K. But the control characters may cause problems in some
+" circumstances.
+call RSetDefaultValue("g:vimrplugin_ca_ck", 0)
 
-let g:rplugin_docfile = $VIMRPLUGIN_TMPDIR . "/Rdoc"
-let g:rplugin_globalenvfname = $VIMRPLUGIN_TMPDIR . "/GlobalEnvList"
+" ========================================================================
+" Set default mean of communication with R
 
-" Use Conque Shell plugin by default... 
-if exists("g:ConqueTerm_Loaded") && !exists("g:vimrplugin_conqueplugin")
-    if has("python") || has("python3")
-        let g:vimrplugin_conqueplugin = 1
-        " ... unless explicitly told otherwise in the vimrc
-        if exists("g:vimrplugin_screenplugin") && g:vimrplugin_screenplugin == 1
-            let g:vimrplugin_conqueplugin = 0
-        endif
+if has('gui_running')
+    let g:rplugin_do_tmux_split = 0
+endif
+
+if g:rplugin_is_darwin
+    let g:rplugin_r64app = 0
+    if isdirectory("/Applications/R64.app")
+        call RSetDefaultValue("g:vimrplugin_applescript", 1)
+        let g:rplugin_r64app = 1
+    elseif isdirectory("/Applications/R.app")
+        call RSetDefaultValue("g:vimrplugin_applescript", 1)
     else
-        call RWarningMsg("Python interface must be enabled to run Vim-R-Plugin with Conque Shell.")
-        let g:vimrplugin_conqueplugin = 0
-        sleep 2
+        call RSetDefaultValue("g:vimrplugin_applescript", 0)
     endif
-endif
-if exists("g:vimrplugin_conqueplugin") && g:vimrplugin_conqueplugin == 1
-    if !exists("g:ConqueTerm_Version") || (exists("g:ConqueTerm_Version") && g:ConqueTerm_Version < 120)
-        let g:vimrplugin_conqueplugin = 0
-        call RWarningMsg("Vim-R-plugin requires Conque Shell plugin >= 1.2")
-        call input("Press  to continue. ")
+    if !exists("g:macvim_skim_app_path")
+        let g:macvim_skim_app_path = '/Applications/Skim.app'
     endif
+else
+    let g:vimrplugin_applescript = 0
 endif
 
-if !exists("g:vimrplugin_conqueplugin")
-    let g:vimrplugin_conqueplugin = 0
-endif
-
-if g:vimrplugin_conqueplugin == 1
-    let g:vimrplugin_screenplugin = 0
+if has("gui_running") || g:vimrplugin_applescript
+    let vimrplugin_only_in_tmux = 0
 endif
 
-if !exists("g:vimrplugin_screenplugin")
-    if exists("g:ScreenVersion")
-        let g:vimrplugin_screenplugin = 1
-    else
-        let g:vimrplugin_screenplugin = 0
+if $TMUX == ""
+    let g:rplugin_do_tmux_split = 0
+    let g:vimrplugin_tmux_ob = 0
+    if g:vimrplugin_objbr_place =~ "console"
+        let g:vimrplugin_objbr_place = substitute(g:vimrplugin_objbr_place, "console", "script", "")
     endif
+else
+    let g:rplugin_do_tmux_split = 1
+    let g:vimrplugin_applescript = 0
+    call RSetDefaultValue("g:vimrplugin_tmux_ob", 1)
 endif
 
-if !exists("g:ScreenVersion")
-    " g:ScreenVersion was introduced in screen plugin 1.3
-    if g:vimrplugin_screenplugin == 1
-        call RWarningMsg("Vim-R-plugin requires Screen plugin >= 1.3")
-        call input("Press  to continue. ")
+if has("gui_running") || has("win32") || g:vimrplugin_applescript
+    let g:rplugin_do_tmux_split = 0
+    let g:vimrplugin_tmux_ob = 0
+    if g:vimrplugin_objbr_place =~ "console"
+        let g:vimrplugin_objbr_place = substitute(g:vimrplugin_objbr_place, "console", "script", "")
     endif
-    let g:vimrplugin_screenplugin = 0
-endif
-
-" The screen.vim plugin only works on terminal emulators
-if !exists("g:vimrplugin_screenplugin") || has('gui_running')
-    let g:vimrplugin_screenplugin = 0
 endif
 
-" Check again if screen is installed
-if !has("gui_win32") && g:vimrplugin_conqueplugin == 0 && g:vimrplugin_screenplugin == 0 && !executable("screen")
-    if (has("python") || has("python3")) && !exists("g:ConqueTerm_Version")
-        call RWarningMsg("Please, install either the 'screen' application or the 'Conque Shell' plugin to enable the Vim-R-plugin.")
-    else
-        call RWarningMsg("Please, install the 'screen' application to enable the Vim-R-plugin.")
-    endif
-    call input("Press  to continue. ")
-    let g:rplugin_failed = 1
-    finish
+if g:vimrplugin_objbr_place =~ "console"
+    let g:vimrplugin_tmux_ob = 1
 endif
 
-" Are we in a Debian package? Is the plugin being running for the first time?
-let g:rplugin_omnifname = g:rplugin_uservimfiles . "/r-plugin/omniList"
-if g:rplugin_home != g:rplugin_uservimfiles
-    " Create r-plugin directory if it doesn't exist yet:
-    if !isdirectory(g:rplugin_uservimfiles . "/r-plugin")
-        call mkdir(g:rplugin_uservimfiles . "/r-plugin", "p")
-    endif
 
-    " If there is no functions.vim, copy the default one
-    if !filereadable(g:rplugin_uservimfiles . "/r-plugin/functions.vim")
-        if filereadable("/usr/share/vim/addons/r-plugin/functions.vim")
-            let ffile = readfile("/usr/share/vim/addons/r-plugin/functions.vim")
-            call writefile(ffile, g:rplugin_uservimfiles . "/r-plugin/functions.vim")
-            unlet ffile
-        endif
-    endif
+" ========================================================================
 
-    " If there is no omniList, copy the default one
-    if !filereadable(g:rplugin_omnifname)
-        if filereadable("/usr/share/vim/addons/r-plugin/omniList")
-            let omnilines = readfile("/usr/share/vim/addons/r-plugin/omniList")
-        else
-            if filereadable(g:rplugin_home . "/r-plugin/omniList")
-                let omnilines = readfile(g:rplugin_home . "/r-plugin/omniList")
-            else
-                let omnilines = []
-            endif
-        endif
-        call writefile(omnilines, g:rplugin_omnifname)
-        unlet omnilines
-    endif
-endif
+" Start with an empty list of objects in the workspace
+let g:rplugin_globalenvlines = []
 
 " Minimum width for the Object Browser
-if g:vimrplugin_objbr_w < 9
-    let g:vimrplugin_objbr_w = 9
+if g:vimrplugin_objbr_w < 10
+    let g:vimrplugin_objbr_w = 10
 endif
 
-" Keeps the libraries object list in memory to avoid the need of reading the file
-" repeatedly:
-let g:rplugin_liblist = readfile(g:rplugin_omnifname)
-
-
 " Control the menu 'R' and the tool bar buttons
 if !exists("g:rplugin_hasmenu")
     let g:rplugin_hasmenu = 0
@@ -2274,62 +2755,131 @@ endif
 " List of marks that the plugin seeks to find the block to be sent to R
 let s:all_marks = "abcdefghijklmnopqrstuvwxyz"
 
+if filewritable('/dev/null')
+    let g:rplugin_null = "'/dev/null'"
+elseif has("win32") && filewritable('NUL')
+    let g:rplugin_null = "'NUL'"
+else
+    let g:rplugin_null = 'tempfile()'
+endif
+
+autocmd BufEnter * call RBufEnter()
+if &filetype != "rbrowser"
+    autocmd VimLeave * call RVimLeave()
+endif
 
-" Create an empty file to avoid errors if the user do Ctrl-X Ctrl-O before
-" starting R:
-call writefile([], g:rplugin_globalenvfname)
+let g:rplugin_firstbuffer = expand("%:p")
+let g:rplugin_running_objbr = 0
+let g:rplugin_running_rhelp = 0
+let g:rplugin_newliblist = 0
+let g:rplugin_status_line = &statusline
+let g:rplugin_r_pid = 0
+let g:rplugin_myport = 0
+let g:rplugin_vimcomport = 0
+let g:rplugin_vimcom_home = ""
+let g:rplugin_vimcom_version = 0
+let g:rplugin_lastev = ""
+let g:rplugin_last_r_prompt = ""
+let g:rplugin_hasRSFbutton = 0
+let g:rplugin_tmuxsname = "VimR-" . substitute(localtime(), '.*\(...\)', '\1', '')
+let g:rplugin_starting_R = 0
+
+" SyncTeX options
+let g:rplugin_has_wmctrl = 0
+let g:rplugin_synctexpid = 0
+let g:rplugin_zathura_pid = {}
+
+let g:rplugin_py_exec = "none"
+if executable("python3")
+    let g:rplugin_py_exec = "python3"
+elseif executable("python")
+    let g:rplugin_py_exec = "python"
+endif
+
+function GetRandomNumber(width)
+    if g:rplugin_py_exec != "none"
+        let pycode = ["import os, sys, base64",
+                    \ "sys.stdout.write(base64.b64encode(os.urandom(" . a:width . ")).decode())" ]
+        call writefile(pycode, g:rplugin_tmpdir . "/getRandomNumber.py")
+        let randnum = system(g:rplugin_py_exec . ' "' . g:rplugin_tmpdir . '/getRandomNumber.py"')
+        call delete(g:rplugin_tmpdir . "/getRandomNumber.py")
+    elseif !has("win32") && !has("win64") && !has("gui_win32") && !has("gui_win64")
+        let randnum = system("echo $RANDOM")
+    else
+        let randnum = localtime()
+    endif
+    return substitute(randnum, '\W', '', 'g')
+endfunction
 
-" Choose a terminal (code adapted from screen.vim)
-if has("gui_win32")
-    " No external terminal emulator will be called, so any value is good
-    let g:vimrplugin_term = "xterm"
+" If this is the Object Browser running in a Tmux pane, $VIMINSTANCEID is
+" already defined and shouldn't be changed
+if &filetype == "rbrowser"
+    if $VIMINSTANCEID == ""
+        call RWarningMsgInp("VIMINSTANCEID is undefined")
+    endif
 else
-    let s:terminals = ['gnome-terminal', 'konsole', 'xfce4-terminal', 'Eterm', 'rxvt', 'aterm', 'xterm']
-    if has('mac')
-        let s:terminals = ['iTerm', 'Terminal.app'] + s:terminals
-    endif
-    if !exists("g:vimrplugin_term")
-        for term in s:terminals
-            if executable(term)
-                let g:vimrplugin_term = term
-                break
-            endif
-        endfor
-        unlet term
+    let $VIMR_SECRET = GetRandomNumber(16)
+    let $VIMINSTANCEID = substitute(g:rplugin_firstbuffer . GetRandomNumber(16), '\W', '', 'g')
+    if strlen($VIMINSTANCEID) > 64
+        let $VIMINSTANCEID = substitute($VIMINSTANCEID, '.*\(...............................................................\)', '\1', '')
     endif
-    unlet s:terminals
 endif
 
-if !exists("g:vimrplugin_term") && !exists("g:vimrplugin_term_cmd")
-    call RWarningMsg("Please, set the variable 'g:vimrplugin_term_cmd' in your .vimrc.\nRead the plugin documentation for details.")
-    call input("Press  to continue. ")
-    let g:rplugin_failed = 1
-    finish
+let g:rplugin_docfile = g:rplugin_tmpdir . "/Rdoc"
+
+" Create an empty file to avoid errors if the user do Ctrl-X Ctrl-O before
+" starting R:
+if &filetype != "rbrowser"
+    call writefile([], g:rplugin_tmpdir . "/GlobalEnvList_" . $VIMINSTANCEID)
 endif
 
-if g:vimrplugin_term == "gnome-terminal" || g:vimrplugin_term == "xfce4-terminal"
-    " Cannot set icon: http://bugzilla.gnome.org/show_bug.cgi?id=126081
-    let g:rplugin_termcmd = g:vimrplugin_term . " --working-directory='" . expand("%:p:h") . "' --title R -e"
+" Set the value of R path
+if exists("g:vimrplugin_r_path")
+    let g:rplugin_R = expand(g:vimrplugin_r_path)
+    if isdirectory(g:rplugin_R)
+        let g:rplugin_R = g:rplugin_R . "/R"
+    endif
+elseif has("win32") || has("win64")
+    if g:vimrplugin_Rterm
+        let g:rplugin_R = "Rgui.exe"
+    else
+        let g:rplugin_R = "Rterm.exe"
+    endif
+else
+    let g:rplugin_R = "R"
 endif
 
-if g:vimrplugin_term == "konsole"
-    let g:rplugin_termcmd = "konsole --workdir '" . expand("%:p:h") . "' --icon " . g:rplugin_home . "/bitmaps/ricon.png -e"
+if has("win32")
+    runtime r-plugin/windows.vim
+    let g:rplugin_has_icons = len(globpath(&rtp, "bitmaps/RStart.bmp")) > 0
+else
+    let g:rplugin_has_icons = len(globpath(&rtp, "bitmaps/RStart.png")) > 0
 endif
 
-if g:vimrplugin_term == "Eterm"
-    let g:rplugin_termcmd = "Eterm --icon " . g:rplugin_home . "/bitmaps/ricon.png -e"
+if g:vimrplugin_applescript
+    runtime r-plugin/osx.vim
 endif
 
-if g:vimrplugin_term == "rxvt" || g:vimrplugin_term == "aterm"
-    let g:rplugin_termcmd = g:vimrplugin_term . " -e"
+if !has("win32") && !g:vimrplugin_applescript
+    runtime r-plugin/tmux.vim
 endif
 
-if g:vimrplugin_term == "xterm" || g:vimrplugin_term == "uxterm"
-    let g:rplugin_termcmd = g:vimrplugin_term . " -xrm '*iconPixmap: " . g:rplugin_home . "/bitmaps/ricon.xbm' -e"
+if has("gui_running")
+    runtime r-plugin/gui_running.vim
 endif
 
-" Override default settings:
-if exists("g:vimrplugin_term_cmd")
-    let g:rplugin_termcmd = g:vimrplugin_term_cmd
+if !executable(g:rplugin_R)
+    call RWarningMsgInp("R executable not found: '" . g:rplugin_R . "'")
 endif
 
+" Check if there is more than one copy of Nvim-R
+" (e.g. from the Vimballl and from a plugin manager)
+let s:ff = split(substitute(globpath(&rtp, "r-plugin/functions.vim"), "functions.vim", "", "g"), "\n")
+let s:ft = split(globpath(&rtp, "ftplugin/r*_rplugin.vim"), "\n")
+if len(s:ff) > 1 || len(s:ft) > 5
+    call RWarningMsgInp("It seems that Vim-R-plugin is installed in more than one place.\n" .
+                \ "Please, remove one of them to avoid conflicts.\n" .
+                \ "Below is a list of some of the possibly duplicated directories and files:\n" . join(s:ff, "\n") . "\n" . join(s:ft, "\n") . "\n")
+endif
+unlet s:ff
+unlet s:ft
diff --git a/r-plugin/etags2ctags.R b/r-plugin/etags2ctags.R
deleted file mode 100644
index 0520bec..0000000
--- a/r-plugin/etags2ctags.R
+++ /dev/null
@@ -1,71 +0,0 @@
-#  This program is free software; you can redistribute it and/or modify
-#  it under the terms of the GNU General Public License as published by
-#  the Free Software Foundation; either version 2 of the License, or
-#  (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  A copy of the GNU General Public License is available at
-#  http://www.r-project.org/Licenses/
-
-### Jakson Alves de Aquino
-### Sat, July 17, 2010
-
-# Note: Emacs TAGS file can be read by Vim if the feature
-# +emacs_tags was enabled while compiling Vim. If your Vim does
-# not have this feature, you can try the function below:
-
-# Function to convert from Emacs' TAGS file into Vim's tags file.
-# See http://en.wikipedia.org/wiki/Ctags on the web and ":help
-# ctags" in Vim for details on the two file formats.
-# Note: This function only works with a tags file created by the R
-# function rtags().
-# Arguments:
-#   etagsfile = character string with path to original TAGS
-#   ctagsfile = character string with path to destination tags
-# Example:
-#   setwd("/path/to/R-2.11.1/src/library/base/R")
-#   rtags(ofile = "TAGS")
-#   etags2ctags("TAGS", "tags")
-# After the above commands you should be able to jump from on file
-# to another with Vim by hitting CTRL-] over function names.
-etags2ctags <- function(etagsfile, ctagsfile){
-  elines <- readLines(etagsfile)
-  filelen <- length(elines)
-  nfread <- sum(elines == "\x0c")
-  nnames <- filelen - (2 * nfread)
-  clines <- vector(mode = "character", length = nnames)
-  i <- 1
-  k <- 1
-  while (i < filelen) {
-    if(elines[i] == "\x0c"){
-      i <- i + 1
-      curfile <- sub(",.*", "", elines[i])
-      i <- i + 1
-      curflines <- readLines(curfile)
-      while(elines[i] != "\x0c" && i <= filelen){
-	curname <- sub(".\x7f(.*)\x01.*", "\\1", elines[i])
-	curlnum <- as.numeric(sub(".*\x01(.*),.*", "\\1", elines[i]))
-	curaddr <- curflines[as.numeric(curlnum)]
-	curaddr <- gsub("\\\\", "\\\\\\\\", curaddr)
-	curaddr <- gsub("\t", "\\\\t", curaddr)
-	curaddr <- gsub("/", "\\\\/", curaddr)
-	curaddr <- paste("/^", curaddr, "$", sep = "")
-	clines[k] <- paste(curname, curfile, curaddr, sep = "\t")
-	i <- i + 1
-	k <- k + 1
-      }
-    } else {
-      stop("Error while trying to interpret line ", i, " of '", etagsfile, "'.\n")
-    }
-  }
-  curcollate <- Sys.getlocale(category = "LC_COLLATE")
-  invisible(Sys.setlocale(category = "LC_COLLATE", locale = "C"))
-  clines <- sort(clines)
-  invisible(Sys.setlocale(category = "LC_COLLATE", locale = curcollate))
-  writeLines(clines, ctagsfile)
-}
-
diff --git a/r-plugin/extern_term.vim b/r-plugin/extern_term.vim
new file mode 100644
index 0000000..8b83bc0
--- /dev/null
+++ b/r-plugin/extern_term.vim
@@ -0,0 +1,186 @@
+
+function StartR_ExternalTerm(rcmd)
+    if $DISPLAY == "" && !g:rplugin_is_darwin
+        call RWarningMsg("Start 'tmux' before Vim. The X Window system is required to run R in an external terminal.")
+        return
+    endif
+
+    if g:vimrplugin_notmuxconf
+        let tmuxcnf = ' '
+    else
+        " Create a custom tmux.conf
+        let cnflines = ['set-option -g prefix C-a',
+                    \ 'unbind-key C-b',
+                    \ 'bind-key C-a send-prefix',
+                    \ 'set-window-option -g mode-keys vi',
+                    \ 'set -g status off',
+                    \ 'set -g default-terminal "screen-256color"',
+                    \ "set -g terminal-overrides 'xterm*:smcup@:rmcup@'" ]
+
+        if g:vimrplugin_term == "rxvt" || g:vimrplugin_term == "urxvt"
+            let cnflines = cnflines + [
+                        \ "set terminal-overrides 'rxvt*:smcup@:rmcup@'" ]
+        endif
+
+        if g:vimrplugin_tmux_ob || !has("gui_running")
+            if g:rplugin_tmux_version < "2.1"
+                call extend(cnflines, ['set -g mode-mouse on', 'set -g mouse-select-pane on', 'set -g mouse-resize-pane on'])
+            else
+                call extend(cnflines, ['set -g mouse on'])
+            endif
+        endif
+        call writefile(cnflines, g:rplugin_tmpdir . "/tmux.conf")
+        let tmuxcnf = '-f "' . g:rplugin_tmpdir . "/tmux.conf" . '"'
+    endif
+
+    let rcmd = 'VIMRPLUGIN_TMPDIR=' . substitute(g:rplugin_tmpdir, ' ', '\\ ', 'g') . ' VIMR_COMPLDIR=' . substitute(g:rplugin_compldir, ' ', '\\ ', 'g') . ' VIMINSTANCEID=' . $VIMINSTANCEID . ' VIMR_SECRET=' . $VIMR_SECRET . ' VIMEDITOR_SVRNM=' . $VIMEDITOR_SVRNM . ' R_DEFAULT_PACKAGES=' . $R_DEFAULT_PACKAGES . ' ' . a:rcmd
+
+    call system("tmux -L vimr has-session -t " . g:rplugin_tmuxsname)
+    if v:shell_error
+        if g:rplugin_is_darwin
+            let opencmd = printf("tmux -L vimr -2 %s new-session -s %s 'TERM=screen-256color %s'", tmuxcnf, g:rplugin_tmuxsname, rcmd)
+            call writefile(["#!/bin/sh", opencmd], $VIMRPLUGIN_TMPDIR . "/openR")
+            call system("chmod +x '" . $VIMRPLUGIN_TMPDIR . "/openR'")
+            let opencmd = "open '" . $VIMRPLUGIN_TMPDIR . "/openR'"
+        else
+            if g:rplugin_termcmd =~ "gnome-terminal" || g:rplugin_termcmd =~ "xfce4-terminal" || g:rplugin_termcmd =~ "terminal" || g:rplugin_termcmd =~ "iterm"
+                let opencmd = printf("%s 'tmux -L vimr -2 %s new-session -s %s \"%s\"' &", g:rplugin_termcmd, tmuxcnf, g:rplugin_tmuxsname, rcmd)
+            else
+                let opencmd = printf("%s tmux -L vimr -2 %s new-session -s %s \"%s\" &", g:rplugin_termcmd, tmuxcnf, g:rplugin_tmuxsname, rcmd)
+            endif
+        endif
+    else
+        if g:rplugin_is_darwin
+            call RWarningMsg("Tmux session with R is already running")
+            return
+        endif
+        if g:rplugin_termcmd =~ "gnome-terminal" || g:rplugin_termcmd =~ "xfce4-terminal" || g:rplugin_termcmd =~ "terminal" || g:rplugin_termcmd =~ "iterm"
+            let opencmd = printf("%s 'tmux -L vimr -2 %s attach-session -d -t %s' &", g:rplugin_termcmd, tmuxcnf, g:rplugin_tmuxsname)
+        else
+            let opencmd = printf("%s tmux -L vimr -2 %s attach-session -d -t %s &", g:rplugin_termcmd, tmuxcnf, g:rplugin_tmuxsname)
+        endif
+    endif
+
+    let rlog = system(opencmd)
+    if v:shell_error
+        call RWarningMsg(rlog)
+        return
+    endif
+    let g:SendCmdToR = function('SendCmdToR_Term')
+    if WaitVimComStart()
+        if g:vimrplugin_after_start != ''
+            call system(g:vimrplugin_after_start)
+        endif
+    endif
+endfunction
+
+function SendCmdToR_Term(cmd)
+    if g:vimrplugin_ca_ck
+        let cmd = "\001" . "\013" . a:cmd
+    else
+        let cmd = a:cmd
+    endif
+
+    " Send the command to R running in an external terminal emulator
+    let str = substitute(cmd, "'", "'\\\\''", "g")
+    if str =~ '^-'
+        let str = ' ' . str
+    endif
+    let scmd = "tmux -L vimr set-buffer '" . str . "\' && tmux -L vimr paste-buffer -t " . g:rplugin_tmuxsname . '.0'
+    let rlog = system(scmd)
+    if v:shell_error
+        let rlog = substitute(rlog, '\n', ' ', 'g')
+        let rlog = substitute(rlog, '\r', ' ', 'g')
+        call RWarningMsg(rlog)
+        call ClearRInfo()
+        return 0
+    endif
+    return 1
+endfunction
+
+if g:rplugin_is_darwin
+    finish
+endif
+
+" Choose a terminal (code adapted from screen.vim)
+if exists("g:vimrplugin_term")
+    if !executable(g:vimrplugin_term)
+        call RWarningMsgInp("'" . g:vimrplugin_term . "' not found. Please change the value of 'vimrplugin_term' in your vimrc.")
+        let g:vimrplugin_term = "xterm"
+    endif
+endif
+if has("win32") || has("win64") || g:rplugin_is_darwin || g:rplugin_do_tmux_split
+    " No external terminal emulator will be called, so any value is good
+    let g:vimrplugin_term = "xterm"
+endif
+if !exists("g:vimrplugin_term")
+    let s:terminals = ['gnome-terminal', 'konsole', 'xfce4-terminal', 'terminal', 'Eterm',
+                \ 'rxvt', 'urxvt', 'aterm', 'roxterm', 'terminator', 'lxterminal', 'xterm']
+    for s:term in s:terminals
+        if executable(s:term)
+            let g:vimrplugin_term = s:term
+            break
+        endif
+    endfor
+    unlet s:term
+    unlet s:terminals
+endif
+
+if !exists("g:vimrplugin_term") && !exists("g:vimrplugin_term_cmd")
+    call RWarningMsgInp("Please, set the variable 'g:vimrplugin_term_cmd' in your .vimrc. Read the plugin documentation for details.")
+    let g:rplugin_failed = 1
+    finish
+endif
+
+let g:rplugin_termcmd = g:vimrplugin_term . " -e"
+
+if g:vimrplugin_term == "gnome-terminal" || g:vimrplugin_term == "xfce4-terminal" || g:vimrplugin_term == "terminal" || g:vimrplugin_term == "lxterminal"
+    " Cannot set gnome-terminal icon: http://bugzilla.gnome.org/show_bug.cgi?id=126081
+    if g:vimrplugin_vim_wd
+        let g:rplugin_termcmd = g:vimrplugin_term . " -e"
+    else
+        let g:rplugin_termcmd = g:vimrplugin_term . " --working-directory='" . expand("%:p:h") . "' -e"
+    endif
+endif
+
+if g:vimrplugin_term == "terminator"
+    if g:vimrplugin_vim_wd
+        let g:rplugin_termcmd = "terminator --title R -x"
+    else
+        let g:rplugin_termcmd = "terminator --working-directory='" . expand("%:p:h") . "' --title R -x"
+    endif
+endif
+
+if g:vimrplugin_term == "konsole"
+    if g:vimrplugin_vim_wd
+        let g:rplugin_termcmd = "konsole --icon " . g:rplugin_home . "/bitmaps/ricon.png -e"
+    else
+        let g:rplugin_termcmd = "konsole --workdir '" . expand("%:p:h") . "' --icon " . g:rplugin_home . "/bitmaps/ricon.png -e"
+    endif
+endif
+
+if g:vimrplugin_term == "Eterm"
+    let g:rplugin_termcmd = "Eterm --icon " . g:rplugin_home . "/bitmaps/ricon.png -e"
+endif
+
+if g:vimrplugin_term == "roxterm"
+    " Cannot set icon: http://bugzilla.gnome.org/show_bug.cgi?id=126081
+    if g:vimrplugin_vim_wd
+        let g:rplugin_termcmd = "roxterm --title R -e"
+    else
+        let g:rplugin_termcmd = "roxterm --directory='" . expand("%:p:h") . "' --title R -e"
+    endif
+endif
+
+if g:vimrplugin_term == "xterm" || g:vimrplugin_term == "uxterm"
+    let g:rplugin_termcmd = g:vimrplugin_term . " -e"
+endif
+
+if g:vimrplugin_term == "rxvt" || g:vimrplugin_term == "urxvt"
+    let g:rplugin_termcmd = g:vimrplugin_term . " -cd '" . expand("%:p:h") . "' -title R -xrm '*iconPixmap: " . g:rplugin_home . "/bitmaps/ricon.xbm' -e"
+endif
+
+" Override default settings:
+if exists("g:vimrplugin_term_cmd")
+    let g:rplugin_termcmd = g:vimrplugin_term_cmd
+endif
diff --git a/r-plugin/functions.vim b/r-plugin/functions.vim
index 4155ba9..ca24a82 100644
--- a/r-plugin/functions.vim
+++ b/r-plugin/functions.vim
@@ -1,307 +1,187 @@
-syn keyword rFunction  acf acf2AR add1 addmargins add.scope aggregate aggregate.data.frame
-syn keyword rFunction  aggregate.default aggregate.ts AIC alias anova anova.glm anova.glmlist
-syn keyword rFunction  anovalist.lm anova.lm anova.lmlist anova.mlm ansari.test aov approx
-syn keyword rFunction  approxfun ar ar.burg arima arima0 arima0.diag arima.sim
-syn keyword rFunction  ARMAacf ARMAtoMA ar.mle ar.ols ar.yw as.dendrogram as.dist
-syn keyword rFunction  as.formula as.hclust asOneSidedFormula as.stepfun as.ts ave bandwidth.kernel
-syn keyword rFunction  bartlett.test binomial binom.test biplot Box.test bw.bcv bw.nrd
-syn keyword rFunction  bw.nrd0 bw.SJ bw.ucv C cancor case.names ccf
-syn keyword rFunction  .checkMFClasses chisq.test clearNames cmdscale coef coefficients complete.cases
-syn keyword rFunction  confint confint.default constrOptim contrasts contr.helmert contr.poly contr.SAS
-syn keyword rFunction  contr.sum contr.treatment convolve cooks.distance cophenetic cor cor.test
-syn keyword rFunction  cov cov2cor covratio cov.wt cpgram cutree cycle
-syn keyword rFunction  D dbeta dbinom dcauchy dchisq decompose delete.response
-syn keyword rFunction  deltat dendrapply density density.default deriv deriv3 deriv3.default
-syn keyword rFunction  deriv3.formula deriv.default deriv.formula deviance dexp df dfbeta
-syn keyword rFunction  dfbetas dffits df.kernel df.residual dgamma dgeom dhyper
-syn keyword rFunction  diffinv diff.ts dist dlnorm dlogis dmultinom dnbinom
-syn keyword rFunction  dnorm dpois drop1 drop.scope drop.terms dsignrank dt
-syn keyword rFunction  dummy.coef dunif dweibull dwilcox ecdf eff.aovlist effects
-syn keyword rFunction  embed end estVar expand.model.frame extractAIC factanal factor.scope
-syn keyword rFunction  family fft filter fisher.test fitted fitted.values fivenum
-syn keyword rFunction  fligner.test formula frequency friedman.test ftable Gamma gaussian
-syn keyword rFunction  getInitial .getXlevels glm glm.control glm.fit glm.fit.null hasTsp
-syn keyword rFunction  hat hatvalues hatvalues.lm hclust heatmap HoltWinters influence
-syn keyword rFunction  influence.measures integrate interaction.plot inverse.gaussian IQR is.empty.model is.leaf
-syn keyword rFunction  is.mts isoreg is.stepfun is.ts is.tskernel KalmanForecast KalmanLike
-syn keyword rFunction  KalmanRun KalmanSmooth kernapply kernel kmeans knots kruskal.test
-syn keyword rFunction  ksmooth ks.test lag lag.plot line lines.ts lm
-syn keyword rFunction  lm.fit lm.fit.null lm.influence lm.wfit lm.wfit.null loadings loess
-syn keyword rFunction  loess.control loess.smooth logLik loglin lowess ls.diag lsfit
-syn keyword rFunction  ls.print mad mahalanobis makeARIMA make.link makepredictcall manova
-syn keyword rFunction  mantelhaen.test mauchley.test mauchly.test mcnemar.test median median.default medpolish
-syn keyword rFunction  .MFclass model.extract model.frame model.frame.aovlist model.frame.default model.frame.glm model.frame.lm
-syn keyword rFunction  model.matrix model.matrix.default model.matrix.lm model.offset model.response model.tables model.weights
-syn keyword rFunction  monthplot mood.test mvfft na.action na.contiguous na.exclude na.fail
-syn keyword rFunction  na.omit na.pass napredict naprint naresid nextn nlm
-syn keyword rFunction  nlminb nls nls.control NLSstAsymptotic NLSstClosestX NLSstLfAsymptote NLSstRtAsymptote
-syn keyword rFunction  numericDeriv offset oneway.test optim optimise optimize order.dendrogram
-syn keyword rFunction  pacf p.adjust pairwise.prop.test pairwise.table pairwise.t.test pairwise.wilcox.test pbeta
-syn keyword rFunction  pbinom pbirthday pcauchy pchisq pexp pf pgamma
-syn keyword rFunction  pgeom phyper plclust plnorm plogis plot.density plot.ecdf
-syn keyword rFunction  plot.lm plot.mlm plot.spec plot.spec.coherency plot.spec.phase plot.stepfun plot.ts
-syn keyword rFunction  plot.TukeyHSD pnbinom pnorm poisson poisson.test poly polym
-syn keyword rFunction  power power.anova.test power.prop.test power.t.test ppoints ppois ppr
-syn keyword rFunction  PP.test prcomp predict predict.glm predict.lm predict.mlm predict.poly
-syn keyword rFunction  preplot princomp print.anova print.coefmat printCoefmat print.density print.family
-syn keyword rFunction  print.formula print.ftable print.glm print.infl print.integrate print.lm print.logLik
-syn keyword rFunction  print.terms print.ts profile proj promax prop.test prop.trend.test
-syn keyword rFunction  psignrank pt ptukey punif pweibull pwilcox qbeta
-syn keyword rFunction  qbinom qbirthday qcauchy qchisq qexp qf qgamma
-syn keyword rFunction  qgeom qhyper qlnorm qlogis qnbinom qnorm qpois
-syn keyword rFunction  qqline qqnorm qqnorm.default qqplot qsignrank qt qtukey
-syn keyword rFunction  quade.test quantile quantile.default quasi quasibinomial quasipoisson qunif
-syn keyword rFunction  qweibull qwilcox r2dtable rbeta rbinom rcauchy rchisq
-syn keyword rFunction  read.ftable rect.hclust reformulate relevel reorder replications reshape
-syn keyword rFunction  reshapeLong reshapeWide resid residuals residuals.default residuals.glm residuals.lm
-syn keyword rFunction  rexp rf rgamma rgeom rhyper rlnorm rlogis
-syn keyword rFunction  rmultinom rnbinom rnorm rpois rsignrank rstandard rstandard.glm
-syn keyword rFunction  rstandard.lm rstudent rstudent.glm rstudent.lm rt runif runmed
-syn keyword rFunction  rweibull rwilcox scatter.smooth screeplot sd se.contrast selfStart
-syn keyword rFunction  setNames shapiro.test simulate smooth smoothEnds smooth.spline sortedXyData
-syn keyword rFunction  spec.ar spec.pgram spec.taper spectrum spline splinefun splinefunH
-syn keyword rFunction  SSasymp SSasympOff SSasympOrig SSbiexp SSD SSfol SSfpl
-syn keyword rFunction  SSgompertz SSlogis SSmicmen SSweibull start stat.anova step
-syn keyword rFunction  stepfun stl StructTS summary.aov summary.aovlist summary.glm summary.infl
-syn keyword rFunction  summary.lm summary.manova summary.mlm summary.stepfun supsmu symnum termplot
-syn keyword rFunction  terms terms.aovlist terms.default terms.formula terms.terms time toeplitz
-syn keyword rFunction  ts tsdiag ts.intersect tsp ts.plot tsSmooth ts.union
-syn keyword rFunction  t.test TukeyHSD TukeyHSD.aov uniroot update update.default update.formula
-syn keyword rFunction  var variable.names varimax var.test vcov weighted.mean weighted.residuals
-syn keyword rFunction  weights wilcox.test window write.ftable xtabs abline arrows
-syn keyword rFunction  assocplot axis Axis axis.Date axis.POSIXct axTicks barplot
-syn keyword rFunction  barplot.default box boxplot boxplot.default boxplot.matrix bxp cdplot
-syn keyword rFunction  clip close.screen co.intervals contour contour.default coplot curve
-syn keyword rFunction  dotchart erase.screen filled.contour fourfoldplot frame grconvertX grconvertY
-syn keyword rFunction  grid hist hist.default identify image image.default layout
-syn keyword rFunction  layout.show lcm legend lines lines.default locator matlines
-syn keyword rFunction  matplot matpoints mosaicplot mtext pairs pairs.default panel.smooth
-syn keyword rFunction  par persp pie piechart plot plot.default plot.design
-syn keyword rFunction  plot.new plot.window plot.xy points points.default polygon polypath
-syn keyword rFunction  rasterImage rect rug screen segments smoothScatter spineplot
-syn keyword rFunction  split.screen stars stem strheight stripchart strwidth sunflowerplot
-syn keyword rFunction  symbols text text.default title xinch xspline xyinch
-syn keyword rFunction  yinch adjustcolor as.graphicsAnnot as.raster bitmap bmp boxplot.stats
-syn keyword rFunction  check.options chull CIDFont cm cm.colors col2rgb colorConverter
-syn keyword rFunction  colorRamp colorRampPalette colors colours contourLines convertColor densCols
-syn keyword rFunction  dev2bitmap devAskNewPage dev.control dev.copy dev.copy2eps dev.copy2pdf dev.cur
-syn keyword rFunction  deviceIsInteractive dev.interactive dev.list dev.new dev.next dev.off dev.prev
-syn keyword rFunction  dev.print dev.set dev.size embedFonts extendrange getGraphicsEvent getGraphicsEventEnv
-syn keyword rFunction  graphics.off gray gray.colors grey grey.colors hcl heat.colors
-syn keyword rFunction  hsv is.raster jpeg make.rgb n2mfrow nclass.FD nclass.scott
-syn keyword rFunction  nclass.Sturges palette pdf pdfFonts pdf.options pictex png
-syn keyword rFunction  postscript postscriptFont postscriptFonts ps.options quartz quartzFont quartzFonts
-syn keyword rFunction  quartz.options rainbow recordGraphics recordPlot replayPlot rgb rgb2hsv
-syn keyword rFunction  savePlot setEPS setGraphicsEventEnv setGraphicsEventHandlers setPS svg terrain.colors
-syn keyword rFunction  tiff topo.colors trans3d Type1Font x11 X11 X11Font
-syn keyword rFunction  X11Fonts X11.options xfig xy.coords xyTable xyz.coords alarm
-syn keyword rFunction  apropos argsAnywhere aspell as.person as.personList as.relistable as.roman
-syn keyword rFunction  assignInNamespace available.packages bibentry browseEnv browseURL browseVignettes bug.report
-syn keyword rFunction  capture.output checkCRAN chooseBioCmirror chooseCRANmirror citation citEntry citFooter
-syn keyword rFunction  citHeader close.socket combn compareVersion contrib.url count.fields CRAN.packages
-syn keyword rFunction  data dataentry data.entry de debugger demo de.ncols
-syn keyword rFunction  de.restore de.setup .DollarNames download.file download.packages dump.frames edit
-syn keyword rFunction  emacs example file.edit find findLineNum fix fixInNamespace
-syn keyword rFunction  flush.console formatOL formatUL getAnywhere getCRANmirrors getFromNamespace getS3method
-syn keyword rFunction  getTxtProgressBar glob2rx head head.matrix help help.request help.search
-syn keyword rFunction  help.start history installed.packages install.packages is.relistable limitedLabels loadhistory
-syn keyword rFunction  localeToCharset lsf.str ls.str maintainer make.packages.html makeRweaveLatexCodeRunner make.socket
-syn keyword rFunction  memory.limit memory.size menu methods mirror2html modifyList new.packages
-syn keyword rFunction  news normalizePath nsl object.size old.packages package.contents packageDescription
-syn keyword rFunction  package.skeleton packageStatus packageVersion page person personList pico
-syn keyword rFunction  prompt promptData promptPackage rc.getOption rc.options rc.settings rc.status
-syn keyword rFunction  readCitationFile read.csv read.csv2 read.delim read.delim2 read.DIF read.fortran
-syn keyword rFunction  read.fwf read.socket read.table recover relist remove.packages Rprof
-syn keyword rFunction  Rprofmem RShowDoc RSiteSearch rtags Rtangle RtangleSetup RtangleWritedoc
-syn keyword rFunction  RweaveChunkPrefix RweaveEvalWithOpt RweaveLatex RweaveLatexFinish RweaveLatexOptions RweaveLatexSetup RweaveLatexWritedoc
-syn keyword rFunction  RweaveTryStop savehistory select.list sessionInfo setBreakpoint setRepositories setTxtProgressBar
-syn keyword rFunction  stack Stangle str strOptions summaryRprof Sweave SweaveHooks
-syn keyword rFunction  SweaveSyntConv tail tail.matrix tar timestamp toBibtex toLatex
-syn keyword rFunction  txtProgressBar type.convert unstack untar unzip update.packages update.packageStatus
-syn keyword rFunction  upgrade URLdecode URLencode url.show vi View vignette
-syn keyword rFunction  write.csv write.csv2 write.socket write.table wsbrowser xedit xemacs
-syn keyword rFunction  zip.file.extract .First.lib addNextMethod allGenerics allNames Arith as
-syn keyword rFunction  asMethodDefinition assignClassDef assignMethodsMetaData balanceMethodsList cacheGenericsMetaData cacheMetaData cacheMethod
-syn keyword rFunction  callGeneric callNextMethod canCoerce cbind2 checkSlotAssignment classesToAM classMetaName
-syn keyword rFunction  coerce Compare completeClassDefinition completeExtends completeSubclasses Complex conformMethod
-syn keyword rFunction  defaultDumpName defaultPrototype doPrimitiveMethod .doTracePrint dumpMethod dumpMethods el
-syn keyword rFunction  elNamed empty.dump emptyMethodsList evalSource existsFunction existsMethod extends
-syn keyword rFunction  finalDefaultMethod findClass findFunction findMethod findMethods findMethodSignatures findUnique
-syn keyword rFunction  formalArgs functionBody generic.skeleton getAccess getAllMethods getAllSuperClasses getClass
-syn keyword rFunction  getClassDef getClasses getClassName getClassPackage getDataPart getExtends getFunction
-syn keyword rFunction  getGeneric getGenerics getGroup getGroupMembers getMethod getMethods getMethodsForDispatch
-syn keyword rFunction  getMethodsMetaData getPackageName getProperties getPrototype getRefClass getSlots getSubclasses
-syn keyword rFunction  getValidity getVirtual hasArg hasMethod hasMethods .hasSlot implicitGeneric
-syn keyword rFunction  inheritedSlotNames initFieldArgs initialize insertMethod insertSource is isClass
-syn keyword rFunction  isClassDef isClassUnion isGeneric isGrammarSymbol isGroup isSealedClass isSealedMethod
-syn keyword rFunction  isVirtualClass isXS3Class languageEl .Last.lib linearizeMlist listFromMethods listFromMlist
-syn keyword rFunction  loadMethod Logic makeClassRepresentation makeExtends makeGeneric makeMethodsList makePrototypeFromClassDef
-syn keyword rFunction  makeStandardGeneric matchSignature Math Math2 mergeMethods metaNameUndo MethodAddCoerce
-syn keyword rFunction  methodSignatureMatrix method.skeleton MethodsList MethodsListSelect methodsPackageMetaName missingArg mlistMetaName
-syn keyword rFunction  new newBasic newClassRepresentation newEmptyObject Ops packageSlot possibleExtends
-syn keyword rFunction  prohibitGeneric promptClass promptMethods prototype Quote rbind2 reconcilePropertiesAndPrototype
-syn keyword rFunction  registerImplicitGenerics rematchDefinition removeClass removeGeneric removeMethod removeMethods removeMethodsObject
-syn keyword rFunction  representation requireMethods resetClass resetGeneric S3Class S3Part sealClass
-syn keyword rFunction  seemsS4Object selectMethod selectSuperClasses .selectSuperClasses sessionData setAs setClass
-syn keyword rFunction  setClassUnion setDataPart setGeneric setGenericImplicit setGroupGeneric setIs setMethod
-syn keyword rFunction  setOldClass setPackageName setPrimitiveMethods setRefClass setReplaceMethod setValidity show
-syn keyword rFunction  showClass showDefault showExtends showMethods showMlist signature SignatureMethod
-syn keyword rFunction  sigToEnv slot slotNames .slotNames slotsFromS3 substituteDirect substituteFunctionArgs
-syn keyword rFunction  Summary superClassDepth testInheritedMethods testVirtual traceOff traceOn .TraceWithMethods
-syn keyword rFunction  tryNew trySilent unRematchDefinition .untracedFunction validObject validSlotNames .valueClassTest
-syn keyword rFunction  abbreviate abs acos acosh addNA addTaskCallback agrep
-syn keyword rFunction  .Alias alist all all.equal all.equal.character all.equal.default all.equal.factor
-syn keyword rFunction  all.equal.formula all.equal.language all.equal.list all.equal.numeric all.equal.POSIXct all.equal.raw all.names
-syn keyword rFunction  all.vars any anyDuplicated anyDuplicated.array anyDuplicated.data.frame anyDuplicated.default anyDuplicated.matrix
-syn keyword rFunction  aperm append apply Arg args array arrayInd
-syn keyword rFunction  as.array as.array.default as.call as.character as.character.condition as.character.Date as.character.default
-syn keyword rFunction  as.character.error as.character.factor as.character.hexmode as.character.numeric_version as.character.octmode as.character.POSIXt as.character.srcref
-syn keyword rFunction  as.complex as.data.frame as.data.frame.array as.data.frame.AsIs as.data.frame.character as.data.frame.complex as.data.frame.data.frame
-syn keyword rFunction  as.data.frame.Date as.data.frame.default as.data.frame.difftime as.data.frame.factor as.data.frame.integer as.data.frame.list as.data.frame.logical
-syn keyword rFunction  as.data.frame.matrix as.data.frame.model.matrix as.data.frame.numeric as.data.frame.numeric_version as.data.frame.ordered as.data.frame.POSIXct as.data.frame.POSIXlt
-syn keyword rFunction  as.data.frame.raw as.data.frame.table as.data.frame.ts as.data.frame.vector as.Date as.Date.character as.Date.date
-syn keyword rFunction  as.Date.dates as.Date.default as.Date.factor as.Date.numeric as.Date.POSIXct as.Date.POSIXlt as.difftime
-syn keyword rFunction  as.double as.double.difftime as.double.POSIXlt as.environment as.expression as.expression.default as.factor
-syn keyword rFunction  as.function as.function.default as.hexmode asin asinh as.integer as.list
-syn keyword rFunction  as.list.data.frame as.list.Date as.list.default as.list.environment as.list.factor as.list.function as.list.numeric_version
-syn keyword rFunction  as.list.POSIXct as.logical as.logical.factor as.matrix as.matrix.data.frame as.matrix.default as.matrix.noquote
-syn keyword rFunction  as.matrix.POSIXlt as.name asNamespace as.null as.null.default as.numeric as.numeric_version
-syn keyword rFunction  as.octmode as.ordered as.package_version as.pairlist as.POSIXct as.POSIXct.date as.POSIXct.Date
-syn keyword rFunction  as.POSIXct.dates as.POSIXct.default as.POSIXct.numeric as.POSIXct.POSIXlt as.POSIXlt as.POSIXlt.character as.POSIXlt.date
-syn keyword rFunction  as.POSIXlt.Date as.POSIXlt.dates as.POSIXlt.default as.POSIXlt.factor as.POSIXlt.numeric as.POSIXlt.POSIXct as.qr
-syn keyword rFunction  as.raw as.real asS3 asS4 assign as.single as.single.default
-syn keyword rFunction  as.symbol as.table as.table.default as.vector as.vector.factor atan atan2
-syn keyword rFunction  atanh attach attachNamespace attr attr.all.equal attributes autoload
-syn keyword rFunction  autoloader backsolve baseenv basename besselI besselJ besselK
-syn keyword rFunction  besselY beta bindingIsActive bindingIsLocked bindtextdomain body bquote
-syn keyword rFunction  browser browserCondition browserSetDebug browserText builtins by by.data.frame
-syn keyword rFunction  by.default bzfile c .C .cache_class call .Call
-syn keyword rFunction  callCC .Call.graphics capabilities casefold cat category cbind
-syn keyword rFunction  cbind.data.frame c.Date ceiling character char.expand charmatch charToRaw
-syn keyword rFunction  chartr chol chol2inv chol.default choose class close
-syn keyword rFunction  closeAllConnections close.connection close.srcfile c.noquote c.numeric_version codes codes.factor
-syn keyword rFunction  codes.ordered col colMeans colnames colSums commandArgs comment
-syn keyword rFunction  complex computeRestarts conditionCall conditionCall.condition conditionMessage conditionMessage.condition conflicts
-syn keyword rFunction  Conj contributors cos cosh c.POSIXct c.POSIXlt crossprod
-syn keyword rFunction  cummax cummin cumprod cumsum cut cut.Date cut.default
-syn keyword rFunction  cut.POSIXt data.class data.frame data.matrix date debug debugonce
-syn keyword rFunction  .decode_numeric_version default.stringsAsFactors .Defunct delay delayedAssign deparse .deparseOpts
-syn keyword rFunction  .Deprecated det detach determinant determinant.matrix dget diag
-syn keyword rFunction  diff diff.Date diff.default diff.POSIXt difftime .difftime digamma
-syn keyword rFunction  dim dim.data.frame dimnames dimnames.data.frame dir dir.create dirname
-syn keyword rFunction  do.call .doTrace double dput dQuote drop droplevels
-syn keyword rFunction  droplevels.data.frame droplevels.factor dump duplicated duplicated.array duplicated.data.frame duplicated.default
-syn keyword rFunction  duplicated.matrix duplicated.numeric_version duplicated.POSIXlt .dynLibs dyn.load dyn.unload eapply
-syn keyword rFunction  eigen emptyenv enc2native enc2utf8 .encode_numeric_version encodeString Encoding
-syn keyword rFunction  enquote environment environmentIsLocked environmentName env.profile eval eval.parent
-syn keyword rFunction  evalq exists exp expand.grid .expand_R_libs_env_var expm1 .Export
-syn keyword rFunction  expression .External .External.graphics factor factorial fifo file
-syn keyword rFunction  file.access file.append file.choose file.copy file.create file.exists file.info
-syn keyword rFunction  file.path file.remove file.rename file.show file.symlink Filter Find
-syn keyword rFunction  findInterval .find.package findPackageEnv findRestart .First.sys floor flush
-syn keyword rFunction  flush.connection force formals format format.AsIs formatC format.char
-syn keyword rFunction  format.data.frame format.Date format.default format.difftime formatDL format.factor format.hexmode
-syn keyword rFunction  format.info format.numeric_version format.octmode format.POSIXct format.POSIXlt format.pval .Fortran
-syn keyword rFunction  forwardsolve function gamma gammaCody gc gcinfo gc.time
-syn keyword rFunction  gctorture get getAllConnections getCallingDLL getCallingDLLe getCConverterDescriptions getCConverterStatus
-syn keyword rFunction  getConnection getDLLRegisteredRoutines getDLLRegisteredRoutines.character getDLLRegisteredRoutines.DLLInfo getenv geterrmessage getExportedValue
-syn keyword rFunction  getHook getLoadedDLLs getNamespace getNamespaceExports getNamespaceImports getNamespaceInfo getNamespaceName
-syn keyword rFunction  getNamespaceUsers getNamespaceVersion getNativeSymbolInfo getNumCConverters getOption .getRequiredPackages .getRequiredPackages2
-syn keyword rFunction  getRversion getSrcLines getTaskCallbackNames gettext gettextf getwd gl
-syn keyword rFunction  globalenv gregexpr grep grepl gsub .gt .gtn
-syn keyword rFunction  gzcon gzfile .handleSimpleError httpclient I iconv iconvlist
-syn keyword rFunction  icuSetCollate identical identity ifelse Im .Import .ImportFrom
-syn keyword rFunction  importIntoEnv inherits integer interaction interactive .Internal intersect
-syn keyword rFunction  intToBits intToUtf8 inverse.rle invisible invokeRestart invokeRestartInteractively is.array
-syn keyword rFunction  is.atomic isatty isBaseNamespace is.call is.character is.complex is.data.frame
-syn keyword rFunction  isdebugged is.double is.element is.environment is.expression is.factor is.finite
-syn keyword rFunction  is.function isIncomplete is.infinite is.integer is.language is.list is.loaded
-syn keyword rFunction  is.logical is.matrix .isMethodsDispatchOn is.na is.na.data.frame is.name isNamespace
-syn keyword rFunction  is.nan is.na.numeric_version is.na.POSIXlt is.null is.numeric is.numeric.Date is.numeric.difftime
-syn keyword rFunction  is.numeric.POSIXt is.numeric_version is.object ISOdate ISOdatetime isOpen .isOpen
-syn keyword rFunction  is.ordered is.package_version is.pairlist is.primitive is.qr is.R is.raw
-syn keyword rFunction  is.real is.recursive isRestart isS4 isSeekable is.single is.symbol
-syn keyword rFunction  isSymmetric isSymmetric.matrix is.table isTRUE is.unsorted is.vector jitter
-syn keyword rFunction  julian julian.Date julian.POSIXt kappa kappa.default kappa.lm kappa.qr
-syn keyword rFunction  kappa.tri kronecker labels labels.default La.chol La.chol2inv La.eigen
-syn keyword rFunction  lapply .Last.value$value La.svd lazyLoad lazyLoadDBfetch lbeta lchoose
-syn keyword rFunction  length length.POSIXlt levels levels.default lfactorial lgamma .libPaths
-syn keyword rFunction  library library.dynam library.dynam.unload licence license list list2env
-syn keyword rFunction  list.files load loadedNamespaces loadingNamespaceInfo loadNamespace loadURL local
-syn keyword rFunction  lockBinding lockEnvironment log log10 log1p log2 logb
-syn keyword rFunction  logical lower.tri ls machine Machine makeActiveBinding .makeMessage
-syn keyword rFunction  make.names .make_numeric_version make.unique manglePackageName Map mapply margin.table
-syn keyword rFunction  match match.arg match.call match.fun Math.data.frame Math.Date Math.difftime
-syn keyword rFunction  Math.factor Math.POSIXt mat.or.vec matrix max max.col mean
-syn keyword rFunction  mean.data.frame mean.Date mean.default mean.difftime mean.POSIXct mean.POSIXlt memCompress
-syn keyword rFunction  memDecompress mem.limits memory.profile merge merge.data.frame merge.default .mergeExportMethods
-syn keyword rFunction  .mergeImportMethods message mget min missing Mod mode
-syn keyword rFunction  months months.Date months.POSIXt names namespaceExport namespaceImport namespaceImportClasses
-syn keyword rFunction  namespaceImportFrom namespaceImportMethods nargs nchar ncol NCOL Negate
-syn keyword rFunction  new.env NextMethod ngettext nlevels noquote norm .NotYetImplemented
-syn keyword rFunction  .NotYetUsed nrow NROW numeric nzchar objects oldClass
-syn keyword rFunction  on.exit open open.connection open.srcfile open.srcfilecopy Ops.data.frame Ops.Date
-syn keyword rFunction  Ops.difftime Ops.factor Ops.numeric_version Ops.ordered Ops.POSIXt options .OptRequireMethods
-syn keyword rFunction  order ordered outer package.description packageEvent packageHasNamespace .packages
-syn keyword rFunction  packageStartupMessage .packageStartupMessage packBits pairlist parent.env parent.frame parse
-syn keyword rFunction  parse.dcf parseNamespaceFile paste path.expand .path.package pentagamma pipe
-syn keyword rFunction  Platform pmatch pmax pmax.int pmin pmin.int polyroot
-syn keyword rFunction  Position .POSIXct .POSIXlt pos.to.env pretty pretty.default prettyNum
-syn keyword rFunction  .Primitive .primTrace .primUntrace print print.AsIs print.by print.condition
-syn keyword rFunction  print.connection print.data.frame print.Date print.default print.difftime print.DLLInfo print.DLLInfoList
-syn keyword rFunction  print.DLLRegisteredRoutines print.factor print.function print.hexmode print.libraryIQR print.listof print.NativeRoutineList
-syn keyword rFunction  printNoClass print.noquote print.numeric_version print.octmode print.packageInfo print.POSIXct print.POSIXlt
-syn keyword rFunction  print.proc_time print.restart print.rle print.simple.list print.srcfile print.srcref print.summaryDefault
-syn keyword rFunction  print.summary.table print.table print.warnings prmatrix proc.time prod prop.table
-syn keyword rFunction  provide psigamma pushBack pushBackLength q qr qr.coef
-syn keyword rFunction  qr.default qr.fitted qr.Q qr.qty qr.qy qr.R qr.resid
-syn keyword rFunction  qr.solve qr.X quarters quarters.Date quarters.POSIXt quit quote
-syn keyword rFunction  range range.default rank rapply raw rawConnection rawConnectionValue
-syn keyword rFunction  rawShift rawToBits rawToChar rbind rbind.data.frame rcond Re
-syn keyword rFunction  readBin readChar read.dcf readline readLines .readRDS readRenviron
-syn keyword rFunction  read.table.url real Recall Reduce regexpr reg.finalizer registerS3method
-syn keyword rFunction  registerS3methods remove removeCConverter removeTaskCallback rep rep.Date rep.factor
-syn keyword rFunction  rep.int replace replicate rep.numeric_version rep.POSIXct rep.POSIXlt require
-syn keyword rFunction  restart restartDescription restartFormals retracemem return rev rev.default
-syn keyword rFunction  R.home rle rm RNGkind RNGversion round round.Date
-syn keyword rFunction  round.POSIXt row rowMeans rownames row.names row.names.data.frame row.names.default
-syn keyword rFunction  .row_names_info rowsum rowsum.data.frame rowsum.default rowSums R.Version .S3method
-syn keyword rFunction  sample sample.int sapply save save.image .saveRDS scale
-syn keyword rFunction  scale.default scan scan.url .Script search searchpaths seek
-syn keyword rFunction  seek.connection seq seq.Date seq.default seq.int seq.POSIXt sequence
-syn keyword rFunction  serialize setCConverterStatus setdiff setequal setHook setNamespaceInfo .set_row_names
-syn keyword rFunction  set.seed setSessionTimeLimit setTimeLimit setwd showConnections shQuote sign
-syn keyword rFunction  signalCondition .signalSimpleWarning signif simpleCondition simpleError simpleMessage simpleWarning
-syn keyword rFunction  sin single sinh sink sink.number slice.index socketConnection
-syn keyword rFunction  socketSelect solve solve.default solve.qr sort sort.default sort.int
-syn keyword rFunction  sort.list sort.POSIXlt source source.url split split.data.frame split.Date
-syn keyword rFunction  split.default split.POSIXct sprintf sqrt sQuote srcfile srcfilecopy
-syn keyword rFunction  srcref standardGeneric .standard_regexps stderr stdin stdout stop
-syn keyword rFunction  stopifnot storage.mode strftime strptime strsplit strtoi strtrim
-syn keyword rFunction  structure strwrap sub subset .subset .subset2 subset.data.frame
-syn keyword rFunction  subset.default subset.matrix substitute substr substring sum summary
-syn keyword rFunction  summary.connection summary.data.frame Summary.data.frame summary.Date Summary.Date summary.default Summary.difftime
-syn keyword rFunction  summary.factor Summary.factor summary.matrix Summary.numeric_version summary.POSIXct Summary.POSIXct summary.POSIXlt
-syn keyword rFunction  Summary.POSIXlt summary.srcfile summary.srcref summary.table suppressMessages suppressPackageStartupMessages suppressWarnings
-syn keyword rFunction  svd sweep switch symbol.C symbol.For sys.call sys.calls
-syn keyword rFunction  Sys.chmod Sys.Date sys.frame sys.frames sys.function Sys.getenv Sys.getlocale
-syn keyword rFunction  Sys.getpid Sys.glob Sys.info sys.load.image Sys.localeconv sys.nframe sys.on.exit
-syn keyword rFunction  sys.parent sys.parents Sys.putenv Sys.readlink sys.save.image Sys.setenv Sys.setlocale
-syn keyword rFunction  Sys.sleep sys.source sys.status system system2 system.file system.time
-syn keyword rFunction  Sys.time Sys.timezone Sys.umask Sys.unsetenv Sys.which t table
-syn keyword rFunction  tabulate tan tanh .TAOCP1997init tapply taskCallbackManager tcrossprod
-syn keyword rFunction  t.data.frame t.default tempdir tempfile testPlatformEquivalence tetragamma textConnection
-syn keyword rFunction  textConnectionValue tolower topenv toString toString.default toupper trace
-syn keyword rFunction  traceback tracemem tracingState transform transform.data.frame transform.default trigamma
-syn keyword rFunction  trunc truncate truncate.connection trunc.Date trunc.POSIXt try tryCatch
-syn keyword rFunction  typeof unclass undebug union unique unique.array unique.data.frame
-syn keyword rFunction  unique.default unique.matrix unique.numeric_version unique.POSIXlt units units.difftime unix
-syn keyword rFunction  unix.time unlink unlist unloadNamespace unlockBinding unname unserialize
-syn keyword rFunction  unsplit untrace untracemem unz upper.tri url UseMethod
-syn keyword rFunction  utf8ToInt vapply vector Vectorize Version warning warnings
-syn keyword rFunction  weekdays weekdays.Date weekdays.POSIXt which which.max which.min with
-syn keyword rFunction  withCallingHandlers with.default within within.data.frame within.list withRestarts withVisible
-syn keyword rFunction  write writeBin writeChar write.dcf writeLines write.table0 xor
-syn keyword rFunction  xor.hexmode xor.octmode xpdrows.data.frame xtfrm xtfrm.AsIs xtfrm.Date xtfrm.default
-syn keyword rFunction  xtfrm.difftime xtfrm.factor xtfrm.numeric_version xtfrm.POSIXct xtfrm.POSIXlt xtfrm.Surv xzfile
-syn keyword rFunction  zapsmall
+
+if has("nvim")
+    finish
+endif
+
+runtime R/flag.vim
+if exists("g:NvimR_installed")
+    finish
+endif
+
+" Only source this once
+if exists("*RmFromRLibList")
+    if len(g:rplugin_lists_to_load) > 0
+        for s:lib in g:rplugin_lists_to_load
+            call SourceRFunList(s:lib)
+        endfor
+        unlet s:lib
+    endif
+    finish
+endif
+
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" Set global variables when this script is called for the first time
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+" Users may define the value of g:vimrplugin_start_libs
+if !exists("g:vimrplugin_start_libs")
+    let g:vimrplugin_start_libs = "base,stats,graphics,grDevices,utils,methods"
+endif
+
+let g:rplugin_lists_to_load = split(g:vimrplugin_start_libs, ",")
+let g:rplugin_debug_lists = []
+let g:rplugin_loaded_lists = []
+let g:rplugin_Rhelp_list = []
+let g:rplugin_omni_lines = []
+let g:rplugin_new_libs = 0
+
+" syntax/r.vim may have being called before ftplugin/r.vim
+if !exists("g:rplugin_compldir")
+    runtime r-plugin/setcompldir.vim
+endif
+
+
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" Function for highlighting rFunction
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+" Must be run for each buffer
+function SourceRFunList(lib)
+    if isdirectory(g:rplugin_compldir)
+        let fnf = split(globpath(g:rplugin_compldir, 'fun_' . a:lib . '_*'), "\n")
+        if len(fnf) == 1
+            " Highlight R functions
+            exe "source " . substitute(fnf[0], ' ', '\\ ', 'g')
+        elseif len(fnf) == 0
+            let g:rplugin_debug_lists += ['Function list for "' . a:lib . '" not found.']
+        elseif len(fnf) > 1
+            let g:rplugin_debug_lists += ['There is more than one function list for "' . a:lib . '".']
+            for obl in fnf
+                let g:rplugin_debug_lists += [obl]
+            endfor
+        endif
+    endif
+endfunction
+
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" Omnicompletion functions
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+function RLisObjs(arglead, cmdline, curpos)
+    let lob = []
+    let rkeyword = '^' . a:arglead
+    for xx in g:rplugin_Rhelp_list
+        if xx =~ rkeyword
+            call add(lob, xx)
+        endif
+    endfor
+    return lob
+endfunction
+
+function RmFromRLibList(lib)
+    for idx in range(len(g:rplugin_loaded_lists))
+        if g:rplugin_loaded_lists[idx] == a:lib
+            call remove(g:rplugin_loaded_lists, idx)
+            break
+        endif
+    endfor
+    for idx in range(len(g:rplugin_lists_to_load))
+        if g:rplugin_lists_to_load[idx] == a:lib
+            call remove(g:rplugin_lists_to_load, idx)
+            break
+        endif
+    endfor
+endfunction
+
+function AddToRLibList(lib)
+    if isdirectory(g:rplugin_compldir)
+        let omf = split(globpath(g:rplugin_compldir, 'omnils_' . a:lib . '_*'), "\n")
+        if len(omf) == 1
+            let g:rplugin_loaded_lists += [a:lib]
+
+            " List of objects for omni completion
+            let olist = readfile(omf[0])
+            let g:rplugin_omni_lines += olist
+
+            " List of objects for :Rhelp completion
+            for xx in olist
+                let xxx = split(xx, "\x06")
+                if len(xxx) > 0 && xxx[0] !~ '\$'
+                    call add(g:rplugin_Rhelp_list, xxx[0])
+                endif
+            endfor
+        elseif len(omf) == 0
+            let g:rplugin_debug_lists += ['Omnils list for "' . a:lib . '" not found.']
+            call RmFromRLibList(a:lib)
+            return
+        elseif len(omf) > 1
+            let g:rplugin_debug_lists += ['There is more than one omnils and function list for "' . a:lib . '".']
+            for obl in omf
+                let g:rplugin_debug_lists += [obl]
+            endfor
+            call RmFromRLibList(a:lib)
+            return
+        endif
+    endif
+endfunction
+
+
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" Function called by vimcom
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+function FillRLibList()
+    " Avoid crash (segmentation fault)
+    if g:rplugin_starting_R
+        let g:rplugin_fillrliblist_called = 1
+        return
+    endif
+
+    " Update the list of objects for omnicompletion
+    if filereadable(g:rplugin_tmpdir . "/libnames_" . $VIMINSTANCEID)
+        let g:rplugin_lists_to_load = readfile(g:rplugin_tmpdir . "/libnames_" . $VIMINSTANCEID)
+        for lib in g:rplugin_lists_to_load
+            let isloaded = 0
+            for olib in g:rplugin_loaded_lists
+                if lib == olib
+                    let isloaded = 1
+                    break
+                endif
+            endfor
+            if isloaded == 0
+                call AddToRLibList(lib)
+            endif
+        endfor
+    endif
+    " Now we need to update the syntax in all R files. There should be a
+    " better solution than setting a flag to let other buffers know that they
+    " also need to update the syntax on CursorMoved event:
+    " https://github.com/neovim/neovim/issues/901
+    let g:rplugin_new_libs = len(g:rplugin_loaded_lists)
+    silent exe 'set filetype=' . &filetype
+    let b:rplugin_new_libs = g:rplugin_new_libs
+endfunction
+
+
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" Update the buffer syntax if necessary
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+function RCheckLibList()
+    if b:rplugin_new_libs == g:rplugin_new_libs
+        return
+    endif
+    silent exe 'set filetype=' . &filetype
+    let b:rplugin_new_libs = g:rplugin_new_libs
+endfunction
+
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" Source the Syntax scripts for the first time and Load omnilists
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+for s:lib in g:rplugin_lists_to_load
+    call SourceRFunList(s:lib)
+    call AddToRLibList(s:lib)
+endfor
+
+unlet s:lib
diff --git a/r-plugin/global_r_plugin.vim b/r-plugin/global_r_plugin.vim
deleted file mode 100644
index 76ab6f9..0000000
--- a/r-plugin/global_r_plugin.vim
+++ /dev/null
@@ -1,7 +0,0 @@
-
-function! RActivateThePlugin()
-    runtime ftplugin/r.vim
-    call StartR("R")
-endfunction
-
-nmap  rf :call RActivateThePlugin()
diff --git a/r-plugin/gui_running.vim b/r-plugin/gui_running.vim
new file mode 100644
index 0000000..4f3eae8
--- /dev/null
+++ b/r-plugin/gui_running.vim
@@ -0,0 +1,387 @@
+" This file contains code used only if has("gui_running")
+
+if exists("g:did_r_plugin_gui_running")
+    finish
+endif
+let g:did_r_plugin_gui_running = 1
+
+if exists('g:maplocalleader')
+    let s:tll = '' . g:maplocalleader
+else
+    let s:tll = '\\'
+endif
+
+function RCreateMenuItem(type, label, plug, combo, target)
+    if a:type =~ '0'
+        let tg = a:target . '0'
+        let il = 'i'
+    else
+        let tg = a:target . ''
+        let il = 'a'
+    endif
+    if a:type =~ "n"
+        if hasmapto(a:plug, "n")
+            let boundkey = RNMapCmd(a:plug)
+            exec 'nmenu  &R.' . a:label . '' . boundkey . ' ' . tg
+        else
+            exec 'nmenu  &R.' . a:label . s:tll . a:combo . ' ' . tg
+        endif
+    endif
+    if a:type =~ "v"
+        if hasmapto(a:plug, "v")
+            let boundkey = RVMapCmd(a:plug)
+            exec 'vmenu  &R.' . a:label . '' . boundkey . ' ' . '' . tg
+        else
+            exec 'vmenu  &R.' . a:label . s:tll . a:combo . ' ' . '' . tg
+        endif
+    endif
+    if a:type =~ "i"
+        if hasmapto(a:plug, "i")
+            let boundkey = RIMapCmd(a:plug)
+            exec 'imenu  &R.' . a:label . '' . boundkey . ' ' . '' . tg . il
+        else
+            exec 'imenu  &R.' . a:label . s:tll . a:combo . ' ' . '' . tg . il
+        endif
+    endif
+endfunction
+
+function RBrowserMenu()
+    call RCreateMenuItem("nvi", 'Object\ browser.Show/Update', 'RUpdateObjBrowser', 'ro', ':call RObjBrowser()')
+    call RCreateMenuItem("nvi", 'Object\ browser.Expand\ (all\ lists)', 'ROpenLists', 'r=', ':call RBrOpenCloseLs(1)')
+    call RCreateMenuItem("nvi", 'Object\ browser.Collapse\ (all\ lists)', 'RCloseLists', 'r-', ':call RBrOpenCloseLs(0)')
+    if &filetype == "rbrowser"
+        imenu  R.Object\ browser.Toggle\ (cur)Enter :call RBrowserDoubleClick()
+        nmenu  R.Object\ browser.Toggle\ (cur)Enter :call RBrowserDoubleClick()
+    endif
+    let g:rplugin_hasmenu = 1
+endfunction
+
+function RControlMenu()
+    call RCreateMenuItem("nvi", 'Command.List\ space', 'RListSpace', 'rl', ':call g:SendCmdToR("ls()")')
+    call RCreateMenuItem("nvi", 'Command.Clear\ console\ screen', 'RClearConsole', 'rr', ':call RClearConsole()')
+    call RCreateMenuItem("nvi", 'Command.Clear\ all', 'RClearAll', 'rm', ':call RClearAll()')
+    "-------------------------------
+    menu R.Command.-Sep1- 
+    call RCreateMenuItem("nvi", 'Command.Print\ (cur)', 'RObjectPr', 'rp', ':call RAction("print")')
+    call RCreateMenuItem("nvi", 'Command.Names\ (cur)', 'RObjectNames', 'rn', ':call RAction("vim.names")')
+    call RCreateMenuItem("nvi", 'Command.Structure\ (cur)', 'RObjectStr', 'rt', ':call RAction("str")')
+    call RCreateMenuItem("nvi", 'Command.View\ data\.frame\ (cur)', 'RViewDF', 'rv', ':call RAction("viewdf")')
+    "-------------------------------
+    menu R.Command.-Sep2- 
+    call RCreateMenuItem("nvi", 'Command.Arguments\ (cur)', 'RShowArgs', 'ra', ':call RAction("args")')
+    call RCreateMenuItem("nvi", 'Command.Example\ (cur)', 'RShowEx', 're', ':call RAction("example")')
+    call RCreateMenuItem("nvi", 'Command.Help\ (cur)', 'RHelp', 'rh', ':call RAction("help")')
+    "-------------------------------
+    menu R.Command.-Sep3- 
+    call RCreateMenuItem("nvi", 'Command.Summary\ (cur)', 'RSummary', 'rs', ':call RAction("summary")')
+    call RCreateMenuItem("nvi", 'Command.Plot\ (cur)', 'RPlot', 'rg', ':call RAction("plot")')
+    call RCreateMenuItem("nvi", 'Command.Plot\ and\ summary\ (cur)', 'RSPlot', 'rb', ':call RAction("plotsumm")')
+    let g:rplugin_hasmenu = 1
+endfunction
+
+function MakeRMenu()
+    if g:rplugin_hasmenu == 1
+        return
+    endif
+
+    " Do not translate "File":
+    menutranslate clear
+
+    "----------------------------------------------------------------------------
+    " Start/Close
+    "----------------------------------------------------------------------------
+    call RCreateMenuItem("nvi", 'Start/Close.Start\ R\ (default)', 'RStart', 'rf', ':call StartR("R")')
+    call RCreateMenuItem("nvi", 'Start/Close.Start\ R\ (custom)', 'RCustomStart', 'rc', ':call StartR("custom")')
+    "-------------------------------
+    menu R.Start/Close.-Sep1- 
+    call RCreateMenuItem("nvi", 'Start/Close.Close\ R\ (no\ save)', 'RClose', 'rq', ":call RQuit('no')")
+    menu R.Start/Close.-Sep2- 
+
+    nmenu  R.Start/Close.Stop\ R:RStop :RStop
+
+    "----------------------------------------------------------------------------
+    " Send
+    "----------------------------------------------------------------------------
+    if &filetype == "r" || g:vimrplugin_never_unmake_menu
+        call RCreateMenuItem("ni", 'Send.File', 'RSendFile', 'aa', ':call SendFileToR("silent")')
+        call RCreateMenuItem("ni", 'Send.File\ (echo)', 'RESendFile', 'ae', ':call SendFileToR("echo")')
+        call RCreateMenuItem("ni", 'Send.File\ (open\ \.Rout)', 'RShowRout', 'ao', ':call ShowRout()')
+    endif
+    "-------------------------------
+    menu R.Send.-Sep1- 
+    call RCreateMenuItem("ni", 'Send.Block\ (cur)', 'RSendMBlock', 'bb', ':call SendMBlockToR("silent", "stay")')
+    call RCreateMenuItem("ni", 'Send.Block\ (cur,\ echo)', 'RESendMBlock', 'be', ':call SendMBlockToR("echo", "stay")')
+    call RCreateMenuItem("ni", 'Send.Block\ (cur,\ down)', 'RDSendMBlock', 'bd', ':call SendMBlockToR("silent", "down")')
+    call RCreateMenuItem("ni", 'Send.Block\ (cur,\ echo\ and\ down)', 'REDSendMBlock', 'ba', ':call SendMBlockToR("echo", "down")')
+    "-------------------------------
+    if &filetype == "rnoweb" || &filetype == "rmd" || &filetype == "rrst" || g:vimrplugin_never_unmake_menu
+        menu R.Send.-Sep2- 
+        call RCreateMenuItem("ni", 'Send.Chunk\ (cur)', 'RSendChunk', 'cc', ':call b:SendChunkToR("silent", "stay")')
+        call RCreateMenuItem("ni", 'Send.Chunk\ (cur,\ echo)', 'RESendChunk', 'ce', ':call b:SendChunkToR("echo", "stay")')
+        call RCreateMenuItem("ni", 'Send.Chunk\ (cur,\ down)', 'RDSendChunk', 'cd', ':call b:SendChunkToR("silent", "down")')
+        call RCreateMenuItem("ni", 'Send.Chunk\ (cur,\ echo\ and\ down)', 'REDSendChunk', 'ca', ':call b:SendChunkToR("echo", "down")')
+        call RCreateMenuItem("ni", 'Send.Chunk\ (from\ first\ to\ here)', 'RSendChunkFH', 'ch', ':call SendFHChunkToR()')
+    endif
+    "-------------------------------
+    menu R.Send.-Sep3- 
+    call RCreateMenuItem("ni", 'Send.Function\ (cur)', 'RSendFunction', 'ff', ':call SendFunctionToR("silent", "stay")')
+    call RCreateMenuItem("ni", 'Send.Function\ (cur,\ echo)', 'RESendFunction', 'fe', ':call SendFunctionToR("echo", "stay")')
+    call RCreateMenuItem("ni", 'Send.Function\ (cur\ and\ down)', 'RDSendFunction', 'fd', ':call SendFunctionToR("silent", "down")')
+    call RCreateMenuItem("ni", 'Send.Function\ (cur,\ echo\ and\ down)', 'REDSendFunction', 'fa', ':call SendFunctionToR("echo", "down")')
+    "-------------------------------
+    menu R.Send.-Sep4- 
+    call RCreateMenuItem("v", 'Send.Selection', 'RSendSelection', 'ss', ':call SendSelectionToR("silent", "stay")')
+    call RCreateMenuItem("v", 'Send.Selection\ (echo)', 'RESendSelection', 'se', ':call SendSelectionToR("echo", "stay")')
+    call RCreateMenuItem("v", 'Send.Selection\ (and\ down)', 'RDSendSelection', 'sd', ':call SendSelectionToR("silent", "down")')
+    call RCreateMenuItem("v", 'Send.Selection\ (echo\ and\ down)', 'REDSendSelection', 'sa', ':call SendSelectionToR("echo", "down")')
+    call RCreateMenuItem("v", 'Send.Selection\ (and\ insert\ output)', 'RSendSelAndInsertOutput', 'so', ':call SendSelectionToR("echo", "stay", "NewtabInsert")')
+    "-------------------------------
+    menu R.Send.-Sep5- 
+    call RCreateMenuItem("ni", 'Send.Paragraph', 'RSendParagraph', 'pp', ':call SendParagraphToR("silent", "stay")')
+    call RCreateMenuItem("ni", 'Send.Paragraph\ (echo)', 'RESendParagraph', 'pe', ':call SendParagraphToR("echo", "stay")')
+    call RCreateMenuItem("ni", 'Send.Paragraph\ (and\ down)', 'RDSendParagraph', 'pd', ':call SendParagraphToR("silent", "down")')
+    call RCreateMenuItem("ni", 'Send.Paragraph\ (echo\ and\ down)', 'REDSendParagraph', 'pa', ':call SendParagraphToR("echo", "down")')
+    "-------------------------------
+    menu R.Send.-Sep6- 
+    call RCreateMenuItem("ni0", 'Send.Line', 'RSendLine', 'l', ':call SendLineToR("stay")')
+    call RCreateMenuItem("ni0", 'Send.Line\ (and\ down)', 'RDSendLine', 'd', ':call SendLineToR("down")')
+    call RCreateMenuItem("ni0", 'Send.Line\ (and\ insert\ output)', 'RDSendLineAndInsertOutput', 'o', ':call SendLineToRAndInsertOutput()')
+    call RCreateMenuItem("i", 'Send.Line\ (and\ new\ one)', 'RSendLAndOpenNewOne', 'q', ':call SendLineToR("newline")')
+    call RCreateMenuItem("n", 'Send.Left\ part\ of\ line\ (cur)', 'RNLeftPart', 'r', ':call RSendPartOfLine("left", 0)')
+    call RCreateMenuItem("n", 'Send.Right\ part\ of\ line\ (cur)', 'RNRightPart', 'r', ':call RSendPartOfLine("right", 0)')
+    call RCreateMenuItem("i", 'Send.Left\ part\ of\ line\ (cur)', 'RILeftPart', 'r', 'l:call RSendPartOfLine("left", 1)')
+    call RCreateMenuItem("i", 'Send.Right\ part\ of\ line\ (cur)', 'RIRightPart', 'r', 'l:call RSendPartOfLine("right", 1)')
+
+    "----------------------------------------------------------------------------
+    " Control
+    "----------------------------------------------------------------------------
+    call RControlMenu()
+    "-------------------------------
+    menu R.Command.-Sep4- 
+    if &filetype != "rdoc"
+        call RCreateMenuItem("nvi", 'Command.Set\ working\ directory\ (cur\ file\ path)', 'RSetwd', 'rd', ':call RSetWD()')
+    endif
+    "-------------------------------
+    if &filetype == "rnoweb" || &filetype == "rmd" || &filetype == "rrst" || g:vimrplugin_never_unmake_menu
+        if &filetype == "rnoweb" || g:vimrplugin_never_unmake_menu
+            menu R.Command.-Sep5- 
+            call RCreateMenuItem("nvi", 'Command.Sweave\ (cur\ file)', 'RSweave', 'sw', ':call RSweave()')
+            call RCreateMenuItem("nvi", 'Command.Sweave\ and\ PDF\ (cur\ file)', 'RMakePDF', 'sp', ':call RMakePDF("nobib", 0)')
+            call RCreateMenuItem("nvi", 'Command.Sweave,\ BibTeX\ and\ PDF\ (cur\ file)', 'RBibTeX', 'sb', ':call RMakePDF("bibtex", 0)')
+        endif
+        menu R.Command.-Sep6- 
+        if &filetype == "rnoweb"
+            call RCreateMenuItem("nvi", 'Command.Knit\ (cur\ file)', 'RKnit', 'kn', ':call RKnitRnw()')
+        else
+            call RCreateMenuItem("nvi", 'Command.Knit\ (cur\ file)', 'RKnit', 'kn', ':call RKnit()')
+        endif
+        if &filetype == "rnoweb" || g:vimrplugin_never_unmake_menu
+            call RCreateMenuItem("nvi", 'Command.Knit\ and\ PDF\ (cur\ file)', 'RMakePDFK', 'kp', ':call RMakePDF("nobib", 1)')
+            call RCreateMenuItem("nvi", 'Command.Knit,\ BibTeX\ and\ PDF\ (cur\ file)', 'RBibTeXK', 'kb', ':call RMakePDF("bibtex", 1)')
+        endif
+        if &filetype == "rmd" || g:vimrplugin_never_unmake_menu
+            call RCreateMenuItem("nvi", 'Command.Knit\ and\ PDF\ (cur\ file)', 'RMakePDFK', 'kp', ':call RMakeRmd("pdf_document")')
+            call RCreateMenuItem("nvi", 'Command.Knit\ and\ Beamer\ PDF\ (cur\ file)', 'RMakePDFKb', 'kl', ':call RMakeRmd("beamer_presentation")')
+            call RCreateMenuItem("nvi", 'Command.Knit\ and\ Word\ Document\ (cur\ file)', 'RMakeWord', 'kw', ':call RMakeRmd("word_document")')
+            call RCreateMenuItem("nvi", 'Command.Knit\ and\ HTML\ (cur\ file)', 'RMakeHTML', 'kh', ':call RMakeRmd("html_document")')
+            call RCreateMenuItem("nvi", 'Command.Knit\ and\ ODT\ (cur\ file)', 'RMakeODT', 'ko', ':call RMakeRmd("odt")')
+        endif
+        if &filetype == "rrst" || g:vimrplugin_never_unmake_menu
+            call RCreateMenuItem("nvi", 'Command.Knit\ and\ PDF\ (cur\ file)', 'RMakePDFK', 'kp', ':call RMakePDFrrst()')
+            call RCreateMenuItem("nvi", 'Command.Knit\ and\ HTML\ (cur\ file)', 'RMakeHTML', 'kh', ':call RMakeHTMLrrst("html")')
+            call RCreateMenuItem("nvi", 'Command.Knit\ and\ ODT\ (cur\ file)', 'RMakeODT', 'ko', ':call RMakeHTMLrrst("odt")')
+        endif
+        menu R.Command.-Sep61- 
+        call RCreateMenuItem("nvi", 'Command.Open\ PDF\ (cur\ file)', 'ROpenPDF', 'op', ':call ROpenPDF("Get Master")')
+        if ($DISPLAY != "" && g:vimrplugin_synctex && &filetype == "rnoweb") || g:vimrplugin_never_unmake_menu
+            call RCreateMenuItem("nvi", 'Command.Search\ forward\ (SyncTeX)', 'RSyncFor', 'gp', ':call SyncTeX_forward()')
+            call RCreateMenuItem("nvi", 'Command.Go\ to\ LaTeX\ (SyncTeX)', 'RSyncTex', 'gt', ':call SyncTeX_forward(1)')
+        endif
+    endif
+    "-------------------------------
+    if &filetype == "r" || g:vimrplugin_never_unmake_menu
+        menu R.Command.-Sep71- 
+        call RCreateMenuItem("nvi", 'Command.Spin\ (cur\ file)', 'RSpinFile', 'ks', ':call RSpin()')
+    endif
+    menu R.Command.-Sep72- 
+    if &filetype == "r" || &filetype == "rnoweb" || g:vimrplugin_never_unmake_menu
+        nmenu  R.Command.Build\ tags\ file\ (cur\ dir):RBuildTags :call g:SendCmdToR('rtags(ofile = "TAGS")')
+        imenu  R.Command.Build\ tags\ file\ (cur\ dir):RBuildTags :call g:SendCmdToR('rtags(ofile = "TAGS")')a
+    endif
+
+    menu R.-Sep7- 
+
+    "----------------------------------------------------------------------------
+    " Edit
+    "----------------------------------------------------------------------------
+    if &filetype == "r" || &filetype == "rnoweb" || &filetype == "rrst" || &filetype == "rhelp" || g:vimrplugin_never_unmake_menu
+        if g:vimrplugin_assign == 1 || g:vimrplugin_assign == 2
+            silent exe 'imenu  R.Edit.Insert\ \"\ <-\ \"' . g:vimrplugin_assign_map . ' :call ReplaceUnderS()a'
+        endif
+        imenu  R.Edit.Complete\ object\ name^X^O 
+        if hasmapto("RCompleteArgs", "i")
+            let boundkey = RIMapCmd("RCompleteArgs")
+            exe "imenu  R.Edit.Complete\\ function\\ arguments" . boundkey . " " . boundkey
+        else
+            imenu  R.Edit.Complete\ function\ arguments^X^A 
+        endif
+        menu R.Edit.-Sep71- 
+        nmenu  R.Edit.Indent\ (line)== ==
+        vmenu  R.Edit.Indent\ (selected\ lines)= =
+        nmenu  R.Edit.Indent\ (whole\ buffer)gg=G gg=G
+        menu R.Edit.-Sep72- 
+        call RCreateMenuItem("ni", 'Edit.Toggle\ comment\ (line/sel)', 'RToggleComment', 'xx', ':call RComment("normal")')
+        call RCreateMenuItem("v", 'Edit.Toggle\ comment\ (line/sel)', 'RToggleComment', 'xx', ':call RComment("selection")')
+        call RCreateMenuItem("ni", 'Edit.Comment\ (line/sel)', 'RSimpleComment', 'xc', ':call RSimpleCommentLine("normal", "c")')
+        call RCreateMenuItem("v", 'Edit.Comment\ (line/sel)', 'RSimpleComment', 'xc', ':call RSimpleCommentLine("selection", "c")')
+        call RCreateMenuItem("ni", 'Edit.Uncomment\ (line/sel)', 'RSimpleUnComment', 'xu', ':call RSimpleCommentLine("normal", "u")')
+        call RCreateMenuItem("v", 'Edit.Uncomment\ (line/sel)', 'RSimpleUnComment', 'xu', ':call RSimpleCommentLine("selection", "u")')
+        call RCreateMenuItem("ni", 'Edit.Add/Align\ right\ comment\ (line,\ sel)', 'RRightComment', ';', ':call MovePosRCodeComment("normal")')
+        call RCreateMenuItem("v", 'Edit.Add/Align\ right\ comment\ (line,\ sel)', 'RRightComment', ';', ':call MovePosRCodeComment("selection")')
+        if &filetype == "rnoweb" || &filetype == "rrst" || &filetype == "rmd" || g:vimrplugin_never_unmake_menu
+            menu R.Edit.-Sep73- 
+            call RCreateMenuItem("n", 'Edit.Go\ (next\ R\ chunk)', 'RNextRChunk', 'gn', ':call b:NextRChunk()')
+            call RCreateMenuItem("n", 'Edit.Go\ (previous\ R\ chunk)', '', 'gN', ':call b:PreviousRChunk()')
+        endif
+    endif
+
+    "----------------------------------------------------------------------------
+    " Object Browser
+    "----------------------------------------------------------------------------
+    call RBrowserMenu()
+
+    "----------------------------------------------------------------------------
+    " Help
+    "----------------------------------------------------------------------------
+    menu R.-Sep8- 
+    amenu R.Help\ (plugin).Overview :help r-plugin-overview
+    amenu R.Help\ (plugin).Main\ features :help r-plugin-features
+    amenu R.Help\ (plugin).Installation :help r-plugin-installation
+    amenu R.Help\ (plugin).Use :help r-plugin-use
+    amenu R.Help\ (plugin).Known\ bugs\ and\ workarounds :help r-plugin-known-bugs
+
+    amenu R.Help\ (plugin).Options.Assignment\ operator\ and\ Rnoweb\ code :help vimrplugin_assign
+    amenu R.Help\ (plugin).Options.Object\ Browser :help vimrplugin_objbr_place
+    amenu R.Help\ (plugin).Options.Vim\ as\ pager\ for\ R\ help :help vimrplugin_vimpager
+    if !(has("gui_win32") || has("gui_win64"))
+        amenu R.Help\ (plugin).Options.Terminal\ emulator :help vimrplugin_term
+    endif
+    if g:rplugin_is_darwin
+        amenu R.Help\ (plugin).Options.Integration\ with\ Apple\ Script :help vimrplugin_applescript
+    endif
+    if has("gui_win32") || has("gui_win64")
+        amenu R.Help\ (plugin).Options.Use\ 32\ bit\ version\ of\ R :help vimrplugin_i386
+    endif
+    amenu R.Help\ (plugin).Options.R\ path :help vimrplugin_r_path
+    amenu R.Help\ (plugin).Options.Arguments\ to\ R :help vimrplugin_r_args
+    amenu R.Help\ (plugin).Options.Omni\ completion\ when\ R\ not\ running :help vimrplugin_start_libs
+    amenu R.Help\ (plugin).Options.Syntax\ highlighting\ of\ \.Rout\ files :help vimrplugin_routmorecolors
+    amenu R.Help\ (plugin).Options.Automatically\ open\ the\ \.Rout\ file :help vimrplugin_routnotab
+    amenu R.Help\ (plugin).Options.Special\ R\ functions :help vimrplugin_listmethods
+    amenu R.Help\ (plugin).Options.Indent\ commented\ lines :help vimrplugin_indent_commented
+    amenu R.Help\ (plugin).Options.LaTeX\ command :help vimrplugin_latexcmd
+    amenu R.Help\ (plugin).Options.Never\ unmake\ the\ R\ menu :help vimrplugin_never_unmake_menu
+
+    amenu R.Help\ (plugin).Custom\ key\ bindings :help r-plugin-key-bindings
+    amenu R.Help\ (plugin).Files :help r-plugin-files
+    amenu R.Help\ (plugin).FAQ\ and\ tips.All\ tips :help r-plugin-tips
+    amenu R.Help\ (plugin).FAQ\ and\ tips.Indenting\ setup :help r-plugin-indenting
+    amenu R.Help\ (plugin).FAQ\ and\ tips.Folding\ setup :help r-plugin-folding
+    amenu R.Help\ (plugin).FAQ\ and\ tips.Remap\ LocalLeader :help r-plugin-localleader
+    amenu R.Help\ (plugin).FAQ\ and\ tips.Customize\ key\ bindings :help r-plugin-bindings
+    amenu R.Help\ (plugin).FAQ\ and\ tips.ShowMarks :help r-plugin-showmarks
+    amenu R.Help\ (plugin).FAQ\ and\ tips.SnipMate :help r-plugin-snippets
+    amenu R.Help\ (plugin).FAQ\ and\ tips.LaTeX-Box :help r-plugin-latex-box
+    amenu R.Help\ (plugin).FAQ\ and\ tips.Highlight\ marks :help r-plugin-showmarks
+    amenu R.Help\ (plugin).FAQ\ and\ tips.Global\ plugin :help r-plugin-global
+    amenu R.Help\ (plugin).FAQ\ and\ tips.Jump\ to\ function\ definitions :help r-plugin-tagsfile
+    amenu R.Help\ (plugin).News :help r-plugin-news
+
+    amenu R.Help\ (R):Rhelp :call g:SendCmdToR("help.start()")
+    let g:rplugin_hasmenu = 1
+
+    "----------------------------------------------------------------------------
+    " ToolBar
+    "----------------------------------------------------------------------------
+    if g:rplugin_has_icons
+        " Buttons
+        amenu  ToolBar.RStart :call StartR("R")
+        amenu  ToolBar.RClose :call RQuit('no')
+        "---------------------------
+        if &filetype == "r" || g:vimrplugin_never_unmake_menu
+            nmenu  ToolBar.RSendFile :call SendFileToR("echo")
+            imenu  ToolBar.RSendFile :call SendFileToR("echo")
+            let g:rplugin_hasRSFbutton = 1
+        endif
+        nmenu  ToolBar.RSendBlock :call SendMBlockToR("echo", "down")
+        imenu  ToolBar.RSendBlock :call SendMBlockToR("echo", "down")
+        nmenu  ToolBar.RSendFunction :call SendFunctionToR("echo", "down")
+        imenu  ToolBar.RSendFunction :call SendFunctionToR("echo", "down")
+        vmenu  ToolBar.RSendSelection :call SendSelectionToR("echo", "down")
+        nmenu  ToolBar.RSendParagraph :call SendParagraphToR("echo", "down")
+        imenu  ToolBar.RSendParagraph :call SendParagraphToR("echo", "down")
+        nmenu  ToolBar.RSendLine :call SendLineToR("down")
+        imenu  ToolBar.RSendLine :call SendLineToR("down")
+        "---------------------------
+        nmenu  ToolBar.RListSpace :call g:SendCmdToR("ls()")
+        imenu  ToolBar.RListSpace :call g:SendCmdToR("ls()")
+        nmenu  ToolBar.RClear :call RClearConsole()
+        imenu  ToolBar.RClear :call RClearConsole()
+        nmenu  ToolBar.RClearAll :call RClearAll()
+        imenu  ToolBar.RClearAll :call RClearAll()
+
+        " Hints
+        tmenu ToolBar.RStart Start R (default)
+        tmenu ToolBar.RClose Close R (no save)
+        if &filetype == "r" || g:vimrplugin_never_unmake_menu
+            tmenu ToolBar.RSendFile Send file (echo)
+        endif
+        tmenu ToolBar.RSendBlock Send block (cur, echo and down)
+        tmenu ToolBar.RSendFunction Send function (cur, echo and down)
+        tmenu ToolBar.RSendSelection Send selection (cur, echo and down)
+        tmenu ToolBar.RSendParagraph Send paragraph (cur, echo and down)
+        tmenu ToolBar.RSendLine Send line (cur and down)
+        tmenu ToolBar.RListSpace List objects
+        tmenu ToolBar.RClear Clear the console screen
+        tmenu ToolBar.RClearAll Remove objects from workspace and clear the console screen
+        let g:rplugin_hasbuttons = 1
+    else
+        let g:rplugin_hasbuttons = 0
+    endif
+endfunction
+
+function UnMakeRMenu()
+    if g:rplugin_hasmenu == 0 || g:vimrplugin_never_unmake_menu == 1 || &previewwindow || (&buftype == "nofile" && &filetype != "rbrowser")
+        return
+    endif
+    aunmenu R
+    let g:rplugin_hasmenu = 0
+    if g:rplugin_hasbuttons
+        aunmenu ToolBar.RClearAll
+        aunmenu ToolBar.RClear
+        aunmenu ToolBar.RListSpace
+        aunmenu ToolBar.RSendLine
+        aunmenu ToolBar.RSendSelection
+        aunmenu ToolBar.RSendParagraph
+        aunmenu ToolBar.RSendFunction
+        aunmenu ToolBar.RSendBlock
+        if g:rplugin_hasRSFbutton
+            aunmenu ToolBar.RSendFile
+            let g:rplugin_hasRSFbutton = 0
+        endif
+        aunmenu ToolBar.RClose
+        aunmenu ToolBar.RStart
+        let g:rplugin_hasbuttons = 0
+    endif
+endfunction
+
+function MakeRBrowserMenu()
+    let g:rplugin_curbuf = bufname("%")
+    if g:rplugin_hasmenu == 1
+        return
+    endif
+    menutranslate clear
+    call RControlMenu()
+    call RBrowserMenu()
+endfunction
+
diff --git a/r-plugin/omniList b/r-plugin/omniList
deleted file mode 100644
index 9bb351d..0000000
--- a/r-plugin/omniList
+++ /dev/null
@@ -1,2909 +0,0 @@
-acf;function;function;stats;x, lag.max = NULL, type = c("correlation", "covariance", 	"partial"), plot = TRUE, na.action = na.fail, demean = TRUE, 	...
-acf2AR;function;function;stats;acf
-add1;function;function;stats;Generic Method
-addmargins;function;function;stats;A, margin = seq_along(dim(A)), FUN = sum, quiet = FALSE
-add.scope;function;function;stats;terms1, terms2
-aggregate;function;function;stats;x, ...
-aggregate.data.frame;function;function;stats;x, by, FUN, ..., simplify = TRUE
-aggregate.default;function;function;stats;x, ...
-aggregate.ts;function;function;stats;x, nfrequency = 1, FUN = sum, ndeltat = 1, ts.eps = getOption("ts.eps"), 	...
-AIC;function;function;stats;Generic Method
-alias;function;function;stats;object, ...
-anova;function;function;stats;Generic Method
-anova.glm;function;function;stats;object, ..., dispersion = NULL, test = NULL
-anova.glmlist;function;function;stats;object, ..., dispersion = NULL, test = NULL
-anovalist.lm;function;function;stats;object, ..., test = NULL
-anova.lm;function;function;stats;object, ...
-anova.lmlist;function;function;stats;object, ..., scale = 0, test = "F"
-anova.mlm;function;function;stats;object, ..., test = c("Pillai", "Wilks", "Hotelling-Lawley", 	"Roy", "Spherical"), Sigma = diag(nrow = p), T = Thin.row(proj(M) - 	proj(X)), M = diag(nrow = p), X = ~0, idata = data.frame(index = seq_len(p)), 	tol = 1e-07
-ansari.test;function;function;stats;x, ...
-aov;function;function;stats;formula, data = NULL, projections = FALSE, qr = TRUE, 	contrasts = NULL, ...
-approx;function;function;stats;x, y = NULL, xout, method = "linear", n = 50, yleft, 	yright, rule = 1, f = 0, ties = mean
-approxfun;function;function;stats;x, y = NULL, method = "linear", yleft, yright, rule = 1, 	f = 0, ties = mean
-ar;function;function;stats;x, aic = TRUE, order.max = NULL, method = c("yule-walker", 	"burg", "ols", "mle", "yw"), na.action = na.fail, series = deparse(substitute(x)), 	...
-ar.burg;function;function;stats;x, ...
-arima;function;function;stats;x, order = c(0, 0, 0), seasonal = list(order = c(0, 	0, 0), period = NA), xreg = NULL, include.mean = TRUE, transform.pars = TRUE, 	fixed = NULL, init = NULL, method = c("CSS-ML", "ML", "CSS"), 	n.cond, optim.method = "BFGS", optim.control = list(), kappa = 1e+06
-arima0;function;function;stats;x, order = c(0, 0, 0), seasonal = list(order = c(0, 	0, 0), period = NA), xreg = NULL, include.mean = TRUE, delta = 0.01, 	transform.pars = TRUE, fixed = NULL, init = NULL, method = c("ML", 	    "CSS"), n.cond, optim.control = list()
-arima0.diag;function;function;stats;...
-arima.sim;function;function;stats;model, n, rand.gen = rnorm, innov = rand.gen(n, ...), 	n.start = NA, start.innov = rand.gen(n.start, ...), ...
-ARMAacf;function;function;stats;ar = numeric(0), ma = numeric(0), lag.max = r, pacf = FALSE
-ARMAtoMA;function;function;stats;ar = numeric(0), ma = numeric(0), lag.max
-ar.mle;function;function;stats;x, aic = TRUE, order.max = NULL, na.action = na.fail, 	demean = TRUE, series = NULL, ...
-ar.ols;function;function;stats;x, aic = TRUE, order.max = NULL, na.action = na.fail, 	demean = TRUE, intercept = demean, series = NULL, ...
-ar.yw;function;function;stats;x, ...
-as.dendrogram;function;function;stats;object, ...
-as.dist;function;function;stats;m, diag = FALSE, upper = FALSE
-as.formula;function;function;stats;object, env = parent.frame()
-as.hclust;function;function;stats;x, ...
-asOneSidedFormula;function;function;stats;object
-as.stepfun;function;function;stats;x, ...
-as.ts;function;function;stats;x, ...
-ave;function;function;stats;x, ..., FUN = mean
-bandwidth.kernel;function;function;stats;k
-bartlett.test;function;function;stats;x, ...
-binomial;function;function;stats;link = "logit"
-binom.test;function;function;stats;x, n, p = 0.5, alternative = c("two.sided", "less", 	"greater"), conf.level = 0.95
-biplot;function;function;stats;Generic Method
-Box.test;function;function;stats;x, lag = 1, type = c("Box-Pierce", "Ljung-Box"), fitdf = 0
-bw.bcv;function;function;stats;x, nb = 1000, lower = 0.1 * hmax, upper = hmax, tol = 0.1 * 	lower
-bw.nrd;function;function;stats;x
-bw.nrd0;function;function;stats;x
-bw.SJ;function;function;stats;x, nb = 1000, lower = 0.1 * hmax, upper = hmax, method = c("ste", 	"dpi"), tol = 0.1 * lower
-bw.ucv;function;function;stats;x, nb = 1000, lower = 0.1 * hmax, upper = hmax, tol = 0.1 * 	lower
-C;function;function;stats;object, contr, how.many, ...
-cancor;function;function;stats;x, y, xcenter = TRUE, ycenter = TRUE
-case.names;function;function;stats;object, ...
-ccf;function;function;stats;x, y, lag.max = NULL, type = c("correlation", "covariance"), 	plot = TRUE, na.action = na.fail, ...
-.checkMFClasses;function;function;stats;cl, m, ordNotOK = FALSE
-chisq.test;function;function;stats;x, y = NULL, correct = TRUE, p = rep(1/length(x), length(x)), 	rescale.p = FALSE, simulate.p.value = FALSE, B = 2000
-clearNames;function;function;stats;object
-cmdscale;function;function;stats;d, k = 2, eig = FALSE, add = FALSE, x.ret = FALSE
-coef;function;function;stats;Generic Method
-coefficients;function;function;stats;object, ...
-complete.cases;function;function;stats;...
-confint;function;function;stats;Generic Method
-confint.default;function;function;stats;object, parm, level = 0.95, ...
-constrOptim;function;function;stats;theta, f, grad, ui, ci, mu = 1e-04, control = list(), 	method = if (is.null(grad)) "Nelder-Mead" else "BFGS", outer.iterations = 100, 	outer.eps = 1e-05, ..., hessian = FALSE
-contrasts;function;function;stats;x, contrasts = TRUE, sparse = FALSE
-contrasts<-;function;function;stats;x, how.many, value
-contr.helmert;function;function;stats;n, contrasts = TRUE, sparse = FALSE
-contr.poly;function;function;stats;n, scores = 1:n, contrasts = TRUE, sparse = FALSE
-contr.SAS;function;function;stats;n, contrasts = TRUE, sparse = FALSE
-contr.sum;function;function;stats;n, contrasts = TRUE, sparse = FALSE
-contr.treatment;function;function;stats;n, base = 1, contrasts = TRUE, sparse = FALSE
-convolve;function;function;stats;x, y, conj = TRUE, type = c("circular", "open", "filter")
-cooks.distance;function;function;stats;model, ...
-cophenetic;function;function;stats;x
-cor;function;function;stats;x, y = NULL, use = "everything", method = c("pearson", 	"kendall", "spearman")
-cor.test;function;function;stats;x, ...
-cov;function;function;stats;x, y = NULL, use = "everything", method = c("pearson", 	"kendall", "spearman")
-cov2cor;function;function;stats;V
-covratio;function;function;stats;model, infl = lm.influence(model, do.coef = FALSE), 	res = weighted.residuals(model)
-cov.wt;function;function;stats;x, wt = rep(1/nrow(x), nrow(x)), cor = FALSE, center = TRUE, 	method = c("unbiased", "ML")
-cpgram;function;function;stats;ts, taper = 0.1, main = paste("Series: ", deparse(substitute(ts))), 	ci.col = "blue"
-cutree;function;function;stats;tree, k = NULL, h = NULL
-cycle;function;function;stats;x, ...
-D;function;function;stats;expr, name
-dbeta;function;function;stats;x, shape1, shape2, ncp = 0, log = FALSE
-dbinom;function;function;stats;x, size, prob, log = FALSE
-dcauchy;function;function;stats;x, location = 0, scale = 1, log = FALSE
-dchisq;function;function;stats;x, df, ncp = 0, log = FALSE
-decompose;function;function;stats;x, type = c("additive", "multiplicative"), filter = NULL
-delete.response;function;function;stats;termobj
-deltat;function;function;stats;x, ...
-dendrapply;function;function;stats;X, FUN, ...
-density;function;function;stats;x, ...
-density.default;function;function;stats;x, bw = "nrd0", adjust = 1, kernel = c("gaussian", 	"epanechnikov", "rectangular", "triangular", "biweight", 	"cosine", "optcosine"), weights = NULL, window = kernel, 	width, give.Rkern = FALSE, n = 512, from, to, cut = 3, na.rm = FALSE, 	...
-deriv;function;function;stats;expr, ...
-deriv3;function;function;stats;expr, ...
-deriv3.default;function;function;stats;expr, namevec, function.arg = NULL, tag = ".expr", 	hessian = TRUE, ...
-deriv3.formula;function;function;stats;expr, namevec, function.arg = NULL, tag = ".expr", 	hessian = TRUE, ...
-deriv.default;function;function;stats;expr, namevec, function.arg = NULL, tag = ".expr", 	hessian = FALSE, ...
-deriv.formula;function;function;stats;expr, namevec, function.arg = NULL, tag = ".expr", 	hessian = FALSE, ...
-deviance;function;function;stats;Generic Method
-dexp;function;function;stats;x, rate = 1, log = FALSE
-df;function;function;stats;x, df1, df2, ncp, log = FALSE
-dfbeta;function;function;stats;model, ...
-dfbetas;function;function;stats;model, ...
-dffits;function;function;stats;model, infl = lm.influence(model, do.coef = FALSE), 	res = weighted.residuals(model)
-df.kernel;function;function;stats;k
-df.residual;function;function;stats;Generic Method
-dgamma;function;function;stats;x, shape, rate = 1, scale = 1/rate, log = FALSE
-dgeom;function;function;stats;x, prob, log = FALSE
-dhyper;function;function;stats;x, m, n, k, log = FALSE
-diffinv;function;function;stats;x, ...
-diff.ts;function;function;stats;x, lag = 1, differences = 1, ...
-dist;function;function;stats;x, method = "euclidean", diag = FALSE, upper = FALSE, 	p = 2
-dlnorm;function;function;stats;x, meanlog = 0, sdlog = 1, log = FALSE
-dlogis;function;function;stats;x, location = 0, scale = 1, log = FALSE
-dmultinom;function;function;stats;x, size = NULL, prob, log = FALSE
-dnbinom;function;function;stats;x, size, prob, mu, log = FALSE
-dnorm;function;function;stats;x, mean = 0, sd = 1, log = FALSE
-dpois;function;function;stats;x, lambda, log = FALSE
-drop1;function;function;stats;Generic Method
-drop.scope;function;function;stats;terms1, terms2
-drop.terms;function;function;stats;termobj, dropx = NULL, keep.response = FALSE
-dsignrank;function;function;stats;x, n, log = FALSE
-dt;function;function;stats;x, df, ncp, log = FALSE
-dummy.coef;function;function;stats;object, ...
-dunif;function;function;stats;x, min = 0, max = 1, log = FALSE
-dweibull;function;function;stats;x, shape, scale = 1, log = FALSE
-dwilcox;function;function;stats;x, m, n, log = FALSE
-ecdf;function;function;stats;x
-eff.aovlist;function;function;stats;aovlist
-effects;function;function;stats;object, ...
-embed;function;function;stats;x, dimension = 1
-end;function;function;stats;x, ...
-estVar;function;function;stats;object, ...
-expand.model.frame;function;function;stats;model, extras, envir = environment(formula(model)), 	na.expand = FALSE
-extractAIC;function;function;stats;Generic Method
-factanal;function;function;stats;x, factors, data = NULL, covmat = NULL, n.obs = NA, 	subset, na.action, start = NULL, scores = c("none", "regression", 	    "Bartlett"), rotation = "varimax", control = NULL, ...
-factor.scope;function;function;stats;factor, scope
-family;function;function;stats;object, ...
-fft;function;function;stats;z, inverse = FALSE
-filter;function;function;stats;x, filter, method = c("convolution", "recursive"), 	sides = 2, circular = FALSE, init = NULL
-fisher.test;function;function;stats;x, y = NULL, workspace = 2e+05, hybrid = FALSE, control = list(), 	or = 1, alternative = "two.sided", conf.int = TRUE, conf.level = 0.95, 	simulate.p.value = FALSE, B = 2000
-fitted;function;function;stats;Generic Method
-fitted.values;function;function;stats;object, ...
-fivenum;function;function;stats;x, na.rm = TRUE
-fligner.test;function;function;stats;x, ...
-formula;function;function;stats;Generic Method
-frequency;function;function;stats;x, ...
-friedman.test;function;function;stats;y, ...
-ftable;function;function;stats;x, ...
-Gamma;function;function;stats;link = "inverse"
-gaussian;function;function;stats;link = "identity"
-get_all_vars;function;function;stats;formula, data = NULL, ...
-getInitial;function;function;stats;object, data, ...
-.getXlevels;function;function;stats;Terms, m
-glm;function;function;stats;formula, family = gaussian, data, weights, subset, 	na.action, start = NULL, etastart, mustart, offset, control = list(...), 	model = TRUE, method = "glm.fit", x = FALSE, y = TRUE, contrasts = NULL, 	...
-glm.control;function;function;stats;epsilon = 1e-08, maxit = 25, trace = FALSE
-glm.fit;function;function;stats;x, y, weights = rep(1, nobs), start = NULL, etastart = NULL, 	mustart = NULL, offset = rep(0, nobs), family = gaussian(), 	control = list(), intercept = TRUE
-glm.fit.null;function;function;stats;x, y, weights, start = NULL, etastart = NULL, mustart = NULL, 	offset, family = gaussian(), control = glm.control(), intercept = FALSE
-hasTsp;function;function;stats;x
-hat;function;function;stats;x, intercept = TRUE
-hatvalues;function;function;stats;model, ...
-hatvalues.lm;function;function;stats;model, infl = lm.influence(model, do.coef = FALSE), 	...
-hclust;function;function;stats;d, method = "complete", members = NULL
-heatmap;function;function;stats;x, Rowv = NULL, Colv = if (symm) "Rowv" else NULL, 	distfun = dist, hclustfun = hclust, reorderfun = function(d, 	    w) reorder(d, w), add.expr, symm = FALSE, revC = identical(Colv, 	    "Rowv"), scale = c("row", "column", "none"), na.rm = TRUE, 	margins = c(5, 5), ColSideColors, RowSideColors, cexRow = 0.2 + 	    1/log10(nr), cexCol = 0.2 + 1/log10(nc), labRow = NULL, 	labCol = NULL, main = NULL, xlab = NULL, ylab = NULL, keep.dendro = FALSE, 	verbose = getOption("verbose"), ...
-HoltWinters;function;function;stats;x, alpha = NULL, beta = NULL, gamma = NULL, seasonal = c("additive", 	"multiplicative"), start.periods = 2, l.start = NULL, b.start = NULL, 	s.start = NULL, optim.start = c(alpha = 0.3, beta = 0.1, 	    gamma = 0.1), optim.control = list()
-influence;function;function;stats;model, ...
-influence.measures;function;function;stats;model
-integrate;function;function;stats;f, lower, upper, ..., subdivisions = 100, rel.tol = .Machine$double.eps^0.25, 	abs.tol = rel.tol, stop.on.error = TRUE, keep.xy = FALSE, 	aux = NULL
-interaction.plot;function;function;stats;x.factor, trace.factor, response, fun = mean, type = c("l", 	"p", "b"), legend = TRUE, trace.label = deparse(substitute(trace.factor)), 	fixed = FALSE, xlab = deparse(substitute(x.factor)), ylab = ylabel, 	ylim = range(cells, na.rm = TRUE), lty = nc:1, col = 1, pch = c(1L:9, 	    0, letters), xpd = NULL, leg.bg = par("bg"), leg.bty = "n", 	xtick = FALSE, xaxt = par("xaxt"), axes = TRUE, ...
-inverse.gaussian;function;function;stats;link = "1/mu^2"
-IQR;function;function;stats;x, na.rm = FALSE
-is.empty.model;function;function;stats;x
-is.leaf;function;function;stats;object
-is.mts;function;function;stats;x
-isoreg;function;function;stats;x, y = NULL
-is.stepfun;function;function;stats;x
-is.ts;function;function;stats;x
-is.tskernel;function;function;stats;k
-KalmanForecast;function;function;stats;n.ahead = 10, mod, fast = TRUE
-KalmanLike;function;function;stats;y, mod, nit = 0, fast = TRUE
-KalmanRun;function;function;stats;y, mod, nit = 0, fast = TRUE
-KalmanSmooth;function;function;stats;y, mod, nit = 0
-kernapply;function;function;stats;x, ...
-kernel;function;function;stats;coef, m = length(coef) + 1, r, name = "unknown"
-kmeans;function;function;stats;x, centers, iter.max = 10, nstart = 1, algorithm = c("Hartigan-Wong", 	"Lloyd", "Forgy", "MacQueen")
-knots;function;function;stats;Fn, ...
-kruskal.test;function;function;stats;x, ...
-ksmooth;function;function;stats;x, y, kernel = c("box", "normal"), bandwidth = 0.5, 	range.x = range(x), n.points = max(100, length(x)), x.points
-ks.test;function;function;stats;x, y, ..., alternative = c("two.sided", "less", "greater"), 	exact = NULL
-lag;function;function;stats;x, ...
-lag.plot;function;function;stats;x, lags = 1, layout = NULL, set.lags = 1L:lags, main = NULL, 	asp = 1, diag = TRUE, diag.col = "gray", type = "p", oma = NULL, 	ask = NULL, do.lines = (n <= 150), labels = do.lines, ...
-line;function;function;stats;x, y = NULL
-lines.ts;function;function;stats;x, ...
-lm;function;function;stats;formula, data, subset, weights, na.action, method = "qr", 	model = TRUE, x = FALSE, y = FALSE, qr = TRUE, singular.ok = TRUE, 	contrasts = NULL, offset, ...
-lm.fit;function;function;stats;x, y, offset = NULL, method = "qr", tol = 1e-07, singular.ok = TRUE, 	...
-lm.fit.null;function;function;stats;x, y, method = "qr", tol = 1e-07, ...
-lm.influence;function;function;stats;model, do.coef = TRUE
-lm.wfit;function;function;stats;x, y, w, offset = NULL, method = "qr", tol = 1e-07, 	singular.ok = TRUE, ...
-lm.wfit.null;function;function;stats;x, y, w, method = "qr", tol = 1e-07, ...
-loadings;function;function;stats;x
-loess;function;function;stats;formula, data, weights, subset, na.action, model = FALSE, 	span = 0.75, enp.target, degree = 2, parametric = FALSE, 	drop.square = FALSE, normalize = TRUE, family = c("gaussian", 	    "symmetric"), method = c("loess", "model.frame"), control = loess.control(...), 	...
-loess.control;function;function;stats;surface = c("interpolate", "direct"), statistics = c("approximate", 	"exact"), trace.hat = c("exact", "approximate"), cell = 0.2, 	iterations = 4, ...
-loess.smooth;function;function;stats;x, y, span = 2/3, degree = 1, family = c("symmetric", 	"gaussian"), evaluation = 50, ...
-logLik;function;function;stats;Generic Method
-loglin;function;function;stats;table, margin, start = rep(1, length(table)), fit = FALSE, 	eps = 0.1, iter = 20, param = FALSE, print = TRUE
-lowess;function;function;stats;x, y = NULL, f = 2/3, iter = 3, delta = 0.01 * diff(range(xy$x[o]))
-ls.diag;function;function;stats;ls.out
-lsfit;function;function;stats;x, y, wt = NULL, intercept = TRUE, tolerance = 1e-07, 	yname = NULL
-ls.print;function;function;stats;ls.out, digits = 4, print.it = TRUE
-mad;function;function;stats;x, center = median(x), constant = 1.4826, na.rm = FALSE, 	low = FALSE, high = FALSE
-mahalanobis;function;function;stats;x, center, cov, inverted = FALSE, ...
-makeARIMA;function;function;stats;phi, theta, Delta, kappa = 1e+06
-make.link;function;function;stats;link
-makepredictcall;function;function;stats;var, call
-manova;function;function;stats;...
-mantelhaen.test;function;function;stats;x, y = NULL, z = NULL, alternative = c("two.sided", 	"less", "greater"), correct = TRUE, exact = FALSE, conf.level = 0.95
-mauchley.test;function;function;stats;...
-mauchly.test;function;function;stats;object, ...
-mcnemar.test;function;function;stats;x, y = NULL, correct = TRUE
-median;function;function;stats;x, na.rm = FALSE
-median.default;function;function;stats;x, na.rm = FALSE
-medpolish;function;function;stats;x, eps = 0.01, maxiter = 10, trace.iter = TRUE, na.rm = FALSE
-.MFclass;function;function;stats;x
-model.extract;function;function;stats;frame, component
-model.frame;function;function;stats;Generic Method
-model.frame.aovlist;function;function;stats;formula, data = NULL, ...
-model.frame.default;function;function;stats;formula, data = NULL, subset = NULL, na.action = na.fail, 	drop.unused.levels = FALSE, xlev = NULL, ...
-model.frame.glm;function;function;stats;formula, ...
-model.frame.lm;function;function;stats;formula, ...
-model.matrix;function;function;stats;Generic Method
-model.matrix.default;function;function;stats;object, data = environment(object), contrasts.arg = NULL, 	xlev = NULL, ...
-model.matrix.lm;function;function;stats;object, ...
-model.offset;function;function;stats;x
-model.response;function;function;stats;data, type = "any"
-model.tables;function;function;stats;x, ...
-model.weights;function;function;stats;x
-monthplot;function;function;stats;x, ...
-mood.test;function;function;stats;x, ...
-mvfft;function;function;stats;z, inverse = FALSE
-na.action;function;function;stats;object, ...
-na.contiguous;function;function;stats;object, ...
-na.exclude;function;function;stats;object, ...
-na.fail;function;function;stats;object, ...
-na.omit;function;function;stats;object, ...
-na.pass;function;function;stats;object, ...
-napredict;function;function;stats;omit, x, ...
-naprint;function;function;stats;x, ...
-naresid;function;function;stats;omit, x, ...
-nextn;function;function;stats;n, factors = c(2, 3, 5)
-nlm;function;function;stats;f, p, ..., hessian = FALSE, typsize = rep(1, length(p)), 	fscale = 1, print.level = 0, ndigit = 12, gradtol = 1e-06, 	stepmax = max(1000 * sqrt(sum((p/typsize)^2)), 1000), steptol = 1e-06, 	iterlim = 100, check.analyticals = TRUE
-nlminb;function;function;stats;start, objective, gradient = NULL, hessian = NULL, 	..., scale = 1, control = list(), lower = -Inf, upper = Inf
-nls;function;function;stats;formula, data = parent.frame(), start, control = nls.control(), 	algorithm = c("default", "plinear", "port"), trace = FALSE, 	subset, weights, na.action, model = FALSE, lower = -Inf, 	upper = Inf, ...
-nls.control;function;function;stats;maxiter = 50, tol = 1e-05, minFactor = 1/1024, printEval = FALSE, 	warnOnly = FALSE
-NLSstAsymptotic;function;function;stats;xy
-NLSstClosestX;function;function;stats;xy, yval
-NLSstLfAsymptote;function;function;stats;xy
-NLSstRtAsymptote;function;function;stats;xy
-numericDeriv;function;function;stats;expr, theta, rho = parent.frame(), dir = 1
-offset;function;function;stats;object
-oneway.test;function;function;stats;formula, data, subset, na.action, var.equal = FALSE
-optim;function;function;stats;par, fn, gr = NULL, ..., method = c("Nelder-Mead", 	"BFGS", "CG", "L-BFGS-B", "SANN"), lower = -Inf, upper = Inf, 	control = list(), hessian = FALSE
-optimise;function;function;stats;f, interval, ..., lower = min(interval), upper = max(interval), 	maximum = FALSE, tol = .Machine$double.eps^0.25
-optimize;function;function;stats;f, interval, ..., lower = min(interval), upper = max(interval), 	maximum = FALSE, tol = .Machine$double.eps^0.25
-order.dendrogram;function;function;stats;x
-pacf;function;function;stats;x, lag.max, plot, na.action, ...
-p.adjust;function;function;stats;p, method = p.adjust.methods, n = length(p)
-p.adjust.methods;character;character;stats;Not a function
-pairwise.prop.test;function;function;stats;x, n, p.adjust.method = p.adjust.methods, ...
-pairwise.table;function;function;stats;compare.levels, level.names, p.adjust.method
-pairwise.t.test;function;function;stats;x, g, p.adjust.method = p.adjust.methods, pool.sd = !paired, 	paired = FALSE, alternative = c("two.sided", "less", "greater"), 	...
-pairwise.wilcox.test;function;function;stats;x, g, p.adjust.method = p.adjust.methods, paired = FALSE, 	...
-pbeta;function;function;stats;q, shape1, shape2, ncp = 0, lower.tail = TRUE, log.p = FALSE
-pbinom;function;function;stats;q, size, prob, lower.tail = TRUE, log.p = FALSE
-pbirthday;function;function;stats;n, classes = 365, coincident = 2
-pcauchy;function;function;stats;q, location = 0, scale = 1, lower.tail = TRUE, log.p = FALSE
-pchisq;function;function;stats;q, df, ncp = 0, lower.tail = TRUE, log.p = FALSE
-pexp;function;function;stats;q, rate = 1, lower.tail = TRUE, log.p = FALSE
-pf;function;function;stats;q, df1, df2, ncp, lower.tail = TRUE, log.p = FALSE
-pgamma;function;function;stats;q, shape, rate = 1, scale = 1/rate, lower.tail = TRUE, 	log.p = FALSE
-pgeom;function;function;stats;q, prob, lower.tail = TRUE, log.p = FALSE
-phyper;function;function;stats;q, m, n, k, lower.tail = TRUE, log.p = FALSE
-plclust;function;function;stats;tree, hang = 0.1, unit = FALSE, level = FALSE, hmin = 0, 	square = TRUE, labels = NULL, plot. = TRUE, axes = TRUE, 	frame.plot = FALSE, ann = TRUE, main = "", sub = NULL, xlab = NULL, 	ylab = "Height"
-plnorm;function;function;stats;q, meanlog = 0, sdlog = 1, lower.tail = TRUE, log.p = FALSE
-plogis;function;function;stats;q, location = 0, scale = 1, lower.tail = TRUE, log.p = FALSE
-plot.density;function;function;stats;x, main = NULL, xlab = NULL, ylab = "Density", type = "l", 	zero.line = TRUE, ...
-plot.ecdf;function;function;stats;x, ..., ylab = "Fn(x)", verticals = FALSE, col.01line = "gray70", 	pch = 19
-plot.lm;function;function;stats;x, which = c(1L:3L, 5L), caption = list("Residuals vs Fitted", 	"Normal Q-Q", "Scale-Location", "Cook's distance", "Residuals vs Leverage", 	expression("Cook's dist vs Leverage  " * h[ii]/(1 - h[ii]))), 	panel = if (add.smooth) panel.smooth else points, sub.caption = NULL, 	main = "", ask = prod(par("mfcol")) < length(which) && dev.interactive(), 	..., id.n = 3, labels.id = names(residuals(x)), cex.id = 0.75, 	qqline = TRUE, cook.levels = c(0.5, 1), add.smooth = getOption("add.smooth"), 	label.pos = c(4, 2), cex.caption = 1
-plot.mlm;function;function;stats;x, ...
-plot.spec;function;function;stats;x, add = FALSE, ci = 0.95, log = c("yes", "dB", "no"), 	xlab = "frequency", ylab = NULL, type = "l", ci.col = "blue", 	ci.lty = 3, main = NULL, sub = NULL, plot.type = c("marginal", 	    "coherency", "phase"), ...
-plot.spec.coherency;function;function;stats;x, ci = 0.95, xlab = "frequency", ylab = "squared coherency", 	ylim = c(0, 1), type = "l", main = NULL, ci.col = "blue", 	ci.lty = 3, ...
-plot.spec.phase;function;function;stats;x, ci = 0.95, xlab = "frequency", ylab = "phase", ylim = c(-pi, 	pi), type = "l", main = NULL, ci.col = "blue", ci.lty = 3, 	...
-plot.stepfun;function;function;stats;x, xval, xlim, ylim = range(c(y, Fn.kn)), xlab = "x", 	ylab = "f(x)", main = NULL, add = FALSE, verticals = TRUE, 	do.points = (n < 1000), pch = par("pch"), col = par("col"), 	col.points = col, cex.points = par("cex"), col.hor = col, 	col.vert = col, lty = par("lty"), lwd = par("lwd"), ...
-plot.ts;function;function;stats;x, y = NULL, plot.type = c("multiple", "single"), xy.labels, 	xy.lines, panel = lines, nc, yax.flip = FALSE, mar.multi = c(0, 	    5.1, 0, if (yax.flip) 5.1 else 2.1), oma.multi = c(6, 	    0, 5, 0), axes = TRUE, ...
-plot.TukeyHSD;function;function;stats;x, ...
-pnbinom;function;function;stats;q, size, prob, mu, lower.tail = TRUE, log.p = FALSE
-pnorm;function;function;stats;q, mean = 0, sd = 1, lower.tail = TRUE, log.p = FALSE
-poisson;function;function;stats;link = "log"
-poisson.test;function;function;stats;x, T = 1, r = 1, alternative = c("two.sided", "less", 	"greater"), conf.level = 0.95
-poly;function;function;stats;x, ..., degree = 1, coefs = NULL, raw = FALSE
-polym;function;function;stats;..., degree = 1, raw = FALSE
-power;function;function;stats;lambda = 1
-power.anova.test;function;function;stats;groups = NULL, n = NULL, between.var = NULL, within.var = NULL, 	sig.level = 0.05, power = NULL
-power.prop.test;function;function;stats;n = NULL, p1 = NULL, p2 = NULL, sig.level = 0.05, power = NULL, 	alternative = c("two.sided", "one.sided"), strict = FALSE
-power.t.test;function;function;stats;n = NULL, delta = NULL, sd = 1, sig.level = 0.05, power = NULL, 	type = c("two.sample", "one.sample", "paired"), alternative = c("two.sided", 	    "one.sided"), strict = FALSE
-ppoints;function;function;stats;n, a = ifelse(n <= 10, 3/8, 1/2)
-ppois;function;function;stats;q, lambda, lower.tail = TRUE, log.p = FALSE
-ppr;function;function;stats;x, ...
-PP.test;function;function;stats;x, lshort = TRUE
-prcomp;function;function;stats;x, ...
-predict;function;function;stats;Generic Method
-predict.glm;function;function;stats;object, newdata = NULL, type = c("link", "response", 	"terms"), se.fit = FALSE, dispersion = NULL, terms = NULL, 	na.action = na.pass, ...
-predict.lm;function;function;stats;object, newdata, se.fit = FALSE, scale = NULL, df = Inf, 	interval = c("none", "confidence", "prediction"), level = 0.95, 	type = c("response", "terms"), terms = NULL, na.action = na.pass, 	pred.var = res.var/weights, weights = 1, ...
-predict.mlm;function;function;stats;object, newdata, se.fit = FALSE, na.action = na.pass, 	...
-predict.poly;function;function;stats;object, newdata, ...
-preplot;function;function;stats;object, ...
-princomp;function;function;stats;x, ...
-print.anova;function;function;stats;x, digits = max(getOption("digits") - 2, 3), signif.stars = getOption("show.signif.stars"), 	...
-print.coefmat;function;function;stats;x, digits = max(3, getOption("digits") - 2), signif.stars = getOption("show.signif.stars"), 	dig.tst = max(1, min(5, digits - 1)), cs.ind, tst.ind, zap.ind = integer(0L), 	P.values = NULL, has.Pvalue, eps.Pvalue = .Machine$double.eps, 	na.print = "", ...
-printCoefmat;function;function;stats;x, digits = max(3, getOption("digits") - 2), signif.stars = getOption("show.signif.stars"), 	signif.legend = signif.stars, dig.tst = max(1, min(5, digits - 	    1)), cs.ind = 1:k, tst.ind = k + 1, zap.ind = integer(0), 	P.values = NULL, has.Pvalue = nc >= 4 && substr(colnames(x)[nc], 	    1, 3) == "Pr(", eps.Pvalue = .Machine$double.eps, na.print = "NA", 	...
-print.density;function;function;stats;x, digits = NULL, ...
-print.family;function;function;stats;x, ...
-print.formula;function;function;stats;x, showEnv = !identical(e, .GlobalEnv), ...
-print.ftable;function;function;stats;x, digits = getOption("digits"), ...
-print.glm;function;function;stats;x, digits = max(3, getOption("digits") - 3), ...
-print.infl;function;function;stats;x, digits = max(3, getOption("digits") - 4), ...
-print.integrate;function;function;stats;x, digits = getOption("digits"), ...
-print.lm;function;function;stats;x, digits = max(3, getOption("digits") - 3), ...
-print.logLik;function;function;stats;x, digits = getOption("digits"), ...
-print.terms;function;function;stats;x, ...
-print.ts;function;function;stats;x, calendar, ...
-profile;function;function;stats;Generic Method
-proj;function;function;stats;object, ...
-promax;function;function;stats;x, m = 4
-prop.test;function;function;stats;x, n, p = NULL, alternative = c("two.sided", "less", 	"greater"), conf.level = 0.95, correct = TRUE
-prop.trend.test;function;function;stats;x, n, score = seq_along(x)
-psignrank;function;function;stats;q, n, lower.tail = TRUE, log.p = FALSE
-pt;function;function;stats;q, df, ncp, lower.tail = TRUE, log.p = FALSE
-ptukey;function;function;stats;q, nmeans, df, nranges = 1, lower.tail = TRUE, log.p = FALSE
-punif;function;function;stats;q, min = 0, max = 1, lower.tail = TRUE, log.p = FALSE
-pweibull;function;function;stats;q, shape, scale = 1, lower.tail = TRUE, log.p = FALSE
-pwilcox;function;function;stats;q, m, n, lower.tail = TRUE, log.p = FALSE
-qbeta;function;function;stats;p, shape1, shape2, ncp = 0, lower.tail = TRUE, log.p = FALSE
-qbinom;function;function;stats;p, size, prob, lower.tail = TRUE, log.p = FALSE
-qbirthday;function;function;stats;prob = 0.5, classes = 365, coincident = 2
-qcauchy;function;function;stats;p, location = 0, scale = 1, lower.tail = TRUE, log.p = FALSE
-qchisq;function;function;stats;p, df, ncp = 0, lower.tail = TRUE, log.p = FALSE
-qexp;function;function;stats;p, rate = 1, lower.tail = TRUE, log.p = FALSE
-qf;function;function;stats;p, df1, df2, ncp, lower.tail = TRUE, log.p = FALSE
-qgamma;function;function;stats;p, shape, rate = 1, scale = 1/rate, lower.tail = TRUE, 	log.p = FALSE
-qgeom;function;function;stats;p, prob, lower.tail = TRUE, log.p = FALSE
-qhyper;function;function;stats;p, m, n, k, lower.tail = TRUE, log.p = FALSE
-qlnorm;function;function;stats;p, meanlog = 0, sdlog = 1, lower.tail = TRUE, log.p = FALSE
-qlogis;function;function;stats;p, location = 0, scale = 1, lower.tail = TRUE, log.p = FALSE
-qnbinom;function;function;stats;p, size, prob, mu, lower.tail = TRUE, log.p = FALSE
-qnorm;function;function;stats;p, mean = 0, sd = 1, lower.tail = TRUE, log.p = FALSE
-qpois;function;function;stats;p, lambda, lower.tail = TRUE, log.p = FALSE
-qqline;function;function;stats;y, datax = FALSE, ...
-qqnorm;function;function;stats;Generic Method
-qqnorm.default;function;function;stats;y, ylim, main = "Normal Q-Q Plot", xlab = "Theoretical Quantiles", 	ylab = "Sample Quantiles", plot.it = TRUE, datax = FALSE, 	...
-qqplot;function;function;stats;x, y, plot.it = TRUE, xlab = deparse(substitute(x)), 	ylab = deparse(substitute(y)), ...
-qsignrank;function;function;stats;p, n, lower.tail = TRUE, log.p = FALSE
-qt;function;function;stats;p, df, ncp, lower.tail = TRUE, log.p = FALSE
-qtukey;function;function;stats;p, nmeans, df, nranges = 1, lower.tail = TRUE, log.p = FALSE
-quade.test;function;function;stats;y, ...
-quantile;function;function;stats;x, ...
-quantile.default;function;function;stats;x, probs = seq(0, 1, 0.25), na.rm = FALSE, names = TRUE, 	type = 7, ...
-quasi;function;function;stats;link = "identity", variance = "constant"
-quasibinomial;function;function;stats;link = "logit"
-quasipoisson;function;function;stats;link = "log"
-qunif;function;function;stats;p, min = 0, max = 1, lower.tail = TRUE, log.p = FALSE
-qweibull;function;function;stats;p, shape, scale = 1, lower.tail = TRUE, log.p = FALSE
-qwilcox;function;function;stats;p, m, n, lower.tail = TRUE, log.p = FALSE
-r2dtable;function;function;stats;n, r, c
-rbeta;function;function;stats;n, shape1, shape2, ncp = 0
-rbinom;function;function;stats;n, size, prob
-rcauchy;function;function;stats;n, location = 0, scale = 1
-rchisq;function;function;stats;n, df, ncp = 0
-read.ftable;function;function;stats;file, sep = "", quote = "\"", row.var.names, col.vars, 	skip = 0
-rect.hclust;function;function;stats;tree, k = NULL, which = NULL, x = NULL, h = NULL, border = 2, 	cluster = NULL
-reformulate;function;function;stats;termlabels, response = NULL
-relevel;function;function;stats;x, ref, ...
-reorder;function;function;stats;x, ...
-replications;function;function;stats;formula, data = NULL, na.action
-reshape;function;function;stats;data, varying = NULL, v.names = NULL, timevar = "time", 	idvar = "id", ids = 1L:NROW(data), times = seq_along(varying[[1L]]), 	drop = NULL, direction, new.row.names = NULL, sep = ".", 	split = if (sep == "") {	    list(regexp = "[A-Za-z][0-9]", include = TRUE)	} else {	    list(regexp = sep, include = FALSE, fixed = TRUE)	}
-reshapeLong;function;function;stats;x, jvars, ilev = row.names(x), jlev = names(x)[jvars], 	iname = "reshape.i", jname = "reshape.j", vname = "reshape.v"
-reshapeWide;function;function;stats;x, i, j, val, jnames = levels(j)
-resid;function;function;stats;object, ...
-residuals;function;function;stats;Generic Method
-residuals.default;function;function;stats;object, ...
-residuals.glm;function;function;stats;object, type = c("deviance", "pearson", "working", 	"response", "partial"), ...
-residuals.lm;function;function;stats;object, type = c("working", "response", "deviance", 	"pearson", "partial"), ...
-rexp;function;function;stats;n, rate = 1
-rf;function;function;stats;n, df1, df2, ncp
-rgamma;function;function;stats;n, shape, rate = 1, scale = 1/rate
-rgeom;function;function;stats;n, prob
-rhyper;function;function;stats;nn, m, n, k
-rlnorm;function;function;stats;n, meanlog = 0, sdlog = 1
-rlogis;function;function;stats;n, location = 0, scale = 1
-rmultinom;function;function;stats;n, size, prob
-rnbinom;function;function;stats;n, size, prob, mu
-rnorm;function;function;stats;n, mean = 0, sd = 1
-rpois;function;function;stats;n, lambda
-rsignrank;function;function;stats;nn, n
-rstandard;function;function;stats;model, ...
-rstandard.glm;function;function;stats;model, infl = lm.influence(model, do.coef = FALSE), 	...
-rstandard.lm;function;function;stats;model, infl = lm.influence(model, do.coef = FALSE), 	sd = sqrt(deviance(model)/df.residual(model)), ...
-rstudent;function;function;stats;model, ...
-rstudent.glm;function;function;stats;model, infl = influence(model, do.coef = FALSE), ...
-rstudent.lm;function;function;stats;model, infl = lm.influence(model, do.coef = FALSE), 	res = infl$wt.res, ...
-rt;function;function;stats;n, df, ncp
-runif;function;function;stats;n, min = 0, max = 1
-runmed;function;function;stats;x, k, endrule = c("median", "keep", "constant"), algorithm = NULL, 	print.level = 0
-rweibull;function;function;stats;n, shape, scale = 1
-rwilcox;function;function;stats;nn, m, n
-scatter.smooth;function;function;stats;x, y = NULL, span = 2/3, degree = 1, family = c("symmetric", 	"gaussian"), xlab = NULL, ylab = NULL, ylim = range(y, prediction$y, 	na.rm = TRUE), evaluation = 50, ...
-screeplot;function;function;stats;x, ...
-sd;function;function;stats;x, na.rm = FALSE
-se.contrast;function;function;stats;Generic Method
-selfStart;function;function;stats;model, initial, parameters, template
-setNames;function;function;stats;object, nm
-shapiro.test;function;function;stats;x
-simulate;function;function;stats;object, nsim = 1, seed = NULL, ...
-smooth;function;function;stats;x, kind = c("3RS3R", "3RSS", "3RSR", "3R", "3", "S"), 	twiceit = FALSE, endrule = "Tukey", do.ends = FALSE
-smoothEnds;function;function;stats;y, k = 3
-smooth.spline;function;function;stats;x, y = NULL, w = NULL, df, spar = NULL, cv = FALSE, 	all.knots = FALSE, nknots = NULL, keep.data = TRUE, df.offset = 0, 	penalty = 1, control.spar = list()
-sortedXyData;function;function;stats;x, y, data
-spec.ar;function;function;stats;x, n.freq, order = NULL, plot = TRUE, na.action = na.fail, 	method = "yule-walker", ...
-spec.pgram;function;function;stats;x, spans = NULL, kernel = NULL, taper = 0.1, pad = 0, 	fast = TRUE, demean = FALSE, detrend = TRUE, plot = TRUE, 	na.action = na.fail, ...
-spec.taper;function;function;stats;x, p = 0.1
-spectrum;function;function;stats;x, ..., method = c("pgram", "ar")
-spline;function;function;stats;x, y = NULL, n = 3 * length(x), method = "fmm", xmin = min(x), 	xmax = max(x), xout, ties = mean
-splinefun;function;function;stats;x, y = NULL, method = c("fmm", "periodic", "natural", 	"monoH.FC"), ties = mean
-splinefunH;function;function;stats;x, y, m
-SSasymp;function;function;stats;input, Asym, R0, lrc
-SSasympOff;function;function;stats;input, Asym, lrc, c0
-SSasympOrig;function;function;stats;input, Asym, lrc
-SSbiexp;function;function;stats;input, A1, lrc1, A2, lrc2
-SSD;function;function;stats;object, ...
-SSfol;function;function;stats;Dose, input, lKe, lKa, lCl
-SSfpl;function;function;stats;input, A, B, xmid, scal
-SSgompertz;function;function;stats;x, Asym, b2, b3
-SSlogis;function;function;stats;input, Asym, xmid, scal
-SSmicmen;function;function;stats;input, Vm, K
-SSweibull;function;function;stats;x, Asym, Drop, lrc, pwr
-start;function;function;stats;x, ...
-stat.anova;function;function;stats;table, test = c("Chisq", "F", "Cp"), scale, df.scale, 	n
-step;function;function;stats;object, scope, scale = 0, direction = c("both", "backward", 	"forward"), trace = 1, keep = NULL, steps = 1000, k = 2, 	...
-stepfun;function;function;stats;x, y, f = as.numeric(right), ties = "ordered", right = FALSE
-stl;function;function;stats;x, s.window, s.degree = 0, t.window = NULL, t.degree = 1, 	l.window = nextodd(period), l.degree = t.degree, s.jump = ceiling(s.window/10), 	t.jump = ceiling(t.window/10), l.jump = ceiling(l.window/10), 	robust = FALSE, inner = if (robust) 1 else 2, outer = if (robust) 15 else 0, 	na.action = na.fail
-StructTS;function;function;stats;x, type = c("level", "trend", "BSM"), init = NULL, 	fixed = NULL, optim.control = NULL
-summary.aov;function;function;stats;object, intercept = FALSE, split, expand.split = TRUE, 	keep.zero.df = TRUE, ...
-summary.aovlist;function;function;stats;object, ...
-summary.glm;function;function;stats;object, dispersion = NULL, correlation = FALSE, symbolic.cor = FALSE, 	...
-summary.infl;function;function;stats;object, digits = max(2, getOption("digits") - 5), ...
-summary.lm;function;function;stats;object, correlation = FALSE, symbolic.cor = FALSE, 	...
-summary.manova;function;function;stats;object, test = c("Pillai", "Wilks", "Hotelling-Lawley", 	"Roy"), intercept = FALSE, tol = 1e-07, ...
-summary.mlm;function;function;stats;object, ...
-summary.stepfun;function;function;stats;object, ...
-supsmu;function;function;stats;x, y, wt = rep(1, n), span = "cv", periodic = FALSE, 	bass = 0
-symnum;function;function;stats;x, cutpoints = c(0.3, 0.6, 0.8, 0.9, 0.95), symbols = if (numeric.x) c(" ", 	".", ",", "+", "*", "B") else c(".", "|"), legend = length(symbols) >= 	3, na = "?", eps = 1e-05, numeric.x = is.numeric(x), corr = missing(cutpoints) && 	numeric.x, show.max = if (corr) "1", show.min = NULL, abbr.colnames = has.colnames, 	lower.triangular = corr && is.numeric(x) && is.matrix(x), 	diag.lower.tri = corr && !is.null(show.max)
-termplot;function;function;stats;model, data = NULL, envir = environment(formula(model)), 	partial.resid = FALSE, rug = FALSE, terms = NULL, se = FALSE, 	xlabs = NULL, ylabs = NULL, main = NULL, col.term = 2, lwd.term = 1.5, 	col.se = "orange", lty.se = 2, lwd.se = 1, col.res = "gray", 	cex = 1, pch = par("pch"), col.smth = "darkred", lty.smth = 2, 	span.smth = 2/3, ask = dev.interactive() && nb.fig < n.tms, 	use.factor.levels = TRUE, smooth = NULL, ylim = "common", 	...
-terms;function;function;stats;Generic Method
-terms.aovlist;function;function;stats;x, ...
-terms.default;function;function;stats;x, ...
-terms.formula;function;function;stats;x, specials = NULL, abb = NULL, data = NULL, neg.out = TRUE, 	keep.order = FALSE, simplify = FALSE, ..., allowDotAsName = FALSE
-terms.terms;function;function;stats;x, ...
-time;function;function;stats;x, ...
-toeplitz;function;function;stats;x
-ts;function;function;stats;data = NA, start = 1, end = numeric(0), frequency = 1, 	deltat = 1, ts.eps = getOption("ts.eps"), class = if (nseries > 	    1) c("mts", "ts") else "ts", names = if (!is.null(dimnames(data))) colnames(data) else paste("Series", 	    seq(nseries))
-tsdiag;function;function;stats;object, gof.lag, ...
-ts.intersect;function;function;stats;..., dframe = FALSE
-tsp;function;function;stats;x
-tsp<-;function;function;stats;x, value
-ts.plot;function;function;stats;..., gpars = list()
-tsSmooth;function;function;stats;object, ...
-ts.union;function;function;stats;..., dframe = FALSE
-t.test;function;function;stats;x, ...
-TukeyHSD;function;function;stats;x, which, ordered = FALSE, conf.level = 0.95, ...
-TukeyHSD.aov;function;function;stats;x, which = seq_along(tabs), ordered = FALSE, conf.level = 0.95, 	...
-uniroot;function;function;stats;f, interval, ..., lower = min(interval), upper = max(interval), 	f.lower = f(lower, ...), f.upper = f(upper, ...), tol = .Machine$double.eps^0.25, 	maxiter = 1000
-update;function;function;stats;Generic Method
-update.default;function;function;stats;object, formula., ..., evaluate = TRUE
-update.formula;function;function;stats;old, new, ...
-var;function;function;stats;x, y = NULL, na.rm = FALSE, use
-variable.names;function;function;stats;object, ...
-varimax;function;function;stats;x, normalize = TRUE, eps = 1e-05
-var.test;function;function;stats;x, ...
-vcov;function;function;stats;Generic Method
-weighted.mean;function;function;stats;x, w, ...
-weighted.residuals;function;function;stats;obj, drop0 = TRUE
-weights;function;function;stats;object, ...
-wilcox.test;function;function;stats;x, ...
-window;function;function;stats;x, ...
-window<-;function;function;stats;x, ..., value
-write.ftable;function;function;stats;x, file = "", quote = TRUE, append = FALSE, digits = getOption("digits")
-xtabs;function;function;stats;formula = ~., data = parent.frame(), subset, sparse = FALSE, 	na.action, exclude = c(NA, NaN), drop.unused.levels = FALSE
-abline;function;function;graphics;a = NULL, b = NULL, h = NULL, v = NULL, reg = NULL, 	coef = NULL, untf = FALSE, ...
-arrows;function;function;graphics;x0, y0, x1 = x0, y1 = y0, length = 0.25, angle = 30, 	code = 2, col = par("fg"), lty = par("lty"), lwd = par("lwd"), 	...
-assocplot;function;function;graphics;x, col = c("black", "red"), space = 0.3, main = NULL, 	xlab = NULL, ylab = NULL
-axis;function;function;graphics;side, at = NULL, labels = TRUE, tick = TRUE, line = NA, 	pos = NA, outer = FALSE, font = NA, lty = "solid", lwd = 1, 	lwd.ticks = lwd, col = NULL, col.ticks = NULL, hadj = NA, 	padj = NA, ...
-Axis;function;function;graphics;x = NULL, at = NULL, ..., side, labels = NULL
-axis.Date;function;function;graphics;side, x, at, format, labels = TRUE, ...
-axis.POSIXct;function;function;graphics;side, x, at, format, labels = TRUE, ...
-axTicks;function;function;graphics;side, axp = NULL, usr = NULL, log = NULL
-barplot;function;function;graphics;height, ...
-barplot.default;function;function;graphics;height, width = 1, space = NULL, names.arg = NULL, 	legend.text = NULL, beside = FALSE, horiz = FALSE, density = NULL, 	angle = 45, col = NULL, border = par("fg"), main = NULL, 	sub = NULL, xlab = NULL, ylab = NULL, xlim = NULL, ylim = NULL, 	xpd = TRUE, log = "", axes = TRUE, axisnames = TRUE, cex.axis = par("cex.axis"), 	cex.names = par("cex.axis"), inside = TRUE, plot = TRUE, 	axis.lty = 0, offset = 0, add = FALSE, args.legend = NULL, 	...
-box;function;function;graphics;which = "plot", lty = "solid", ...
-boxplot;function;function;graphics;x, ...
-boxplot.default;function;function;graphics;x, ..., range = 1.5, width = NULL, varwidth = FALSE, 	notch = FALSE, outline = TRUE, names, plot = TRUE, border = par("fg"), 	col = NULL, log = "", pars = list(boxwex = 0.8, staplewex = 0.5, 	    outwex = 0.5), horizontal = FALSE, add = FALSE, at = NULL
-boxplot.matrix;function;function;graphics;x, use.cols = TRUE, ...
-bxp;function;function;graphics;z, notch = FALSE, width = NULL, varwidth = FALSE, outline = TRUE, 	notch.frac = 0.5, log = "", border = par("fg"), pars = NULL, 	frame.plot = axes, horizontal = FALSE, add = FALSE, at = NULL, 	show.names = NULL, ...
-cdplot;function;function;graphics;x, ...
-clip;function;function;graphics;x1, x2, y1, y2
-close.screen;function;function;graphics;n, all.screens = FALSE
-co.intervals;function;function;graphics;x, number = 6, overlap = 0.5
-contour;function;function;graphics;Generic Method
-contour.default;function;function;graphics;x = seq(0, 1, length.out = nrow(z)), y = seq(0, 1, 	length.out = ncol(z)), z, nlevels = 10, levels = pretty(zlim, 	nlevels), labels = NULL, xlim = range(x, finite = TRUE), 	ylim = range(y, finite = TRUE), zlim = range(z, finite = TRUE), 	labcex = 0.6, drawlabels = TRUE, method = "flattest", vfont, 	axes = TRUE, frame.plot = axes, col = par("fg"), lty = par("lty"), 	lwd = par("lwd"), add = FALSE, ...
-coplot;function;function;graphics;formula, data, given.values, panel = points, rows, 	columns, show.given = TRUE, col = par("fg"), pch = par("pch"), 	bar.bg = c(num = gray(0.8), fac = gray(0.95)), xlab = c(x.name, 	    paste("Given :", a.name)), ylab = c(y.name, paste("Given :", 	    b.name)), subscripts = FALSE, axlabels = function(f) abbreviate(levels(f)), 	number = 6, overlap = 0.5, xlim, ylim, ...
-curve;function;function;graphics;expr, from = NULL, to = NULL, n = 101, add = FALSE, 	type = "l", ylab = NULL, log = NULL, xlim = NULL, ...
-dotchart;function;function;graphics;x, labels = NULL, groups = NULL, gdata = NULL, cex = par("cex"), 	pch = 21, gpch = 21, bg = par("bg"), color = par("fg"), gcolor = par("fg"), 	lcolor = "gray", xlim = range(x[is.finite(x)]), main = NULL, 	xlab = NULL, ylab = NULL, ...
-erase.screen;function;function;graphics;n = cur.screen
-filled.contour;function;function;graphics;x = seq(0, 1, length.out = nrow(z)), y = seq(0, 1, 	length.out = ncol(z)), z, xlim = range(x, finite = TRUE), 	ylim = range(y, finite = TRUE), zlim = range(z, finite = TRUE), 	levels = pretty(zlim, nlevels), nlevels = 20, color.palette = cm.colors, 	col = color.palette(length(levels) - 1), plot.title, plot.axes, 	key.title, key.axes, asp = NA, xaxs = "i", yaxs = "i", las = 1, 	axes = TRUE, frame.plot = axes, ...
-fourfoldplot;function;function;graphics;x, color = c("#99CCFF", "#6699CC"), conf.level = 0.95, 	std = c("margins", "ind.max", "all.max"), margin = c(1, 2), 	space = 0.2, main = NULL, mfrow = NULL, mfcol = NULL
-frame;function;function;graphics;No arguments
-grconvertX;function;function;graphics;x, from = "user", to = "user"
-grconvertY;function;function;graphics;y, from = "user", to = "user"
-grid;function;function;graphics;nx = NULL, ny = nx, col = "lightgray", lty = "dotted", 	lwd = par("lwd"), equilogs = TRUE
-hist;function;function;graphics;Generic Method
-hist.default;function;function;graphics;x, breaks = "Sturges", freq = NULL, probability = !freq, 	include.lowest = TRUE, right = TRUE, density = NULL, angle = 45, 	col = NULL, border = NULL, main = paste("Histogram of", xname), 	xlim = range(breaks), ylim = NULL, xlab = xname, ylab, axes = TRUE, 	plot = TRUE, labels = FALSE, nclass = NULL, warn.unused = TRUE, 	...
-identify;function;function;graphics;Generic Method
-image;function;function;graphics;Generic Method
-image.default;function;function;graphics;x = seq(0, 1, length.out = nrow(z)), y = seq(0, 1, 	length.out = ncol(z)), z, zlim = range(z[is.finite(z)]), 	xlim = range(x), ylim = range(y), col = heat.colors(12), 	add = FALSE, xaxs = "i", yaxs = "i", xlab, ylab, breaks, 	oldstyle = FALSE, ...
-layout;function;function;graphics;mat, widths = rep(1, ncol(mat)), heights = rep(1, nrow(mat)), 	respect = FALSE
-layout.show;function;function;graphics;n = 1
-lcm;function;function;graphics;x
-legend;function;function;graphics;x, y = NULL, legend, fill = NULL, col = par("col"), 	border = "black", lty, lwd, pch, angle = 45, density = NULL, 	bty = "o", bg = par("bg"), box.lwd = par("lwd"), box.lty = par("lty"), 	box.col = par("fg"), pt.bg = NA, cex = 1, pt.cex = cex, pt.lwd = lwd, 	xjust = 0, yjust = 1, x.intersp = 1, y.intersp = 1, adj = c(0, 	    0.5), text.width = NULL, text.col = par("col"), merge = do.lines && 	    has.pch, trace = FALSE, plot = TRUE, ncol = 1, horiz = FALSE, 	title = NULL, inset = 0, xpd, title.col = text.col, title.adj = 0.5, 	seg.len = 2
-lines;function;function;graphics;Generic Method
-lines.default;function;function;graphics;x, y = NULL, type = "l", ...
-locator;function;function;graphics;n = 512, type = "n", ...
-matlines;function;function;graphics;x, y, type = "l", lty = 1:5, lwd = 1, pch = NULL, col = 1:6, 	...
-matplot;function;function;graphics;x, y, type = "p", lty = 1:5, lwd = 1, lend = par("lend"), 	pch = NULL, col = 1:6, cex = NULL, bg = NA, xlab = NULL, 	ylab = NULL, xlim = NULL, ylim = NULL, ..., add = FALSE, 	verbose = getOption("verbose")
-matpoints;function;function;graphics;x, y, type = "p", lty = 1:5, lwd = 1, pch = NULL, col = 1:6, 	...
-mosaicplot;function;function;graphics;x, ...
-mtext;function;function;graphics;text, side = 3, line = 0, outer = FALSE, at = NA, adj = NA, 	padj = NA, cex = NA, col = NA, font = NA, ...
-pairs;function;function;graphics;Generic Method
-pairs.default;function;function;graphics;x, labels, panel = points, ..., lower.panel = panel, 	upper.panel = panel, diag.panel = NULL, text.panel = textPanel, 	label.pos = 0.5 + has.diag/3, cex.labels = NULL, font.labels = 1, 	row1attop = TRUE, gap = 1
-panel.smooth;function;function;graphics;x, y, col = par("col"), bg = NA, pch = par("pch"), 	cex = 1, col.smooth = "red", span = 2/3, iter = 3, ...
-par;function;function;graphics;..., no.readonly = FALSE
-persp;function;function;graphics;x, ...
-pie;function;function;graphics;x, labels = names(x), edges = 200, radius = 0.8, clockwise = FALSE, 	init.angle = if (clockwise) 90 else 0, density = NULL, angle = 45, 	col = NULL, border = NULL, lty = NULL, main = NULL, ...
-piechart;function;function;graphics;x, labels = names(x), edges = 200, radius = 0.8, density = NULL, 	angle = 45, col = NULL, main = NULL, ...
-plot;function;function;graphics;Generic Method
-plot.default;function;function;graphics;x, y = NULL, type = "p", xlim = NULL, ylim = NULL, 	log = "", main = NULL, sub = NULL, xlab = NULL, ylab = NULL, 	ann = par("ann"), axes = TRUE, frame.plot = axes, panel.first = NULL, 	panel.last = NULL, asp = NA, ...
-plot.design;function;function;graphics;x, y = NULL, fun = mean, data = NULL, ..., ylim = NULL, 	xlab = "Factors", ylab = NULL, main = NULL, ask = NULL, xaxt = par("xaxt"), 	axes = TRUE, xtick = FALSE
-plot.new;function;function;graphics;No arguments
-plot.window;function;function;graphics;xlim, ylim, log = "", asp = NA, ...
-plot.xy;function;function;graphics;xy, type, pch = par("pch"), lty = par("lty"), col = par("col"), 	bg = NA, cex = 1, lwd = par("lwd"), ...
-points;function;function;graphics;Generic Method
-points.default;function;function;graphics;x, y = NULL, type = "p", ...
-polygon;function;function;graphics;x, y = NULL, density = NULL, angle = 45, border = NULL, 	col = NA, lty = par("lty"), ..., fillOddEven = FALSE
-polypath;function;function;graphics;x, y = NULL, border = NULL, col = NA, lty = par("lty"), 	rule = "winding", ...
-rasterImage;function;function;graphics;image, xleft, ybottom, xright, ytop, angle = 0, interpolate = TRUE, 	...
-rect;function;function;graphics;xleft, ybottom, xright, ytop, density = NULL, angle = 45, 	col = NA, border = NULL, lty = par("lty"), lwd = par("lwd"), 	...
-rug;function;function;graphics;x, ticksize = 0.03, side = 1, lwd = 0.5, col = par("fg"), 	quiet = getOption("warn") < 0, ...
-screen;function;function;graphics;n = cur.screen, new = TRUE
-segments;function;function;graphics;x0, y0, x1 = x0, y1 = y0, col = par("fg"), lty = par("lty"), 	lwd = par("lwd"), ...
-smoothScatter;function;function;graphics;x, y = NULL, nbin = 128, bandwidth, colramp = colorRampPalette(c("white", 	blues9)), nrpoints = 100, pch = ".", cex = 1, col = "black", 	transformation = function(x) x^0.25, postPlotHook = box, 	xlab = NULL, ylab = NULL, xlim, ylim, xaxs = par("xaxs"), 	yaxs = par("yaxs"), ...
-spineplot;function;function;graphics;x, ...
-split.screen;function;function;graphics;figs, screen, erase = TRUE
-stars;function;function;graphics;x, full = TRUE, scale = TRUE, radius = TRUE, labels = dimnames(x)[[1L]], 	locations = NULL, nrow = NULL, ncol = NULL, len = 1, key.loc = NULL, 	key.labels = dimnames(x)[[2L]], key.xpd = TRUE, xlim = NULL, 	ylim = NULL, flip.labels = NULL, draw.segments = FALSE, col.segments = 1L:n.seg, 	col.stars = NA, axes = FALSE, frame.plot = axes, main = NULL, 	sub = NULL, xlab = "", ylab = "", cex = 0.8, lwd = 0.25, 	lty = par("lty"), xpd = FALSE, mar = pmin(par("mar"), 1.1 + 	    c(2 * axes + (xlab != ""), 2 * axes + (ylab != ""), 1, 	        0)), add = FALSE, plot = TRUE, ...
-stem;function;function;graphics;x, scale = 1, width = 80, atom = 1e-08
-strheight;function;function;graphics;s, units = "user", cex = NULL, font = NULL, vfont = NULL, 	...
-stripchart;function;function;graphics;x, ...
-strwidth;function;function;graphics;s, units = "user", cex = NULL, font = NULL, vfont = NULL, 	...
-sunflowerplot;function;function;graphics;x, y = NULL, number, log = "", digits = 6, xlab = NULL, 	ylab = NULL, xlim = NULL, ylim = NULL, add = FALSE, rotate = FALSE, 	pch = 16, cex = 0.8, cex.fact = 1.5, col = par("col"), bg = NA, 	size = 1/8, seg.col = 2, seg.lwd = 1.5, ...
-symbols;function;function;graphics;x, y = NULL, circles, squares, rectangles, stars, thermometers, 	boxplots, inches = TRUE, add = FALSE, fg = par("col"), bg = NA, 	xlab = NULL, ylab = NULL, main = NULL, xlim = NULL, ylim = NULL, 	...
-text;function;function;graphics;Generic Method
-text.default;function;function;graphics;x, y = NULL, labels = seq_along(x), adj = NULL, pos = NULL, 	offset = 0.5, vfont = NULL, cex = 1, col = NULL, font = NULL, 	...
-title;function;function;graphics;main = NULL, sub = NULL, xlab = NULL, ylab = NULL, 	line = NA, outer = FALSE, ...
-xinch;function;function;graphics;x = 1, warn.log = TRUE
-xspline;function;function;graphics;x, y = NULL, shape = 0, open = TRUE, repEnds = TRUE, 	draw = TRUE, border = par("fg"), col = NA, ...
-xyinch;function;function;graphics;xy = 1, warn.log = TRUE
-yinch;function;function;graphics;y = 1, warn.log = TRUE
-adjustcolor;function;function;grDevices;col, alpha.f = 1, red.f = 1, green.f = 1, blue.f = 1, 	offset = c(0, 0, 0, 0), transform = diag(c(red.f, green.f, 	    blue.f, alpha.f))
-as.graphicsAnnot;function;function;grDevices;x
-as.raster;function;function;grDevices;x, ...
-bitmap;function;function;grDevices;file, type = "png16m", height = 7, width = 7, res = 72, 	units = "in", pointsize, taa = NA, gaa = NA, ...
-blues9;character;character;grDevices;Not a function
-bmp;function;function;grDevices;filename = "Rplot%03d.bmp", width = 480, height = 480, 	units = "px", pointsize = 12, bg = "white", res = NA, ..., 	type = c("cairo", "Xlib", "quartz"), antialias
-boxplot.stats;function;function;grDevices;x, coef = 1.5, do.conf = TRUE, do.out = TRUE
-cairo_pdf;function;function;grDevices;filename = if (onefile) "Rplots.pdf" else "Rplot%03d.pdf", 	width = 7, height = 7, pointsize = 12, onefile = FALSE, bg = "white", 	antialias = c("default", "none", "gray", "subpixel")
-cairo_ps;function;function;grDevices;filename = if (onefile) "Rplots.ps" else "Rplot%03d.ps", 	width = 7, height = 7, pointsize = 12, onefile = FALSE, bg = "white", 	antialias = c("default", "none", "gray", "subpixel")
-check.options;function;function;grDevices;new, name.opt, reset = FALSE, assign.opt = FALSE, envir = .GlobalEnv, 	check.attributes = c("mode", "length"), override.check = FALSE
-chull;function;function;grDevices;x, y = NULL
-CIDFont;function;function;grDevices;family, cmap, cmapEncoding, pdfresource = ""
-cm;function;function;grDevices;x
-cm.colors;function;function;grDevices;n, alpha = 1
-col2rgb;function;function;grDevices;col, alpha = FALSE
-colorConverter;function;function;grDevices;toXYZ, fromXYZ, name, white = NULL
-colorRamp;function;function;grDevices;colors, bias = 1, space = c("rgb", "Lab"), interpolate = c("linear", 	"spline")
-colorRampPalette;function;function;grDevices;colors, ...
-colors;function;function;grDevices;No arguments
-colorspaces;list;list;grDevices;Not a function
-colorspaces$XYZ;colorConverter; ;grDevices;Not a function
-colorspaces$Apple RGB;unknown; ;grDevices;Not a function
-colorspaces$sRGB;RGBcolorConverter; ;grDevices;Not a function
-colorspaces$CIE RGB;unknown; ;grDevices;Not a function
-colorspaces$Lab;colorConverter; ;grDevices;Not a function
-colorspaces$Luv;colorConverter; ;grDevices;Not a function
-colours;function;function;grDevices;No arguments
-contourLines;function;function;grDevices;x = seq(0, 1, length.out = nrow(z)), y = seq(0, 1, 	length.out = ncol(z)), z, nlevels = 10, levels = pretty(range(z, 	na.rm = TRUE), nlevels)
-convertColor;function;function;grDevices;color, from, to, from.ref.white = NULL, to.ref.white = NULL, 	scale.in = 1, scale.out = 1, clip = TRUE
-densCols;function;function;grDevices;x, y = NULL, nbin = 128, bandwidth, colramp = colorRampPalette(blues9[-(1:3)])
-dev2bitmap;function;function;grDevices;file, type = "png16m", height = 7, width = 7, res = 72, 	units = "in", pointsize, ..., method = c("postscript", "pdf"), 	taa = NA, gaa = NA
-devAskNewPage;function;function;grDevices;ask = NULL
-dev.control;function;function;grDevices;displaylist = c("inhibit", "enable")
-dev.copy;function;function;grDevices;device, ..., which = dev.next()
-dev.copy2eps;function;function;grDevices;...
-dev.copy2pdf;function;function;grDevices;..., out.type = "pdf"
-dev.cur;function;function;grDevices;No arguments
-deviceIsInteractive;function;function;grDevices;name = NULL
-dev.interactive;function;function;grDevices;orNone = FALSE
-dev.list;function;function;grDevices;No arguments
-dev.new;function;function;grDevices;...
-dev.next;function;function;grDevices;which = dev.cur()
-dev.off;function;function;grDevices;which = dev.cur()
-dev.prev;function;function;grDevices;which = dev.cur()
-dev.print;function;function;grDevices;device = postscript, ...
-dev.set;function;function;grDevices;which = dev.next()
-dev.size;function;function;grDevices;units = c("in", "cm", "px")
-embedFonts;function;function;grDevices;file, format, outfile = file, fontpaths = "", options = ""
-extendrange;function;function;grDevices;x, r = range(x, na.rm = TRUE), f = 0.05
-getGraphicsEvent;function;function;grDevices;prompt = "Waiting for input", onMouseDown = NULL, onMouseMove = NULL, 	onMouseUp = NULL, onKeybd = NULL, consolePrompt = prompt
-getGraphicsEventEnv;function;function;grDevices;which = dev.cur()
-graphics.off;function;function;grDevices;No arguments
-gray;function;function;grDevices;level
-gray.colors;function;function;grDevices;n, start = 0.3, end = 0.9, gamma = 2.2
-grey;function;function;grDevices;level
-grey.colors;function;function;grDevices;n, start = 0.3, end = 0.9, gamma = 2.2
-hcl;function;function;grDevices;h = 0, c = 35, l = 85, alpha = 1, fixup = TRUE
-heat.colors;function;function;grDevices;n, alpha = 1
-Hershey;list;list;grDevices;Not a function
-Hershey$typeface;character;character;grDevices;Not a function
-Hershey$fontindex;character;character;grDevices;Not a function
-Hershey$allowed;matrix;numeric;grDevices;Not a function
-hsv;function;function;grDevices;h = 1, s = 1, v = 1, gamma = 1, alpha = 1
-is.raster;function;function;grDevices;x
-jpeg;function;function;grDevices;filename = "Rplot%03d.jpeg", width = 480, height = 480, 	units = "px", pointsize = 12, quality = 75, bg = "white", 	res = NA, ..., type = c("cairo", "Xlib", "quartz"), antialias
-make.rgb;function;function;grDevices;red, green, blue, name = NULL, white = "D65", gamma = 2.2
-n2mfrow;function;function;grDevices;nr.plots
-nclass.FD;function;function;grDevices;x
-nclass.scott;function;function;grDevices;x
-nclass.Sturges;function;function;grDevices;x
-palette;function;function;grDevices;value
-pdf;function;function;grDevices;file = ifelse(onefile, "Rplots.pdf", "Rplot%03d.pdf"), 	width, height, onefile, family, title, fonts, version, paper, 	encoding, bg, fg, pointsize, pagecentre, colormodel, useDingbats, 	useKerning, fillOddEven, maxRasters
-pdfFonts;function;function;grDevices;...
-pdf.options;function;function;grDevices;..., reset = FALSE
-pictex;function;function;grDevices;file = "Rplots.tex", width = 5, height = 4, debug = FALSE, 	bg = "white", fg = "black"
-png;function;function;grDevices;filename = "Rplot%03d.png", width = 480, height = 480, 	units = "px", pointsize = 12, bg = "white", res = NA, ..., 	type = c("cairo", "Xlib", "quartz"), antialias
-postscript;function;function;grDevices;file = ifelse(onefile, "Rplots.ps", "Rplot%03d.ps"), 	onefile, family, title, fonts, encoding, bg, fg, width, height, 	horizontal, pointsize, paper, pagecentre, print.it, command, 	colormodel, useKerning, fillOddEven
-postscriptFont;function;function;grDevices;family, metrics, encoding = "default"
-postscriptFonts;function;function;grDevices;...
-ps.options;function;function;grDevices;..., reset = FALSE, override.check = FALSE
-quartz;function;function;grDevices;title, width, height, pointsize, family, fontsmooth, 	antialias, type, file = NULL, bg, canvas, dpi
-quartzFont;function;function;grDevices;family
-quartzFonts;function;function;grDevices;...
-quartz.options;function;function;grDevices;..., reset = FALSE
-rainbow;function;function;grDevices;n, s = 1, v = 1, start = 0, end = max(1, n - 1)/n, 	gamma = 1, alpha = 1
-recordGraphics;function;function;grDevices;expr, list, env
-recordPlot;function;function;grDevices;No arguments
-replayPlot;function;function;grDevices;x
-rgb;function;function;grDevices;red, green, blue, alpha, names = NULL, maxColorValue = 1
-rgb2hsv;function;function;grDevices;r, g = NULL, b = NULL, gamma = 1, maxColorValue = 255
-savePlot;function;function;grDevices;filename = paste("Rplot", type, sep = "."), type = c("png", 	"jpeg", "tiff", "bmp"), device = dev.cur()
-setEPS;function;function;grDevices;...
-setGraphicsEventEnv;function;function;grDevices;which = dev.cur(), env
-setGraphicsEventHandlers;function;function;grDevices;which = dev.cur(), ...
-setPS;function;function;grDevices;...
-svg;function;function;grDevices;filename = if (onefile) "Rplots.svg" else "Rplot%03d.svg", 	width = 7, height = 7, pointsize = 12, onefile = FALSE, bg = "white", 	antialias = c("default", "none", "gray", "subpixel")
-terrain.colors;function;function;grDevices;n, alpha = 1
-tiff;function;function;grDevices;filename = "Rplot%03d.tiff", width = 480, height = 480, 	units = "px", pointsize = 12, compression = c("none", "rle", 	    "lzw", "jpeg", "zip"), bg = "white", res = NA, ..., type = c("cairo", 	    "Xlib", "quartz"), antialias
-topo.colors;function;function;grDevices;n, alpha = 1
-trans3d;function;function;grDevices;x, y, z, pmat
-Type1Font;function;function;grDevices;family, metrics, encoding = "default"
-x11;function;function;grDevices;display = "", width, height, pointsize, gamma, bg, 	canvas, fonts, xpos, ypos, title, type, antialias
-X11;function;function;grDevices;display = "", width, height, pointsize, gamma, bg, 	canvas, fonts, xpos, ypos, title, type, antialias
-X11Font;function;function;grDevices;font
-X11Fonts;function;function;grDevices;...
-X11.options;function;function;grDevices;..., reset = FALSE
-xfig;function;function;grDevices;file = ifelse(onefile, "Rplots.fig", "Rplot%03d.fig"), 	onefile = FALSE, encoding = "none", paper = "default", horizontal = TRUE, 	width = 0, height = 0, family = "Helvetica", pointsize = 12, 	bg = "transparent", fg = "black", pagecentre = TRUE, defaultfont = FALSE, 	textspecial = FALSE
-xy.coords;function;function;grDevices;x, y = NULL, xlab = NULL, ylab = NULL, log = NULL, 	recycle = FALSE
-xyTable;function;function;grDevices;x, y = NULL, digits
-xyz.coords;function;function;grDevices;x, y = NULL, z = NULL, xlab = NULL, ylab = NULL, zlab = NULL, 	log = NULL, recycle = FALSE
-?;function;function;utils;e1, e2
-alarm;function;function;utils;No arguments
-apropos;function;function;utils;what, where = FALSE, ignore.case = TRUE, mode = "any"
-argsAnywhere;function;function;utils;x
-aspell;function;function;utils;files, filter, control = list(), encoding = "unknown", 	program = NULL
-aspell_package_Rd_files;function;function;utils;dir, drop = "\\references", control = list(), program = NULL
-aspell_package_vignettes;function;function;utils;dir, control = list(), program = NULL
-aspell_write_personal_dictionary_file;function;function;utils;x, out, language = "en", program = NULL
-as.person;function;function;utils;x
-as.personList;function;function;utils;x
-as.relistable;function;function;utils;x
-as.roman;function;function;utils;x
-assignInNamespace;function;function;utils;x, value, ns, pos = -1, envir = as.environment(pos)
-available.packages;function;function;utils;contriburl = contrib.url(getOption("repos"), type), 	method, fields = NULL, type = getOption("pkgType"), filters = NULL
-bibentry;function;function;utils;bibtype, textVersion = NULL, header = NULL, footer = NULL, 	key = NULL, ..., other = list(), mheader = NULL, mfooter = NULL
-browseEnv;function;function;utils;envir = .GlobalEnv, pattern, excludepatt = "^last\\.warning", 	html = .Platform$OS.type != "mac", expanded = TRUE, properties = NULL, 	main = NULL, debugMe = FALSE
-browseURL;function;function;utils;url, browser = getOption("browser"), encodeIfNeeded = FALSE
-browseVignettes;function;function;utils;package = NULL, lib.loc = NULL, all = TRUE
-bug.report;function;function;utils;subject = "", ccaddress = Sys.getenv("USER"), method = getOption("mailer"), 	address = "r-bugs@r-project.org", file = "R.bug.report", 	package = NULL, lib.loc = NULL
-capture.output;function;function;utils;..., file = NULL, append = FALSE
-checkCRAN;function;function;utils;method
-chooseBioCmirror;function;function;utils;graphics = getOption("menu.graphics")
-chooseCRANmirror;function;function;utils;graphics = getOption("menu.graphics")
-citation;function;function;utils;package = "base", lib.loc = NULL, auto = NULL
-citEntry;function;function;utils;entry, textVersion, header = NULL, footer = NULL, ...
-citFooter;function;function;utils;...
-citHeader;function;function;utils;...
-close.socket;function;function;utils;socket, ...
-combn;function;function;utils;x, m, FUN = NULL, simplify = TRUE, ...
-compareVersion;function;function;utils;a, b
-contrib.url;function;function;utils;repos, type = getOption("pkgType")
-count.fields;function;function;utils;file, sep = "", quote = "\"'", skip = 0, blank.lines.skip = TRUE, 	comment.char = "#"
-CRAN.packages;function;function;utils;CRAN = getOption("repos"), method, contriburl = contrib.url(CRAN)
-data;function;function;utils;..., list = character(0L), package = NULL, lib.loc = NULL, 	verbose = getOption("verbose"), envir = .GlobalEnv
-dataentry;function;function;utils;data, modes
-data.entry;function;function;utils;..., Modes = NULL, Names = NULL
-de;function;function;utils;..., Modes = list(), Names = NULL
-debugger;function;function;utils;dump = last.dump
-demo;function;function;utils;topic, package = NULL, lib.loc = NULL, character.only = FALSE, 	verbose = getOption("verbose"), echo = TRUE, ask = getOption("demo.ask")
-de.ncols;function;function;utils;inlist
-de.restore;function;function;utils;inlist, ncols, coltypes, argnames, args
-de.setup;function;function;utils;ilist, list.names, incols
-.DollarNames;function;function;utils;x, pattern
-download.file;function;function;utils;url, destfile, method, quiet = FALSE, mode = "w", cacheOK = TRUE
-download.packages;function;function;utils;pkgs, destdir, available = NULL, repos = getOption("repos"), 	contriburl = contrib.url(repos, type), method, type = getOption("pkgType"), 	...
-dump.frames;function;function;utils;dumpto = "last.dump", to.file = FALSE
-edit;function;function;utils;Generic Method
-emacs;function;function;utils;name = NULL, file = ""
-example;function;function;utils;topic, package = NULL, lib.loc = NULL, local = FALSE, 	echo = TRUE, verbose = getOption("verbose"), setRNG = FALSE, 	ask = getOption("example.ask"), prompt.prefix = abbreviate(topic, 	    6)
-file.edit;function;function;utils;..., title = file, editor = getOption("editor")
-file_test;function;function;utils;op, x, y
-find;function;function;utils;what, mode = "any", numeric = FALSE, simple.words = TRUE
-findLineNum;function;function;utils;srcfile, line, nameonly = TRUE, envir = parent.frame(), 	lastenv
-fix;function;function;utils;x, ...
-fixInNamespace;function;function;utils;x, ns, pos = -1, envir = as.environment(pos), ...
-flush.console;function;function;utils;No arguments
-formatOL;function;function;utils;x, type = "arabic", offset = 0, start = 1, width = 0.9 * 	getOption("width")
-formatUL;function;function;utils;x, label = "*", offset = 0, width = 0.9 * getOption("width")
-getAnywhere;function;function;utils;x
-getCRANmirrors;function;function;utils;all = FALSE, local.only = FALSE
-getFromNamespace;function;function;utils;x, ns, pos = -1, envir = as.environment(pos)
-getS3method;function;function;utils;f, class, optional = FALSE
-getTxtProgressBar;function;function;utils;pb
-glob2rx;function;function;utils;pattern, trim.head = FALSE, trim.tail = TRUE
-head;function;function;utils;x, ...
-head.matrix;function;function;utils;x, n = 6L, ...
-help;function;function;utils;topic, package = NULL, lib.loc = NULL, verbose = getOption("verbose"), 	try.all.packages = getOption("help.try.all.packages"), help_type = getOption("help_type")
-help.request;function;function;utils;subject = "", ccaddress = Sys.getenv("USER"), method = getOption("mailer"), 	address = "r-help@R-project.org", file = "R.help.request"
-help.search;function;function;utils;pattern, fields = c("alias", "concept", "title"), apropos, 	keyword, whatis, ignore.case = TRUE, package = NULL, lib.loc = NULL, 	help.db = getOption("help.db"), verbose = getOption("verbose"), 	rebuild = FALSE, agrep = NULL, use_UTF8 = FALSE
-help.start;function;function;utils;update = FALSE, gui = "irrelevant", browser = getOption("browser"), 	remote = NULL
-history;function;function;utils;max.show = 25, reverse = FALSE, pattern, ...
-installed.packages;function;function;utils;lib.loc = NULL, priority = NULL, noCache = FALSE, fields = NULL, 	subarch = .Platform$r_arch
-install.packages;function;function;utils;pkgs, lib, repos = getOption("repos"), contriburl = contrib.url(repos, 	type), method, available = NULL, destdir = NULL, dependencies = NA, 	type = getOption("pkgType"), configure.args = getOption("configure.args"), 	configure.vars = getOption("configure.vars"), clean = FALSE, 	Ncpus = getOption("Ncpus"), libs_only = FALSE, INSTALL_opts, 	...
-is.relistable;function;function;utils;x
-limitedLabels;function;function;utils;value, maxwidth = getOption("width") - 5
-loadhistory;function;function;utils;file = ".Rhistory"
-localeToCharset;function;function;utils;locale = Sys.getlocale("LC_CTYPE")
-lsf.str;function;function;utils;pos = -1, envir, ...
-ls.str;function;function;utils;pos = -1, name, envir, all.names = FALSE, pattern, 	mode = "any"
-maintainer;function;function;utils;pkg
-make.packages.html;function;function;utils;lib.loc = .libPaths(), temp = TRUE, verbose = TRUE
-makeRweaveLatexCodeRunner;function;function;utils;evalFunc = RweaveEvalWithOpt
-make.socket;function;function;utils;host = "localhost", port, fail = TRUE, server = FALSE
-memory.limit;function;function;utils;size = NA
-memory.size;function;function;utils;max = FALSE
-menu;function;function;utils;choices, graphics = FALSE, title = NULL
-methods;function;function;utils;generic.function, class
-mirror2html;function;function;utils;mirrors = NULL, file = "mirrors.html", head = "mirrors-head.html", 	foot = "mirrors-foot.html"
-modifyList;function;function;utils;x, val
-new.packages;function;function;utils;lib.loc = NULL, repos = getOption("repos"), contriburl = contrib.url(repos, 	type), instPkgs = installed.packages(lib.loc = lib.loc), 	method, available = NULL, ask = FALSE, ..., type = getOption("pkgType")
-news;function;function;utils;query, package = "R", lib.loc = NULL, format = NULL, 	reader = NULL, db = NULL
-normalizePath;function;function;utils;path
-nsl;function;function;utils;hostname
-object.size;function;function;utils;x
-old.packages;function;function;utils;lib.loc = NULL, repos = getOption("repos"), contriburl = contrib.url(repos, 	type), instPkgs = installed.packages(lib.loc = lib.loc), 	method, available = NULL, checkBuilt = FALSE, type = getOption("pkgType")
-package.contents;function;function;utils;pkg, lib.loc = NULL
-packageDescription;function;function;utils;pkg, lib.loc = NULL, fields = NULL, drop = TRUE, encoding = ""
-package.skeleton;function;function;utils;name = "anRpackage", list = character(), environment = .GlobalEnv, 	path = ".", force = FALSE, namespace = FALSE, code_files = character()
-packageStatus;function;function;utils;lib.loc = NULL, repositories = NULL, method, type = getOption("pkgType")
-packageVersion;function;function;utils;pkg, lib.loc = NULL
-page;function;function;utils;x, method = c("dput", "print"), ...
-person;function;function;utils;given = NULL, family = NULL, middle = NULL, email = NULL, 	role = NULL, comment = NULL, first = NULL, last = NULL
-personList;function;function;utils;...
-pico;function;function;utils;name = NULL, file = ""
-prompt;function;function;utils;object, filename = NULL, name = NULL, ...
-promptData;function;function;utils;object, filename = NULL, name = NULL
-promptPackage;function;function;utils;package, lib.loc = NULL, filename = NULL, name = NULL, 	final = FALSE
-rc.getOption;function;function;utils;name
-rc.options;function;function;utils;...
-rc.settings;function;function;utils;ops, ns, args, func, ipck, S3, data, help, argdb, files
-rc.status;function;function;utils;No arguments
-readCitationFile;function;function;utils;file, meta = NULL
-read.csv;function;function;utils;file, header = TRUE, sep = ",", quote = "\"", dec = ".", 	fill = TRUE, comment.char = "", ...
-read.csv2;function;function;utils;file, header = TRUE, sep = ";", quote = "\"", dec = ",", 	fill = TRUE, comment.char = "", ...
-read.delim;function;function;utils;file, header = TRUE, sep = "\t", quote = "\"", dec = ".", 	fill = TRUE, comment.char = "", ...
-read.delim2;function;function;utils;file, header = TRUE, sep = "\t", quote = "\"", dec = ",", 	fill = TRUE, comment.char = "", ...
-read.DIF;function;function;utils;file, header = FALSE, dec = ".", row.names, col.names, 	as.is = !stringsAsFactors, na.strings = "NA", colClasses = NA, 	nrows = -1, skip = 0, check.names = TRUE, blank.lines.skip = TRUE, 	stringsAsFactors = default.stringsAsFactors(), transpose = FALSE
-read.fortran;function;function;utils;file, format, ..., as.is = TRUE, colClasses = NA
-read.fwf;function;function;utils;file, widths, header = FALSE, sep = "\t", skip = 0, 	row.names, col.names, n = -1, buffersize = 2000, ...
-read.socket;function;function;utils;socket, maxlen = 256, loop = FALSE
-read.table;function;function;utils;file, header = FALSE, sep = "", quote = "\"'", dec = ".", 	row.names, col.names, as.is = !stringsAsFactors, na.strings = "NA", 	colClasses = NA, nrows = -1, skip = 0, check.names = TRUE, 	fill = !blank.lines.skip, strip.white = FALSE, blank.lines.skip = TRUE, 	comment.char = "#", allowEscapes = FALSE, flush = FALSE, 	stringsAsFactors = default.stringsAsFactors(), fileEncoding = "", 	encoding = "unknown"
-recover;function;function;utils;No arguments
-relist;function;function;utils;flesh, skeleton = attr(flesh, "skeleton")
-remove.packages;function;function;utils;pkgs, lib
-Rprof;function;function;utils;filename = "Rprof.out", append = FALSE, interval = 0.02, 	memory.profiling = FALSE
-Rprofmem;function;function;utils;filename = "Rprofmem.out", append = FALSE, threshold = 0
-RShowDoc;function;function;utils;what, type = c("pdf", "html", "txt"), package
-RSiteSearch;function;function;utils;string, restrict = c("functions", "vignettes", "views"), 	format = c("normal", "short"), sortby = c("score", "date:late", 	    "date:early", "subject", "subject:descending", "from", 	    "from:descending", "size", "size:descending"), matchesPerPage = 20
-rtags;function;function;utils;path = ".", pattern = "\\.[RrSs]$", recursive = FALSE, 	src = list.files(path = path, pattern = pattern, full.names = TRUE, 	    recursive = recursive), keep.re = NULL, ofile = "", append = FALSE, 	verbose = getOption("verbose")
-Rtangle;function;function;utils;No arguments
-RtangleSetup;function;function;utils;file, syntax, output = NULL, annotate = TRUE, split = FALSE, 	prefix = TRUE, quiet = FALSE
-RtangleWritedoc;function;function;utils;object, chunk
-RweaveChunkPrefix;function;function;utils;options
-RweaveEvalWithOpt;function;function;utils;expr, options
-RweaveLatex;function;function;utils;No arguments
-RweaveLatexFinish;function;function;utils;object, error = FALSE
-RweaveLatexOptions;function;function;utils;options
-RweaveLatexSetup;function;function;utils;file, syntax, output = NULL, quiet = FALSE, debug = FALSE, 	stylepath, ...
-RweaveLatexWritedoc;function;function;utils;object, chunk
-RweaveTryStop;function;function;utils;err, options
-savehistory;function;function;utils;file = ".Rhistory"
-select.list;function;function;utils;choices, preselect = NULL, multiple = FALSE, title = NULL, 	graphics = getOption("menu.graphics")
-sessionInfo;function;function;utils;package = NULL
-setBreakpoint;function;function;utils;srcfile, line, nameonly = TRUE, envir = parent.frame(), 	lastenv, verbose = TRUE, tracer, print = FALSE, ...
-setRepositories;function;function;utils;graphics = getOption("menu.graphics"), ind = NULL
-setTxtProgressBar;function;function;utils;pb, value, title = NULL, label = NULL
-stack;function;function;utils;x, ...
-Stangle;function;function;utils;file, driver = Rtangle(), syntax = getOption("SweaveSyntax"), 	...
-str;function;function;utils;Generic Method
-strOptions;function;function;utils;strict.width = "no", digits.d = 3, vec.len = 4, formatNum = function(x, 	...) format(x, trim = TRUE, drop0trailing = TRUE, ...)
-summaryRprof;function;function;utils;filename = "Rprof.out", chunksize = 5000, memory = c("none", 	"both", "tseries", "stats"), index = 2, diff = TRUE, exclude = NULL
-Sweave;function;function;utils;file, driver = RweaveLatex(), syntax = getOption("SweaveSyntax"), 	...
-SweaveHooks;function;function;utils;options, run = FALSE, envir = .GlobalEnv
-SweaveSyntaxLatex;SweaveSyntax;list;utils;Not a function
-SweaveSyntaxLatex$doc;character;character;utils;Not a function
-SweaveSyntaxLatex$code;character;character;utils;Not a function
-SweaveSyntaxLatex$coderef;character;character;utils;Not a function
-SweaveSyntaxLatex$docopt;character;character;utils;Not a function
-SweaveSyntaxLatex$docexpr;character;character;utils;Not a function
-SweaveSyntaxLatex$extension;character;character;utils;Not a function
-SweaveSyntaxLatex$syntaxname;character;character;utils;Not a function
-SweaveSyntaxLatex$input;character;character;utils;Not a function
-SweaveSyntaxLatex$trans;list; ;utils;Not a function
-SweaveSyntaxNoweb;SweaveSyntax;list;utils;Not a function
-SweaveSyntaxNoweb$doc;character;character;utils;Not a function
-SweaveSyntaxNoweb$code;character;character;utils;Not a function
-SweaveSyntaxNoweb$coderef;character;character;utils;Not a function
-SweaveSyntaxNoweb$docopt;character;character;utils;Not a function
-SweaveSyntaxNoweb$docexpr;character;character;utils;Not a function
-SweaveSyntaxNoweb$extension;character;character;utils;Not a function
-SweaveSyntaxNoweb$syntaxname;character;character;utils;Not a function
-SweaveSyntaxNoweb$input;character;character;utils;Not a function
-SweaveSyntaxNoweb$trans;list; ;utils;Not a function
-SweaveSyntConv;function;function;utils;file, syntax, output = NULL
-tail;function;function;utils;x, ...
-tail.matrix;function;function;utils;x, n = 6L, addrownums = TRUE, ...
-tar;function;function;utils;tarfile, files = NULL, compression = c("none", "gzip", 	"bzip2", "xz"), compression_level = 6, tar = Sys.getenv("tar")
-timestamp;function;function;utils;stamp = date(), prefix = "##------ ", suffix = " ------##", 	quiet = FALSE
-toBibtex;function;function;utils;object, ...
-toLatex;function;function;utils;object, ...
-txtProgressBar;function;function;utils;min = 0, max = 1, initial = 0, char = "=", width = NA, 	title, label, style = 1
-type.convert;function;function;utils;x, na.strings = "NA", as.is = FALSE, dec = "."
-unstack;function;function;utils;x, ...
-untar;function;function;utils;tarfile, files = NULL, list = FALSE, exdir = ".", compressed = NA, 	extras = NULL, verbose = FALSE, tar = Sys.getenv("TAR")
-unzip;function;function;utils;zipfile, files = NULL, list = FALSE, overwrite = TRUE, 	junkpaths = FALSE, exdir = "."
-update.packages;function;function;utils;lib.loc = NULL, repos = getOption("repos"), contriburl = contrib.url(repos, 	type), method, instlib = NULL, ask = TRUE, available = NULL, 	oldPkgs = NULL, ..., checkBuilt = FALSE, type = getOption("pkgType")
-update.packageStatus;function;function;utils;object, lib.loc = levels(object$inst$LibPath), repositories = levels(object$avail$Repository), 	...
-upgrade;function;function;utils;object, ...
-URLdecode;function;function;utils;URL
-URLencode;function;function;utils;URL, reserved = FALSE
-url.show;function;function;utils;url, title = url, file = tempfile(), delete.file = TRUE, 	method, ...
-vi;function;function;utils;name = NULL, file = ""
-View;function;function;utils;x, title
-vignette;function;function;utils;topic, package = NULL, lib.loc = NULL, all = TRUE
-write.csv;function;function;utils;...
-write.csv2;function;function;utils;...
-write.socket;function;function;utils;socket, string
-write.table;function;function;utils;x, file = "", append = FALSE, quote = TRUE, sep = " ", 	eol = "\n", na = "NA", dec = ".", row.names = TRUE, col.names = TRUE, 	qmethod = c("escape", "double")
-wsbrowser;function;function;utils;IDS, IsRoot, IsContainer, ItemsPerContainer, ParentID, 	NAMES, TYPES, DIMS, expanded = TRUE, kind = "HTML", main = "R Workspace", 	properties = list(), browser = getOption("browser")
-xedit;function;function;utils;name = NULL, file = ""
-xemacs;function;function;utils;name = NULL, file = ""
-zip.file.extract;function;function;utils;file, zipname = "R.zip", unzip = getOption("unzip"), 	dir = tempdir()
-ability.cov;list;list;datasets;Not a function
-ability.cov$cov;matrix;numeric;datasets;Not a function
-ability.cov$center;numeric;numeric;datasets;Not a function
-ability.cov$n.obs;numeric;numeric;datasets;Not a function
-airmiles;ts;numeric;datasets;Not a function
-AirPassengers;ts;numeric;datasets;Not a function
-airquality;data.frame;data.frame;datasets;Not a function
-airquality$Ozone;integer;numeric;datasets;Not a function
-airquality$Solar.R;integer;numeric;datasets;Not a function
-airquality$Wind;numeric;numeric;datasets;Not a function
-airquality$Temp;integer;numeric;datasets;Not a function
-airquality$Month;integer;numeric;datasets;Not a function
-airquality$Day;integer;numeric;datasets;Not a function
-anscombe;data.frame;data.frame;datasets;Not a function
-anscombe$x1;numeric;numeric;datasets;Not a function
-anscombe$x2;numeric;numeric;datasets;Not a function
-anscombe$x3;numeric;numeric;datasets;Not a function
-anscombe$x4;numeric;numeric;datasets;Not a function
-anscombe$y1;numeric;numeric;datasets;Not a function
-anscombe$y2;numeric;numeric;datasets;Not a function
-anscombe$y3;numeric;numeric;datasets;Not a function
-anscombe$y4;numeric;numeric;datasets;Not a function
-attenu;data.frame;data.frame;datasets;Not a function
-attenu$event;numeric;numeric;datasets;Not a function
-attenu$mag;numeric;numeric;datasets;Not a function
-attenu$station;factor;factor;datasets;Not a function
-attenu$dist;numeric;numeric;datasets;Not a function
-attenu$accel;numeric;numeric;datasets;Not a function
-attitude;data.frame;data.frame;datasets;Not a function
-attitude$rating;numeric;numeric;datasets;Not a function
-attitude$complaints;numeric;numeric;datasets;Not a function
-attitude$privileges;numeric;numeric;datasets;Not a function
-attitude$learning;numeric;numeric;datasets;Not a function
-attitude$raises;numeric;numeric;datasets;Not a function
-attitude$critical;numeric;numeric;datasets;Not a function
-attitude$advance;numeric;numeric;datasets;Not a function
-austres;ts;numeric;datasets;Not a function
-beaver1;data.frame;data.frame;datasets;Not a function
-beaver1$day;numeric;numeric;datasets;Not a function
-beaver1$time;numeric;numeric;datasets;Not a function
-beaver1$temp;numeric;numeric;datasets;Not a function
-beaver1$activ;numeric;numeric;datasets;Not a function
-beaver2;data.frame;data.frame;datasets;Not a function
-beaver2$day;numeric;numeric;datasets;Not a function
-beaver2$time;numeric;numeric;datasets;Not a function
-beaver2$temp;numeric;numeric;datasets;Not a function
-beaver2$activ;numeric;numeric;datasets;Not a function
-BJsales;ts;numeric;datasets;Not a function
-BJsales.lead;ts;numeric;datasets;Not a function
-BOD;data.frame;data.frame;datasets;Not a function
-BOD$Time;numeric;numeric;datasets;Not a function
-BOD$demand;numeric;numeric;datasets;Not a function
-cars;data.frame;data.frame;datasets;Not a function
-cars$speed;numeric;numeric;datasets;Not a function
-cars$dist;numeric;numeric;datasets;Not a function
-ChickWeight;nfnGroupedData;data.frame;datasets;Not a function
-ChickWeight$weight;numeric;numeric;datasets;Not a function
-ChickWeight$Time;numeric;numeric;datasets;Not a function
-ChickWeight$Chick;ordered;factor;datasets;Not a function
-ChickWeight$Diet;factor;factor;datasets;Not a function
-chickwts;data.frame;data.frame;datasets;Not a function
-chickwts$weight;numeric;numeric;datasets;Not a function
-chickwts$feed;factor;factor;datasets;Not a function
-co2;ts;numeric;datasets;Not a function
-CO2;nfnGroupedData;data.frame;datasets;Not a function
-CO2$Plant;ordered;factor;datasets;Not a function
-CO2$Type;factor;factor;datasets;Not a function
-CO2$Treatment;factor;factor;datasets;Not a function
-CO2$conc;numeric;numeric;datasets;Not a function
-CO2$uptake;numeric;numeric;datasets;Not a function
-crimtab;table;numeric;datasets;Not a function
-discoveries;ts;numeric;datasets;Not a function
-DNase;nfnGroupedData;data.frame;datasets;Not a function
-DNase$Run;ordered;factor;datasets;Not a function
-DNase$conc;numeric;numeric;datasets;Not a function
-DNase$density;numeric;numeric;datasets;Not a function
-esoph;data.frame;data.frame;datasets;Not a function
-esoph$agegp;ordered;factor;datasets;Not a function
-esoph$alcgp;ordered;factor;datasets;Not a function
-esoph$tobgp;ordered;factor;datasets;Not a function
-esoph$ncases;numeric;numeric;datasets;Not a function
-esoph$ncontrols;numeric;numeric;datasets;Not a function
-euro;numeric;numeric;datasets;Not a function
-euro.cross;matrix;numeric;datasets;Not a function
-eurodist;dist;numeric;datasets;Not a function
-EuStockMarkets;mts;numeric;datasets;Not a function
-faithful;data.frame;data.frame;datasets;Not a function
-faithful$eruptions;numeric;numeric;datasets;Not a function
-faithful$waiting;numeric;numeric;datasets;Not a function
-fdeaths;ts;numeric;datasets;Not a function
-.First.lib;function;function;datasets;...
-Formaldehyde;data.frame;data.frame;datasets;Not a function
-Formaldehyde$carb;numeric;numeric;datasets;Not a function
-Formaldehyde$optden;numeric;numeric;datasets;Not a function
-freeny;data.frame;data.frame;datasets;Not a function
-freeny$y;ts;numeric;datasets;Not a function
-freeny$lag.quarterly.revenue;numeric;numeric;datasets;Not a function
-freeny$price.index;numeric;numeric;datasets;Not a function
-freeny$income.level;numeric;numeric;datasets;Not a function
-freeny$market.potential;numeric;numeric;datasets;Not a function
-freeny.x;matrix;numeric;datasets;Not a function
-freeny.y;ts;numeric;datasets;Not a function
-HairEyeColor;table;numeric;datasets;Not a function
-Harman23.cor;list;list;datasets;Not a function
-Harman23.cor$cov;matrix;numeric;datasets;Not a function
-Harman23.cor$center;numeric;numeric;datasets;Not a function
-Harman23.cor$n.obs;numeric;numeric;datasets;Not a function
-Harman74.cor;list;list;datasets;Not a function
-Harman74.cor$cov;matrix;numeric;datasets;Not a function
-Harman74.cor$center;numeric;numeric;datasets;Not a function
-Harman74.cor$n.obs;numeric;numeric;datasets;Not a function
-Indometh;nfnGroupedData;data.frame;datasets;Not a function
-Indometh$Subject;ordered;factor;datasets;Not a function
-Indometh$time;numeric;numeric;datasets;Not a function
-Indometh$conc;numeric;numeric;datasets;Not a function
-infert;data.frame;data.frame;datasets;Not a function
-infert$education;factor;factor;datasets;Not a function
-infert$age;numeric;numeric;datasets;Not a function
-infert$parity;numeric;numeric;datasets;Not a function
-infert$induced;numeric;numeric;datasets;Not a function
-infert$case;numeric;numeric;datasets;Not a function
-infert$spontaneous;numeric;numeric;datasets;Not a function
-infert$stratum;integer;numeric;datasets;Not a function
-infert$pooled.stratum;numeric;numeric;datasets;Not a function
-InsectSprays;data.frame;data.frame;datasets;Not a function
-InsectSprays$count;numeric;numeric;datasets;Not a function
-InsectSprays$spray;factor;factor;datasets;Not a function
-iris;data.frame;data.frame;datasets;Not a function
-iris$Sepal.Length;numeric;numeric;datasets;Not a function
-iris$Sepal.Width;numeric;numeric;datasets;Not a function
-iris$Petal.Length;numeric;numeric;datasets;Not a function
-iris$Petal.Width;numeric;numeric;datasets;Not a function
-iris$Species;factor;factor;datasets;Not a function
-iris3;array;numeric;datasets;Not a function
-islands;numeric;numeric;datasets;Not a function
-JohnsonJohnson;ts;numeric;datasets;Not a function
-LakeHuron;ts;numeric;datasets;Not a function
-ldeaths;ts;numeric;datasets;Not a function
-lh;ts;numeric;datasets;Not a function
-LifeCycleSavings;data.frame;data.frame;datasets;Not a function
-LifeCycleSavings$sr;numeric;numeric;datasets;Not a function
-LifeCycleSavings$pop15;numeric;numeric;datasets;Not a function
-LifeCycleSavings$pop75;numeric;numeric;datasets;Not a function
-LifeCycleSavings$dpi;numeric;numeric;datasets;Not a function
-LifeCycleSavings$ddpi;numeric;numeric;datasets;Not a function
-Loblolly;nfnGroupedData;data.frame;datasets;Not a function
-Loblolly$height;numeric;numeric;datasets;Not a function
-Loblolly$age;numeric;numeric;datasets;Not a function
-Loblolly$Seed;ordered;factor;datasets;Not a function
-longley;data.frame;data.frame;datasets;Not a function
-longley$GNP.deflator;numeric;numeric;datasets;Not a function
-longley$GNP;numeric;numeric;datasets;Not a function
-longley$Unemployed;numeric;numeric;datasets;Not a function
-longley$Armed.Forces;numeric;numeric;datasets;Not a function
-longley$Population;numeric;numeric;datasets;Not a function
-longley$Year;integer;numeric;datasets;Not a function
-longley$Employed;numeric;numeric;datasets;Not a function
-lynx;ts;numeric;datasets;Not a function
-mdeaths;ts;numeric;datasets;Not a function
-morley;data.frame;data.frame;datasets;Not a function
-morley$Expt;integer;numeric;datasets;Not a function
-morley$Run;integer;numeric;datasets;Not a function
-morley$Speed;integer;numeric;datasets;Not a function
-mtcars;data.frame;data.frame;datasets;Not a function
-mtcars$mpg;numeric;numeric;datasets;Not a function
-mtcars$cyl;numeric;numeric;datasets;Not a function
-mtcars$disp;numeric;numeric;datasets;Not a function
-mtcars$hp;numeric;numeric;datasets;Not a function
-mtcars$drat;numeric;numeric;datasets;Not a function
-mtcars$wt;numeric;numeric;datasets;Not a function
-mtcars$qsec;numeric;numeric;datasets;Not a function
-mtcars$vs;numeric;numeric;datasets;Not a function
-mtcars$am;numeric;numeric;datasets;Not a function
-mtcars$gear;numeric;numeric;datasets;Not a function
-mtcars$carb;numeric;numeric;datasets;Not a function
-nhtemp;ts;numeric;datasets;Not a function
-Nile;ts;numeric;datasets;Not a function
-.noGenerics;logical;logical;datasets;Not a function
-nottem;ts;numeric;datasets;Not a function
-occupationalStatus;table;numeric;datasets;Not a function
-Orange;nfnGroupedData;data.frame;datasets;Not a function
-Orange$Tree;ordered;factor;datasets;Not a function
-Orange$age;numeric;numeric;datasets;Not a function
-Orange$circumference;numeric;numeric;datasets;Not a function
-OrchardSprays;data.frame;data.frame;datasets;Not a function
-OrchardSprays$decrease;numeric;numeric;datasets;Not a function
-OrchardSprays$rowpos;numeric;numeric;datasets;Not a function
-OrchardSprays$colpos;numeric;numeric;datasets;Not a function
-OrchardSprays$treatment;factor;factor;datasets;Not a function
-.packageName;character;character;datasets;Not a function
-PlantGrowth;data.frame;data.frame;datasets;Not a function
-PlantGrowth$weight;numeric;numeric;datasets;Not a function
-PlantGrowth$group;factor;factor;datasets;Not a function
-precip;numeric;numeric;datasets;Not a function
-presidents;ts;numeric;datasets;Not a function
-pressure;data.frame;data.frame;datasets;Not a function
-pressure$temperature;numeric;numeric;datasets;Not a function
-pressure$pressure;numeric;numeric;datasets;Not a function
-Puromycin;data.frame;data.frame;datasets;Not a function
-Puromycin$conc;numeric;numeric;datasets;Not a function
-Puromycin$rate;numeric;numeric;datasets;Not a function
-Puromycin$state;factor;factor;datasets;Not a function
-quakes;data.frame;data.frame;datasets;Not a function
-quakes$lat;numeric;numeric;datasets;Not a function
-quakes$long;numeric;numeric;datasets;Not a function
-quakes$depth;integer;numeric;datasets;Not a function
-quakes$mag;numeric;numeric;datasets;Not a function
-quakes$stations;integer;numeric;datasets;Not a function
-randu;data.frame;data.frame;datasets;Not a function
-randu$x;numeric;numeric;datasets;Not a function
-randu$y;numeric;numeric;datasets;Not a function
-randu$z;numeric;numeric;datasets;Not a function
-rivers;numeric;numeric;datasets;Not a function
-rock;data.frame;data.frame;datasets;Not a function
-rock$area;integer;numeric;datasets;Not a function
-rock$peri;numeric;numeric;datasets;Not a function
-rock$shape;numeric;numeric;datasets;Not a function
-rock$perm;numeric;numeric;datasets;Not a function
-Seatbelts;mts;numeric;datasets;Not a function
-sleep;data.frame;data.frame;datasets;Not a function
-sleep$extra;numeric;numeric;datasets;Not a function
-sleep$group;factor;factor;datasets;Not a function
-sleep$ID;factor;factor;datasets;Not a function
-stackloss;data.frame;data.frame;datasets;Not a function
-stackloss$Air.Flow;numeric;numeric;datasets;Not a function
-stackloss$Water.Temp;numeric;numeric;datasets;Not a function
-stackloss$Acid.Conc.;numeric;numeric;datasets;Not a function
-stackloss$stack.loss;numeric;numeric;datasets;Not a function
-stack.loss;numeric;numeric;datasets;Not a function
-stack.x;matrix;numeric;datasets;Not a function
-state.abb;character;character;datasets;Not a function
-state.area;numeric;numeric;datasets;Not a function
-state.center;list;list;datasets;Not a function
-state.center$x;numeric;numeric;datasets;Not a function
-state.center$y;numeric;numeric;datasets;Not a function
-state.division;factor;factor;datasets;Not a function
-state.name;character;character;datasets;Not a function
-state.region;factor;factor;datasets;Not a function
-state.x77;matrix;numeric;datasets;Not a function
-sunspot.month;ts;numeric;datasets;Not a function
-sunspots;ts;numeric;datasets;Not a function
-sunspot.year;ts;numeric;datasets;Not a function
-swiss;data.frame;data.frame;datasets;Not a function
-swiss$Fertility;numeric;numeric;datasets;Not a function
-swiss$Agriculture;numeric;numeric;datasets;Not a function
-swiss$Examination;integer;numeric;datasets;Not a function
-swiss$Education;integer;numeric;datasets;Not a function
-swiss$Catholic;numeric;numeric;datasets;Not a function
-swiss$Infant.Mortality;numeric;numeric;datasets;Not a function
-Theoph;nfnGroupedData;data.frame;datasets;Not a function
-Theoph$Subject;ordered;factor;datasets;Not a function
-Theoph$Wt;numeric;numeric;datasets;Not a function
-Theoph$Dose;numeric;numeric;datasets;Not a function
-Theoph$Time;numeric;numeric;datasets;Not a function
-Theoph$conc;numeric;numeric;datasets;Not a function
-Titanic;table;numeric;datasets;Not a function
-ToothGrowth;data.frame;data.frame;datasets;Not a function
-ToothGrowth$len;numeric;numeric;datasets;Not a function
-ToothGrowth$supp;factor;factor;datasets;Not a function
-ToothGrowth$dose;numeric;numeric;datasets;Not a function
-treering;ts;numeric;datasets;Not a function
-trees;data.frame;data.frame;datasets;Not a function
-trees$Girth;numeric;numeric;datasets;Not a function
-trees$Height;numeric;numeric;datasets;Not a function
-trees$Volume;numeric;numeric;datasets;Not a function
-UCBAdmissions;table;numeric;datasets;Not a function
-UKDriverDeaths;ts;numeric;datasets;Not a function
-UKgas;ts;numeric;datasets;Not a function
-USAccDeaths;ts;numeric;datasets;Not a function
-USArrests;data.frame;data.frame;datasets;Not a function
-USArrests$Murder;numeric;numeric;datasets;Not a function
-USArrests$Assault;integer;numeric;datasets;Not a function
-USArrests$UrbanPop;integer;numeric;datasets;Not a function
-USArrests$Rape;numeric;numeric;datasets;Not a function
-USJudgeRatings;data.frame;data.frame;datasets;Not a function
-USJudgeRatings$CONT;numeric;numeric;datasets;Not a function
-USJudgeRatings$INTG;numeric;numeric;datasets;Not a function
-USJudgeRatings$DMNR;numeric;numeric;datasets;Not a function
-USJudgeRatings$DILG;numeric;numeric;datasets;Not a function
-USJudgeRatings$CFMG;numeric;numeric;datasets;Not a function
-USJudgeRatings$DECI;numeric;numeric;datasets;Not a function
-USJudgeRatings$PREP;numeric;numeric;datasets;Not a function
-USJudgeRatings$FAMI;numeric;numeric;datasets;Not a function
-USJudgeRatings$ORAL;numeric;numeric;datasets;Not a function
-USJudgeRatings$WRIT;numeric;numeric;datasets;Not a function
-USJudgeRatings$PHYS;numeric;numeric;datasets;Not a function
-USJudgeRatings$RTEN;numeric;numeric;datasets;Not a function
-USPersonalExpenditure;matrix;numeric;datasets;Not a function
-uspop;ts;numeric;datasets;Not a function
-VADeaths;matrix;numeric;datasets;Not a function
-volcano;matrix;numeric;datasets;Not a function
-warpbreaks;data.frame;data.frame;datasets;Not a function
-warpbreaks$breaks;numeric;numeric;datasets;Not a function
-warpbreaks$wool;factor;factor;datasets;Not a function
-warpbreaks$tension;factor;factor;datasets;Not a function
-women;data.frame;data.frame;datasets;Not a function
-women$height;numeric;numeric;datasets;Not a function
-women$weight;numeric;numeric;datasets;Not a function
-WorldPhones;matrix;numeric;datasets;Not a function
-WWWusage;ts;numeric;datasets;Not a function
-@<-;function;function;methods;object, name, value
-addNextMethod;function;function;methods;method, f = "", mlist, optional = FALSE, envir
-allGenerics;function;function;methods;...
-allNames;function;function;methods;x
-Arith;function;function;methods;e1, e2
-as;function;function;methods;object, Class, strict = TRUE, ext = possibleExtends(thisClass, 	Class)
-as<-;function;function;methods;object, Class, value
-asMethodDefinition;function;function;methods;def, signature = list(), sealed = FALSE, fdef = def
-assignClassDef;function;function;methods;Class, def, where = .GlobalEnv, force = FALSE
-assignMethodsMetaData;function;function;methods;f, value, fdef, where, deflt
-balanceMethodsList;function;function;methods;mlist, args, check = TRUE
-body<-;function;function;methods;fun, envir = environment(fun), value
-.__C__<-;classRepresentation; ;methods;Not a function
-.__C__(;classRepresentation; ;methods;Not a function
-.__C__{;classRepresentation; ;methods;Not a function
-cacheGenericsMetaData;function;function;methods;f, fdef, attach = TRUE, where = topenv(parent.frame()), 	package, methods
-cacheMetaData;function;function;methods;where, attach = TRUE, searchWhere = as.environment(where), 	doCheck = TRUE
-cacheMethod;function;function;methods;f, sig, def, args = names(sig), fdef, inherited = FALSE
-.__C__activeBindingFunction;classRepresentation; ;methods;Not a function
-callGeneric;function;function;methods;...
-callNextMethod;function;function;methods;...
-canCoerce;function;function;methods;object, Class
-.__C__anova;classRepresentation; ;methods;Not a function
-.__C__anova.glm;classRepresentation; ;methods;Not a function
-.__C__anova.glm.null;classRepresentation; ;methods;Not a function
-.__C__ANY;classRepresentation; ;methods;Not a function
-.__C__aov;classRepresentation; ;methods;Not a function
-.__C__array;classRepresentation; ;methods;Not a function
-cbind2;function;function;methods;x, y
-.__C__call;classRepresentation; ;methods;Not a function
-.__C__character;classRepresentation; ;methods;Not a function
-.__C__classPrototypeDef;classRepresentation; ;methods;Not a function
-.__C__classRepresentation;classRepresentation; ;methods;Not a function
-.__C__ClassUnionRepresentation;classRepresentation; ;methods;Not a function
-.__C__complex;classRepresentation; ;methods;Not a function
-.__C__conditionalExtension;classRepresentation; ;methods;Not a function
-.__C__data.frame;classRepresentation; ;methods;Not a function
-.__C__data.frameRowLabels;ClassUnionRepresentation; ;methods;Not a function
-.__C__Date;classRepresentation; ;methods;Not a function
-.__C__defaultBindingFunction;classRepresentation; ;methods;Not a function
-.__C__density;classRepresentation; ;methods;Not a function
-.__C__derivedDefaultMethod;classRepresentation; ;methods;Not a function
-.__C__derivedDefaultMethodWithTrace;classRepresentation; ;methods;Not a function
-.__C__dump.frames;classRepresentation; ;methods;Not a function
-.__C__EmptyMethodsList;classRepresentation; ;methods;Not a function
-.__C__environment;classRepresentation; ;methods;Not a function
-.__C__.environment;classRepresentation; ;methods;Not a function
-.__C__envRefClass;refClassRepresentation; ;methods;Not a function
-.__C__expression;classRepresentation; ;methods;Not a function
-.__C__externalptr;classRepresentation; ;methods;Not a function
-.__C__.externalptr;classRepresentation; ;methods;Not a function
-.__C__factor;classRepresentation; ;methods;Not a function
-.__C__for;classRepresentation; ;methods;Not a function
-.__C__formula;classRepresentation; ;methods;Not a function
-.__C__function;classRepresentation; ;methods;Not a function
-.__C__functionWithTrace;classRepresentation; ;methods;Not a function
-.__C__genericFunction;classRepresentation; ;methods;Not a function
-.__C__genericFunctionWithTrace;classRepresentation; ;methods;Not a function
-.__C__glm;classRepresentation; ;methods;Not a function
-.__C__glm.null;classRepresentation; ;methods;Not a function
-.__C__groupGenericFunction;classRepresentation; ;methods;Not a function
-.__C__groupGenericFunctionWithTrace;classRepresentation; ;methods;Not a function
-checkSlotAssignment;function;function;methods;obj, name, value
-.__C__hsearch;classRepresentation; ;methods;Not a function
-.__C__if;classRepresentation; ;methods;Not a function
-.__C__integer;classRepresentation; ;methods;Not a function
-.__C__integrate;classRepresentation; ;methods;Not a function
-.__C__language;classRepresentation; ;methods;Not a function
-classesToAM;function;function;methods;classes, includeSubclasses = FALSE, abbreviate = 2
-classMetaName;function;function;methods;name
-.__C__libraryIQR;classRepresentation; ;methods;Not a function
-.__C__LinearMethodsList;classRepresentation; ;methods;Not a function
-.__C__list;classRepresentation; ;methods;Not a function
-.__C__listOfMethods;classRepresentation; ;methods;Not a function
-.__C__lm;classRepresentation; ;methods;Not a function
-.__C__logical;classRepresentation; ;methods;Not a function
-.__C__logLik;classRepresentation; ;methods;Not a function
-.__C__maov;classRepresentation; ;methods;Not a function
-.__C__matrix;classRepresentation; ;methods;Not a function
-.__C__MethodDefinition;classRepresentation; ;methods;Not a function
-.__C__MethodDefinitionWithTrace;classRepresentation; ;methods;Not a function
-.__C__MethodSelectionReport;classRepresentation; ;methods;Not a function
-.__C__MethodsList;classRepresentation; ;methods;Not a function
-.__C__MethodWithNext;classRepresentation; ;methods;Not a function
-.__C__MethodWithNextWithTrace;classRepresentation; ;methods;Not a function
-.__C__missing;classRepresentation; ;methods;Not a function
-.__C__mlm;classRepresentation; ;methods;Not a function
-.__C__mtable;classRepresentation; ;methods;Not a function
-.__C__mts;classRepresentation; ;methods;Not a function
-.__C__name;classRepresentation; ;methods;Not a function
-.__C__.name;classRepresentation; ;methods;Not a function
-.__C__namedList;classRepresentation; ;methods;Not a function
-.__C__nonstandardGeneric;classRepresentation; ;methods;Not a function
-.__C__nonstandardGenericFunction;classRepresentation; ;methods;Not a function
-.__C__nonstandardGenericWithTrace;classRepresentation; ;methods;Not a function
-.__C__nonstandardGroupGenericFunction;classRepresentation; ;methods;Not a function
-.__C__nonStructure;classRepresentation; ;methods;Not a function
-.__C__NULL;classRepresentation; ;methods;Not a function
-.__C__.NULL;classRepresentation; ;methods;Not a function
-.__C__numeric;classRepresentation; ;methods;Not a function
-.__C__ObjectsWithPackage;classRepresentation; ;methods;Not a function
-coerce;function;function;methods;from, to, strict = TRUE
-coerce<-;function;function;methods;from, to, value
-.__C__oldClass;classRepresentation; ;methods;Not a function
-Compare;function;function;methods;e1, e2
-completeClassDefinition;function;function;methods;Class, ClassDef = getClassDef(Class), where, doExtends = TRUE
-completeExtends;function;function;methods;ClassDef, class2, extensionDef, where
-completeSubclasses;function;function;methods;classDef, class2, extensionDef, where, classDef2 = getClassDef(class2, 	where)
-Complex;function;function;methods;z
-conformMethod;function;function;methods;signature, mnames, fnames, f = "", fdef, 	method
-.__C__OptionalFunction;ClassUnionRepresentation; ;methods;Not a function
-.__C__optionalMethod;classRepresentation; ;methods;Not a function
-.__C__ordered;classRepresentation; ;methods;Not a function
-.__C__.Other;classRepresentation; ;methods;Not a function
-.__C__packageInfo;classRepresentation; ;methods;Not a function
-.__C__packageIQR;classRepresentation; ;methods;Not a function
-.__C__POSIXct;classRepresentation; ;methods;Not a function
-.__C__POSIXlt;classRepresentation; ;methods;Not a function
-.__C__POSIXt;classRepresentation; ;methods;Not a function
-.__C__PossibleMethod;ClassUnionRepresentation; ;methods;Not a function
-.__C__raw;classRepresentation; ;methods;Not a function
-.__C__recordedplot;classRepresentation; ;methods;Not a function
-.__C__refClass;ClassUnionRepresentation; ;methods;Not a function
-.__C__refClassRepresentation;classRepresentation; ;methods;Not a function
-.__C__refMethodDef;classRepresentation; ;methods;Not a function
-.__C__refObject;ClassUnionRepresentation; ;methods;Not a function
-.__C__refObjectGenerator;refClassRepresentation; ;methods;Not a function
-.__C__repeat;classRepresentation; ;methods;Not a function
-.__C__rle;classRepresentation; ;methods;Not a function
-.__C__S3;classRepresentation; ;methods;Not a function
-.__C__S4;classRepresentation; ;methods;Not a function
-.__C__SClassExtension;classRepresentation; ;methods;Not a function
-.__C__SealedMethodDefinition;classRepresentation; ;methods;Not a function
-.__C__signature;classRepresentation; ;methods;Not a function
-.__C__socket;classRepresentation; ;methods;Not a function
-.__C__sourceEnvironment;classRepresentation; ;methods;Not a function
-.__C__standardGeneric;classRepresentation; ;methods;Not a function
-.__C__standardGenericWithTrace;classRepresentation; ;methods;Not a function
-.__C__structure;classRepresentation; ;methods;Not a function
-.__C__summaryDefault;classRepresentation; ;methods;Not a function
-.__C__summary.table;classRepresentation; ;methods;Not a function
-.__C__SuperClassMethod;ClassUnionRepresentation; ;methods;Not a function
-.__C__table;classRepresentation; ;methods;Not a function
-.__C__traceable;classRepresentation; ;methods;Not a function
-.__C__ts;classRepresentation; ;methods;Not a function
-.__C__uninitializedField;classRepresentation; ;methods;Not a function
-.__C__vector;classRepresentation; ;methods;Not a function
-.__C__VIRTUAL;classRepresentation; ;methods;Not a function
-.__C__while;classRepresentation; ;methods;Not a function
-defaultDumpName;function;function;methods;generic, signature
-defaultPrototype;function;function;methods;No arguments
-doPrimitiveMethod;function;function;methods;name, def, call = sys.call(sys.parent()), ev = sys.frame(sys.parent(2))
-.doTracePrint;function;function;methods;msg = ""
-dumpMethod;function;function;methods;f, signature = character(), file = defaultDumpName(f, 	signature), where = topenv(parent.frame()), def = getMethod(f, 	signature, where = where, optional = TRUE)
-dumpMethods;function;function;methods;f, file = "", signature = NULL, methods = findMethods(f, 	where = where), where = topenv(parent.frame())
-el;function;function;methods;object, where
-el<-;function;function;methods;No arguments
-elNamed;function;function;methods;x, name, mustFind = FALSE
-elNamed<-;function;function;methods;x, name, value
-empty.dump;function;function;methods;No arguments
-emptyMethodsList;function;function;methods;mlist, thisClass = "ANY", sublist = list()
-.EmptyPrimitiveSkeletons;list;list;methods;Not a function
-evalSource;function;function;methods;source, package = "", lock = TRUE, cache = FALSE
-existsFunction;function;function;methods;f, generic = TRUE, where = topenv(parent.frame())
-existsMethod;function;function;methods;f, signature = character(), where = topenv(parent.frame())
-extends;function;function;methods;class1, class2, maybe = TRUE, fullInfo = FALSE
-finalDefaultMethod;function;function;methods;method
-findClass;function;function;methods;Class, where = topenv(parent.frame()), unique = ""
-findFunction;function;function;methods;f, generic = TRUE, where = topenv(parent.frame())
-findMethod;function;function;methods;f, signature, where = topenv(parent.frame())
-findMethods;function;function;methods;f, where, classes = character(), inherited = FALSE
-findMethodSignatures;function;function;methods;..., target = TRUE, methods = findMethods(...)
-findUnique;function;function;methods;what, message, where = topenv(parent.frame())
-fixPre1.8;function;function;methods;names, where = topenv(parent.frame())
-formalArgs;function;function;methods;def
-functionBody;function;function;methods;fun = sys.function(sys.parent())
-functionBody<-;function;function;methods;fun, envir = environment(fun), value
-generic.skeleton;function;function;methods;name, fdef, fdefault
-getAccess;function;function;methods;ClassDef
-getAllMethods;function;function;methods;f, fdef, where = topenv(parent.frame())
-getAllSuperClasses;function;function;methods;ClassDef, simpleOnly = TRUE
-getClass;function;function;methods;Class, .Force = FALSE, where = .classEnv(Class, topenv(parent.frame()), 	FALSE)
-getClassDef;function;function;methods;Class, where = topenv(parent.frame()), package = packageSlot(Class), 	inherits = TRUE
-getClasses;function;function;methods;where = .externalCallerEnv(), inherits = missing(where)
-getClassName;function;function;methods;ClassDef
-getClassPackage;function;function;methods;ClassDef
-getDataPart;function;function;methods;object
-getExtends;function;function;methods;ClassDef
-getFunction;function;function;methods;name, generic = TRUE, mustFind = TRUE, where = topenv(parent.frame())
-getGeneric;function;function;methods;f, mustFind = FALSE, where, package = ""
-getGenerics;function;function;methods;where, searchForm = FALSE
-getGroup;function;function;methods;fdef, recursive = FALSE, where = topenv(parent.frame())
-getGroupMembers;function;function;methods;group, recursive = FALSE, character = TRUE
-getMethod;function;function;methods;f, signature = character(), where = topenv(parent.frame()), 	optional = FALSE, mlist, fdef
-getMethods;function;function;methods;f, where = topenv(parent.frame()), table = FALSE
-getMethodsForDispatch;function;function;methods;fdef, inherited = FALSE
-getMethodsMetaData;function;function;methods;f, where = topenv(parent.frame())
-getPackageName;function;function;methods;where = topenv(parent.frame()), create = TRUE
-getProperties;function;function;methods;ClassDef
-getPrototype;function;function;methods;ClassDef
-getRefClass;function;function;methods;Class, where = topenv(parent.frame())
-getSlots;function;function;methods;x
-getSubclasses;function;function;methods;ClassDef
-getValidity;function;function;methods;ClassDef
-getVirtual;function;function;methods;ClassDef
-hasArg;function;function;methods;name
-hasMethod;function;function;methods;f, signature = character(), where = .genEnv(f, topenv(parent.frame()))
-hasMethods;function;function;methods;f, where, package
-.hasSlot;function;function;methods;object, name
-implicitGeneric;function;function;methods;name, where = topenv(parent.frame()), generic = getGeneric(name, 	where = where)
-inheritedSlotNames;function;function;methods;Class, where = topenv(parent.frame())
-initFieldArgs;function;function;methods;.Object, classDef, selfEnv, ...
-initialize;function;function;methods;.Object, ...
-insertMethod;function;function;methods;mlist, signature, args, def, cacheOnly = FALSE
-insertSource;function;function;methods;source, package = "", functions = allPlainObjects(), 	methods = (if (missing(functions)) allMethodTables() else NULL), 	force = missing(functions) & missing(methods)
-is;function;function;methods;object, class2
-isClass;function;function;methods;Class, formal = TRUE, where = topenv(parent.frame())
-isClassDef;function;function;methods;object
-isClassUnion;function;function;methods;Class
-isGeneric;function;function;methods;f, where = topenv(parent.frame()), fdef = NULL, getName = FALSE
-isGrammarSymbol;function;function;methods;symbol
-isGroup;function;function;methods;f, where = topenv(parent.frame()), fdef = getGeneric(f, 	where = where)
-isSealedClass;function;function;methods;Class, where = topenv(parent.frame())
-isSealedMethod;function;function;methods;f, signature, fdef = getGeneric(f, FALSE, where = where), 	where = topenv(parent.frame())
-isVirtualClass;function;function;methods;Class, where = topenv(parent.frame())
-isXS3Class;function;function;methods;classDef
-languageEl;function;function;methods;object, which
-languageEl<-;function;function;methods;object, which, value
-.Last.lib;function;function;methods;libpath
-linearizeMlist;function;function;methods;mlist, inherited = TRUE
-listFromMethods;function;function;methods;generic, where, table
-listFromMlist;function;function;methods;mlist, prefix = list(), sigs. = TRUE, methods. = TRUE
-loadMethod;function;function;methods;method, fname, envir
-Logic;function;function;methods;e1, e2
-makeClassRepresentation;function;function;methods;name, slots = list(), superClasses = character(), prototype = NULL, 	package, validity = NULL, access = list(), version = .newExternalptr(), 	sealed = FALSE, virtual = NA, where
-makeExtends;function;function;methods;Class, to, coerce = NULL, test = NULL, replace = NULL, 	by = character(), package, slots = getSlots(classDef1), classDef1 = getClass(Class), 	classDef2
-makeGeneric;function;function;methods;f, fdef, fdefault = fdef, group = list(), valueClass = character(), 	package = getPackageName(environment(fdef)), signature = NULL, 	genericFunction = NULL, simpleInheritanceOnly = NULL
-makeMethodsList;function;function;methods;object, level = 1
-makePrototypeFromClassDef;function;function;methods;slots, ClassDef, extends, where
-makeStandardGeneric;function;function;methods;f, fdef
-matchSignature;function;function;methods;signature, fun, where = baseenv()
-Math;function;function;methods;Generic Method
-Math2;function;function;methods;x, digits
-mergeMethods;function;function;methods;m1, m2, genericLabel = character()
-metaNameUndo;function;function;methods;strings, prefix, searchForm = FALSE
-MethodAddCoerce;function;function;methods;method, argName, thisClass, methodClass
-methodSignatureMatrix;function;function;methods;object, sigSlots = c("target", "defined")
-method.skeleton;function;function;methods;generic, signature, file, external = FALSE, where = topenv(parent.frame())
-MethodsList;function;function;methods;.ArgName, ...
-MethodsListSelect;function;function;methods;f, env, mlist = NULL, fEnv = if (is(fdef, "genericFunction")) environment(fdef) else baseenv(), 	finalDefault = finalDefaultMethod(mlist), evalArgs = TRUE, 	useInherited = TRUE, fdef = getGeneric(f, where = env), resetAllowed = TRUE
-methodsPackageMetaName;function;function;methods;prefix, name, package = ""
-missingArg;function;function;methods;symbol, envir = parent.frame(), eval = FALSE
-mlistMetaName;function;function;methods;name = "", package = ""
-new;function;function;methods;Class, ...
-newBasic;function;function;methods;Class, ...
-newClassRepresentation;function;function;methods;...
-newEmptyObject;function;function;methods;No arguments
-.OldClassesList;list;list;methods;Not a function
-Ops;function;function;methods;Generic Method
-packageSlot;function;function;methods;object
-packageSlot<-;function;function;methods;object, value
-possibleExtends;function;function;methods;class1, class2, ClassDef1 = getClassDef(class1), ClassDef2 = getClassDef(class2, 	where = .classEnv(ClassDef1))
-prohibitGeneric;function;function;methods;name, where = topenv(parent.frame())
-promptClass;function;function;methods;clName, filename = NULL, type = "class", keywords = "classes", 	where = topenv(parent.frame())
-promptMethods;function;function;methods;f, filename = NULL, methods
-prototype;function;function;methods;...
-Quote;function;function;methods;No arguments
-rbind2;function;function;methods;x, y
-reconcilePropertiesAndPrototype;function;function;methods;name, properties, prototype, superClasses, where
-registerImplicitGenerics;function;function;methods;what = .ImplicitGenericsTable(where), where = topenv(parent.frame())
-rematchDefinition;function;function;methods;definition, generic, mnames, fnames, signature
-removeClass;function;function;methods;Class, where = topenv(parent.frame())
-removeGeneric;function;function;methods;f, where = topenv(parent.frame())
-removeMethod;function;function;methods;f, signature = character(), where = topenv(parent.frame())
-removeMethods;function;function;methods;f, where = topenv(parent.frame()), all = missing(where)
-removeMethodsObject;function;function;methods;f, where = topenv(parent.frame())
-representation;function;function;methods;...
-requireMethods;function;function;methods;functions, signature, message = "", where = topenv(parent.frame())
-resetClass;function;function;methods;Class, classDef, where
-resetGeneric;function;function;methods;f, fdef = getGeneric(f, where = where), mlist = getMethodsForDispatch(fdef), 	where = topenv(parent.frame()), deflt = finalDefaultMethod(mlist)
-S3Class;function;function;methods;object
-S3Class<-;function;function;methods;object, value
-S3Part;function;function;methods;object, strictS3 = FALSE, S3Class
-S3Part<-;function;function;methods;object, strictS3 = FALSE, needClass = .S3Class(object), 	value
-sealClass;function;function;methods;Class, where = topenv(parent.frame())
-seemsS4Object;function;function;methods;object
-selectMethod;function;function;methods;f, signature, optional = FALSE, useInherited = TRUE, 	mlist = if (!is.null(fdef)) getMethodsForDispatch(fdef), 	fdef = getGeneric(f, !optional), verbose = FALSE, doCache = FALSE
-selectSuperClasses;function;function;methods;Class, dropVirtual = FALSE, namesOnly = TRUE, directOnly = TRUE, 	simpleOnly = directOnly, where = topenv(parent.frame())
-.selectSuperClasses;function;function;methods;ext, dropVirtual = FALSE, namesOnly = TRUE, directOnly = TRUE, 	simpleOnly = directOnly
-sessionData;function;function;methods;No arguments
-setAs;function;function;methods;from, to, def, replace = NULL, where = topenv(parent.frame())
-setClass;function;function;methods;Class, representation = list(), prototype = NULL, contains = character(), 	validity = NULL, access = list(), where = topenv(parent.frame()), 	version = .newExternalptr(), sealed = FALSE, package = getPackageName(where), 	S3methods = FALSE
-setClassUnion;function;function;methods;name, members = character(), where = topenv(parent.frame())
-setDataPart;function;function;methods;object, value, check = TRUE
-setGeneric;function;function;methods;name, def = NULL, group = list(), valueClass = character(), 	where = topenv(parent.frame()), package = NULL, signature = NULL, 	useAsDefault = NULL, genericFunction = NULL, simpleInheritanceOnly = NULL
-setGenericImplicit;function;function;methods;name, where = topenv(parent.frame()), restore = TRUE
-setGroupGeneric;function;function;methods;name, def = NULL, group = list(), valueClass = character(), 	knownMembers = list(), package = getPackageName(where), where = topenv(parent.frame())
-setIs;function;function;methods;class1, class2, test = NULL, coerce = NULL, replace = NULL, 	by = character(), where = topenv(parent.frame()), classDef = getClass(class1, 	    TRUE, where = where), extensionObject = NULL, doComplete = TRUE
-setMethod;function;function;methods;f, signature = character(), definition, where = topenv(parent.frame()), 	valueClass = NULL, sealed = FALSE
-setOldClass;function;function;methods;Classes, prototype = NULL, where = topenv(parent.frame()), 	test = FALSE, S4Class
-setPackageName;function;function;methods;pkg, env
-setPrimitiveMethods;function;function;methods;f, fdef, code, generic, mlist = get(".Methods", envir = environment(generic))
-setRefClass;function;function;methods;Class, fields = character(), contains = character(), 	methods = list(), where = topenv(parent.frame()), ...
-setReplaceMethod;function;function;methods;f, ..., where = topenv(parent.frame())
-setValidity;function;function;methods;Class, method, where = topenv(parent.frame())
-.ShortPrimitiveSkeletons;list;list;methods;Not a function
-show;function;function;methods;object
-showClass;function;function;methods;Class, complete = TRUE, propertiesAreCalled = "Slots"
-showDefault;function;function;methods;object, oldMethods = TRUE
-showExtends;function;function;methods;ext, printTo = stdout()
-showMethods;function;function;methods;f = character(), where = topenv(parent.frame()), classes = NULL, 	includeDefs = FALSE, inherited = !includeDefs, showEmpty, 	printTo = stdout(), fdef = getGeneric(f, where = where)
-showMlist;function;function;methods;mlist, includeDefs = TRUE, inherited = TRUE, classes = NULL, 	useArgNames = TRUE, printTo = stdout()
-signature;function;function;methods;...
-SignatureMethod;function;function;methods;names, signature, definition
-sigToEnv;function;function;methods;signature, generic
-slot;function;function;methods;object, name
-slot<-;function;function;methods;object, name, check = TRUE, value
-slotNames;function;function;methods;x
-.slotNames;function;function;methods;x
-slotsFromS3;function;function;methods;object
-substituteDirect;function;function;methods;object, frame = parent.frame(), cleanFunction = TRUE
-substituteFunctionArgs;function;function;methods;def, newArgs, args = formalArgs(def), silent = FALSE, 	functionName = "a function"
-Summary;function;function;methods;Generic Method
-superClassDepth;function;function;methods;ClassDef, soFar = ClassDef@className, simpleOnly = TRUE
-.__T__addNextMethod:methods;environment; ;methods;Not a function
-.__T__Arith:base;environment; ;methods;Not a function
-.__T__[:base;environment; ;methods;Not a function
-.__T__$<-:base;environment; ;methods;Not a function
-.__T__$:base;environment; ;methods;Not a function
-.__T__body<-:base;environment; ;methods;Not a function
-.__T__cbind2:methods;environment; ;methods;Not a function
-.__T__coerce<-:methods;environment; ;methods;Not a function
-.__T__coerce:methods;environment; ;methods;Not a function
-.__T__Compare:methods;environment; ;methods;Not a function
-.__T__Complex:base;environment; ;methods;Not a function
-testInheritedMethods;function;function;methods;f, signatures, test = TRUE, virtual = FALSE, groupMethods = TRUE, 	where = .GlobalEnv
-testVirtual;function;function;methods;properties, extends, prototype, where
-.__T__initialize:methods;environment; ;methods;Not a function
-.__T__loadMethod:methods;environment; ;methods;Not a function
-.__T__Logic:base;environment; ;methods;Not a function
-.__T__Math2:methods;environment; ;methods;Not a function
-.__T__Math:base;environment; ;methods;Not a function
-.__T__Ops:base;environment; ;methods;Not a function
-traceOff;function;function;methods;what
-traceOn;function;function;methods;what, tracer = browseAll, exit = NULL
-.TraceWithMethods;function;function;methods;what, tracer = NULL, exit = NULL, at = numeric(), print = TRUE, 	signature = NULL, where = .GlobalEnv, edit = FALSE, from = NULL, 	untrace = FALSE
-.__T__rbind2:methods;environment; ;methods;Not a function
-tryNew;function;function;methods;Class, where
-trySilent;function;function;methods;expr
-.__T__show:methods;environment; ;methods;Not a function
-.__T__slotsFromS3:methods;environment; ;methods;Not a function
-.__T__Summary:base;environment; ;methods;Not a function
-unRematchDefinition;function;function;methods;definition
-.untracedFunction;function;function;methods;f
-validObject;function;function;methods;object, test = FALSE, complete = FALSE
-validSlotNames;function;function;methods;names
-.valueClassTest;function;function;methods;object, classes, fname
-.Autoloaded;unknown; ;Autoloads;Not a function
-^;function;function;base;No arguments
-~;function;function;base;No arguments
-<;function;function;base;No arguments
-<<-;function;function;base;No arguments
-<=;function;function;base;No arguments
-<-;function;function;base;No arguments
-=;function;function;base;No arguments
-==;function;function;base;No arguments
->;function;function;base;No arguments
->=;function;function;base;No arguments
-|;function;function;base;Generic Method
-||;function;function;base;No arguments
--;function;function;base;Generic Method
-:;function;function;base;No arguments
-::;function;function;base;pkg, name
-:::;function;function;base;pkg, name
-!;function;function;base;No arguments
-!=;function;function;base;No arguments
-/;function;function;base;Generic Method
-(;function;function;base;No arguments
-[;function;function;base;Generic Method
-[<-;function;function;base;Generic Method
-[[;function;function;base;Generic Method
-[[<-;function;function;base;Generic Method
-{;function;function;base;No arguments
-@;function;function;base;No arguments
-$;function;function;base;No arguments
-$<-;function;function;base;No arguments
-*;function;function;base;Generic Method
-&;function;function;base;Generic Method
-&&;function;function;base;No arguments
-%/%;function;function;base;No arguments
-%*%;function;function;base;No arguments
-%%;function;function;base;No arguments
-+;function;function;base;Generic Method
-abbreviate;function;function;base;names.arg, minlength = 4, use.classes = TRUE, dot = FALSE, 	strict = FALSE, method = c("left.kept", "both.sides")
-abs;function;function;base;No arguments
-acos;function;function;base;No arguments
-acosh;function;function;base;No arguments
-addNA;function;function;base;x, ifany = FALSE
-addTaskCallback;function;function;base;f, data = NULL, name = character(0L)
-agrep;function;function;base;pattern, x, ignore.case = FALSE, value = FALSE, max.distance = 0.1, 	useBytes = FALSE
-.Alias;function;function;base;expr
-alist;function;function;base;...
-all;function;function;base;No arguments
-all.equal;function;function;base;target, current, ...
-all.equal.character;function;function;base;target, current, check.attributes = TRUE, ...
-all.equal.default;function;function;base;target, current, ...
-all.equal.factor;function;function;base;target, current, check.attributes = TRUE, ...
-all.equal.formula;function;function;base;target, current, ...
-all.equal.language;function;function;base;target, current, ...
-all.equal.list;function;function;base;target, current, check.attributes = TRUE, ...
-all.equal.numeric;function;function;base;target, current, tolerance = .Machine$double.eps^0.5, 	scale = NULL, check.attributes = TRUE, ...
-all.equal.POSIXct;function;function;base;target, current, ..., scale = 1
-all.equal.raw;function;function;base;target, current, check.attributes = TRUE, ...
-all.names;function;function;base;expr, functions = TRUE, max.names = -1L, unique = FALSE
-all.vars;function;function;base;expr, functions = FALSE, max.names = -1L, unique = TRUE
-any;function;function;base;No arguments
-anyDuplicated;function;function;base;x, incomparables = FALSE, ...
-anyDuplicated.array;function;function;base;x, incomparables = FALSE, MARGIN = 1L, fromLast = FALSE, 	...
-anyDuplicated.data.frame;function;function;base;x, incomparables = FALSE, fromLast = FALSE, ...
-anyDuplicated.default;function;function;base;x, incomparables = FALSE, fromLast = FALSE, ...
-anyDuplicated.matrix;function;function;base;x, incomparables = FALSE, MARGIN = 1L, fromLast = FALSE, 	...
-aperm;function;function;base;a, perm = NULL, resize = TRUE
-append;function;function;base;x, values, after = length(x)
-apply;function;function;base;X, MARGIN, FUN, ...
-Arg;function;function;base;No arguments
-args;function;function;base;name
-.ArgsEnv;environment; ;base;Not a function
-array;function;function;base;data = NA, dim = length(data), dimnames = NULL
-arrayInd;function;function;base;ind, .dim, .dimnames = NULL, useNames = FALSE
-as.array;function;function;base;x, ...
-as.array.default;function;function;base;x, ...
-as.call;function;function;base;No arguments
-as.character;function;function;base;Generic Method
-as.character.condition;function;function;base;x, ...
-as.character.Date;function;function;base;x, ...
-as.character.default;function;function;base;x, ...
-as.character.error;function;function;base;x, ...
-as.character.factor;function;function;base;x, ...
-as.character.hexmode;function;function;base;x, ...
-as.character.numeric_version;function;function;base;x, ...
-as.character.octmode;function;function;base;x, ...
-as.character.POSIXt;function;function;base;x, ...
-as.character.srcref;function;function;base;x, useSource = TRUE, ...
-as.complex;function;function;base;No arguments
-as.data.frame;function;function;base;Generic Method
-as.data.frame.array;function;function;base;x, row.names = NULL, optional = FALSE, ...
-as.data.frame.AsIs;function;function;base;x, row.names = NULL, optional = FALSE, ...
-as.data.frame.character;function;function;base;x, ..., stringsAsFactors = default.stringsAsFactors()
-as.data.frame.complex;function;function;base;x, row.names = NULL, optional = FALSE, ..., nm = paste(deparse(substitute(x), 	width.cutoff = 500L), collapse = " ")
-as.data.frame.data.frame;function;function;base;x, row.names = NULL, ...
-as.data.frame.Date;function;function;base;x, row.names = NULL, optional = FALSE, ..., nm = paste(deparse(substitute(x), 	width.cutoff = 500L), collapse = " ")
-as.data.frame.default;function;function;base;x, ...
-as.data.frame.difftime;function;function;base;x, row.names = NULL, optional = FALSE, ..., nm = paste(deparse(substitute(x), 	width.cutoff = 500L), collapse = " ")
-as.data.frame.factor;function;function;base;x, row.names = NULL, optional = FALSE, ..., nm = paste(deparse(substitute(x), 	width.cutoff = 500L), collapse = " ")
-as.data.frame.integer;function;function;base;x, row.names = NULL, optional = FALSE, ..., nm = paste(deparse(substitute(x), 	width.cutoff = 500L), collapse = " ")
-as.data.frame.list;function;function;base;x, row.names = NULL, optional = FALSE, ..., stringsAsFactors = default.stringsAsFactors()
-as.data.frame.logical;function;function;base;x, row.names = NULL, optional = FALSE, ..., nm = paste(deparse(substitute(x), 	width.cutoff = 500L), collapse = " ")
-as.data.frame.matrix;function;function;base;x, row.names = NULL, optional = FALSE, ..., stringsAsFactors = default.stringsAsFactors()
-as.data.frame.model.matrix;function;function;base;x, row.names = NULL, optional = FALSE, ...
-as.data.frame.numeric;function;function;base;x, row.names = NULL, optional = FALSE, ..., nm = paste(deparse(substitute(x), 	width.cutoff = 500L), collapse = " ")
-as.data.frame.numeric_version;function;function;base;x, row.names = NULL, optional = FALSE, ..., nm = paste(deparse(substitute(x), 	width.cutoff = 500L), collapse = " ")
-as.data.frame.ordered;function;function;base;x, row.names = NULL, optional = FALSE, ..., nm = paste(deparse(substitute(x), 	width.cutoff = 500L), collapse = " ")
-as.data.frame.POSIXct;function;function;base;x, row.names = NULL, optional = FALSE, ..., nm = paste(deparse(substitute(x), 	width.cutoff = 500L), collapse = " ")
-as.data.frame.POSIXlt;function;function;base;x, row.names = NULL, optional = FALSE, ...
-as.data.frame.raw;function;function;base;x, row.names = NULL, optional = FALSE, ..., nm = paste(deparse(substitute(x), 	width.cutoff = 500L), collapse = " ")
-as.data.frame.table;function;function;base;x, row.names = NULL, ..., responseName = "Freq", stringsAsFactors = TRUE
-as.data.frame.ts;function;function;base;x, ...
-as.data.frame.vector;function;function;base;x, row.names = NULL, optional = FALSE, ..., nm = paste(deparse(substitute(x), 	width.cutoff = 500L), collapse = " ")
-as.Date;function;function;base;x, ...
-as.Date.character;function;function;base;x, format = "", ...
-as.Date.date;function;function;base;x, ...
-as.Date.dates;function;function;base;x, ...
-as.Date.default;function;function;base;x, ...
-as.Date.factor;function;function;base;x, ...
-as.Date.numeric;function;function;base;x, origin, ...
-as.Date.POSIXct;function;function;base;x, tz = "UTC", ...
-as.Date.POSIXlt;function;function;base;x, ...
-as.difftime;function;function;base;tim, format = "%X", units = "auto"
-as.double;function;function;base;Generic Method
-as.double.difftime;function;function;base;x, units = "auto", ...
-as.double.POSIXlt;function;function;base;x, ...
-as.environment;function;function;base;No arguments
-as.expression;function;function;base;x, ...
-as.expression.default;function;function;base;x, ...
-as.factor;function;function;base;x
-as.function;function;function;base;x, ...
-as.function.default;function;function;base;x, envir = parent.frame(), ...
-as.hexmode;function;function;base;x
-asin;function;function;base;No arguments
-asinh;function;function;base;No arguments
-as.integer;function;function;base;No arguments
-[.AsIs;function;function;base;x, i, ...
-as.list;function;function;base;x, ...
-as.list.data.frame;function;function;base;x, ...
-as.list.Date;function;function;base;x, ...
-as.list.default;function;function;base;x, ...
-as.list.environment;function;function;base;x, all.names = FALSE, ...
-as.list.factor;function;function;base;x, ...
-as.list.function;function;function;base;x, ...
-as.list.numeric_version;function;function;base;x, ...
-as.list.POSIXct;function;function;base;x, ...
-as.logical;function;function;base;Generic Method
-as.logical.factor;function;function;base;x, ...
-as.matrix;function;function;base;Generic Method
-as.matrix.data.frame;function;function;base;x, rownames.force = NA, ...
-as.matrix.default;function;function;base;x, ...
-as.matrix.noquote;function;function;base;x, ...
-as.matrix.POSIXlt;function;function;base;x, ...
-as.name;function;function;base;x
-asNamespace;function;function;base;ns, base.OK = TRUE
-as.null;function;function;base;x, ...
-as.null.default;function;function;base;x, ...
-as.numeric;function;function;base;No arguments
-as.numeric_version;function;function;base;x
-as.octmode;function;function;base;x
-as.ordered;function;function;base;x
-as.package_version;function;function;base;x
-as.pairlist;function;function;base;x
-as.POSIXct;function;function;base;x, tz = "", ...
-as.POSIXct.date;function;function;base;x, ...
-as.POSIXct.Date;function;function;base;x, ...
-as.POSIXct.dates;function;function;base;x, ...
-as.POSIXct.default;function;function;base;x, tz = "", ...
-as.POSIXct.numeric;function;function;base;x, tz = "", origin, ...
-as.POSIXct.POSIXlt;function;function;base;x, tz = "", ...
-as.POSIXlt;function;function;base;x, tz = "", ...
-as.POSIXlt.character;function;function;base;x, tz = "", format, ...
-as.POSIXlt.date;function;function;base;x, ...
-as.POSIXlt.Date;function;function;base;x, ...
-as.POSIXlt.dates;function;function;base;x, ...
-as.POSIXlt.default;function;function;base;x, tz = "", ...
-as.POSIXlt.factor;function;function;base;x, ...
-as.POSIXlt.numeric;function;function;base;x, tz = "", origin, ...
-as.POSIXlt.POSIXct;function;function;base;x, tz = "", ...
-as.qr;function;function;base;x
-as.raw;function;function;base;No arguments
-as.real;function;function;base;No arguments
-asS3;function;function;base;object, flag = TRUE, complete = TRUE
-asS4;function;function;base;object, flag = TRUE, complete = TRUE
-assign;function;function;base;x, value, pos = -1, envir = as.environment(pos), inherits = FALSE, 	immediate = TRUE
-as.single;function;function;base;x, ...
-as.single.default;function;function;base;x, ...
-as.symbol;function;function;base;x
-as.table;function;function;base;x, ...
-as.table.default;function;function;base;x, ...
-as.vector;function;function;base;Generic Method
-as.vector.factor;function;function;base;x, mode = "any"
-atan;function;function;base;No arguments
-atan2;function;function;base;y, x
-atanh;function;function;base;No arguments
-attach;function;function;base;what, pos = 2, name = deparse(substitute(what)), warn.conflicts = TRUE
-attachNamespace;function;function;base;ns, pos = 2, dataPath = NULL, depends = NULL
-attr;function;function;base;No arguments
-attr<-;function;function;base;No arguments
-attr.all.equal;function;function;base;target, current, check.attributes = TRUE, check.names = TRUE, 	...
-attributes;function;function;base;No arguments
-attributes<-;function;function;base;No arguments
-autoload;function;function;base;name, package, reset = FALSE, ...
-.AutoloadEnv;environment; ;base;Not a function
-autoloader;function;function;base;name, package, ...
-backsolve;function;function;base;r, x, k = ncol(r), upper.tri = TRUE, transpose = FALSE
-baseenv;function;function;base;No arguments
-basename;function;function;base;path
-.BaseNamespaceEnv;environment; ;base;Not a function
-besselI;function;function;base;x, nu, expon.scaled = FALSE
-besselJ;function;function;base;x, nu
-besselK;function;function;base;x, nu, expon.scaled = FALSE
-besselY;function;function;base;x, nu
-beta;function;function;base;a, b
-bindingIsActive;function;function;base;sym, env
-bindingIsLocked;function;function;base;sym, env
-bindtextdomain;function;function;base;domain, dirname = NULL
-body;function;function;base;fun = sys.function(sys.parent())
-body<-;function;function;base;fun, envir = environment(fun), value
-bquote;function;function;base;expr, where = parent.frame()
-break;flow-control;flow-control;base;Not a function
-browser;function;function;base;No arguments
-browserCondition;function;function;base;n = 1L
-browserSetDebug;function;function;base;n = 1L
-browserText;function;function;base;n = 1L
-builtins;function;function;base;internal = FALSE
-by;function;function;base;data, INDICES, FUN, ..., simplify = TRUE
-by.data.frame;function;function;base;data, INDICES, FUN, ..., simplify = TRUE
-by.default;function;function;base;data, INDICES, FUN, ..., simplify = TRUE
-bzfile;function;function;base;description, open = "", encoding = getOption("encoding"), 	compression = 9
-c;function;function;base;Generic Method
-.C;function;function;base;No arguments
-.cache_class;function;function;base;No arguments
-call;function;function;base;No arguments
-.Call;function;function;base;No arguments
-callCC;function;function;base;fun
-.Call.graphics;function;function;base;No arguments
-capabilities;function;function;base;what = NULL
-casefold;function;function;base;x, upper = FALSE
-cat;function;function;base;..., file = "", sep = " ", fill = FALSE, labels = NULL, 	append = FALSE
-category;function;function;base;...
-cbind;function;function;base;Generic Method
-cbind.data.frame;function;function;base;..., deparse.level = 1
-c.Date;function;function;base;..., recursive = FALSE
-ceiling;function;function;base;No arguments
-character;function;function;base;length = 0
-char.expand;function;function;base;input, target, nomatch = stop("no match")
-charmatch;function;function;base;x, table, nomatch = NA_integer_
-charToRaw;function;function;base;x
-chartr;function;function;base;old, new, x
-check_tzones;function;function;base;...
-chol;function;function;base;x, ...
-chol2inv;function;function;base;x, size = NCOL(x), LINPACK = FALSE
-chol.default;function;function;base;x, pivot = FALSE, LINPACK = pivot, ...
-choose;function;function;base;n, k
-class;function;function;base;No arguments
-class<-;function;function;base;No arguments
-close;function;function;base;con, ...
-closeAllConnections;function;function;base;No arguments
-close.connection;function;function;base;con, type = "rw", ...
-close.srcfile;function;function;base;con, ...
-c.noquote;function;function;base;..., recursive = FALSE
-c.numeric_version;function;function;base;..., recursive = FALSE
-codes;function;function;base;x, ...
-codes<-;function;function;base;x, ..., value
-codes.factor;function;function;base;x, ...
-codes.ordered;function;function;base;x, ...
-col;function;function;base;x, as.factor = FALSE
-colMeans;function;function;base;x, na.rm = FALSE, dims = 1L
-colnames;function;function;base;x, do.NULL = TRUE, prefix = "col"
-colnames<-;function;function;base;x, value
-colSums;function;function;base;x, na.rm = FALSE, dims = 1L
-commandArgs;function;function;base;trailingOnly = FALSE
-comment;function;function;base;x
-comment<-;function;function;base;x, value
-complex;function;function;base;length.out = 0, real = numeric(), imaginary = numeric(), 	modulus = 1, argument = 0
-computeRestarts;function;function;base;cond = NULL
-conditionCall;function;function;base;c
-conditionCall.condition;function;function;base;c
-conditionMessage;function;function;base;c
-conditionMessage.condition;function;function;base;c
-conflicts;function;function;base;where = search(), detail = FALSE
-Conj;function;function;base;No arguments
-contributors;function;function;base;No arguments
-cos;function;function;base;No arguments
-cosh;function;function;base;No arguments
-c.POSIXct;function;function;base;..., recursive = FALSE
-c.POSIXlt;function;function;base;..., recursive = FALSE
-crossprod;function;function;base;x, y = NULL
-Cstack_info;function;function;base;No arguments
-cummax;function;function;base;No arguments
-cummin;function;function;base;No arguments
-cumprod;function;function;base;No arguments
-cumsum;function;function;base;No arguments
-cut;function;function;base;x, ...
-cut.Date;function;function;base;x, breaks, labels = NULL, start.on.monday = TRUE, right = FALSE, 	...
-cut.default;function;function;base;x, breaks, labels = NULL, include.lowest = FALSE, right = TRUE, 	dig.lab = 3, ordered_result = FALSE, ...
-cut.POSIXt;function;function;base;x, breaks, labels = NULL, start.on.monday = TRUE, right = FALSE, 	...
-data.class;function;function;base;x
-[<-.data.frame;function;function;base;x, i, j, value
-[.data.frame;function;function;base;x, i, j, drop = if (missing(i)) TRUE else length(cols) == 	1
-[[<-.data.frame;function;function;base;x, i, j, value
-[[.data.frame;function;function;base;x, ..., exact = TRUE
-$<-.data.frame;function;function;base;x, name, value
-data.frame;function;function;base;..., row.names = NULL, check.rows = FALSE, check.names = TRUE, 	stringsAsFactors = default.stringsAsFactors()
-data.matrix;function;function;base;frame, rownames.force = NA
-date;function;function;base;No arguments
--.Date;function;function;base;e1, e2
-[<-.Date;function;function;base;x, ..., value
-[.Date;function;function;base;x, ..., drop = TRUE
-[[.Date;function;function;base;x, ..., drop = TRUE
-+.Date;function;function;base;e1, e2
-debug;function;function;base;fun, text = "", condition = NULL
-debugonce;function;function;base;fun, text = "", condition = NULL
-.decode_numeric_version;function;function;base;x, base = NULL
-default.stringsAsFactors;function;function;base;No arguments
-.Defunct;function;function;base;new, package = NULL, msg
-delay;function;function;base;x, env = .GlobalEnv
-delayedAssign;function;function;base;x, value, eval.env = parent.frame(1), assign.env = parent.frame(1)
-deparse;function;function;base;expr, width.cutoff = 60L, backtick = mode(expr) %in% 	c("call", "expression", "(", "function"), control = c("keepInteger", 	"showAttributes", "keepNA"), nlines = -1L
-.deparseOpts;function;function;base;control
-.Deprecated;function;function;base;new, package = NULL, msg
-det;function;function;base;x, ...
-detach;function;function;base;name, pos = 2, unload = FALSE, character.only = FALSE, 	force = FALSE
-determinant;function;function;base;x, logarithm = TRUE, ...
-determinant.matrix;function;function;base;x, logarithm = TRUE, ...
-.Device;character;character;base;Not a function
-.Devices;pairlist;list;base;Not a function
-dget;function;function;base;file
-diag;function;function;base;x = 1, nrow, ncol
-diag<-;function;function;base;x, value
-diff;function;function;base;x, ...
-diff.Date;function;function;base;x, lag = 1L, differences = 1L, ...
-diff.default;function;function;base;x, lag = 1L, differences = 1L, ...
-diff.POSIXt;function;function;base;x, lag = 1L, differences = 1L, ...
-difftime;function;function;base;time1, time2, tz, units = c("auto", "secs", "mins", 	"hours", "days", "weeks")
-/.difftime;function;function;base;e1, e2
-.difftime;function;function;base;xx, units
-[.difftime;function;function;base;x, ..., drop = TRUE
-*.difftime;function;function;base;e1, e2
-digamma;function;function;base;No arguments
-dim;function;function;base;Generic Method
-dim<-;function;function;base;No arguments
-dim.data.frame;function;function;base;x
-dimnames;function;function;base;Generic Method
-dimnames<-;function;function;base;Generic Method
-dimnames<-.data.frame;function;function;base;x, value
-dimnames.data.frame;function;function;base;x
-dir;function;function;base;path = ".", pattern = NULL, all.files = FALSE, full.names = FALSE, 	recursive = FALSE, ignore.case = FALSE
-dir.create;function;function;base;path, showWarnings = TRUE, recursive = FALSE, mode = "0777"
-dirname;function;function;base;path
-$.DLLInfo;function;function;base;x, name
-do.call;function;function;base;what, args, quote = FALSE, envir = parent.frame()
-.doTrace;function;function;base;expr, msg
-double;function;function;base;length = 0
-dput;function;function;base;x, file = "", control = c("keepNA", "keepInteger", 	"showAttributes")
-dQuote;function;function;base;x
-drop;function;function;base;x
-droplevels;function;function;base;x, ...
-droplevels.data.frame;function;function;base;x, except = NULL, ...
-droplevels.factor;function;function;base;x, ...
-dump;function;function;base;list, file = "dumpdata.R", append = FALSE, control = "all", 	envir = parent.frame(), evaluate = TRUE
-duplicated;function;function;base;x, incomparables = FALSE, ...
-duplicated.array;function;function;base;x, incomparables = FALSE, MARGIN = 1L, fromLast = FALSE, 	...
-duplicated.data.frame;function;function;base;x, incomparables = FALSE, fromLast = FALSE, ...
-duplicated.default;function;function;base;x, incomparables = FALSE, fromLast = FALSE, ...
-duplicated.matrix;function;function;base;x, incomparables = FALSE, MARGIN = 1L, fromLast = FALSE, 	...
-duplicated.numeric_version;function;function;base;x, incomparables = FALSE, ...
-duplicated.POSIXlt;function;function;base;x, incomparables = FALSE, ...
-.dynLibs;function;function;base;new
-dyn.load;function;function;base;x, local = TRUE, now = TRUE, ...
-dyn.unload;function;function;base;x
-eapply;function;function;base;env, FUN, ..., all.names = FALSE, USE.NAMES = TRUE
-eigen;function;function;base;x, symmetric, only.values = FALSE, EISPACK = FALSE
-emptyenv;function;function;base;No arguments
-enc2native;function;function;base;No arguments
-enc2utf8;function;function;base;No arguments
-.encode_numeric_version;function;function;base;x, base = NULL
-encodeString;function;function;base;x, width = 0, quote = "", na.encode = TRUE, justify = c("left", 	"right", "centre", "none")
-Encoding;function;function;base;x
-Encoding<-;function;function;base;x, value
-enquote;function;function;base;cl
-environment;function;function;base;fun = NULL
-environment<-;function;function;base;No arguments
-environmentIsLocked;function;function;base;env
-environmentName;function;function;base;env
-env.profile;function;function;base;env
-eval;function;function;base;expr, envir = parent.frame(), enclos = if (is.list(envir) || 	is.pairlist(envir)) parent.frame() else baseenv()
-eval.parent;function;function;base;expr, n = 1
-evalq;function;function;base;expr, envir = parent.frame(), enclos = if (is.list(envir) || 	is.pairlist(envir)) parent.frame() else baseenv()
-exists;function;function;base;x, where = -1, envir = if (missing(frame)) as.environment(where) else sys.frame(frame), 	frame, mode = "any", inherits = TRUE
-exp;function;function;base;No arguments
-expand.grid;function;function;base;..., KEEP.OUT.ATTRS = TRUE, stringsAsFactors = TRUE
-.expand_R_libs_env_var;function;function;base;x
-expm1;function;function;base;No arguments
-.Export;function;function;base;...
-expression;function;function;base;No arguments
-.External;function;function;base;No arguments
-.External.graphics;function;function;base;No arguments
-F;logical;logical;base;Not a function
-factor;function;function;base;x = character(), levels, labels = levels, exclude = NA, 	ordered = is.ordered(x)
-[<-.factor;function;function;base;x, ..., value
-[.factor;function;function;base;x, ..., drop = FALSE
-[[<-.factor;function;function;base;x, ..., value
-[[.factor;function;function;base;x, ...
-factorial;function;function;base;x
-fifo;function;function;base;description, open = "", blocking = FALSE, encoding = getOption("encoding")
-file;function;function;base;description = "", open = "", blocking = TRUE, encoding = getOption("encoding"), 	raw = FALSE
-file.access;function;function;base;names, mode = 0
-file.append;function;function;base;file1, file2
-file.choose;function;function;base;new = FALSE
-file.copy;function;function;base;from, to, overwrite = recursive, recursive = FALSE
-file.create;function;function;base;..., showWarnings = TRUE
-file.exists;function;function;base;...
-file.info;function;function;base;...
-file.path;function;function;base;..., fsep = .Platform$file.sep
-file.remove;function;function;base;...
-file.rename;function;function;base;from, to
-file.show;function;function;base;..., header = rep("", nfiles), title = "R Information", 	delete.file = FALSE, pager = getOption("pager"), encoding = ""
-file.symlink;function;function;base;from, to
-Filter;function;function;base;f, x
-Find;function;function;base;f, x, right = FALSE, nomatch = NULL
-findInterval;function;function;base;x, vec, rightmost.closed = FALSE, all.inside = FALSE
-.find.package;function;function;base;package = NULL, lib.loc = NULL, quiet = FALSE, verbose = getOption("verbose")
-findPackageEnv;function;function;base;info
-findRestart;function;function;base;name, cond = NULL
-.First.sys;function;function;base;No arguments
-floor;function;function;base;No arguments
-flush;function;function;base;con
-flush.connection;function;function;base;con
-for;flow-control;flow-control;base;Not a function
-force;function;function;base;x
-formals;function;function;base;fun = sys.function(sys.parent())
-formals<-;function;function;base;fun, envir = environment(fun), value
-format;function;function;base;x, ...
-format.AsIs;function;function;base;x, width = 12, ...
-formatC;function;function;base;x, digits = NULL, width = NULL, format = NULL, flag = "", 	mode = NULL, big.mark = "", big.interval = 3L, small.mark = "", 	small.interval = 5L, decimal.mark = ".", preserve.width = "individual", 	zero.print = NULL, drop0trailing = FALSE
-format.char;function;function;base;x, width = NULL, flag = "-"
-format.data.frame;function;function;base;x, ..., justify = "none"
-format.Date;function;function;base;x, ...
-format.default;function;function;base;x, trim = FALSE, digits = NULL, nsmall = 0L, justify = c("left", 	"right", "centre", "none"), width = NULL, na.encode = TRUE, 	scientific = NA, big.mark = "", big.interval = 3L, small.mark = "", 	small.interval = 5L, decimal.mark = ".", zero.print = NULL, 	drop0trailing = FALSE, ...
-format.difftime;function;function;base;x, ...
-formatDL;function;function;base;x, y, style = c("table", "list"), width = 0.9 * getOption("width"), 	indent = NULL
-format.factor;function;function;base;x, ...
-format.hexmode;function;function;base;x, width = NULL, upper.case = FALSE, ...
-format.info;function;function;base;x, digits = NULL, nsmall = 0
-format.numeric_version;function;function;base;x, ...
-format.octmode;function;function;base;x, width = NULL, ...
-format.POSIXct;function;function;base;x, format = "", tz = "", usetz = FALSE, ...
-format.POSIXlt;function;function;base;x, format = "", usetz = FALSE, ...
-format.pval;function;function;base;pv, digits = max(1, getOption("digits") - 2), eps = .Machine$double.eps, 	na.form = "NA", ...
-.Fortran;function;function;base;No arguments
-forwardsolve;function;function;base;l, x, k = ncol(l), upper.tri = FALSE, transpose = FALSE
-function;function;function;base;No arguments
-gamma;function;function;base;No arguments
-gammaCody;function;function;base;x
-gc;function;function;base;verbose = getOption("verbose"), reset = FALSE
-gcinfo;function;function;base;verbose
-gc.time;function;function;base;No arguments
-gctorture;function;function;base;on = TRUE
-.GenericArgsEnv;environment; ;base;Not a function
-get;function;function;base;x, pos = -1, envir = as.environment(pos), mode = "any", 	inherits = TRUE
-getAllConnections;function;function;base;No arguments
-getCallingDLL;function;function;base;f = sys.function(-1), doStop = FALSE
-getCallingDLLe;function;function;base;e
-getCConverterDescriptions;function;function;base;No arguments
-getCConverterStatus;function;function;base;No arguments
-getConnection;function;function;base;what
-getDLLRegisteredRoutines;function;function;base;dll, addNames = TRUE
-getDLLRegisteredRoutines.character;function;function;base;dll, addNames = TRUE
-getDLLRegisteredRoutines.DLLInfo;function;function;base;dll, addNames = TRUE
-getenv;function;function;base;...
-geterrmessage;function;function;base;No arguments
-getExportedValue;function;function;base;ns, name
-getHook;function;function;base;hookName
-getLoadedDLLs;function;function;base;No arguments
-getNamespace;function;function;base;name
-getNamespaceExports;function;function;base;ns
-getNamespaceImports;function;function;base;ns
-getNamespaceInfo;function;function;base;ns, which
-getNamespaceName;function;function;base;ns
-getNamespaceUsers;function;function;base;ns
-getNamespaceVersion;function;function;base;ns
-getNativeSymbolInfo;function;function;base;name, PACKAGE, unlist = TRUE, withRegistrationInfo = FALSE
-getNumCConverters;function;function;base;No arguments
-getOption;function;function;base;x, default = NULL
-.getRequiredPackages;function;function;base;file = "DESCRIPTION", lib.loc = NULL, quietly = FALSE, 	useImports = FALSE
-.getRequiredPackages2;function;function;base;pkgInfo, quietly = FALSE, lib.loc = NULL, useImports = FALSE
-getRversion;function;function;base;No arguments
-getSrcLines;function;function;base;srcfile, first, last
-getTaskCallbackNames;function;function;base;No arguments
-gettext;function;function;base;..., domain = NULL
-gettextf;function;function;base;fmt, ..., domain = NULL
-getwd;function;function;base;No arguments
-gl;function;function;base;n, k, length = n * k, labels = 1:n, ordered = FALSE
-globalenv;function;function;base;No arguments
-.GlobalEnv;environment; ;base;Not a function
-gregexpr;function;function;base;pattern, text, ignore.case = FALSE, perl = FALSE, fixed = FALSE, 	useBytes = FALSE
-grep;function;function;base;pattern, x, ignore.case = FALSE, perl = FALSE, value = FALSE, 	fixed = FALSE, useBytes = FALSE, invert = FALSE
-grepl;function;function;base;pattern, x, ignore.case = FALSE, perl = FALSE, fixed = FALSE, 	useBytes = FALSE
-gsub;function;function;base;pattern, replacement, x, ignore.case = FALSE, perl = FALSE, 	fixed = FALSE, useBytes = FALSE
-.gt;function;function;base;x, i, j
-.gtn;function;function;base;x, strictly
-gzcon;function;function;base;con, level = 6, allowNonCompressed = TRUE
-gzfile;function;function;base;description, open = "", encoding = getOption("encoding"), 	compression = 6
-.handleSimpleError;function;function;base;h, msg, call
-.__H__.cbind;function;function;base;..., deparse.level = 1
-|.hexmode;function;function;base;a, b
-[.hexmode;function;function;base;x, i
-&.hexmode;function;function;base;a, b
-.__H__.rbind;function;function;base;..., deparse.level = 1
-httpclient;function;function;base;url, port = 80, error.is.fatal = TRUE, check.MIME.type = TRUE, 	file = tempfile(), drop.ctrl.z = TRUE
-I;function;function;base;x
-iconv;function;function;base;x, from = "", to = "", sub = NA, mark = TRUE
-iconvlist;function;function;base;No arguments
-icuSetCollate;function;function;base;...
-identical;function;function;base;x, y, num.eq = TRUE, single.NA = TRUE, attrib.as.set = TRUE
-identity;function;function;base;x
-if;flow-control;flow-control;base;Not a function
-ifelse;function;function;base;test, yes, no
-Im;function;function;base;No arguments
-.Import;function;function;base;...
-.ImportFrom;function;function;base;name, ...
-importIntoEnv;function;function;base;impenv, impnames, expenv, expnames
-%in%;function;function;base;x, table
-inherits;function;function;base;x, what, which = FALSE
-integer;function;function;base;length = 0
-interaction;function;function;base;..., drop = FALSE, sep = ".", lex.order = FALSE
-interactive;function;function;base;No arguments
-.Internal;function;function;base;No arguments
-intersect;function;function;base;x, y
-intToBits;function;function;base;x
-intToUtf8;function;function;base;x, multiple = FALSE
-inverse.rle;function;function;base;x, ...
-invisible;function;function;base;No arguments
-invokeRestart;function;function;base;r, ...
-invokeRestartInteractively;function;function;base;r
-is.array;function;function;base;No arguments
-is.atomic;function;function;base;No arguments
-isatty;function;function;base;con
-isBaseNamespace;function;function;base;ns
-is.call;function;function;base;No arguments
-is.character;function;function;base;No arguments
-is.complex;function;function;base;No arguments
-is.data.frame;function;function;base;x
-isdebugged;function;function;base;fun
-is.double;function;function;base;No arguments
-is.element;function;function;base;el, set
-is.environment;function;function;base;No arguments
-is.expression;function;function;base;No arguments
-is.factor;function;function;base;x
-is.finite;function;function;base;No arguments
-is.function;function;function;base;No arguments
-isIncomplete;function;function;base;con
-is.infinite;function;function;base;No arguments
-is.integer;function;function;base;No arguments
-is.language;function;function;base;No arguments
-is.list;function;function;base;No arguments
-is.loaded;function;function;base;symbol, PACKAGE = "", type = ""
-is.logical;function;function;base;No arguments
-is.matrix;function;function;base;No arguments
-.isMethodsDispatchOn;function;function;base;onOff = NULL
-is.na;function;function;base;Generic Method
-is.na<-;function;function;base;x, value
-is.na.data.frame;function;function;base;x
-is.na<-.default;function;function;base;x, value
-is.na<-.factor;function;function;base;x, value
-is.name;function;function;base;No arguments
-isNamespace;function;function;base;ns
-is.nan;function;function;base;No arguments
-is.na.numeric_version;function;function;base;x
-is.na.POSIXlt;function;function;base;x
-is.null;function;function;base;No arguments
-is.numeric;function;function;base;Generic Method
-is.numeric.Date;function;function;base;x
-is.numeric.difftime;function;function;base;x
-is.numeric.POSIXt;function;function;base;x
-is.numeric_version;function;function;base;x
-is.object;function;function;base;No arguments
-ISOdate;function;function;base;year, month, day, hour = 12, min = 0, sec = 0, tz = "GMT"
-ISOdatetime;function;function;base;year, month, day, hour, min, sec, tz = ""
-isOpen;function;function;base;con, rw = ""
-.isOpen;function;function;base;srcfile
-is.ordered;function;function;base;x
-is.package_version;function;function;base;x
-is.pairlist;function;function;base;No arguments
-is.primitive;function;function;base;x
-is.qr;function;function;base;x
-is.R;function;function;base;No arguments
-is.raw;function;function;base;No arguments
-is.real;function;function;base;No arguments
-is.recursive;function;function;base;No arguments
-isRestart;function;function;base;x
-isS4;function;function;base;object
-isSeekable;function;function;base;con
-is.single;function;function;base;No arguments
-is.symbol;function;function;base;No arguments
-isSymmetric;function;function;base;object, ...
-isSymmetric.matrix;function;function;base;object, tol = 100 * .Machine$double.eps, ...
-is.table;function;function;base;x
-isTRUE;function;function;base;x
-is.unsorted;function;function;base;x, na.rm = FALSE, strictly = FALSE
-is.vector;function;function;base;x, mode = "any"
-jitter;function;function;base;x, factor = 1, amount = NULL
-julian;function;function;base;x, ...
-julian.Date;function;function;base;x, origin = as.Date("1970-01-01"), ...
-julian.POSIXt;function;function;base;x, origin = as.POSIXct("1970-01-01", tz = "GMT"), ...
-kappa;function;function;base;z, ...
-kappa.default;function;function;base;z, exact = FALSE, norm = NULL, method = c("qr", "direct"), 	...
-kappa.lm;function;function;base;z, ...
-kappa.qr;function;function;base;z, ...
-kappa.tri;function;function;base;z, exact = FALSE, LINPACK = TRUE, norm = NULL, ...
-.knownS3Generics;character;character;base;Not a function
-kronecker;function;function;base;X, Y, FUN = "*", make.dimnames = FALSE, ...
-l10n_info;function;function;base;No arguments
-labels;function;function;base;Generic Method
-labels.default;function;function;base;object, ...
-La.chol;function;function;base;x
-La.chol2inv;function;function;base;x, size = ncol(x)
-La.eigen;function;function;base;x, symmetric, only.values = FALSE, method = c("dsyevr", 	"dsyev")
-lapply;function;function;base;X, FUN, ...
-.Last.value;list;list;base;Not a function
-.Last.value$value;function;function;base;Unknown arguments
-.Last.value$visible;logical;logical;base;Not a function
-La.svd;function;function;base;x, nu = min(n, p), nv = min(n, p)
-lazyLoad;function;function;base;filebase, envir = parent.frame(), filter
-lazyLoadDBfetch;function;function;base;No arguments
-lbeta;function;function;base;a, b
-lchoose;function;function;base;n, k
-.leap.seconds;POSIXct; ;base;Not a function
-length;function;function;base;Generic Method
-length<-;function;function;base;Generic Method
-length<-.factor;function;function;base;x, value
-length.POSIXlt;function;function;base;x
-letters;character;character;base;Not a function
-LETTERS;character;character;base;Not a function
-levels;function;function;base;x
-levels<-;function;function;base;Generic Method
-levels.default;function;function;base;x
-levels<-.factor;function;function;base;x, value
-lfactorial;function;function;base;x
-lgamma;function;function;base;No arguments
-.libPaths;function;function;base;new
-library;function;function;base;package, help, pos = 2, lib.loc = NULL, character.only = FALSE, 	logical.return = FALSE, warn.conflicts = TRUE, quietly = FALSE, 	keep.source = getOption("keep.source.pkgs"), verbose = getOption("verbose")
-.Library;character;character;base;Not a function
-library.dynam;function;function;base;chname, package = NULL, lib.loc = NULL, verbose = getOption("verbose"), 	file.ext = .Platform$dynlib.ext, ...
-library.dynam.unload;function;function;base;chname, libpath, verbose = getOption("verbose"), file.ext = .Platform$dynlib.ext
-.Library.site;character;character;base;Not a function
-licence;function;function;base;No arguments
-license;function;function;base;No arguments
-list;function;function;base;No arguments
-list2env;function;function;base;x, envir = NULL, parent = parent.frame(), hash = FALSE, 	size = 29L
-list.files;function;function;base;path = ".", pattern = NULL, all.files = FALSE, full.names = FALSE, 	recursive = FALSE, ignore.case = FALSE
-[.listof;function;function;base;x, i, ...
-load;function;function;base;file, envir = parent.frame()
-loadedNamespaces;function;function;base;No arguments
-loadingNamespaceInfo;function;function;base;No arguments
-loadNamespace;function;function;base;package, lib.loc = NULL, keep.source = getOption("keep.source.pkgs"), 	partial = FALSE, declarativeOnly = FALSE
-loadURL;function;function;base;url, envir = parent.frame(), quiet = TRUE, ...
-local;function;function;base;expr, envir = new.env()
-lockBinding;function;function;base;sym, env
-lockEnvironment;function;function;base;env, bindings = FALSE
-log;function;function;base;No arguments
-log10;function;function;base;No arguments
-log1p;function;function;base;No arguments
-log2;function;function;base;No arguments
-logb;function;function;base;x, base = exp(1)
-logical;function;function;base;length = 0
-lower.tri;function;function;base;x, diag = FALSE
-ls;function;function;base;name, pos = -1, envir = as.environment(pos), all.names = FALSE, 	pattern
-machine;function;function;base;No arguments
-Machine;function;function;base;No arguments
-.Machine;list;list;base;Not a function
-.Machine$double.eps;numeric;numeric;base;Not a function
-.Machine$double.neg.eps;numeric;numeric;base;Not a function
-.Machine$double.xmin;numeric;numeric;base;Not a function
-.Machine$double.xmax;numeric;numeric;base;Not a function
-.Machine$double.base;integer;numeric;base;Not a function
-.Machine$double.digits;integer;numeric;base;Not a function
-.Machine$double.rounding;integer;numeric;base;Not a function
-.Machine$double.guard;integer;numeric;base;Not a function
-.Machine$double.ulp.digits;integer;numeric;base;Not a function
-.Machine$double.neg.ulp.digits;integer;numeric;base;Not a function
-.Machine$double.exponent;integer;numeric;base;Not a function
-.Machine$double.min.exp;integer;numeric;base;Not a function
-.Machine$double.max.exp;integer;numeric;base;Not a function
-.Machine$integer.max;integer;numeric;base;Not a function
-.Machine$sizeof.long;integer;numeric;base;Not a function
-.Machine$sizeof.longlong;integer;numeric;base;Not a function
-.Machine$sizeof.longdouble;integer;numeric;base;Not a function
-.Machine$sizeof.pointer;integer;numeric;base;Not a function
-makeActiveBinding;function;function;base;sym, fun, env
-.makeMessage;function;function;base;..., domain = NULL, appendLF = FALSE
-make.names;function;function;base;names, unique = FALSE, allow_ = TRUE
-.make_numeric_version;function;function;base;x, strict = TRUE, regexp, classes = NULL
-make.unique;function;function;base;names, sep = "."
-manglePackageName;function;function;base;pkgName, pkgVersion
-Map;function;function;base;f, ...
-mapply;function;function;base;FUN, ..., MoreArgs = NULL, SIMPLIFY = TRUE, USE.NAMES = TRUE
-margin.table;function;function;base;x, margin = NULL
-match;function;function;base;x, table, nomatch = NA_integer_, incomparables = NULL
-match.arg;function;function;base;arg, choices, several.ok = FALSE
-match.call;function;function;base;definition = NULL, call = sys.call(sys.parent()), expand.dots = TRUE
-match.fun;function;function;base;FUN, descend = TRUE
-Math.data.frame;function;function;base;x, ...
-Math.Date;function;function;base;x, ...
-Math.difftime;function;function;base;x, ...
-Math.factor;function;function;base;x, ...
-Math.POSIXt;function;function;base;x, ...
-mat.or.vec;function;function;base;nr, nc
-matrix;function;function;base;data = NA, nrow = 1, ncol = 1, byrow = FALSE, dimnames = NULL
-max;function;function;base;No arguments
-max.col;function;function;base;m, ties.method = c("random", "first", "last")
-mean;function;function;base;x, ...
-mean.data.frame;function;function;base;x, ...
-mean.Date;function;function;base;x, ...
-mean.default;function;function;base;x, trim = 0, na.rm = FALSE, ...
-mean.difftime;function;function;base;x, ...
-mean.POSIXct;function;function;base;x, ...
-mean.POSIXlt;function;function;base;x, ...
-memCompress;function;function;base;from, type = c("gzip", "bzip2", "xz", "none")
-memDecompress;function;function;base;from, type = c("unknown", "gzip", "bzip2", "xz", "none"), 	asChar = FALSE
-mem.limits;function;function;base;nsize = NA, vsize = NA
-memory.profile;function;function;base;No arguments
-merge;function;function;base;x, y, ...
-merge.data.frame;function;function;base;x, y, by = intersect(names(x), names(y)), by.x = by, 	by.y = by, all = FALSE, all.x = all, all.y = all, sort = TRUE, 	suffixes = c(".x", ".y"), incomparables = NULL, ...
-merge.default;function;function;base;x, y, ...
-.mergeExportMethods;function;function;base;new, ns
-.mergeImportMethods;function;function;base;impenv, expenv, metaname
-message;function;function;base;..., domain = NULL, appendLF = TRUE
-.methodsNamespace;environment; ;base;Not a function
-mget;function;function;base;x, envir, mode = "any", ifnotfound = list(function(x) stop(paste("value for '", 	x, "' not found", sep = ""), call. = FALSE)), inherits = FALSE
-min;function;function;base;No arguments
-missing;function;function;base;No arguments
-Mod;function;function;base;No arguments
-mode;function;function;base;x
-mode<-;function;function;base;x, value
-month.abb;character;character;base;Not a function
-month.name;character;character;base;Not a function
-months;function;function;base;x, abbreviate
-months.Date;function;function;base;x, abbreviate = FALSE
-months.POSIXt;function;function;base;x, abbreviate = FALSE
-mostattributes<-;function;function;base;obj, value
-names;function;function;base;No arguments
-names<-;function;function;base;No arguments
-namespaceExport;function;function;base;ns, vars
-namespaceImport;function;function;base;self, ...
-namespaceImportClasses;function;function;base;self, ns, vars
-namespaceImportFrom;function;function;base;self, ns, vars, generics, packages
-namespaceImportMethods;function;function;base;self, ns, vars
-nargs;function;function;base;No arguments
-nchar;function;function;base;x, type = "chars", allowNA = FALSE
-ncol;function;function;base;x
-NCOL;function;function;base;x
-Negate;function;function;base;f
-new.env;function;function;base;hash = FALSE, parent = parent.frame(), size = 29L
-next;flow-control;flow-control;base;Not a function
-NextMethod;function;function;base;generic = NULL, object = NULL, ...
-ngettext;function;function;base;n, msg1, msg2, domain = NULL
-nlevels;function;function;base;x
-.noGenerics;logical;logical;base;Not a function
-noquote;function;function;base;obj
-[.noquote;function;function;base;x, ...
-norm;function;function;base;x, type = c("O", "I", "F", "M")
-.NotYetImplemented;function;function;base;No arguments
-.NotYetUsed;function;function;base;arg, error = TRUE
-nrow;function;function;base;x
-NROW;function;function;base;x
-numeric;function;function;base;length = 0
-[.numeric_version;function;function;base;x, i, j
-[[<-.numeric_version;function;function;base;x, ..., value
-[[.numeric_version;function;function;base;x, ..., exact = NA
-numeric_version;function;function;base;x, strict = TRUE
-nzchar;function;function;base;No arguments
-%o%;function;function;base;X, Y
-objects;function;function;base;name, pos = -1, envir = as.environment(pos), all.names = FALSE, 	pattern
-|.octmode;function;function;base;a, b
-[.octmode;function;function;base;x, i
-&.octmode;function;function;base;a, b
-oldClass;function;function;base;No arguments
-oldClass<-;function;function;base;No arguments
-on.exit;function;function;base;No arguments
-open;function;function;base;con, ...
-open.connection;function;function;base;con, open = "r", blocking = TRUE, ...
-open.srcfile;function;function;base;con, line, ...
-open.srcfilecopy;function;function;base;con, line, ...
-Ops.data.frame;function;function;base;e1, e2 = NULL
-Ops.Date;function;function;base;e1, e2
-Ops.difftime;function;function;base;e1, e2
-Ops.factor;function;function;base;e1, e2
-Ops.numeric_version;function;function;base;e1, e2
-Ops.ordered;function;function;base;e1, e2
-Ops.POSIXt;function;function;base;e1, e2
-options;function;function;base;...
-.Options;pairlist;list;base;Not a function
-.Options$prompt;unknown; ;base;Not a function
-.Options$continue;unknown; ;base;Not a function
-.Options$expressions;unknown; ;base;Not a function
-.Options$width;unknown; ;base;Not a function
-.Options$digits;unknown; ;base;Not a function
-.Options$echo;unknown; ;base;Not a function
-.Options$verbose;unknown; ;base;Not a function
-.Options$check.bounds;logical;logical;base;Not a function
-.Options$keep.source;logical;logical;base;Not a function
-.Options$keep.source.pkgs;logical;logical;base;Not a function
-.Options$warning.length;integer;numeric;base;Not a function
-.Options$OutDec;unknown; ;base;Not a function
-.Options$rl_word_breaks;unknown; ;base;Not a function
-.Options$warn;unknown; ;base;Not a function
-.Options$timeout;unknown; ;base;Not a function
-.Options$encoding;unknown; ;base;Not a function
-.Options$show.error.messages;logical;logical;base;Not a function
-.Options$scipen;unknown; ;base;Not a function
-.Options$max.print;numeric;numeric;base;Not a function
-.Options$add.smooth;logical;logical;base;Not a function
-.Options$stringsAsFactors;unknown; ;base;Not a function
-.Options$defaultPackages;unknown; ;base;Not a function
-.Options$papersize;unknown; ;base;Not a function
-.Options$printcmd;unknown; ;base;Not a function
-.Options$dvipscmd;unknown; ;base;Not a function
-.Options$texi2dvi;unknown; ;base;Not a function
-.Options$browser;unknown; ;base;Not a function
-.Options$pager;unknown; ;base;Not a function
-.Options$pdfviewer;unknown; ;base;Not a function
-.Options$useFancyQuotes;unknown; ;base;Not a function
-.Options$help.try.all.packages;logical;logical;base;Not a function
-.Options$internet.info;numeric;numeric;base;Not a function
-.Options$pkgType;unknown; ;base;Not a function
-.Options$str;unknown; ;base;Not a function
-.Options$demo.ask;character;character;base;Not a function
-.Options$example.ask;character;character;base;Not a function
-.Options$HTTPUserAgent;unknown; ;base;Not a function
-.Options$menu.graphics;logical;logical;base;Not a function
-.Options$mailer;unknown; ;base;Not a function
-.Options$unzip;unknown; ;base;Not a function
-.Options$editor;unknown; ;base;Not a function
-.Options$repos;unknown; ;base;Not a function
-.Options$locatorBell;unknown; ;base;Not a function
-.Options$device.ask.default;logical;logical;base;Not a function
-.Options$bitmapType;unknown; ;base;Not a function
-.Options$device;unknown; ;base;Not a function
-.Options$contrasts;unknown; ;base;Not a function
-.Options$na.action;character;character;base;Not a function
-.Options$show.coef.Pvalues;logical;logical;base;Not a function
-.Options$show.signif.stars;logical;logical;base;Not a function
-.Options$ts.eps;numeric;numeric;base;Not a function
-.Options$ts.S.compat;logical;logical;base;Not a function
-.OptRequireMethods;function;function;base;No arguments
-order;function;function;base;..., na.last = TRUE, decreasing = FALSE
-ordered;function;function;base;x, ...
-outer;function;function;base;X, Y, FUN = "*", ...
-package.description;function;function;base;pkg, lib.loc = NULL, fields = NULL
-packageEvent;function;function;base;pkgname, event = c("onLoad", "attach", "detach", "onUnload")
-packageHasNamespace;function;function;base;package, package.lib
-.packages;function;function;base;all.available = FALSE, lib.loc = NULL
-packageStartupMessage;function;function;base;..., domain = NULL, appendLF = TRUE
-.packageStartupMessage;function;function;base;message, call = NULL
-$.package_version;function;function;base;x, name
-package_version;function;function;base;x, strict = TRUE
-packBits;function;function;base;x, type = c("raw", "integer")
-pairlist;function;function;base;...
-parent.env;function;function;base;env
-parent.env<-;function;function;base;env, value
-parent.frame;function;function;base;n = 1
-parse;function;function;base;file = "", n = NULL, text = NULL, prompt = "?", srcfile = NULL, 	encoding = "unknown"
-parse.dcf;function;function;base;text = NULL, file = "", fields = NULL, versionfix = FALSE
-parseNamespaceFile;function;function;base;package, package.lib, mustExist = TRUE
-paste;function;function;base;..., sep = " ", collapse = NULL
-path.expand;function;function;base;path
-.path.package;function;function;base;package = NULL, quiet = FALSE
-pentagamma;function;function;base;x
-pi;numeric;numeric;base;Not a function
-pipe;function;function;base;description, open = "", encoding = getOption("encoding")
-Platform;function;function;base;No arguments
-.Platform;list;list;base;Not a function
-.Platform$OS.type;character;character;base;Not a function
-.Platform$file.sep;character;character;base;Not a function
-.Platform$dynlib.ext;character;character;base;Not a function
-.Platform$GUI;unknown; ;base;Not a function
-.Platform$endian;unknown; ;base;Not a function
-.Platform$pkgType;unknown; ;base;Not a function
-.Platform$path.sep;character;character;base;Not a function
-.Platform$r_arch;unknown; ;base;Not a function
-pmatch;function;function;base;x, table, nomatch = NA_integer_, duplicates.ok = FALSE
-pmax;function;function;base;..., na.rm = FALSE
-pmax.int;function;function;base;..., na.rm = FALSE
-pmin;function;function;base;..., na.rm = FALSE
-pmin.int;function;function;base;..., na.rm = FALSE
-polyroot;function;function;base;z
-Position;function;function;base;f, x, right = FALSE, nomatch = NA_integer_
-.POSIXct;function;function;base;xx, tz = NULL
-[<-.POSIXct;function;function;base;x, ..., value
-[.POSIXct;function;function;base;x, ..., drop = TRUE
-[[.POSIXct;function;function;base;x, ..., drop = TRUE
-.POSIXlt;function;function;base;xx, tz = NULL
-[<-.POSIXlt;function;function;base;x, i, value
-[.POSIXlt;function;function;base;x, ..., drop = TRUE
--.POSIXt;function;function;base;e1, e2
-+.POSIXt;function;function;base;e1, e2
-pos.to.env;function;function;base;No arguments
-pretty;function;function;base;x, ...
-pretty.default;function;function;base;x, n = 5, min.n = n%/%3, shrink.sml = 0.75, high.u.bias = 1.5, 	u5.bias = 0.5 + 1.5 * high.u.bias, eps.correct = 0, ...
-prettyNum;function;function;base;x, big.mark = "", big.interval = 3L, small.mark = "", 	small.interval = 5L, decimal.mark = ".", preserve.width = c("common", 	    "individual", "none"), zero.print = NULL, drop0trailing = FALSE, 	is.cmplx = NA, ...
-.Primitive;function;function;base;No arguments
-.primTrace;function;function;base;No arguments
-.primUntrace;function;function;base;No arguments
-print;function;function;base;Generic Method
-print.AsIs;function;function;base;x, ...
-print.by;function;function;base;x, ..., vsep
-print.condition;function;function;base;x, ...
-print.connection;function;function;base;x, ...
-print.data.frame;function;function;base;x, ..., digits = NULL, quote = FALSE, right = TRUE, 	row.names = TRUE
-print.Date;function;function;base;x, ...
-print.default;function;function;base;x, digits = NULL, quote = TRUE, na.print = NULL, print.gap = NULL, 	right = FALSE, max = NULL, useSource = TRUE, ...
-print.difftime;function;function;base;x, digits = getOption("digits"), ...
-print.DLLInfo;function;function;base;x, ...
-print.DLLInfoList;function;function;base;x, ...
-print.DLLRegisteredRoutines;function;function;base;x, ...
-print.factor;function;function;base;x, quote = FALSE, max.levels = NULL, width = getOption("width"), 	...
-print.function;function;function;base;x, useSource = TRUE, ...
-print.hexmode;function;function;base;x, ...
-print.libraryIQR;function;function;base;x, ...
-print.listof;function;function;base;x, ...
-print.NativeRoutineList;function;function;base;x, ...
-printNoClass;function;function;base;x, digits = NULL, quote = TRUE, na.print = NULL, print.gap = NULL, 	right = FALSE, ...
-print.noquote;function;function;base;x, ...
-print.numeric_version;function;function;base;x, ...
-print.octmode;function;function;base;x, ...
-print.packageInfo;function;function;base;x, ...
-print.POSIXct;function;function;base;x, ...
-print.POSIXlt;function;function;base;x, ...
-print.proc_time;function;function;base;x, ...
-print.restart;function;function;base;x, ...
-print.rle;function;function;base;x, digits = getOption("digits"), prefix = "", ...
-print.simple.list;function;function;base;x, ...
-print.srcfile;function;function;base;x, ...
-print.srcref;function;function;base;x, useSource = TRUE, ...
-print.summaryDefault;function;function;base;x, ...
-print.summary.table;function;function;base;x, digits = max(1, getOption("digits") - 3), ...
-print.table;function;function;base;x, digits = getOption("digits"), quote = FALSE, na.print = "", 	zero.print = "0", justify = "none", ...
-print.warnings;function;function;base;x, ...
-prmatrix;function;function;base;x, rowlab = dn[[1]], collab = dn[[2]], quote = TRUE, 	right = FALSE, na.print = NULL, ...
-proc.time;function;function;base;No arguments
-prod;function;function;base;No arguments
-prop.table;function;function;base;x, margin = NULL
-provide;function;function;base;package
-psigamma;function;function;base;x, deriv = 0
-pushBack;function;function;base;data, connection, newLine = TRUE
-pushBackLength;function;function;base;connection
-q;function;function;base;save = "default", status = 0, runLast = TRUE
-qr;function;function;base;x, ...
-qr.coef;function;function;base;qr, y
-qr.default;function;function;base;x, tol = 1e-07, LAPACK = FALSE, ...
-qr.fitted;function;function;base;qr, y, k = qr$rank
-qr.Q;function;function;base;qr, complete = FALSE, Dvec = rep.int(if (cmplx) 1 + 	(0+0i) else 1, if (complete) dqr[1] else min(dqr))
-qr.qty;function;function;base;qr, y
-qr.qy;function;function;base;qr, y
-qr.R;function;function;base;qr, complete = FALSE
-qr.resid;function;function;base;qr, y
-qr.solve;function;function;base;a, b, tol = 1e-07
-qr.X;function;function;base;qr, complete = FALSE, ncol = if (complete) nrow(R) else min(dim(R))
-quarters;function;function;base;x, abbreviate
-quarters.Date;function;function;base;x, ...
-quarters.POSIXt;function;function;base;x, ...
-quit;function;function;base;save = "default", status = 0, runLast = TRUE
-quote;function;function;base;No arguments
-range;function;function;base;Generic Method
-range.default;function;function;base;..., na.rm = FALSE, finite = FALSE
-rank;function;function;base;x, na.last = TRUE, ties.method = c("average", "first", 	"random", "max", "min")
-rapply;function;function;base;object, f, classes = "ANY", deflt = NULL, how = c("unlist", 	"replace", "list"), ...
-raw;function;function;base;length = 0
-rawConnection;function;function;base;object, open = "r"
-rawConnectionValue;function;function;base;con
-rawShift;function;function;base;x, n
-rawToBits;function;function;base;x
-rawToChar;function;function;base;x, multiple = FALSE
-rbind;function;function;base;Generic Method
-rbind.data.frame;function;function;base;..., deparse.level = 1
-rcond;function;function;base;x, norm = c("O", "I", "1"), triangular = FALSE, ...
-Re;function;function;base;No arguments
-readBin;function;function;base;con, what, n = 1L, size = NA_integer_, signed = TRUE, 	endian = .Platform$endian
-readChar;function;function;base;con, nchars, useBytes = FALSE
-read.dcf;function;function;base;file, fields = NULL, all = FALSE
-readline;function;function;base;prompt = ""
-readLines;function;function;base;con = stdin(), n = -1L, ok = TRUE, warn = TRUE, encoding = "unknown"
-.readRDS;function;function;base;file, refhook = NULL
-readRenviron;function;function;base;path
-read.table.url;function;function;base;url, method, ...
-real;function;function;base;length = 0
-Recall;function;function;base;...
-Reduce;function;function;base;f, x, init, right = FALSE, accumulate = FALSE
-regexpr;function;function;base;pattern, text, ignore.case = FALSE, perl = FALSE, fixed = FALSE, 	useBytes = FALSE
-reg.finalizer;function;function;base;e, f, onexit = FALSE
-registerS3method;function;function;base;genname, class, method, envir = parent.frame()
-registerS3methods;function;function;base;info, package, env
-remove;function;function;base;..., list = character(0L), pos = -1, envir = as.environment(pos), 	inherits = FALSE
-removeCConverter;function;function;base;id
-removeTaskCallback;function;function;base;id
-rep;function;function;base;Generic Method
-rep.Date;function;function;base;x, ...
-repeat;flow-control;flow-control;base;Not a function
-rep.factor;function;function;base;x, ...
-rep.int;function;function;base;x, times
-replace;function;function;base;x, list, values
-replicate;function;function;base;n, expr, simplify = TRUE
-rep.numeric_version;function;function;base;x, ...
-rep.POSIXct;function;function;base;x, ...
-rep.POSIXlt;function;function;base;x, ...
-require;function;function;base;package, lib.loc = NULL, quietly = FALSE, warn.conflicts = TRUE, 	keep.source = getOption("keep.source.pkgs"), character.only = FALSE, 	save = FALSE
-restart;function;function;base;No arguments
-restartDescription;function;function;base;r
-restartFormals;function;function;base;r
-retracemem;function;function;base;No arguments
-return;function;function;base;No arguments
-rev;function;function;base;x
-rev.default;function;function;base;x
-R.home;function;function;base;component = "home"
-rle;function;function;base;x
-rm;function;function;base;..., list = character(0L), pos = -1, envir = as.environment(pos), 	inherits = FALSE
-RNGkind;function;function;base;kind = NULL, normal.kind = NULL
-RNGversion;function;function;base;vstr
-round;function;function;base;Generic Method
-round.Date;function;function;base;x, ...
-round.POSIXt;function;function;base;x, units = c("secs", "mins", "hours", "days")
-row;function;function;base;x, as.factor = FALSE
-rowMeans;function;function;base;x, na.rm = FALSE, dims = 1L
-rownames;function;function;base;x, do.NULL = TRUE, prefix = "row"
-row.names;function;function;base;x
-row.names<-;function;function;base;x, value
-rownames<-;function;function;base;x, value
-row.names<-.data.frame;function;function;base;x, value
-row.names.data.frame;function;function;base;x
-row.names<-.default;function;function;base;x, value
-row.names.default;function;function;base;x
-.row_names_info;function;function;base;x, type = 1L
-rowsum;function;function;base;x, group, reorder = TRUE, ...
-rowsum.data.frame;function;function;base;x, group, reorder = TRUE, na.rm = FALSE, ...
-rowsum.default;function;function;base;x, group, reorder = TRUE, na.rm = FALSE, ...
-rowSums;function;function;base;x, na.rm = FALSE, dims = 1L
-R_system_version;function;function;base;x, strict = TRUE
-R.version;simple.list;list;base;Not a function
-R.version$platform;character;character;base;Not a function
-R.version$arch;character;character;base;Not a function
-R.version$os;character;character;base;Not a function
-R.version$system;character;character;base;Not a function
-R.version$status;character;character;base;Not a function
-R.version$major;character;character;base;Not a function
-R.version$minor;character;character;base;Not a function
-R.version$year;character;character;base;Not a function
-R.version$month;character;character;base;Not a function
-R.version$day;character;character;base;Not a function
-R.version$svn rev;unknown; ;base;Not a function
-R.version$language;character;character;base;Not a function
-R.version$version.string;character;character;base;Not a function
-R.Version;function;function;base;No arguments
-R.version.string;character;character;base;Not a function
-.S3method;function;function;base;generic, class, method
-.__S3MethodsTable__.;environment; ;base;Not a function
-.S3PrimitiveGenerics;character;character;base;Not a function
-sample;function;function;base;x, size, replace = FALSE, prob = NULL
-sample.int;function;function;base;n, size = n, replace = FALSE, prob = NULL
-sapply;function;function;base;X, FUN, ..., simplify = TRUE, USE.NAMES = TRUE
-save;function;function;base;..., list = character(0L), file = stop("'file' must be specified"), 	ascii = FALSE, version = NULL, envir = parent.frame(), compress = !ascii, 	compression_level, eval.promises = TRUE, precheck = TRUE
-save.image;function;function;base;file = ".RData", version = NULL, ascii = FALSE, compress = !ascii, 	safe = TRUE
-.saveRDS;function;function;base;object, file = "", ascii = FALSE, version = NULL, compress = TRUE, 	refhook = NULL
-scale;function;function;base;x, center = TRUE, scale = TRUE
-scale.default;function;function;base;x, center = TRUE, scale = TRUE
-scan;function;function;base;file = "", what = double(0), nmax = -1, n = -1, sep = "", 	quote = if (identical(sep, "\n")) "" else "'\"", dec = ".", 	skip = 0, nlines = 0, na.strings = "NA", flush = FALSE, fill = FALSE, 	strip.white = FALSE, quiet = FALSE, blank.lines.skip = TRUE, 	multi.line = TRUE, comment.char = "", allowEscapes = FALSE, 	fileEncoding = "", encoding = "unknown"
-scan.url;function;function;base;url, file = tempfile(), method, ...
-.Script;function;function;base;interpreter, script, args, ...
-search;function;function;base;No arguments
-searchpaths;function;function;base;No arguments
-seek;function;function;base;con, ...
-seek.connection;function;function;base;con, where = NA, origin = "start", rw = "", ...
-seq;function;function;base;Generic Method
-seq_along;function;function;base;No arguments
-seq.Date;function;function;base;from, to, by, length.out = NULL, along.with = NULL, 	...
-seq.default;function;function;base;from = 1, to = 1, by = ((to - from)/(length.out - 1)), 	length.out = NULL, along.with = NULL, ...
-seq.int;function;function;base;No arguments
-seq_len;function;function;base;No arguments
-seq.POSIXt;function;function;base;from, to, by, length.out = NULL, along.with = NULL, 	...
-sequence;function;function;base;nvec
-serialize;function;function;base;object, connection, ascii = FALSE, refhook = NULL
-setCConverterStatus;function;function;base;id, status
-setdiff;function;function;base;x, y
-setequal;function;function;base;x, y
-setHook;function;function;base;hookName, value, action = c("append", "prepend", "replace")
-setNamespaceInfo;function;function;base;ns, which, val
-.set_row_names;function;function;base;n
-set.seed;function;function;base;seed, kind = NULL, normal.kind = NULL
-setSessionTimeLimit;function;function;base;cpu = Inf, elapsed = Inf
-setTimeLimit;function;function;base;cpu = Inf, elapsed = Inf, transient = FALSE
-setwd;function;function;base;dir
-showConnections;function;function;base;all = FALSE
-shQuote;function;function;base;string, type = c("sh", "csh", "cmd")
-sign;function;function;base;No arguments
-signalCondition;function;function;base;cond
-.signalSimpleWarning;function;function;base;msg, call
-signif;function;function;base;No arguments
-simpleCondition;function;function;base;message, call = NULL
-simpleError;function;function;base;message, call = NULL
-[.simple.list;function;function;base;x, i, ...
-simpleMessage;function;function;base;message, call = NULL
-simpleWarning;function;function;base;message, call = NULL
-sin;function;function;base;No arguments
-single;function;function;base;length = 0
-sinh;function;function;base;No arguments
-sink;function;function;base;file = NULL, append = FALSE, type = c("output", "message"), 	split = FALSE
-sink.number;function;function;base;type = c("output", "message")
-slice.index;function;function;base;x, MARGIN
-socketConnection;function;function;base;host = "localhost", port, server = FALSE, blocking = FALSE, 	open = "a+", encoding = getOption("encoding")
-socketSelect;function;function;base;socklist, write = FALSE, timeout = NULL
-solve;function;function;base;Generic Method
-solve.default;function;function;base;a, b, tol = ifelse(LINPACK, 1e-07, .Machine$double.eps), 	LINPACK = FALSE, ...
-solve.qr;function;function;base;a, b, ...
-sort;function;function;base;x, decreasing = FALSE, ...
-sort.default;function;function;base;x, decreasing = FALSE, na.last = NA, ...
-sort.int;function;function;base;x, partial = NULL, na.last = NA, decreasing = FALSE, 	method = c("shell", "quick"), index.return = FALSE
-sort.list;function;function;base;x, partial = NULL, na.last = TRUE, decreasing = FALSE, 	method = c("shell", "quick", "radix")
-sort.POSIXlt;function;function;base;x, decreasing = FALSE, na.last = NA, ...
-source;function;function;base;file, local = FALSE, echo = verbose, print.eval = echo, 	verbose = getOption("verbose"), prompt.echo = getOption("prompt"), 	max.deparse.length = 150, chdir = FALSE, encoding = getOption("encoding"), 	continue.echo = getOption("continue"), skip.echo = 0, keep.source = getOption("keep.source")
-source.url;function;function;base;url, file = tempfile(), method, ...
-split;function;function;base;x, f, drop = FALSE, ...
-split<-;function;function;base;x, f, drop = FALSE, ..., value
-split<-.data.frame;function;function;base;x, f, drop = FALSE, ..., value
-split.data.frame;function;function;base;x, f, drop = FALSE, ...
-split.Date;function;function;base;x, f, drop = FALSE, ...
-split<-.default;function;function;base;x, f, drop = FALSE, ..., value
-split.default;function;function;base;x, f, drop = FALSE, ...
-split.POSIXct;function;function;base;x, f, drop = FALSE, ...
-sprintf;function;function;base;fmt, ...
-sqrt;function;function;base;No arguments
-sQuote;function;function;base;x
-srcfile;function;function;base;filename, encoding = getOption("encoding"), Enc = "unknown"
-srcfilecopy;function;function;base;filename, lines
-srcref;function;function;base;srcfile, lloc
-standardGeneric;function;function;base;No arguments
-.standard_regexps;function;function;base;No arguments
-stderr;function;function;base;No arguments
-stdin;function;function;base;No arguments
-stdout;function;function;base;No arguments
-stop;function;function;base;..., call. = TRUE, domain = NULL
-stopifnot;function;function;base;...
-storage.mode;function;function;base;x
-storage.mode<-;function;function;base;No arguments
-strftime;function;function;base;x, format = "", tz = "", usetz = FALSE, ...
-strptime;function;function;base;x, format, tz = ""
-strsplit;function;function;base;x, split, fixed = FALSE, perl = FALSE, useBytes = FALSE
-strtoi;function;function;base;x, base = 0L
-strtrim;function;function;base;x, width
-structure;function;function;base;.Data, ...
-strwrap;function;function;base;x, width = 0.9 * getOption("width"), indent = 0, exdent = 0, 	prefix = "", simplify = TRUE, initial = prefix
-sub;function;function;base;pattern, replacement, x, ignore.case = FALSE, perl = FALSE, 	fixed = FALSE, useBytes = FALSE
-subset;function;function;base;x, ...
-.subset;function;function;base;No arguments
-.subset2;function;function;base;No arguments
-subset.data.frame;function;function;base;x, subset, select, drop = FALSE, ...
-subset.default;function;function;base;x, subset, ...
-subset.matrix;function;function;base;x, subset, select, drop = FALSE, ...
-substitute;function;function;base;No arguments
-substr;function;function;base;x, start, stop
-substr<-;function;function;base;x, start, stop, value
-substring;function;function;base;text, first, last = 1000000L
-substring<-;function;function;base;text, first, last = 1000000L, value
-sum;function;function;base;No arguments
-summary;function;function;base;Generic Method
-summary.connection;function;function;base;object, ...
-summary.data.frame;function;function;base;object, maxsum = 7, digits = max(3, getOption("digits") - 	3), ...
-Summary.data.frame;function;function;base;..., na.rm
-summary.Date;function;function;base;object, digits = 12, ...
-Summary.Date;function;function;base;..., na.rm
-summary.default;function;function;base;object, ..., digits = max(3, getOption("digits") - 	3)
-Summary.difftime;function;function;base;..., na.rm
-summary.factor;function;function;base;object, maxsum = 100, ...
-Summary.factor;function;function;base;..., na.rm
-summary.matrix;function;function;base;object, ...
-Summary.numeric_version;function;function;base;..., na.rm
-summary.POSIXct;function;function;base;object, digits = 15, ...
-Summary.POSIXct;function;function;base;..., na.rm
-summary.POSIXlt;function;function;base;object, digits = 15, ...
-Summary.POSIXlt;function;function;base;..., na.rm
-summary.srcfile;function;function;base;object, ...
-summary.srcref;function;function;base;object, useSource = FALSE, ...
-summary.table;function;function;base;object, ...
-suppressMessages;function;function;base;expr
-suppressPackageStartupMessages;function;function;base;expr
-suppressWarnings;function;function;base;expr
-svd;function;function;base;x, nu = min(n, p), nv = min(n, p), LINPACK = FALSE
-sweep;function;function;base;x, MARGIN, STATS, FUN = "-", check.margin = TRUE, ...
-switch;function;function;base;No arguments
-symbol.C;function;function;base;name
-symbol.For;function;function;base;name
-sys.call;function;function;base;which = 0
-sys.calls;function;function;base;No arguments
-Sys.chmod;function;function;base;paths, mode = "0777"
-Sys.Date;function;function;base;No arguments
-sys.frame;function;function;base;which = 0
-sys.frames;function;function;base;No arguments
-sys.function;function;function;base;which = 0
-Sys.getenv;function;function;base;x = NULL, unset = ""
-Sys.getlocale;function;function;base;category = "LC_ALL"
-Sys.getpid;function;function;base;No arguments
-Sys.glob;function;function;base;paths, dirmark = FALSE
-Sys.info;function;function;base;No arguments
-sys.load.image;function;function;base;name, quiet
-Sys.localeconv;function;function;base;No arguments
-sys.nframe;function;function;base;No arguments
-sys.on.exit;function;function;base;No arguments
-sys.parent;function;function;base;n = 1
-sys.parents;function;function;base;No arguments
-Sys.putenv;function;function;base;...
-Sys.readlink;function;function;base;paths
-sys.save.image;function;function;base;name
-Sys.setenv;function;function;base;...
-Sys.setlocale;function;function;base;category = "LC_ALL", locale = ""
-Sys.sleep;function;function;base;time
-sys.source;function;function;base;file, envir = baseenv(), chdir = FALSE, keep.source = getOption("keep.source.pkgs")
-sys.status;function;function;base;No arguments
-system;function;function;base;command, intern = FALSE, ignore.stdout = FALSE, ignore.stderr = FALSE, 	wait = TRUE, input = NULL, show.output.on.console = TRUE, 	minimized = FALSE, invisible = TRUE
-system2;function;function;base;command, args = character(), stdout = "", stderr = "", 	stdin = "", input = NULL, env = character(), wait = TRUE, 	minimized = FALSE, invisible = TRUE
-system.file;function;function;base;..., package = "base", lib.loc = NULL
-system.time;function;function;base;expr, gcFirst = TRUE
-Sys.time;function;function;base;No arguments
-Sys.timezone;function;function;base;No arguments
-Sys.umask;function;function;base;mode = "0000"
-Sys.unsetenv;function;function;base;x
-Sys.which;function;function;base;names
-t;function;function;base;Generic Method
-T;logical;logical;base;Not a function
-table;function;function;base;..., exclude = if (useNA == "no") c(NA, NaN), useNA = c("no", 	"ifany", "always"), dnn = list.names(...), deparse.level = 1
-tabulate;function;function;base;bin, nbins = max(1L, bin, na.rm = TRUE)
-tan;function;function;base;No arguments
-tanh;function;function;base;No arguments
-.TAOCP1997init;function;function;base;seed
-tapply;function;function;base;X, INDEX, FUN = NULL, ..., simplify = TRUE
-taskCallbackManager;function;function;base;handlers = list(), registered = FALSE, verbose = FALSE
-tcrossprod;function;function;base;x, y = NULL
-t.data.frame;function;function;base;x
-t.default;function;function;base;x
-tempdir;function;function;base;No arguments
-tempfile;function;function;base;pattern = "file", tmpdir = tempdir()
-testPlatformEquivalence;function;function;base;built, run
-tetragamma;function;function;base;x
-textConnection;function;function;base;object, open = "r", local = FALSE, encoding = c("", 	"bytes", "UTF-8")
-textConnectionValue;function;function;base;con
-tolower;function;function;base;x
-topenv;function;function;base;envir = parent.frame(), matchThisEnv = getOption("topLevelEnvironment")
-toString;function;function;base;x, ...
-toString.default;function;function;base;x, width = NULL, ...
-toupper;function;function;base;x
-trace;function;function;base;what, tracer, exit, at, print, signature, where = topenv(parent.frame()), 	edit = FALSE
-traceback;function;function;base;x = NULL, max.lines = getOption("deparse.max.lines")
-tracemem;function;function;base;No arguments
-tracingState;function;function;base;on = NULL
-transform;function;function;base;`_data`, ...
-transform.data.frame;function;function;base;`_data`, ...
-transform.default;function;function;base;`_data`, ...
-trigamma;function;function;base;No arguments
-trunc;function;function;base;Generic Method
-truncate;function;function;base;con, ...
-truncate.connection;function;function;base;con, ...
-trunc.Date;function;function;base;x, ...
-trunc.POSIXt;function;function;base;x, units = c("secs", "mins", "hours", "days"), ...
-try;function;function;base;expr, silent = FALSE
-tryCatch;function;function;base;expr, ..., finally
-typeof;function;function;base;x
-unclass;function;function;base;No arguments
-undebug;function;function;base;fun
-union;function;function;base;x, y
-unique;function;function;base;x, incomparables = FALSE, ...
-unique.array;function;function;base;x, incomparables = FALSE, MARGIN = 1, fromLast = FALSE, 	...
-unique.data.frame;function;function;base;x, incomparables = FALSE, fromLast = FALSE, ...
-unique.default;function;function;base;x, incomparables = FALSE, fromLast = FALSE, ...
-unique.matrix;function;function;base;x, incomparables = FALSE, MARGIN = 1, fromLast = FALSE, 	...
-unique.numeric_version;function;function;base;x, incomparables = FALSE, ...
-unique.POSIXlt;function;function;base;x, incomparables = FALSE, ...
-units;function;function;base;x
-units<-;function;function;base;x, value
-units<-.difftime;function;function;base;x, value
-units.difftime;function;function;base;x
-unix;function;function;base;call, intern = FALSE
-unix.time;function;function;base;expr, gcFirst = TRUE
-unlink;function;function;base;x, recursive = FALSE
-unlist;function;function;base;Generic Method
-unloadNamespace;function;function;base;ns
-unlockBinding;function;function;base;sym, env
-unname;function;function;base;obj, force = FALSE
-unserialize;function;function;base;connection, refhook = NULL
-unsplit;function;function;base;value, f, drop = FALSE
-untrace;function;function;base;what, signature = NULL, where = topenv(parent.frame())
-untracemem;function;function;base;No arguments
-unz;function;function;base;description, filename, open = "", encoding = getOption("encoding")
-upper.tri;function;function;base;x, diag = FALSE
-url;function;function;base;description, open = "", blocking = TRUE, encoding = getOption("encoding")
-UseMethod;function;function;base;No arguments
-.userHooksEnv;environment; ;base;Not a function
-utf8ToInt;function;function;base;x
-vapply;function;function;base;X, FUN, FUN.VALUE, ..., USE.NAMES = TRUE
-vector;function;function;base;mode = "logical", length = 0
-Vectorize;function;function;base;FUN, vectorize.args = arg.names, SIMPLIFY = TRUE, USE.NAMES = TRUE
-version;simple.list;list;base;Not a function
-version$platform;character;character;base;Not a function
-version$arch;character;character;base;Not a function
-version$os;character;character;base;Not a function
-version$system;character;character;base;Not a function
-version$status;character;character;base;Not a function
-version$major;character;character;base;Not a function
-version$minor;character;character;base;Not a function
-version$year;character;character;base;Not a function
-version$month;character;character;base;Not a function
-version$day;character;character;base;Not a function
-version$svn rev;unknown; ;base;Not a function
-version$language;character;character;base;Not a function
-version$version.string;character;character;base;Not a function
-Version;function;function;base;No arguments
-warning;function;function;base;..., call. = TRUE, immediate. = FALSE, domain = NULL
-warnings;function;function;base;...
-weekdays;function;function;base;x, abbreviate
-weekdays.Date;function;function;base;x, abbreviate = FALSE
-weekdays.POSIXt;function;function;base;x, abbreviate = FALSE
-which;function;function;base;x, arr.ind = FALSE, useNames = TRUE
-which.max;function;function;base;x
-which.min;function;function;base;x
-while;flow-control;flow-control;base;Not a function
-with;function;function;base;data, expr, ...
-withCallingHandlers;function;function;base;expr, ...
-with.default;function;function;base;data, expr, ...
-within;function;function;base;data, expr, ...
-within.data.frame;function;function;base;data, expr, ...
-within.list;function;function;base;data, expr, ...
-withRestarts;function;function;base;expr, ...
-withVisible;function;function;base;x
-write;function;function;base;x, file = "data", ncolumns = if (is.character(x)) 1 else 5, 	append = FALSE, sep = " "
-writeBin;function;function;base;object, con, size = NA_integer_, endian = .Platform$endian, 	useBytes = FALSE
-writeChar;function;function;base;object, con, nchars = nchar(object, type = "chars"), 	eos = "", useBytes = FALSE
-write.dcf;function;function;base;x, file = "", append = FALSE, indent = 0.1 * getOption("width"), 	width = 0.9 * getOption("width")
-writeLines;function;function;base;text, con = stdout(), sep = "\n", useBytes = FALSE
-write.table0;function;function;base;x, file = "", append = FALSE, quote = TRUE, sep = " ", 	eol = "\n", na = "NA", dec = ".", row.names = TRUE, col.names = TRUE, 	qmethod = c("escape", "double")
-%x%;function;function;base;X, Y
-xor;function;function;base;x, y
-xor.hexmode;function;function;base;a, b
-xor.octmode;function;function;base;a, b
-xpdrows.data.frame;function;function;base;x, old.rows, new.rows
-xtfrm;function;function;base;Generic Method
-xtfrm.AsIs;function;function;base;x
-xtfrm.Date;function;function;base;x
-xtfrm.default;function;function;base;x
-xtfrm.difftime;function;function;base;x
-xtfrm.factor;function;function;base;x
-xtfrm.numeric_version;function;function;base;x
-xtfrm.POSIXct;function;function;base;x
-xtfrm.POSIXlt;function;function;base;x
-xtfrm.Surv;function;function;base;x
-xzfile;function;function;base;description, open = "", encoding = getOption("encoding"), 	compression = 6
-zapsmall;function;function;base;x, digits = getOption("digits")
diff --git a/r-plugin/osx.vim b/r-plugin/osx.vim
new file mode 100644
index 0000000..70119f6
--- /dev/null
+++ b/r-plugin/osx.vim
@@ -0,0 +1,51 @@
+" This file contains code used only on OS X
+
+function StartR_OSX()
+    if IsSendCmdToRFake()
+        return
+    endif
+    if g:rplugin_r64app && g:vimrplugin_i386 == 0
+        let rcmd = "/Applications/R64.app"
+    else
+        let rcmd = "/Applications/R.app"
+    endif
+
+    if b:rplugin_r_args != " "
+        " https://github.com/jcfaria/Vim-R-plugin/issues/63
+        " https://stat.ethz.ch/pipermail/r-sig-mac/2013-February/009978.html
+        call RWarningMsg('R.app does not support command line arguments. To pass "' . b:rplugin_r_args . '" to R, you must run it in a console. Set "vimrplugin_applescript = 0"')
+    endif
+    let rlog = system("open " . rcmd)
+    if v:shell_error
+        call RWarningMsg(rlog)
+    endif
+    let g:SendCmdToR = function('SendCmdToR_OSX')
+    if WaitVimComStart()
+        if g:vimrplugin_after_start != ''
+            call system(g:vimrplugin_after_start)
+        endif
+    endif
+endfunction
+
+function SendCmdToR_OSX(cmd)
+    if g:vimrplugin_ca_ck
+        let cmd = "\001" . "\013" . a:cmd
+    else
+        let cmd = a:cmd
+    endif
+
+    if g:rplugin_r64app && g:vimrplugin_i386 == 0
+        let rcmd = "R64"
+    else
+        let rcmd = "R"
+    endif
+
+    " for some reason it doesn't like "\025"
+    let cmd = a:cmd
+    let cmd = substitute(cmd, "\\", '\\\', 'g')
+    let cmd = substitute(cmd, '"', '\\"', "g")
+    let cmd = substitute(cmd, "'", "'\\\\''", "g")
+    call system("osascript -e 'tell application \"".rcmd."\" to cmd \"" . cmd . "\"'")
+    return 1
+endfunction
+
diff --git a/r-plugin/r.snippets b/r-plugin/r.snippets
index b135851..4da1600 100644
--- a/r-plugin/r.snippets
+++ b/r-plugin/r.snippets
@@ -4,30 +4,30 @@ snippet li
 # If Condition
 snippet if
 	if(${1:condition}){
-	  ${2:}
+	    ${2:}
 	}
 snippet el
 	else {
-	  ${1:}
+	    ${1:}
 	}
 snippet wh
 	while(${1:condition}){
-	  ${2:}
+	    ${2:}
 	}
 # For Loop
 snippet for
 	for(${1:i} in ${2:range}){
-	  ${3:}
+	    ${3:}
 	}
 # Function
 snippet fun
 	${1:funname} <- function(${2:})
 	{
-	  ${3:}
+	    ${3:}
 	}
 # repeat
 snippet re
 	repeat{
-	  ${2:}
-	  if(${1:condition}) break
+	    ${2:}
+	    if(${1:condition}) break
 	}
diff --git a/r-plugin/rmd.snippets b/r-plugin/rmd.snippets
new file mode 100644
index 0000000..577d7e4
--- /dev/null
+++ b/r-plugin/rmd.snippets
@@ -0,0 +1,205 @@
+#
+# Snipmate Snippets for Pandoc Markdown
+#
+# Many snippets have starred versions, i.e., versions
+# that end with an asterisk (`*`). These snippets use
+# vim's `"*` register---i.e., the contents of the 
+# system clipboard---to insert text.
+
+# Insert Title Block
+snippet %%
+	% ${1:`Filename('', 'title')`}
+	% ${2:`g:snips_author`}
+	% ${3:`strftime("%d %B %Y")`}
+
+	${4}
+snippet %%*
+	% ${1:`Filename('', @*)`}
+	% ${2:`g:snips_author`}
+	% ${3:`strftime("%d %b %Y")`}
+
+	${4}
+
+# Insert Definition List
+snippet ::
+	${1:term}
+	  ~  ${2:definition}
+
+# Underline with `=`s or `-`s
+snippet ===
+	`repeat('=', strlen(getline(line(".") - 1)))`
+	
+	${1}
+snippet ---
+	`repeat('-', strlen(getline(line(".") - 1)))`
+	
+	${1}
+
+# Links and their kin
+# -------------------
+#
+# (These don't play very well with delimitMate)
+#
+
+snippet [
+	[${1:link}](http://${2:url} "${3:title}")${4}
+snippet [*
+	[${1:link}](${2:`@*`} "${3:title}")${4}
+
+snippet [:
+	[${1:id}]: http://${2:url} "${3:title}"
+snippet [:*
+	[${1:id}]: ${2:`@*`} "${3:title}"
+
+snippet [@
+	[${1:link}](mailto:${2:email})${3}
+snippet [@*
+	[${1:link}](mailto:${2:`@*`})${3}
+
+snippet [:@
+	[${1:id}]: mailto:${2:email} "${3:title}"
+snippet [:@*
+	[${1:id}]: mailto:${2:`@*`} "${3:title}"
+
+snippet ![
+	![${1:alt}](${2:url} "${3:title}")${4}
+snippet ![*
+	![${1:alt}](${2:`@*`} "${3:title}")${4}
+
+snippet ![:
+	![${1:id}]: ${2:url} "${3:title}"
+snippet ![:*
+	![${1:id}]: ${2:`@*`} "${3:title}"
+
+snippet [^:
+	[^${1:id}]: ${2:note}
+snippet [^:*
+	[^${1:id}]: ${2:`@*`}
+
+# 
+
+# library()
+snippet req
+	require(${1:}, quietly = TRUE)
+# If Condition
+snippet if
+	if ( ${1:condition} ) 
+	{ 
+		${2:} 
+	}
+snippet el
+	else 
+	{ 
+		${1:} 
+	}
+
+# Function
+snippet fun
+	${1:funname} <- 			# ${2:}
+		function
+	(
+	 	${3:}
+	) 
+	{
+	  ${4:}
+	}
+# repeat
+snippet re
+	repeat{
+	  ${2:}
+	  if(${1:condition}) break
+	}
+
+# matrix
+snippet ma
+	matrix(NA, nrow = ${1:}, ncol = ${2:})
+
+# data frame
+snippet df
+	data.frame(${1:}, header = TRUE)
+
+snippet cmdarg
+	args <- commandArgs(TRUE)
+	if (length(args) == 0)
+	    stop("Please give ${1:}!")
+	if (!all(file.exists(args)))
+	     stop("Couln't find input files!") 
+
+snippet getopt
+	require('getopt', quietly = TRUE)
+	opt_spec <- matrix(c(
+					'help',     'h', 0, "logical", 	"Getting help",
+					'file',     'f', 1, "character","File to process" 
+	                ), ncol = 5, byrow = TRUE)
+	opt <- getopt(spec = opt_spec)
+	if ( !is.null(opt$help) || is.null(commandArgs()) )   {    
+	    cat(getopt(spec = opt_spec, usage = TRUE, command = "yourCmd"))
+	    q(status=0)
+	}
+	# some inital value
+	if ( is.null(opt$???) )    { opt$??? <- ??? }
+
+snippet optparse
+	require("optparse", quietly = TRUE)
+	option_list <- 
+	    list(make_option(c("-n", "--add_numbers"), action="store_true", default=FALSE,
+	                     help="Print line number at the beginning of each line [default]")
+	         )
+	parser <- OptionParser(usage = "%prog [options] file", option_list=option_list)
+	arguments <- parse_args(parser, positional_arguments = TRUE)
+	opt <- arguments$options
+	
+	if(length(arguments$args) != 1) {
+	    cat("Incorrect number of required positional arguments\n\n")
+	    print_help(parser)
+	    stop()
+	} else {
+	    file <- arguments$args
+	}
+	
+	if( file.access(file) == -1) {
+	    stop(sprintf("Specified file ( %s ) does not exist", file))
+	} else {
+	    file_text <- readLines(file)
+	}
+
+snippet #!
+	#!/usr/bin/env Rscript
+
+snippet debug
+	# Development & Debugging, don't forget to uncomment afterwards!
+	#--------------------------------------------------------------------------------
+	#setwd("~/Projekte/${1:}")
+	#opt <- list(${2:}
+	#            )
+	#--------------------------------------------------------------------------------
+
+
+# Took from pandoc-plugin <<<<
+# Underline with `=`s or `-`s
+snippet #===
+	#`repeat('=', strlen(getline(line(".") - 1)))`
+	${1}
+snippet #---
+	#`repeat('-', strlen(getline(line(".") - 1)))`
+	${1}
+
+# >>>>
+
+snippet r
+	\`\`\`{r ${1:chung_tag}, echo = FALSE ${2:options}}
+	${3:}
+	\`\`\`
+snippet ri
+	\`{r ${1:}}\`
+
+snippet copt
+	\`\`\` {r setup, echo = FALSE}
+		opts_chunk$set(fig.path='../figures/${1:}', cache.path='../cache/-'
+		, fig.align='center', fig.show='hold', par=TRUE)	
+		#opts_knit$set(upload.fun = imgur_upload) # upload images
+	\`\`\`
+
+	
+# End of File ===================================================================
+# vim: set noexpandtab:
diff --git a/r-plugin/setcompldir.vim b/r-plugin/setcompldir.vim
new file mode 100644
index 0000000..b6557d4
--- /dev/null
+++ b/r-plugin/setcompldir.vim
@@ -0,0 +1,77 @@
+
+" g:rplugin_home should be the directory where the r-plugin files are.  For
+" users following the installation instructions it will be at ~/.vim or
+" ~/vimfiles, that is, the same value of g:rplugin_uservimfiles. However the
+" variables will have different values if the plugin is installed somewhere
+" else in the runtimepath.
+let g:rplugin_home = expand(":h:h")
+
+" g:rplugin_uservimfiles must be a writable directory. It will be g:rplugin_home
+" unless it's not writable. Then it wil be ~/.vim or ~/vimfiles.
+if filewritable(g:rplugin_home) == 2
+    let g:rplugin_uservimfiles = g:rplugin_home
+else
+    let g:rplugin_uservimfiles = split(&runtimepath, ",")[0]
+endif
+
+" From changelog.vim, with bug fixed by "Si" ("i5ivem")
+" Windows logins can include domain, e.g: 'DOMAIN\Username', need to remove
+" the backslash from this as otherwise cause file path problems.
+if executable("whoami")
+    let g:rplugin_userlogin = substitute(system('whoami'), "\\", "-", "")
+elseif $USER != ""
+    let g:rplugin_userlogin = $USER
+else
+    call RWarningMsgInp("Could not determine user name.")
+    let g:rplugin_failed = 1
+    finish
+endif
+
+if v:shell_error
+    let g:rplugin_userlogin = 'unknown'
+else
+    let newuline = stridx(g:rplugin_userlogin, "\n")
+    if newuline != -1
+        let g:rplugin_userlogin = strpart(g:rplugin_userlogin, 0, newuline)
+    endif
+    unlet newuline
+endif
+
+if has("win32") || has("win64")
+    let g:rplugin_home = substitute(g:rplugin_home, "\\", "/", "g")
+    let g:rplugin_uservimfiles = substitute(g:rplugin_uservimfiles, "\\", "/", "g")
+    if $USERNAME != ""
+        let g:rplugin_userlogin = substitute($USERNAME, " ", "", "g")
+    endif
+endif
+
+if exists("g:vimrplugin_compldir")
+    let g:rplugin_compldir = expand(g:vimrplugin_compldir)
+elseif (has("win32") || has("win64")) && $AppData != "" && isdirectory($AppData)
+    let g:rplugin_compldir = $AppData . "\\Vim-R-plugin"
+elseif $XDG_CACHE_HOME != "" && isdirectory($XDG_CACHE_HOME)
+    let g:rplugin_compldir = $XDG_CACHE_HOME . "/Vim-R-plugin"
+elseif isdirectory(expand("~/.cache"))
+    let g:rplugin_compldir = expand("~/.cache/Vim-R-plugin")
+elseif isdirectory(expand("~/Library/Caches"))
+    let g:rplugin_compldir = expand("~/Library/Caches/Vim-R-plugin")
+else
+    let g:rplugin_compldir = g:rplugin_uservimfiles . "/r-plugin/objlist/"
+endif
+
+" Create the directory if it doesn't exist yet
+if !isdirectory(g:rplugin_compldir)
+    call mkdir(g:rplugin_compldir, "p")
+    if !filereadable(g:rplugin_compldir . "/README")
+        let readme = ['The omnils_ and fun_ files in this directory are generated by Vim-R-plugin',
+                    \ 'and vimcom and are used for omni completion and syntax highlight.',
+                    \ '',
+                    \ 'When you load a new version of a library, their files are replaced.',
+                    \ '',
+                    \ 'You should manually delete files corresponding to libraries that you no',
+                    \ 'longer use.']
+        call writefile(readme, g:rplugin_compldir . "/README")
+    endif
+endif
+let $VIMR_COMPLDIR = g:rplugin_compldir
+
diff --git a/r-plugin/specialfuns.R b/r-plugin/specialfuns.R
deleted file mode 100644
index f546db2..0000000
--- a/r-plugin/specialfuns.R
+++ /dev/null
@@ -1,56 +0,0 @@
-#  This program is free software; you can redistribute it and/or modify
-#  it under the terms of the GNU General Public License as published by
-#  the Free Software Foundation; either version 2 of the License, or
-#  (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  A copy of the GNU General Public License is available at
-#  http://www.r-project.org/Licenses/
-
-### Jakson Alves de Aquino
-### Sat, July 17, 2010
-
-
-.vim.list.args <- function(ff){
-    knownGenerics <- c(names(.knownS3Generics),
-                       tools:::.get_internal_S3_generics()) # from methods()
-    ff <- deparse(substitute(ff))
-    keyf <- paste("^", ff, "$", sep="")
-    is.generic <- (length(grep(keyf, knownGenerics)) > 0)
-    if(is.generic){
-        mm <- methods(ff)
-        l <- length(mm)
-        if(l > 0){
-            for(i in 1:l){
-                if(exists(mm[i])){
-                    cat(ff, "[method ", mm[i], "]:\n", sep="")
-                    print(args(mm[i]))
-                    cat("\n")
-                }
-            }
-            return(invisible(NULL))
-        }
-    }
-    print(args(ff))
-}
-
-
-.vim.plot <- function(x)
-{
-    xname <- deparse(substitute(x))
-    if(length(grep("numeric", class(x))) > 0){
-        oldpar <- par(no.readonly = TRUE)
-        par(mfrow = c(2, 1))
-        hist(x, col = "lightgray", main = paste("Histogram of", xname), xlab = xname)
-        boxplot(x, main = paste("Boxplot of", xname),
-                col = "lightgray", horizontal = TRUE)
-        par(oldpar)
-    } else {
-        plot(x)
-    }
-}
-
diff --git a/r-plugin/synctex_evince_backward.py b/r-plugin/synctex_evince_backward.py
new file mode 100644
index 0000000..e0cf0a3
--- /dev/null
+++ b/r-plugin/synctex_evince_backward.py
@@ -0,0 +1,130 @@
+
+# The code in this files is borrowed from Gedit Synctex plugin.
+#
+# Copyright (C) 2010 Jose Aliste
+#
+# This program is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public Licence as published by the Free Software
+# Foundation; either version 2 of the Licence, or (at your option) any later
+# version.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU General Public Licence for more
+# details.
+#
+# You should have received a copy of the GNU General Public Licence along with
+# this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
+# Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+# Modified to Vim-R-plugin by Jakson Aquino
+
+import dbus, subprocess, time
+import dbus.mainloop.glib, sys, os, signal
+from gi.repository import GObject
+
+RUNNING, CLOSED = range(2)
+
+EV_DAEMON_PATH = "/org/gnome/evince/Daemon"
+EV_DAEMON_NAME = "org.gnome.evince.Daemon"
+EV_DAEMON_IFACE = "org.gnome.evince.Daemon"
+
+EVINCE_PATH = "/org/gnome/evince/Evince"
+EVINCE_IFACE = "org.gnome.evince.Application"
+
+EV_WINDOW_IFACE = "org.gnome.evince.Window"
+
+class EvinceWindowProxy:
+    """A DBUS proxy for an Evince Window."""
+    daemon = None
+    bus = None
+
+    def __init__(self, uri, spawn = False):
+        self.uri = uri
+        self.spawn = spawn
+        self.status = CLOSED
+        self.dbus_name = ''
+        self._handler = None
+        try:
+            if EvinceWindowProxy.bus is None:
+                EvinceWindowProxy.bus = dbus.SessionBus()
+
+            if EvinceWindowProxy.daemon is None:
+                EvinceWindowProxy.daemon = EvinceWindowProxy.bus.get_object(EV_DAEMON_NAME,
+                                                EV_DAEMON_PATH,
+                                                follow_name_owner_changes=True)
+            EvinceWindowProxy.bus.add_signal_receiver(self._on_doc_loaded, signal_name="DocumentLoaded", 
+                                                      dbus_interface = EV_WINDOW_IFACE, 
+                                                      sender_keyword='sender')
+            self._get_dbus_name(False)
+
+        except dbus.DBusException:
+            sys.stderr.write("Could not connect to the Evince Daemon")
+            sys.stderr.flush()
+            loop.quit()
+
+    def _on_doc_loaded(self, uri, **keyargs):
+        if uri == self.uri and self._handler is None:
+            self.handle_find_document_reply(keyargs['sender'])
+        
+    def _get_dbus_name(self, spawn):
+        EvinceWindowProxy.daemon.FindDocument(self.uri,spawn,
+                     reply_handler=self.handle_find_document_reply,
+                     error_handler=self.handle_find_document_error,
+                     dbus_interface = EV_DAEMON_IFACE)
+
+    def handle_find_document_error(self, error):
+        sys.stderr.write("FindDocument DBus call has failed")
+        sys.stderr.flush()
+
+    def handle_find_document_reply(self, evince_name):
+        if self._handler is not None:
+            handler = self._handler
+        else:
+            handler = self.handle_get_window_list_reply
+        if evince_name != '':
+            self.dbus_name = evince_name
+            self.status = RUNNING
+            self.evince = EvinceWindowProxy.bus.get_object(self.dbus_name, EVINCE_PATH)
+            self.evince.GetWindowList(dbus_interface = EVINCE_IFACE,
+                          reply_handler = handler,
+                          error_handler = self.handle_get_window_list_error)
+
+    def handle_get_window_list_error (self, e):
+        sys.stderr.write("GetWindowList DBus call has failed")
+        sys.stderr.flush()
+
+    def handle_get_window_list_reply (self, window_list):
+        if len(window_list) > 0:
+            window_obj = EvinceWindowProxy.bus.get_object(self.dbus_name, window_list[0])
+            self.window = dbus.Interface(window_obj,EV_WINDOW_IFACE)
+            self.window.connect_to_signal("Closed", self.on_window_close)
+            self.window.connect_to_signal("SyncSource", self.on_sync_source)
+        else:
+            #That should never happen. 
+            sys.stderr.write("GetWindowList returned empty list")
+            sys.stderr.flush()
+
+    def on_window_close(self):
+        self.window = None
+        self.status = CLOSED
+
+    def on_sync_source(self, input_file, source_link, timestamp):
+        input_file = input_file.replace("file://", "")
+        input_file = input_file.replace("%20", " ")
+        sys.stdout.write("call SyncTeX_backward('" + input_file + "', " + str(source_link[0]) + ")\n")
+        sys.stdout.flush()
+
+path_output = os.getcwd() + '/' + sys.argv[1]
+path_output = path_output.replace(" ", "%20")
+
+sys.stdout.write("call SyncTeX_SetPID('" + str(os.getpid()) + "')\n")
+sys.stdout.flush()
+
+dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
+
+a = EvinceWindowProxy('file://' + path_output, True)
+
+loop = GObject.MainLoop()
+loop.run() 
+
diff --git a/r-plugin/synctex_evince_forward.py b/r-plugin/synctex_evince_forward.py
new file mode 100644
index 0000000..4d84ceb
--- /dev/null
+++ b/r-plugin/synctex_evince_forward.py
@@ -0,0 +1,144 @@
+
+# The code in this files is borrowed from Gedit Synctex plugin.
+#
+# Copyright (C) 2010 Jose Aliste
+#
+# This program is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public Licence as published by the Free Software
+# Foundation; either version 2 of the Licence, or (at your option) any later
+# version.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU General Public Licence for more
+# details.
+#
+# You should have received a copy of the GNU General Public Licence along with
+# this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
+# Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+# Modified to Vim-R-plugin by Jakson Aquino
+
+import dbus, subprocess, time
+import dbus.mainloop.glib, sys, os
+from gi.repository import GObject
+
+RUNNING, CLOSED = range(2)
+
+EV_DAEMON_PATH = "/org/gnome/evince/Daemon"
+EV_DAEMON_NAME = "org.gnome.evince.Daemon"
+EV_DAEMON_IFACE = "org.gnome.evince.Daemon"
+
+EVINCE_PATH = "/org/gnome/evince/Evince"
+EVINCE_IFACE = "org.gnome.evince.Application"
+
+EV_WINDOW_IFACE = "org.gnome.evince.Window"
+
+
+
+class EvinceWindowProxy:
+    """A DBUS proxy for an Evince Window."""
+    daemon = None
+    bus = None
+
+    def __init__(self, uri, spawn = False):
+        self.uri = uri
+        self.spawn = spawn
+        self.status = CLOSED
+        self.source_handler = None
+        self.dbus_name = ''
+        self._handler = None
+        try:
+            if EvinceWindowProxy.bus is None:
+                EvinceWindowProxy.bus = dbus.SessionBus()
+
+            if EvinceWindowProxy.daemon is None:
+                EvinceWindowProxy.daemon = EvinceWindowProxy.bus.get_object(EV_DAEMON_NAME,
+                                                EV_DAEMON_PATH,
+                                                follow_name_owner_changes=True)
+            EvinceWindowProxy.bus.add_signal_receiver(self._on_doc_loaded, signal_name="DocumentLoaded", 
+                                                      dbus_interface = EV_WINDOW_IFACE, 
+                                                      sender_keyword='sender')
+            self._get_dbus_name(False)
+
+        except dbus.DBusException:
+            sys.stderr.write("Could not connect to the Evince Daemon")
+            sys.stderr.flush()
+
+    def _on_doc_loaded(self, uri, **keyargs):
+        if uri == self.uri and self._handler is None:
+            self.handle_find_document_reply(keyargs['sender'])
+        
+    def _get_dbus_name(self, spawn):
+        EvinceWindowProxy.daemon.FindDocument(self.uri,spawn,
+                     reply_handler=self.handle_find_document_reply,
+                     error_handler=self.handle_find_document_error,
+                     dbus_interface = EV_DAEMON_IFACE)
+
+    def handle_find_document_error(self, error):
+        sys.stderr.write("FindDocument DBus call has failed")
+        sys.stderr.flush()
+
+    def handle_find_document_reply(self, evince_name):
+        if self._handler is not None:
+            handler = self._handler
+        else:
+            handler = self.handle_get_window_list_reply
+        if evince_name != '':
+            self.dbus_name = evince_name
+            self.status = RUNNING
+            self.evince = EvinceWindowProxy.bus.get_object(self.dbus_name, EVINCE_PATH)
+            self.evince.GetWindowList(dbus_interface = EVINCE_IFACE,
+                          reply_handler = handler,
+                          error_handler = self.handle_get_window_list_error)
+
+    def handle_get_window_list_error (self, e):
+        sys.stderr.write("GetWindowList DBus call has failed")
+        sys.stderr.flush()
+
+    def handle_get_window_list_reply (self, window_list):
+        if len(window_list) > 0:
+            window_obj = EvinceWindowProxy.bus.get_object(self.dbus_name, window_list[0])
+            self.window = dbus.Interface(window_obj,EV_WINDOW_IFACE)
+        else:
+            #That should never happen. 
+            sys.stderr.write("GetWindowList returned empty list")
+            sys.stderr.flush()
+
+
+    def SyncView(self, input_file, data, time):
+        if self.status == CLOSED:
+            if self.spawn:
+                self._tmp_syncview = [input_file, data, time];
+                self._handler = self._syncview_handler
+                self._get_dbus_name(True)
+        else:
+            self.window.SyncView(input_file, data, time,  dbus_interface = "org.gnome.evince.Window")
+
+    def _syncview_handler(self, window_list):
+        self.handle_get_window_list_reply(window_list)
+
+        if self.status == CLOSED: 
+            return False
+        self.window.SyncView(self._tmp_syncview[0],self._tmp_syncview[1], self._tmp_syncview[2], dbus_interface="org.gnome.evince.Window")
+        del self._tmp_syncview
+        self._handler = None
+        return True
+
+path_output = os.getcwd() + '/' + sys.argv[1]
+path_output = path_output.replace(" ", "%20")
+line_number = int(sys.argv[2])
+path_input = os.getcwd() + '/' + sys.argv[3]
+
+dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
+
+a = EvinceWindowProxy('file://' + path_output, True)
+
+def sync_view(ev_window, path_input, line_number):
+    ev_window.SyncView(path_input, (line_number, 1), 0)
+    loop.quit()
+
+GObject.timeout_add(400, sync_view, a, path_input, line_number)
+loop = GObject.MainLoop()
+loop.run() 
+
diff --git a/r-plugin/tex_indent.vim b/r-plugin/tex_indent.vim
deleted file mode 100644
index 23c1704..0000000
--- a/r-plugin/tex_indent.vim
+++ /dev/null
@@ -1,185 +0,0 @@
-" Downloaded from: http://www.vim.org/scripts/script.php?script_id=218
-"
-" Vim indent file
-" Language:     LaTeX
-" Maintainer:   Johannes Tanzler 
-" Created:      Sat, 16 Feb 2002 16:50:19 +0100
-" Last Change:	Wed Feb 09, 2011  01:36PM
-" Last Update:  18th feb 2002, by LH :
-"               (*) better support for the option
-"               (*) use some regex instead of several '||'.
-"               Oct 9th, 2003, by JT:
-"               (*) don't change indentation of lines starting with '%'
-"               2005/06/15, Moshe Kaminsky 
-"               (*) New variables:
-"                   g:tex_items, g:tex_itemize_env, g:tex_noindent_env
-" Version: 0.4
-
-" Changed by Jakson Aquino to deal with R code chunks in rnoweb files.
-
-" Options: {{{
-"
-" To set the following options (ok, currently it's just one), add a line like
-"   let g:tex_indent_items = 1
-" to your ~/.vimrc.
-"
-" * g:tex_indent_items
-"
-"   If this variable is set, item-environments are indented like Emacs does
-"   it, i.e., continuation lines are indented with a shiftwidth.
-"   
-"   NOTE: I've already set the variable below; delete the corresponding line
-"   if you don't like this behaviour.
-"
-"   Per default, it is unset.
-"   
-"              set                                unset
-"   ----------------------------------------------------------------
-"       \begin{itemize}                      \begin{itemize}  
-"         \item blablabla                      \item blablabla
-"           bla bla bla                        bla bla bla  
-"         \item blablabla                      \item blablabla
-"           bla bla bla                        bla bla bla  
-"       \end{itemize}                        \end{itemize}    
-"
-"
-" * g:tex_items
-"
-"   A list of tokens to be considered as commands for the beginning of an item 
-"   command. The tokens should be separated with '\|'. The initial '\' should 
-"   be escaped. The default is '\\bibitem\|\\item'.
-"
-" * g:tex_itemize_env
-" 
-"   A list of environment names, separated with '\|', where the items (item 
-"   commands matching g:tex_items) may appear. The default is 
-"   'itemize\|description\|enumerate\|thebibliography'.
-"
-" * g:tex_noindent_env
-"
-"   A list of environment names. separated with '\|', where no indentation is 
-"   required. The default is 'document\|verbatim'.
-"
-" }}} 
-
-if exists("b:did_indent") | finish
-endif
-let b:did_indent = 1
-
-" Delete the next line to avoid the special indention of items
-if !exists("g:tex_indent_items")
-  let g:tex_indent_items = 1
-endif
-if g:tex_indent_items
-  if !exists("g:tex_itemize_env")
-    let g:tex_itemize_env = 'itemize\|description\|enumerate\|thebibliography'
-  endif
-  if !exists('g:tex_items')
-    let g:tex_items = '\\bibitem\|\\item' 
-  endif
-else
-  let g:tex_items = ''
-endif
-
-if !exists("g:tex_noindent_env")
-  let g:tex_noindent_env = 'document\|verbatim'
-endif
-
-setlocal indentexpr=GetTeXIndent2()
-setlocal nolisp
-setlocal nosmartindent
-setlocal autoindent
-exec 'setlocal indentkeys+=}' . substitute(g:tex_items, '^\|\(\\|\)', ',=', 'g')
-let g:tex_items = '^\s*' . g:tex_items
-
-
-" Only define the function once
-if exists("*GetTeXIndent2")
-  finish
-endif
-
-
-
-function GetTeXIndent2()
-
-  " Find a non-blank line above the current line.
-  let lnum = prevnonblank(v:lnum - 1)
-
-  " Skip R code chunk if the file type is rnoweb
-  if &filetype == "rnoweb" && getline(lnum) =~ "^@$"
-    let lnum = search("^<<.*>>=$", "bnW") - 1
-    if lnum < 0
-      let lnum = 0
-    endif
-  endif
-
-  " At the start of the file use zero indent.
-  if lnum == 0 | return 0 
-  endif
-
-  let ind = indent(lnum)
-  let line = getline(lnum)             " last line
-  let cline = getline(v:lnum)          " current line
-
-  " Ignore comments
-  if cline =~ '^\s*%'
-      return ind
-  endif
-  while lnum > 0 && (line =~ '^\s*%' || line =~ '^\s*$')
-      let lnum -= 1
-      let line = getline(lnum)
-  endwhile
-
-
-
-  " Add a 'shiftwidth' after beginning of environments.
-  " Don't add it for \begin{document} and \begin{verbatim}
-  ""if line =~ '^\s*\\begin{\(.*\)}'  && line !~ 'verbatim' 
-  " LH modification : \begin does not always start a line
-  if line =~ '\\begin{.*}'  && line !~ g:tex_noindent_env
-
-    let ind = ind + &sw
-
-    if g:tex_indent_items
-      " Add another sw for item-environments
-      if line =~ g:tex_itemize_env
-        let ind = ind + &sw
-      endif
-    endif
-  endif
-
-  
-  " Subtract a 'shiftwidth' when an environment ends
-  if cline =~ '^\s*\\end' && cline !~ g:tex_noindent_env
-
-    if g:tex_indent_items
-      " Remove another sw for item-environments
-      if cline =~ g:tex_itemize_env
-        let ind = ind - &sw
-      endif
-    endif
-
-    let ind = ind - &sw
-  endif
-
-  
-  " Special treatment for 'item'
-  " ----------------------------
-  
-  if g:tex_indent_items
-
-    " '\item' or '\bibitem' itself:
-    if cline =~ g:tex_items
-      let ind = ind - &sw
-    endif
-
-    " lines following to '\item' are intented once again:
-    if line =~ g:tex_items
-      let ind = ind + &sw
-    endif
-
-  endif
-
-  return ind
-endfunction
-
diff --git a/r-plugin/tmux.vim b/r-plugin/tmux.vim
new file mode 100644
index 0000000..a0c914b
--- /dev/null
+++ b/r-plugin/tmux.vim
@@ -0,0 +1,28 @@
+" Check whether Tmux is OK
+if !executable('tmux') && g:vimrplugin_source !~ "screenR"
+    call RWarningMsgInp("Please, install the 'Tmux' application to enable the Vim-R-plugin.")
+    let g:rplugin_failed = 1
+    finish
+endif
+
+if system("uname") =~ "OpenBSD"
+    " Tmux does not have -V option on OpenBSD: https://github.com/jcfaria/Vim-R-plugin/issues/200
+    let g:rplugin_tmux_version = "2.1"
+else
+    let g:rplugin_tmux_version = system("tmux -V")
+    let g:rplugin_tmux_version = substitute(g:rplugin_tmux_version, '.*tmux \([0-9]\.[0-9]\).*', '\1', '')
+    if strlen(g:rplugin_tmux_version) != 3
+        let g:rplugin_tmux_version = "1.0"
+    endif
+    if g:rplugin_tmux_version < "1.8" && g:vimrplugin_source !~ "screenR"
+        call RWarningMsgInp("Vim-R-plugin requires Tmux >= 1.8")
+        let g:rplugin_failed = 1
+        finish
+    endif
+endif
+
+if g:rplugin_do_tmux_split
+    runtime r-plugin/tmux_split.vim
+else
+    runtime r-plugin/extern_term.vim
+endif
diff --git a/r-plugin/tmux_split.vim b/r-plugin/tmux_split.vim
new file mode 100644
index 0000000..173cc96
--- /dev/null
+++ b/r-plugin/tmux_split.vim
@@ -0,0 +1,205 @@
+
+" Adapted from screen plugin:
+function TmuxActivePane()
+    let line = system("tmux list-panes | grep \'(active)$'")
+    let paneid = matchstr(line, '\v\%\d+ \(active\)')
+    if !empty(paneid)
+        return matchstr(paneid, '\v^\%\d+')
+    else
+        return matchstr(line, '\v^\d+')
+    endif
+endfunction
+
+function StartR_TmuxSplit(rcmd)
+    let g:rplugin_vim_pane = TmuxActivePane()
+    let tmuxconf = ['set-environment VIMRPLUGIN_TMPDIR "' . g:rplugin_tmpdir . '"',
+                \ 'set-environment VIMR_COMPLDIR "' . substitute(g:rplugin_compldir, ' ', '\\ ', "g") . '"',
+                \ 'set-environment VIMEDITOR_SVRNM ' . $VIMEDITOR_SVRNM ,
+                \ 'set-environment VIMINSTANCEID ' . $VIMINSTANCEID ,
+                \ 'set-environment VIMR_SECRET ' . $VIMR_SECRET ,
+                \ 'set-environment R_DEFAULT_PACKAGES ' . $R_DEFAULT_PACKAGES ]
+    if &t_Co == 256
+        call extend(tmuxconf, ['set default-terminal "' . $TERM . '"'])
+    endif
+    call writefile(tmuxconf, g:rplugin_tmpdir . "/tmux" . $VIMINSTANCEID . ".conf")
+    call system("tmux source-file '" . g:rplugin_tmpdir . "/tmux" . $VIMINSTANCEID . ".conf" . "'")
+    call delete(g:rplugin_tmpdir . "/tmux" . $VIMINSTANCEID . ".conf")
+    let tcmd = "tmux split-window "
+    if g:vimrplugin_vsplit
+        if g:vimrplugin_rconsole_width == -1
+            let tcmd .= "-h"
+        else
+            let tcmd .= "-h -l " . g:vimrplugin_rconsole_width
+        endif
+    else
+        let tcmd .= "-l " . g:vimrplugin_rconsole_height
+    endif
+
+    " Let Tmux automatically kill the panel when R quits.
+    let tcmd .= " '" . a:rcmd . "'"
+
+    let rlog = system(tcmd)
+    if v:shell_error
+        call RWarningMsg(rlog)
+        return
+    endif
+    let g:rplugin_rconsole_pane = TmuxActivePane()
+    let rlog = system("tmux select-pane -t " . g:rplugin_vim_pane)
+    if v:shell_error
+        call RWarningMsg(rlog)
+        return
+    endif
+    let g:SendCmdToR = function('SendCmdToR_TmuxSplit')
+    let g:rplugin_last_rcmd = a:rcmd
+    if g:vimrplugin_tmux_title != "automatic" && g:vimrplugin_tmux_title != ""
+        call system("tmux rename-window " . g:vimrplugin_tmux_title)
+    endif
+    if WaitVimComStart()
+        if g:vimrplugin_after_start != ''
+            call system(g:vimrplugin_after_start)
+        endif
+    endif
+endfunction
+
+function StartObjBrowser_Tmux()
+    if b:rplugin_extern_ob
+        " This is the Object Browser
+        echoerr "StartObjBrowser_Tmux() called."
+        return
+    endif
+
+
+    " Don't start the Object Browser if it already exists
+    if IsExternalOBRunning()
+        return
+    endif
+
+    let objbrowserfile = g:rplugin_tmpdir . "/objbrowserInit"
+    let tmxs = " "
+
+    call writefile([
+                \ 'let g:rplugin_vim_pane = "' . g:rplugin_vim_pane . '"',
+                \ 'let g:rplugin_rconsole_pane = "' . g:rplugin_rconsole_pane . '"',
+                \ 'let $VIMINSTANCEID = "' . $VIMINSTANCEID . '"',
+                \ 'let $VIMCOMPORT = "' . g:rplugin_vimcomport . '"',
+                \ 'let showmarks_enable = 0',
+                \ 'let g:rplugin_tmuxsname = "' . g:rplugin_tmuxsname . '"',
+                \ 'let b:rscript_buffer = "' . bufname("%") . '"',
+                \ 'set filetype=rbrowser',
+                \ 'let g:rplugin_vimcom_home = "' . g:rplugin_vimcom_home . '"',
+                \ 'let g:rplugin_vclntsrvr = "' . g:rplugin_vclntsrvr . '"',
+                \ 'let b:objbrtitle = "' . b:objbrtitle . '"',
+                \ 'let b:rplugin_extern_ob = 1',
+                \ 'set shortmess=atI',
+                \ 'set rulerformat=%3(%l%)',
+                \ 'set laststatus=0',
+                \ 'set noruler',
+                \ 'set updatetime=100',
+                \ 'let g:SendCmdToR = function("SendCmdToR_TmuxSplit")',
+                \ 'let g:rplugin_vimcomport = ' . g:rplugin_vimcomport,
+                \ 'let vcs_job = job_start([g:rplugin_vclntsrvr], {"out_cb": "ROnJobStdout", "err_cb": "ROnJobStderr"})',
+                \ 'let g:rplugin_channel = job_getchannel(vcs_job)',
+                \ 'sleep 150m'],
+                \ objbrowserfile)
+
+    if g:vimrplugin_objbr_place =~ "left"
+        let panw = system("tmux list-panes | cat")
+        if g:vimrplugin_objbr_place =~ "console"
+            " Get the R Console width:
+            let panw = substitute(panw, '.*[0-9]: \[\([0-9]*\)x[0-9]*.\{-}' . g:rplugin_rconsole_pane . '\>.*', '\1', "")
+        else
+            " Get the Vim width
+            let panw = substitute(panw, '.*[0-9]: \[\([0-9]*\)x[0-9]*.\{-}' . g:rplugin_vim_pane . '\>.*', '\1', "")
+        endif
+        let panewidth = panw - g:vimrplugin_objbr_w
+        " Just to be safe: If the above code doesn't work as expected
+        " and we get a spurious value:
+        if panewidth < 30 || panewidth > 180
+            let panewidth = 80
+        endif
+    else
+        let panewidth = g:vimrplugin_objbr_w
+    endif
+    if g:vimrplugin_objbr_place =~ "console"
+        let obpane = g:rplugin_rconsole_pane
+    else
+        let obpane = g:rplugin_vim_pane
+    endif
+
+    if g:rplugin_is_darwin && has("gui_macvim")
+        let vimexec = substitute($VIMRUNTIME, "/MacVim.app/Contents/.*", "", "") . "/MacVim.app/Contents/MacOS/Vim"
+        let vimexec = substitute(vimexec, ' ', '\\ ', 'g')
+    else
+        let vimexec = "vim"
+    endif
+
+    let cmd = "tmux split-window -h -l " . panewidth . " -t " . obpane . ' "' . vimexec . " -c 'source " . substitute(objbrowserfile, ' ', '\\ ', 'g') . "'" . '"'
+    let rlog = system(cmd)
+    if v:shell_error
+        let rlog = substitute(rlog, '\n', ' ', 'g')
+        let rlog = substitute(rlog, '\r', ' ', 'g')
+        call RWarningMsg(rlog)
+        let g:rplugin_running_objbr = 0
+        return 0
+    endif
+
+    let g:rplugin_ob_pane = TmuxActivePane()
+    let rlog = system("tmux select-pane -t " . g:rplugin_vim_pane)
+    if v:shell_error
+        call RWarningMsg(rlog)
+        return 0
+    endif
+
+    if g:vimrplugin_objbr_place =~ "left"
+        if g:vimrplugin_objbr_place =~ "console"
+            call system("tmux swap-pane -d -s " . g:rplugin_rconsole_pane . " -t " . g:rplugin_ob_pane)
+        else
+            call system("tmux swap-pane -d -s " . g:rplugin_vim_pane . " -t " . g:rplugin_ob_pane)
+        endif
+    endif
+endfunction
+
+function SendCmdToR_TmuxSplit(cmd)
+    if g:vimrplugin_ca_ck
+        let cmd = "\001" . "\013" . a:cmd
+    else
+        let cmd = a:cmd
+    endif
+
+    if !exists("g:rplugin_rconsole_pane")
+        " Should never happen
+        call RWarningMsg("Missing internal variable: g:rplugin_rconsole_pane")
+    endif
+    let str = substitute(cmd, "'", "'\\\\''", "g")
+    if str =~ '^-'
+        let str = ' ' . str
+    endif
+    let scmd = "tmux set-buffer '" . str . "\' && tmux paste-buffer -t " . g:rplugin_rconsole_pane
+    let rlog = system(scmd)
+    if v:shell_error
+        let rlog = substitute(rlog, "\n", " ", "g")
+        let rlog = substitute(rlog, "\r", " ", "g")
+        call RWarningMsg(rlog)
+        call ClearRInfo()
+        return 0
+    endif
+    return 1
+endfunction
+
+function CloseExternalOB()
+    if IsExternalOBRunning()
+        call system("tmux kill-pane -t " . g:rplugin_ob_pane)
+        unlet g:rplugin_ob_pane
+        sleep 250m
+    endif
+endfunction
+
+function IsExternalOBRunning()
+    if exists("g:rplugin_ob_pane")
+        let plst = system("tmux list-panes | cat")
+        if plst =~ g:rplugin_ob_pane
+            return 1
+        endif
+    endif
+    return 0
+endfunction
diff --git a/r-plugin/vimActivate.js b/r-plugin/vimActivate.js
deleted file mode 100644
index 22a773f..0000000
--- a/r-plugin/vimActivate.js
+++ /dev/null
@@ -1,4 +0,0 @@
-var arg = WScript.Arguments.Item(0);
-var WshShell = WScript.CreateObject("WScript.Shell");
-WshShell.AppActivate(arg);
-
diff --git a/r-plugin/vimSweave.R b/r-plugin/vimSweave.R
deleted file mode 100644
index b0bcb32..0000000
--- a/r-plugin/vimSweave.R
+++ /dev/null
@@ -1,13 +0,0 @@
-
-.vim.Sweave <- function(rnowebfile, latexcmd = "pdflatex", bibtex = FALSE, ...)
-{
-    Sres <- Sweave(rnowebfile, ...)
-    if(exists('Sres')){
-        system(paste(latexcmd, Sres))
-        if(bibtex){
-            system(paste("bibtex", sub("\\.tex$", ".aux", Sres)))
-            system(paste(latexcmd, Sres))
-            system(paste(latexcmd, Sres))
-        }
-    }
-}
diff --git a/r-plugin/vimbrowser.R b/r-plugin/vimbrowser.R
deleted file mode 100644
index 82ec8eb..0000000
--- a/r-plugin/vimbrowser.R
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-.vim.browser <- function(allnames = FALSE)
-{
-    vim.browserline <- function(x.name, x, curlist)
-    {
-        if(is.numeric(x)) x.class <- "numeric"
-        else if(is.factor(x)) x.class <- "factor"
-        else if(is.character(x)) x.class <- "character"
-        else if(is.function(x)) x.class <- "function"
-        else if(is.logical(x)) x.class <- "logical"
-        else if(is.data.frame(x) && !is.null(names(x)) && length(names(x)) > 0) x.class <- "data.frame"
-        else if(is.list(x) && !is.null(names(x)) && length(names(x)) > 0) x.class <- "list"
-        else x.class <- "other"
-
-        cat("'", x.name, "': {'class': \"", x.class, '"', sep = "")
-        x.label <- attr(x, "label", exact = TRUE)
-        if(length(x.label) > 1) x.label <- x.label[[1]]
-        if(!is.null(x.label)) cat(", 'label': \"", x.label, '"', sep = "")
-        if(is.list(x)){
-            x.names <- names(x)
-            llen <- length(x)
-            idx <- grep("^$", x.names)
-            nnn <- 1:llen
-            x.names[idx] <- paste('[[', nnn[idx], ']]', sep = "")
-            curlist <- paste(curlist, x.name, sep = "-")
-            cat(", 'items': {", sep = "")
-
-                                        # Don't include elements of lists with duplicated names
-            x.names.dup <- duplicated(x.names)
-            if(sum(x.names.dup) > 0) x.names <- x.names[!x.names.dup]
-
-            newlistnames <- paste('"', paste(x.names, collapse = '", "'), '"', sep = "")
-            .vim.browser.order <<- paste(.vim.browser.order, "'", curlist, "': [", newlistnames, "], ", sep = "")
-
-            len <- length(x.names)
-            if(len > 0){
-                for(i in 1:len){
-                    vim.browserline(x.names[i], x[[i]], curlist)
-                }
-            }
-            cat("}")
-        }
-        cat("}, ")
-    }
-
-                                        # Begin of .vim.browser()
-    objlist <- ls(".GlobalEnv", all.names = allnames)
-    .vim.browser.order <<- character()
-    sink(paste(Sys.getenv("VIMRPLUGIN_TMPDIR"), "/objbrowser", sep = ""))
-    cat("let b:workspace = {")
-    for(obj in objlist){
-        vim.browserline(obj, get(obj), "")
-    }
-    cat("}\n")
-    .vim.browser.order <- sub(", $", "", .vim.browser.order)
-    cat("let b:list_order = {", .vim.browser.order, "}\n", sep = "")
-    liblist <- search()
-    liblist <- liblist[grep("package:", liblist)]
-    liblist <- sub("package:", "", liblist)
-    cat("let b:liblist = ['", paste(liblist, collapse = "', '"), "']\n", sep = "") 
-    sink()
-    rm(.vim.browser.order, pos = ".GlobalEnv")
-    unlink(paste(Sys.getenv("VIMRPLUGIN_TMPDIR"), "/objbrowserlock", sep = ""))
-}
-
diff --git a/r-plugin/vimhelp.R b/r-plugin/vimhelp.R
deleted file mode 100644
index 6e2fcc8..0000000
--- a/r-plugin/vimhelp.R
+++ /dev/null
@@ -1,59 +0,0 @@
-
-# Code based on all.R (src/library/utils)
-.vim.help <- function(topic, w, classfor, package)
-{
-    if(!missing(classfor) & length(grep(topic, names(.knownS3Generics))) > 0){
-        curwarn <- getOption("warn")
-        options(warn = -1)
-        try(classfor <- classfor, silent = TRUE)  # classfor may be a function
-        try(.theclass <- class(classfor), silent = TRUE)
-        options(warn = curwarn)
-        if(exists(".theclass")){
-            for(i in 1:length(.theclass)){
-                newtopic <- paste(topic, ".", .theclass[i], sep = "")
-                if(length(utils:::index.search(newtopic, .find.package(NULL, NULL))) > 0){
-                    topic <- newtopic
-                    break
-                }
-            }
-        }
-    }
-    if(version$major < "2" || (version$major == "2" && version$minor < "11.0"))
-        stop("The use of Vim as pager for R requires R >= 2.11.0\n  Please, put in your vimrc:\n  let vimrplugin_vimpager = \"no\"")
-    o <- paste(Sys.getenv("VIMRPLUGIN_TMPDIR"), "/Rdoc", sep = "")
-    f <- utils:::index.search(topic, .find.package(NULL, NULL))
-    if(length(f) == 0){
-        cat('No documentation for "', topic, '" in loaded packages and libraries.\n', sep = "")
-        return(invisible(NULL))
-    }
-    if(length(f) > 1){
-        if(missing(package)){
-            f <- sub("/help/.*", "", f)
-            f <- sub(".*/", "", f)
-            sink(o)
-            cat("The topic \"", topic, "\" was found in ", length(f), " libraries.\n\n", sep = "")
-            cat("Please, send one of the lines below to R\nto get the desired documentation:\n\n")
-            for(i in 1:length(f))
-                cat(f[i], "::", topic, "\n", sep = "")
-            sink()
-            unlink(paste(Sys.getenv("VIMRPLUGIN_TMPDIR"), "/Rdoclock", sep = ""))
-            return(invisible(NULL))
-            f <- f[1]
-        } else {
-            f <- f[grep(paste("/", package, "/", sep = ""), f)]
-            if(length(f) == 0)
-                stop("length(f) == 0")
-        }
-    }
-    p <- basename(dirname(dirname(f)))
-    if(version$major > "2" || (version$major == "2" && version$minor >= "12.0")){
-        tools::Rd2txt_options(width = w)
-        res <- tools::Rd2txt(utils:::.getHelpFile(f), out = o, package = p)
-    } else {
-        res <- tools::Rd2txt(utils:::.getHelpFile(f), width = w, out = o, package = p)
-    }
-    unlink(paste(Sys.getenv("VIMRPLUGIN_TMPDIR"), "/Rdoclock", sep = ""))
-    if(length(res) == 0)
-        stop("length(res) == 0")
-}
-
diff --git a/r-plugin/vimprint.R b/r-plugin/vimprint.R
deleted file mode 100644
index 5a34a9a..0000000
--- a/r-plugin/vimprint.R
+++ /dev/null
@@ -1,26 +0,0 @@
-
-.vim.print <- function(object, classfor)
-{
-    if(!exists(object))
-        stop("object '", object, "' not found")
-    if(!missing(classfor) & length(grep(object, names(.knownS3Generics))) > 0){
-        curwarn <- getOption("warn")
-        options(warn = -1)
-        try(classfor <- classfor, silent = TRUE)  # classfor may be a function
-        try(.theclass <- class(classfor), silent = TRUE)
-        options(warn = curwarn)
-        if(exists(".theclass")){
-            for(cls in .theclass){
-                if(exists(paste(object, ".", .theclass, sep = ""))){
-                    .newobj <- get(paste(object, ".", .theclass, sep = ""))
-                    warning("Printing ", object, ".", .theclass, "\n", sep = "")
-                    break
-                }
-            }
-        }
-    }
-    if(!exists(".newobj"))
-        .newobj <- get(object)
-    print(.newobj)
-}
-
diff --git a/r-plugin/windows.py b/r-plugin/windows.py
deleted file mode 100644
index 21ed90e..0000000
--- a/r-plugin/windows.py
+++ /dev/null
@@ -1,120 +0,0 @@
-
-import os
-import string
-import time
-import vim
-
-try:
-    import win32api
-    import win32clipboard as w
-    import win32com.client
-    import win32con
-except ImportError:
-    vim.command("call RWarningMsg('Did you install PyWin32?')")
-    import platform
-    myPyVersion = platform.python_version()
-    myArch = platform.architecture()
-    vim.command("call RWarningMsg('The Python version being used is: " + myPyVersion + " (" + myArch[0] + ")')")
-
-
-def SendToRPy(aString):
-    # backup the clipboard content (if text)
-    w.OpenClipboard(0)
-    if w.IsClipboardFormatAvailable(w.CF_TEXT):
-        cdata = w.GetClipboardData()
-    else:
-        cdata = None
-    w.CloseClipboard()
-
-    finalString = aString.decode("latin-1")
-
-    sleepTime = float(vim.eval("g:vimrplugin_sleeptime"))
-    w.OpenClipboard(0)
-    w.EmptyClipboard()
-    w.SetClipboardText(finalString)
-    w.CloseClipboard()
-
-    shell = win32com.client.Dispatch("WScript.Shell")
-    ok = shell.AppActivate("R Console")
-    if ok:
-        time.sleep(sleepTime)
-        shell.SendKeys("^v")
-        time.sleep(sleepTime)
-    else:
-        vim.command("call RWarningMsg('Is R running?')")
-        time.sleep(1)
-    
-def RestoreClipboardPy():
-    if cdata:
-        w.OpenClipboard(0)
-        w.EmptyClipboard()
-        w.SetClipboardText(cdata)
-        w.CloseClipboard()
-
-def RClearConsolePy():
-
-    sleepTime = string.atof(vim.eval("g:vimrplugin_sleeptime"))
-    shell = win32com.client.Dispatch("WScript.Shell")
-    ok = shell.AppActivate("R Console")
-    if ok:
-        shell.SendKeys("^l")
-        time.sleep(sleepTime)
-    else:
-        vim.command("call RWarningMsg('Is R running?')")
-        time.sleep(1)
-
-def GetRPathPy():
-    keyName = "SOFTWARE\\R-core\\R"
-    kHandle = None
-    try:
-        kHandle = win32api.RegOpenKeyEx(win32con.HKEY_LOCAL_MACHINE, keyName, 0, win32con.KEY_READ)
-    except:
-        try:
-            kHandle = win32api.RegOpenKeyEx(win32con.HKEY_CURRENT_USER, keyName, 0, win32con.KEY_READ)
-        except:
-            vim.command("let s:rinstallpath =  'Not found'")
-    if kHandle:
-        (kname, rpath, vtype) = win32api.RegEnumValue(kHandle, 0)
-        win32api.RegCloseKey(kHandle)
-        if kname == 'InstallPath':
-            vim.command("let s:rinstallpath = '" + rpath + "'")
-        else:
-            vim.command("let s:rinstallpath =  'Not found'")
-
-def StartRPy():
-    rpath = vim.eval("g:rplugin_Rgui")
-    rargs = ['"' + rpath + '"']
-    r_args = vim.eval("g:rplugin_r_args")
-    if r_args != " ":
-        r_args = r_args.split(' ')
-        i = 0
-        alen = len(r_args)
-        while i < alen:
-            rargs.append(r_args[i])
-            i = i + 1
-
-    kHandle = None
-    keyName = "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders"
-    try:
-        kHandle = win32api.RegOpenKeyEx(win32con.HKEY_CURRENT_USER, keyName, 0, win32con.KEY_READ)
-    except:
-        vim.command("RWarningMsg('Personal folder not found in registry')")
-
-    if kHandle:
-        i = 0
-        folder = "none"
-        while folder != "Personal":
-            try:
-                (folder, fpath, vtype) = win32api.RegEnumValue(kHandle, i)
-            except:
-                break
-            i = i + 1
-        win32api.RegCloseKey(kHandle)
-        if folder == "Personal":
-            rargs.append('HOME="' + fpath + '"')
-        else:
-            vim.command("RWarningMsg('Personal folder not found in registry')")
-
-    os.spawnv(os.P_NOWAIT, rpath, rargs)
-
-# vim: sw=4 tabstop=4 expandtab
diff --git a/r-plugin/windows.vim b/r-plugin/windows.vim
new file mode 100644
index 0000000..d97548b
--- /dev/null
+++ b/r-plugin/windows.vim
@@ -0,0 +1,185 @@
+" This file contains code used only on Windows
+
+let g:rplugin_sumatra_path = ""
+
+call RSetDefaultValue("g:vimrplugin_sleeptime", 100)
+call RSetDefaultValue("g:vimrplugin_set_home_env", 1)
+
+" Avoid invalid values defined by the user
+exe "let s:sleeptimestr = " . '"' . g:vimrplugin_sleeptime . '"'
+let s:sleeptime = str2nr(s:sleeptimestr)
+if s:sleeptime < 1 || s:sleeptime > 1000
+    let g:vimrplugin_sleeptime = 100
+endif
+unlet s:sleeptimestr
+unlet s:sleeptime
+
+let g:rplugin_sleeptime = g:vimrplugin_sleeptime . 'm'
+
+if !exists("g:rplugin_rpathadded")
+    if exists("g:vimrplugin_r_path")
+        if !isdirectory(g:vimrplugin_r_path)
+            call RWarningMsgInp("vimrplugin_r_path must be a directory (check your vimrc)")
+            let g:rplugin_failed = 1
+            finish
+        endif
+        if !filereadable(g:vimrplugin_r_path . "\\Rgui.exe")
+            call RWarningMsgInp('File "' . g:vimrplugin_r_path . '\Rgui.exe" is unreadable (check vimrplugin_r_path in your vimrc).')
+            let g:rplugin_failed = 1
+            finish
+        endif
+        let $PATH = g:vimrplugin_r_path . ";" . $PATH
+        let g:rplugin_Rgui = g:vimrplugin_r_path . "\\Rgui.exe"
+    else
+        let rip = filter(split(system('reg.exe QUERY "HKLM\SOFTWARE\R-core\R" /s'), "\n"), 'v:val =~ ".*InstallPath.*REG_SZ"')
+        let g:rdebug_reg_rpath_1 = rip
+        if len(rip) > 0
+            let s:rinstallpath = substitute(rip[0], '.*InstallPath.*REG_SZ\s*', '', '')
+            let s:rinstallpath = substitute(s:rinstallpath, '\n', '', 'g')
+            let s:rinstallpath = substitute(s:rinstallpath, '\s*$', '', 'g')
+            let g:rdebug_reg_rpath_2 = s:rinstallpath
+        endif
+
+        if !exists("s:rinstallpath")
+            call RWarningMsgInp("Could not find R path in Windows Registry. If you have already installed R, please, set the value of 'vimrplugin_r_path'.")
+            let g:rplugin_failed = 1
+            finish
+        endif
+        if isdirectory(s:rinstallpath . '\bin\i386')
+            if !isdirectory(s:rinstallpath . '\bin\x64')
+                let g:vimrplugin_i386 = 1
+            endif
+            if g:vimrplugin_i386
+                let $PATH = s:rinstallpath . '\bin\i386;' . $PATH
+                let g:rplugin_Rgui = s:rinstallpath . '\bin\i386\Rgui.exe'
+            else
+                let $PATH = s:rinstallpath . '\bin\x64;' . $PATH
+                let g:rplugin_Rgui = s:rinstallpath . '\bin\x64\Rgui.exe'
+            endif
+        else
+            let $PATH = s:rinstallpath . '\bin;' . $PATH
+            let g:rplugin_Rgui = s:rinstallpath . '\bin\Rgui.exe'
+        endif
+        unlet s:rinstallpath
+    endif
+    let g:rplugin_rpathadded = 1
+endif
+let g:vimrplugin_term_cmd = "none"
+let g:vimrplugin_term = "none"
+if !exists("g:vimrplugin_r_args")
+    let g:vimrplugin_r_args = "--sdi"
+endif
+if g:vimrplugin_Rterm
+    let g:rplugin_Rgui = substitute(g:rplugin_Rgui, "Rgui", "Rterm", "")
+endif
+
+if !exists("g:vimrplugin_R_window_title")
+    if g:vimrplugin_Rterm
+        let g:vimrplugin_R_window_title = "Rterm"
+    else
+        let g:vimrplugin_R_window_title = "R Console"
+    endif
+endif
+
+function FindSumatra()
+    if executable($ProgramFiles . "\\SumatraPDF\\SumatraPDF.exe")
+        let g:rplugin_sumatra_path = $ProgramFiles . "\\SumatraPDF\\SumatraPDF.exe"
+        return 1
+    endif
+    let smtr = system('reg.exe QUERY "HKLM\Software\Microsoft\Windows\CurrentVersion\App Paths" /v "SumatraPDF.exe"')
+    if len(smtr) > 0
+        let g:rdebug_reg_personal = smtr
+        let smtr = substitute(smtr, '.*REG_SZ\s*', '', '')
+        let smtr = substitute(smtr, '\n', '', 'g')
+        let smtr = substitute(smtr, '\s*$', '', 'g')
+        if executable(smtr)
+            let g:rplugin_sumatra_path = smtr
+            return 1
+        else
+            call RWarningMsg('Sumatra not found: "' . smtr . '"')
+        endif
+    else
+        call RWarningMsg("SumatraPDF not found in Windows registry.")
+    endif
+    return 0
+endfunction
+
+function StartR_Windows()
+    if string(g:SendCmdToR) != "function('SendCmdToR_fake')"
+        let repl = libcall(g:rplugin_vimcom_lib, "IsRRunning", 'No argument')
+        if repl =~ "^Yes"
+            call RWarningMsg('R is already running.')
+            return
+        else
+            let g:SendCmdToR = function('SendCmdToR_fake')
+            let g:rplugin_r_pid = 0
+        endif
+    endif
+
+    if !executable(g:rplugin_Rgui)
+        call RWarningMsg('R executable "' . g:rplugin_Rgui . '" not found.')
+        if exists("g:rdebug_reg_rpath_1")
+            call RWarningMsg('DEBUG message 1: >>' . g:rdebug_reg_rpath_1 . '<<')
+        endif
+        if exists("g:rdebug_reg_rpath_1")
+            call RWarningMsg('DEBUG message 2: >>' . g:rdebug_reg_rpath_2 . '<<')
+        endif
+        return
+    endif
+
+    let rcmd = g:rplugin_Rgui
+    if g:vimrplugin_Rterm
+        let rcmd = substitute(rcmd, "Rgui", "Rterm", "")
+    endif
+    let rcmd = '"' . rcmd . '" ' . g:vimrplugin_r_args
+
+    " R and Vim use different values for the $HOME variable.
+    if g:vimrplugin_set_home_env
+        let saved_home = $HOME
+        let prs = system('reg.exe QUERY "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "Personal"')
+        if len(prs) > 0
+            let g:rdebug_reg_personal = prs
+            let prs = substitute(prs, '.*REG_SZ\s*', '', '')
+            let prs = substitute(prs, '\n', '', 'g')
+            let prs = substitute(prs, '\s*$', '', 'g')
+            let $HOME = prs
+        endif
+    endif
+
+    silent exe "!start " . rcmd
+
+    if g:vimrplugin_set_home_env
+        let $HOME = saved_home
+    endif
+
+    let g:SendCmdToR = function('SendCmdToR_Windows')
+    if WaitVimComStart()
+        call foreground()
+        if g:vimrplugin_arrange_windows && filereadable(g:rplugin_compldir . "/win_pos")
+            call ch_sendraw(g:rplugin_channel, "\005" . g:rplugin_compldir . "\n")
+        endif
+        if g:vimrplugin_after_start != ''
+            call system(g:vimrplugin_after_start)
+        endif
+    endif
+endfunction
+
+function SendCmdToR_Windows(cmd)
+    if g:vimrplugin_ca_ck
+        let cmd = "\001" . "\013" . a:cmd . "\n"
+    else
+        let cmd = a:cmd . "\n"
+    endif
+    let save_clip = getreg('+')
+    call setreg('+', cmd)
+
+    let repl = libcall(g:rplugin_vimcom_lib, "SendToRConsole", cmd)
+    if repl != "OK"
+        call RWarningMsg(repl)
+        call ClearRInfo()
+    endif
+    call foreground()
+
+    call setreg('+', save_clip)
+    return 1
+endfunction
diff --git a/syntax/r.vim b/syntax/r.vim
deleted file mode 100644
index 8912ba1..0000000
--- a/syntax/r.vim
+++ /dev/null
@@ -1,202 +0,0 @@
-" Vim syntax file
-" Language:	      R (GNU S)
-" Maintainer:	      Jakson Aquino 
-" Former Maintainers: Vaidotas Zemlys 
-" 		      Tom Payne 
-" Last Change:	      Sun Feb 20, 2011  12:06PM
-" Filenames:	      *.R *.r *.Rhistory *.Rt
-" 
-" NOTE: The highlighting of R functions is defined in the
-" r-plugin/functions.vim, which is part of vim-r-plugin2:
-" http://www.vim.org/scripts/script.php?script_id=2628
-"
-" CONFIGURATION:
-"   syntax folding can be turned on by
-"
-"      let r_syntax_folding = 1
-"
-" Some lines of code were borrowed from Zhuojun Chen.
-
-if exists("b:current_syntax")
-  finish
-endif
-
-setlocal iskeyword=@,48-57,_,.
-
-if exists("g:r_syntax_folding")
-  setlocal foldmethod=syntax
-endif
-
-syn case match
-
-" Comment
-syn match rComment contains=@Spell "\#.*"
-
-if &filetype == "rhelp"
-  " string enclosed in double quotes
-  syn region rString contains=rSpecial,@Spell start=/"/ skip=/\\\\\|\\"/ end=/"/
-  " string enclosed in single quotes
-  syn region rString contains=rSpecial,@Spell start=/'/ skip=/\\\\\|\\'/ end=/'/
-else
-  " string enclosed in double quotes
-  syn region rString contains=rSpecial,rStrError,@Spell start=/"/ skip=/\\\\\|\\"/ end=/"/
-  " string enclosed in single quotes
-  syn region rString contains=rSpecial,rStrError,@Spell start=/'/ skip=/\\\\\|\\'/ end=/'/
-endif
-
-syn match rStrError display contained "\\."
-
-
-" New line, carriage return, tab, backspace, bell, feed, vertical tab, backslash
-syn match rSpecial display contained "\\\(n\|r\|t\|b\|a\|f\|v\|'\|\"\)\|\\\\"
-
-" Hexadecimal and Octal digits
-syn match rSpecial display contained "\\\(x\x\{1,2}\|[0-8]\{1,3}\)"
-
-" Unicode characters
-syn match rSpecial display contained "\\u\x\{1,4}"
-syn match rSpecial display contained "\\U\x\{1,8}"
-syn match rSpecial display contained "\\u{\x\{1,4}}"
-syn match rSpecial display contained "\\U{\x\{1,8}}"
-
-" Statement
-syn keyword rStatement   break next return
-syn keyword rConditional if else
-syn keyword rRepeat      for in repeat while
-
-" Constant (not really)
-syn keyword rConstant T F LETTERS letters month.ab month.name pi
-syn keyword rConstant R.version.string
-
-syn keyword rNumber   NA_integer_ NA_real_ NA_complex_ NA_character_ 
-
-" Constants
-syn keyword rConstant NULL
-syn keyword rBoolean  FALSE TRUE
-syn keyword rNumber   NA Inf NaN 
-
-" integer
-syn match rInteger "\<\d\+L"
-syn match rInteger "\<0x\([0-9]\|[a-f]\|[A-F]\)\+L"
-syn match rInteger "\<\d\+[Ee]+\=\d\+L"
-
-" number with no fractional part or exponent
-syn match rNumber "\<\d\+\>"
-" hexadecimal number 
-syn match rNumber "\<0x\([0-9]\|[a-f]\|[A-F]\)\+"
-
-" floating point number with integer and fractional parts and optional exponent
-syn match rFloat "\<\d\+\.\d*\([Ee][-+]\=\d\+\)\="
-" floating point number with no integer part and optional exponent
-syn match rFloat "\<\.\d\+\([Ee][-+]\=\d\+\)\="
-" floating point number with no fractional part and optional exponent
-syn match rFloat "\<\d\+[Ee][-+]\=\d\+"
-
-" complex number
-syn match rComplex "\<\d\+i"
-syn match rComplex "\<\d\++\d\+i"
-syn match rComplex "\<0x\([0-9]\|[a-f]\|[A-F]\)\+i"
-syn match rComplex "\<\d\+\.\d*\([Ee][-+]\=\d\+\)\=i"
-syn match rComplex "\<\.\d\+\([Ee][-+]\=\d\+\)\=i"
-syn match rComplex "\<\d\+[Ee][-+]\=\d\+i"
-
-syn match rOperator    "&"
-syn match rOperator    '-'
-syn match rOperator    '*'
-syn match rOperator    '+'
-syn match rOperator    '='
-syn match rOperator    "[|!<>^~`/:@]"
-syn match rOperator    "%\{2}\|%\*%\|%\/%\|%in%\|%o%\|%x%"
-syn match rOpError  '*\{3}'
-syn match rOpError  '//'
-syn match rOpError  '&&&'
-syn match rOpError  '|||'
-syn match rOpError  '<<'
-syn match rOpError  '>>'
-
-syn match rArrow "<\{1,2}-"
-syn match rArrow "->\{1,2}"
-
-" Special
-syn match rDelimiter "[,;:]"
-
-" Error
-if exists("g:r_syntax_folding")
-  syn region rRegion matchgroup=Delimiter start=/(/ matchgroup=Delimiter end=/)/ transparent contains=ALLBUT,rError,rBraceError,rCurlyError fold
-  syn region rRegion matchgroup=Delimiter start=/{/ matchgroup=Delimiter end=/}/ transparent contains=ALLBUT,rError,rBraceError,rParenError fold
-  syn region rRegion matchgroup=Delimiter start=/\[/ matchgroup=Delimiter end=/]/ transparent contains=ALLBUT,rError,rCurlyError,rParenError fold
-else
-  syn region rRegion matchgroup=Delimiter start=/(/ matchgroup=Delimiter end=/)/ transparent contains=ALLBUT,rError,rBraceError,rCurlyError
-  syn region rRegion matchgroup=Delimiter start=/{/ matchgroup=Delimiter end=/}/ transparent contains=ALLBUT,rError,rBraceError,rParenError
-  syn region rRegion matchgroup=Delimiter start=/\[/ matchgroup=Delimiter end=/]/ transparent contains=ALLBUT,rError,rCurlyError,rParenError
-endif
-
-syn match rError      "[)\]}]"
-syn match rBraceError "[)}]" contained
-syn match rCurlyError "[)\]]" contained
-syn match rParenError "[\]}]" contained
-
-" Source list of R functions. The list is produced by the Vim-R-plugin
-" http://www.vim.org/scripts/script.php?script_id=2628
-runtime r-plugin/functions.vim
-
-syn match rDollar display contained "\$"
-
-" List elements will not be highlighted as functions:
-syn match rLstElmt "\$[a-zA-Z0-9\\._]*" contains=rDollar
-
-" Functions that may add new objects
-syn keyword rPreProc     library require attach detach source
-
-if &filetype == "rhelp"
-    syn match rHelpIdent '\\method'
-    syn match rHelpIdent '\\S4method'
-endif
-
-" Type
-syn keyword rType array category character complex double function integer list logical matrix numeric vector data.frame 
-
-" Name of object with spaces
-syn region rNameWSpace start="`" end="`"
-
-if &filetype == "rhelp"
-  syn match rhPreProc "^#ifdef.*" 
-  syn match rhPreProc "^#endif.*" 
-  syn match rhSection "\\dontrun\>"
-endif
-
-" Define the default highlighting.
-hi def link rArrow       Statement	
-hi def link rBoolean     Boolean
-hi def link rBraceError  Error
-hi def link rComment     Comment
-hi def link rComplex     Number
-hi def link rConditional Conditional
-hi def link rConstant    Constant
-hi def link rCurlyError  Error
-hi def link rDelimiter   Delimiter
-hi def link rDollar      SpecialChar
-hi def link rError       Error
-hi def link rFloat       Float
-hi def link rFunction    Function
-hi def link rHelpIdent   Identifier
-hi def link rhPreProc    PreProc
-hi def link rhSection    PreCondit
-hi def link rInteger     Number
-hi def link rLstElmt	 Normal
-hi def link rNameWSpace  Normal
-hi def link rNumber      Number
-hi def link rOperator    Operator
-hi def link rOpError     Error
-hi def link rParenError  Error
-hi def link rPreProc     PreProc
-hi def link rRepeat      Repeat
-hi def link rSpecial     SpecialChar
-hi def link rStatement   Statement
-hi def link rString      String
-hi def link rStrError    Error
-hi def link rType        Type
-
-let b:current_syntax="r"
-
-" vim: ts=8 sw=2
diff --git a/syntax/rbrowser.vim b/syntax/rbrowser.vim
index 8d5e53f..098f573 100644
--- a/syntax/rbrowser.vim
+++ b/syntax/rbrowser.vim
@@ -1,63 +1,58 @@
 " Vim syntax file
-" Language:	Object browser of Vim-R-plugin
+" Language:	Object browser of R Workspace
 " Maintainer:	Jakson Alves de Aquino (jalvesaq@gmail.com)
-" Last Change:	Mon Feb 21, 2011  06:44PM
 
 if exists("b:current_syntax")
-  finish
+    finish
 endif
 scriptencoding utf-8
 
 setlocal iskeyword=@,48-57,_,.
 
 if has("conceal")
-  setlocal conceallevel=2
-  setlocal concealcursor=nvc
-  syn match rbrowserNumeric	"{#.*\t" contains=rbrowserDelim,rbrowserTab
-  syn match rbrowserCharacter	/"#.*\t/ contains=rbrowserDelim,rbrowserTab
-  syn match rbrowserFactor	"'#.*\t" contains=rbrowserDelim,rbrowserTab
-  syn match rbrowserFunction	"(#.*\t" contains=rbrowserDelim,rbrowserTab
-  syn match rbrowserList	"\[#.*\t" contains=rbrowserDelim,rbrowserTab
-  syn match rbrowserLogical	"%#.*\t" contains=rbrowserDelim,rbrowserTab
-  syn match rbrowserLibrary	"##.*\t" contains=rbrowserDelim,rbrowserTab
-  syn match rbrowserRepeat	"!#.*\t" contains=rbrowserDelim,rbrowserTab
-  syn match rbrowserUnknown	"=#.*\t" contains=rbrowserDelim,rbrowserTab
+    setlocal conceallevel=2
+    setlocal concealcursor=nvc
+    syn match rbrowserNumeric	"{#.*\t" contains=rbrowserDelim,rbrowserTab
+    syn match rbrowserCharacter	/"#.*\t/ contains=rbrowserDelim,rbrowserTab
+    syn match rbrowserFactor	"'#.*\t" contains=rbrowserDelim,rbrowserTab
+    syn match rbrowserFunction	"(#.*\t" contains=rbrowserDelim,rbrowserTab
+    syn match rbrowserList	"\[#.*\t" contains=rbrowserDelim,rbrowserTab
+    syn match rbrowserLogical	"%#.*\t" contains=rbrowserDelim,rbrowserTab
+    syn match rbrowserLibrary	"##.*\t" contains=rbrowserDelim,rbrowserTab
+    syn match rbrowserS4	"<#.*\t" contains=rbrowserDelim,rbrowserTab
+    syn match rbrowserLazy	"&#.*\t" contains=rbrowserDelim,rbrowserTab
+    syn match rbrowserUnknown	"=#.*\t" contains=rbrowserDelim,rbrowserTab
 else
-  syn match rbrowserNumeric	"{.*\t" contains=rbrowserDelim,rbrowserTab
-  syn match rbrowserCharacter	/".*\t/ contains=rbrowserDelim,rbrowserTab
-  syn match rbrowserFactor	"'.*\t" contains=rbrowserDelim,rbrowserTab
-  syn match rbrowserFunction	"(.*\t" contains=rbrowserDelim,rbrowserTab
-  syn match rbrowserList	"\[.*\t" contains=rbrowserDelim,rbrowserTab
-  syn match rbrowserLogical	"%.*\t" contains=rbrowserDelim,rbrowserTab
-  syn match rbrowserLibrary	"#.*\t" contains=rbrowserDelim,rbrowserTab
-  syn match rbrowserRepeat	"!.*\t" contains=rbrowserDelim,rbrowserTab
-  syn match rbrowserUnknown	"=.*\t" contains=rbrowserDelim,rbrowserTab
+    syn match rbrowserNumeric	"{.*\t" contains=rbrowserDelim,rbrowserTab
+    syn match rbrowserCharacter	/".*\t/ contains=rbrowserDelim,rbrowserTab
+    syn match rbrowserFactor	"'.*\t" contains=rbrowserDelim,rbrowserTab
+    syn match rbrowserFunction	"(.*\t" contains=rbrowserDelim,rbrowserTab
+    syn match rbrowserList	"\[.*\t" contains=rbrowserDelim,rbrowserTab
+    syn match rbrowserLogical	"%.*\t" contains=rbrowserDelim,rbrowserTab
+    syn match rbrowserLibrary	"#.*\t" contains=rbrowserDelim,rbrowserTab
+    syn match rbrowserS4	"<.*\t" contains=rbrowserDelim,rbrowserTab
+    syn match rbrowserLazy	"&.*\t" contains=rbrowserDelim,rbrowserTab
+    syn match rbrowserUnknown	"=.*\t" contains=rbrowserDelim,rbrowserTab
 endif
 syn match rbrowserEnv		"^.GlobalEnv "
 syn match rbrowserEnv		"^Libraries "
 syn match rbrowserLink		" Libraries$"
 syn match rbrowserLink		" .GlobalEnv$"
-syn match rbrowserWarn		"^Warning:"
-syn match rbrowserWarn		"^The following"
-syn match rbrowserWarn		"^library is loaded"
-syn match rbrowserWarn		"^but is not in the"
-syn match rbrowserWarn		"^libraries are loaded"
-syn match rbrowserWarn		"^but are not in the"
-syn match rbrowserWarn		"^omniList:"
 syn match rbrowserTreePart	"├─"
 syn match rbrowserTreePart	"└─"
 syn match rbrowserTreePart	"│" 
 if &encoding != "utf-8"
-  syn match rbrowserTreePart	"|" 
-  syn match rbrowserTreePart	"`-"
-  syn match rbrowserTreePart	"|-"
+    syn match rbrowserTreePart	"|" 
+    syn match rbrowserTreePart	"`-"
+    syn match rbrowserTreePart	"|-"
 endif
 
 syn match rbrowserTab contained "\t"
+syn match rbrowserErr /Error: label isn't "character"./
 if has("conceal")
-  syn match rbrowserDelim contained /'#\|"#\|(#\|\[#\|{#\|%#\|##\|!#\|=#/ conceal
+    syn match rbrowserDelim contained /'#\|"#\|(#\|\[#\|{#\|%#\|##\|<#\|&#\|=#/ conceal
 else
-  syn match rbrowserDelim contained /'\|"\|(\|\[\|{\|%\|#\|!\|=/
+    syn match rbrowserDelim contained /'\|"\|(\|\[\|{\|%\|#\|<\|&\|=/
 endif
 
 hi def link rbrowserEnv		Statement
@@ -69,10 +64,13 @@ hi def link rbrowserLibrary	PreProc
 hi def link rbrowserLink	Comment
 hi def link rbrowserLogical	Boolean
 hi def link rbrowserFunction	Function
-hi def link rbrowserRepeat	Repeat
+hi def link rbrowserS4		Statement
+hi def link rbrowserLazy	Comment
 hi def link rbrowserUnknown	Normal
 hi def link rbrowserWarn	WarningMsg
+hi def link rbrowserErr 	ErrorMsg
 hi def link rbrowserTreePart	Comment
 hi def link rbrowserDelim	Ignore
 hi def link rbrowserTab		Ignore
 
+" vim: ts=8 sw=4
diff --git a/syntax/rdoc.vim b/syntax/rdoc.vim
index fc709b4..9f94c63 100644
--- a/syntax/rdoc.vim
+++ b/syntax/rdoc.vim
@@ -1,43 +1,65 @@
 " Vim syntax file
-" Language:	Test version of R documentation
+" Language:	R documentation
 " Maintainer:	Jakson A. Aquino 
-" Last Change:	Wed Oct 20, 2010  01:04PM
 
 if exists("b:current_syntax")
-  finish
+    finish
 endif
 
+setlocal iskeyword=@,48-57,_,.
+
 if !exists("rdoc_minlines")
-  let rdoc_minlines = 200
+    let rdoc_minlines = 200
 endif
 if !exists("rdoc_maxlines")
-  let rdoc_maxlines = 2 * rdoc_minlines
+    let rdoc_maxlines = 2 * rdoc_minlines
 endif
 exec "syn sync minlines=" . rdoc_minlines . " maxlines=" . rdoc_maxlines
 
-syn match  rdocTitle	      "^[A-Z].*:"
+
+syn match  rdocTitle	      "^[A-Z].*:$"
 syn match  rdocTitle "^\S.*R Documentation$"
-syn region rdocStringS  start="‘" end="’"
-syn region rdocStringS  start="" end=""
+syn match rdocFunction "\([A-Z]\|[a-z]\|\.\|_\)\([A-Z]\|[a-z]\|[0-9]\|\.\|_\)*" contained
+syn region rdocStringS  start="\%u2018" end="\%u2019" contains=rdocFunction transparent keepend
+syn region rdocStringS  start="\%x91" end="\%x92" contains=rdocFunction transparent keepend
 syn region rdocStringD  start='"' skip='\\"' end='"'
 syn match rdocURL `\v<(((https?|ftp|gopher)://|(mailto|file|news):)[^'	<>"]+|(www|web|w3)[a-z0-9_-]*\.[a-z0-9._-]+\.[^'  <>"]+)[a-zA-Z0-9/]`
 syn keyword rdocNote		note Note NOTE note: Note: NOTE: Notes Notes:
-syn match rdocArg  "^\s*\([a-z]\|[A-Z]\|[0-9]\|\.\)*: "
+
+" When using vim as R pager to see the output of help.search():
+syn region rdocPackage start="^[A-Za-z]\S*::" end="[\s\r]" contains=rdocPackName,rdocFuncName transparent
+syn match rdocPackName "^[A-Za-z][A-Za-z0-9\.]*" contained
+syn match rdocFuncName "::[A-Za-z0-9\.\-_]*" contained
+
+syn region rdocArgReg matchgroup=rdocArgTitle start="^Arguments:" matchgroup=NONE end="^\t" contains=rdocArgItems,rdocArgTitle,rdocPackage,rdocFuncName,rdocStringS keepend transparent
+syn region rdocArgItems start="\n\n" end=":" contains=rdocArg contained transparent
+syn match rdocArg "\([A-Z]\|[a-z]\|[0-9]\|\.\|_\)*" contained
 
 syn include @rdocR syntax/r.vim
 syn region rdocExample matchgroup=rdocExTitle start="^Examples:$" matchgroup=rdocExEnd end='^###$' contains=@rdocR keepend
+syn region rdocUsage matchgroup=rdocTitle start="^Usage:$" matchgroup=NONE end='^\t' contains=@rdocR
+
+syn sync match rdocSyncExample grouphere rdocExample "^Examples:$"
+syn sync match rdocSyncUsage grouphere rdocUsage "^Usage:$"
+syn sync match rdocSyncArg grouphere rdocArgReg "^Arguments:"
+syn sync match rdocSyncNONE grouphere NONE "^\t$"
+
 
 " Define the default highlighting.
+"hi def link rdocArgReg Statement
 hi def link rdocTitle	    Title
+hi def link rdocArgTitle    Title
 hi def link rdocExTitle   Title
 hi def link rdocExEnd   Comment
-hi def link rdocStringS     Function
+hi def link rdocFunction    Function
 hi def link rdocStringD     String
 hi def link rdocURL    HtmlLink
 hi def link rdocArg         Special
 hi def link rdocNote  Todo
 
+hi def link rdocPackName Title
+hi def link rdocFuncName Function
 
 let b:current_syntax = "rdoc"
 
-" vim:ts=8 sts=2 sw=2:
+" vim: ts=8 sw=4
diff --git a/syntax/rhelp.vim b/syntax/rhelp.vim
deleted file mode 100644
index 7d76191..0000000
--- a/syntax/rhelp.vim
+++ /dev/null
@@ -1,237 +0,0 @@
-" Vim syntax file
-" Language:    R Help File
-" Maintainer: Jakson Aquino 
-" Former Maintainer: Johannes Ranke 
-" Last Change: Thu Apr 14, 2011  05:03PM
-" Version:     0.7.4
-" SVN:		   $Id: rhelp.vim 90 2010-11-22 10:58:11Z ranke $
-" Remarks:     - Includes R syntax highlighting in the appropriate
-"                sections if an r.vim file is in the same directory or in the
-"                default debian location.
-"              - There is no Latex markup in equations
-"              - Thanks to Will Gray for finding and fixing a bug
-"              - No support for \if, \ifelse and \out as I don't understand
-"                them and have no examples at hand (help welcome).
-"              - No support for \var tag within quoted string (dito)
-"              - No support for spell checking.
-
-" Version Clears: {{{1
-" For version 5.x: Clear all syntax items
-" For version 6.x and 7.x: Quit when a syntax file was already loaded
-if version < 600 
-  syntax clear
-elseif exists("b:current_syntax")
-  finish
-endif 
-
-syn case match
-
-" R help identifiers {{{1
-syn region rhelpIdentifier matchgroup=rhelpSection	start="\\name{" end="}" 
-syn region rhelpIdentifier matchgroup=rhelpSection	start="\\alias{" end="}" 
-syn region rhelpIdentifier matchgroup=rhelpSection	start="\\pkg{" end="}" contains=rhelpLink
-syn region rhelpIdentifier matchgroup=rhelpSection start="\\method{" end="}" contained
-syn region rhelpIdentifier matchgroup=rhelpSection start="\\Rdversion{" end="}"
-
-" Highlighting of R code using an existing r.vim syntax file if available {{{1
-syn include @R syntax/r.vim
-
-" Strings {{{1
-syn region rhelpString start=/"/ skip=/\\"/ end=/"/ contains=rhelpSpecialChar,rhelpCodeSpecial,rhelpLink contained
-
-" Special characters in R strings
-syn match rhelpCodeSpecial display contained "\\\\\(n\|r\|t\|b\|a\|f\|v\|'\|\"\)\|\\\\"
-
-" Special characters  ( \$ \& \% \# \{ \} \_)
-syn match rhelpSpecialChar        "\\[$&%#{}_]"
-
-
-" R code {{{1
-syn match rhelpDots		"\\dots" containedin=@R
-syn region rhelpRcode matchgroup=Delimiter start="\\examples{" matchgroup=Delimiter transparent end="}" contains=@R,rhelpLink,rhelpIdentifier,rhelpString,rhelpSpecialChar,rhelpSection
-syn region rhelpRcode matchgroup=Delimiter start="\\usage{" matchgroup=Delimiter transparent end="}" contains=@R,rhelpIdentifier,rhelpS4method
-syn region rhelpRcode matchgroup=Delimiter start="\\synopsis{" matchgroup=Delimiter transparent end="}" contains=@R
-syn region rhelpRcode matchgroup=Delimiter start="\\special{" matchgroup=Delimiter transparent end="}" contains=@R
-syn region rhelpRcode matchgroup=Delimiter start="\\code{" skip='\\\@"
-syn match rhelpKeyword	"\\ge"
-syn match rhelpKeyword	"\\le"
-syn match rhelpKeyword	"\\alpha"
-syn match rhelpKeyword	"\\beta"
-syn match rhelpKeyword	"\\gamma"
-syn match rhelpKeyword	"\\delta"
-syn match rhelpKeyword	"\\epsilon"
-syn match rhelpKeyword	"\\zeta"
-syn match rhelpKeyword	"\\eta"
-syn match rhelpKeyword	"\\theta"
-syn match rhelpKeyword	"\\iota"
-syn match rhelpKeyword	"\\kappa"
-syn match rhelpKeyword	"\\lambda"
-syn match rhelpKeyword	"\\mu"
-syn match rhelpKeyword	"\\nu"
-syn match rhelpKeyword	"\\xi"
-syn match rhelpKeyword	"\\omicron"
-syn match rhelpKeyword	"\\pi"
-syn match rhelpKeyword	"\\rho"
-syn match rhelpKeyword	"\\sigma"
-syn match rhelpKeyword	"\\tau"
-syn match rhelpKeyword	"\\upsilon"
-syn match rhelpKeyword	"\\phi"
-syn match rhelpKeyword	"\\chi"
-syn match rhelpKeyword	"\\psi"
-syn match rhelpKeyword	"\\omega"
-syn match rhelpKeyword	"\\Alpha"
-syn match rhelpKeyword	"\\Beta"
-syn match rhelpKeyword	"\\Gamma"
-syn match rhelpKeyword	"\\Delta"
-syn match rhelpKeyword	"\\Epsilon"
-syn match rhelpKeyword	"\\Zeta"
-syn match rhelpKeyword	"\\Eta"
-syn match rhelpKeyword	"\\Theta"
-syn match rhelpKeyword	"\\Iota"
-syn match rhelpKeyword	"\\Kappa"
-syn match rhelpKeyword	"\\Lambda"
-syn match rhelpKeyword	"\\Mu"
-syn match rhelpKeyword	"\\Nu"
-syn match rhelpKeyword	"\\Xi"
-syn match rhelpKeyword	"\\Omicron"
-syn match rhelpKeyword	"\\Pi"
-syn match rhelpKeyword	"\\Rho"
-syn match rhelpKeyword	"\\Sigma"
-syn match rhelpKeyword	"\\Tau"
-syn match rhelpKeyword	"\\Upsilon"
-syn match rhelpKeyword	"\\Phi"
-syn match rhelpKeyword	"\\Chi"
-syn match rhelpKeyword	"\\Psi"
-syn match rhelpKeyword	"\\Omega"
-
-" Links {{{1
-syn region rhelpLink matchgroup=rhelpSection start="\\link{" end="}" contained keepend extend
-syn region rhelpLink matchgroup=rhelpSection start="\\link\[.\{-}\]{" end="}" contained keepend extend
-syn region rhelpLink matchgroup=rhelpSection start="\\linkS4class{" end="}" contained keepend extend
-
-" Verbatim like {{{1
-syn region rhelpVerbatim matchgroup=rhelpType start="\\samp{" skip='\\\@"
-syn match rhelpType		"\\strong\>"
-syn match rhelpType		"\\bold\>"
-syn match rhelpType		"\\sQuote\>"
-syn match rhelpType		"\\dQuote\>"
-syn match rhelpType		"\\preformatted\>"
-syn match rhelpType		"\\kbd\>"
-syn match rhelpType		"\\eqn\>"
-syn match rhelpType		"\\deqn\>"
-syn match rhelpType		"\\file\>"
-syn match rhelpType		"\\email\>"
-syn match rhelpType		"\\url\>"
-syn match rhelpType		"\\href\>"
-syn match rhelpType		"\\var\>"
-syn match rhelpType		"\\env\>"
-syn match rhelpType		"\\option\>"
-syn match rhelpType		"\\command\>"
-syn match rhelpType		"\\newcommand\>"
-syn match rhelpType		"\\renewcommand\>"
-syn match rhelpType		"\\dfn\>"
-syn match rhelpType		"\\cite\>"
-syn match rhelpType		"\\acronym\>"
-
-" rhelp sections {{{1
-syn match rhelpSection		"\\encoding\>"
-syn match rhelpSection		"\\title\>"
-syn match rhelpSection		"\\item\>"
-syn match rhelpSection		"\\description\>"
-syn match rhelpSection		"\\concept\>"
-syn match rhelpSection		"\\arguments\>"
-syn match rhelpSection		"\\details\>"
-syn match rhelpSection		"\\value\>"
-syn match rhelpSection		"\\references\>"
-syn match rhelpSection		"\\note\>"
-syn match rhelpSection		"\\author\>"
-syn match rhelpSection		"\\seealso\>"
-syn match rhelpSection		"\\keyword\>"
-syn match rhelpSection		"\\docType\>"
-syn match rhelpSection		"\\format\>"
-syn match rhelpSection		"\\source\>"
-syn match rhelpSection    "\\itemize\>"
-syn match rhelpSection    "\\describe\>"
-syn match rhelpSection    "\\enumerate\>"
-syn match rhelpSection    "\\item "
-syn match rhelpSection    "\\item$"
-syn match rhelpSection		"\\tabular{[lcr]*}"
-syn match rhelpSection		"\\dontrun\>"
-syn match rhelpSection		"\\dontshow\>"
-syn match rhelpSection		"\\testonly\>"
-syn match rhelpSection		"\\donttest\>"
-
-" Freely named Sections {{{1
-syn region rhelpFreesec matchgroup=Delimiter start="\\section{" matchgroup=Delimiter transparent end="}"
-syn region rhelpFreesubsec matchgroup=Delimiter start="\\subsection{" matchgroup=Delimiter transparent end="}" 
-
-syn match rhelpDelimiter "{\|\[\|(\|)\|\]\|}"
-
-" R help file comments {{{1
-syn match rhelpComment /%.*$/
-
-" Error {{{1
-syn region rhelpRegion matchgroup=Delimiter start=/(/ matchgroup=Delimiter end=/)/ transparent contains=ALLBUT,rhelpError,rhelpBraceError,rhelpCurlyError
-syn region rhelpRegion matchgroup=Delimiter start=/{/ matchgroup=Delimiter end=/}/ transparent contains=ALLBUT,rhelpError,rhelpBraceError,rhelpParenError
-syn region rhelpRegion matchgroup=Delimiter start=/\[/ matchgroup=Delimiter end=/]/ transparent contains=ALLBUT,rhelpError,rhelpCurlyError,rhelpParenError
-syn match rhelpError      /[)\]}]/
-syn match rhelpBraceError /[)}]/ contained
-syn match rhelpCurlyError /[)\]]/ contained
-syn match rhelpParenError /[\]}]/ contained
-
-" Define the default highlighting {{{1
-" For version 5.7 and earlier: only when not done already
-" For version 5.8 and later: only when an item doesn't have highlighting yet
-if version >= 508 || !exists("did_rhelp_syntax_inits")
-  if version < 508
-    let did_rhelp_syntax_inits = 1
-    command -nargs=+ HiLink hi link 
-  else
-    command -nargs=+ HiLink hi def link 
-  endif
-  HiLink rhelpVerbatim    String
-  HiLink rhelpDelimiter   Delimiter
-  HiLink rhelpIdentifier  Identifier
-  HiLink rhelpString      String
-  HiLink rhelpCodeSpecial Special
-  HiLink rhelpKeyword     Keyword
-  HiLink rhelpDots        Keyword
-  HiLink rhelpLink        Underlined
-  HiLink rhelpType        Type
-  HiLink rhelpSection     PreCondit
-  HiLink rhelpError       Error
-  HiLink rhelpBraceError  Error
-  HiLink rhelpCurlyError  Error
-  HiLink rhelpParenError  Error
-  HiLink rhelpPreProc     PreProc
-  HiLink rhelpDelimiter   Delimiter
-  HiLink rhelpComment     Comment
-  HiLink rhelpRComment    Comment
-  HiLink rhelpSpecialChar SpecialChar
-  delcommand HiLink
-endif 
-
-let   b:current_syntax = "rhelp"
-" vim: foldmethod=marker:
diff --git a/syntax/rout.vim b/syntax/rout.vim
index 578a5bd..f380c23 100644
--- a/syntax/rout.vim
+++ b/syntax/rout.vim
@@ -1,69 +1,76 @@
 " Vim syntax file
 " Language:    R output Files
 " Maintainer:  Jakson Aquino 
-" Last Change: Sun May 22, 2011  08:43AM
-"
-
-" Version Clears: {{{1
-" For version 5.x: Clear all syntax items
-" For version 6.x and 7.x: Quit when a syntax file was already loaded
-if version < 600 
-  syntax clear
-elseif exists("b:current_syntax")
-  finish
+
+
+if exists("b:current_syntax")
+    finish
 endif 
 
-if !exists("syn_rout_latex")
-    let g:syn_rout_latex = 0
-endif
+setlocal iskeyword=@,48-57,_,.
 
 syn case match
 
+" Normal text
+syn match routNormal "."
+
 " Strings
 syn region routString start=/"/ skip=/\\\\\|\\"/ end=/"/ end=/$/
 
 " Constants
-syn keyword rConstant NULL
-syn keyword rBoolean  FALSE TRUE
-syn keyword rNumber   NA Inf NaN 
+syn keyword routConst  NULL NA NaN
+syn keyword routTrue   TRUE
+syn keyword routFalse  FALSE
+syn match routConst "\"
+syn match routInf "-Inf\>"
+syn match routInf "\"
 
 " integer
-syn match rInteger "\<\d\+L"
-syn match rInteger "\<0x\([0-9]\|[a-f]\|[A-F]\)\+L"
-syn match rInteger "\<\d\+[Ee]+\=\d\+L"
+syn match routInteger "\<\d\+L"
+syn match routInteger "\<0x\([0-9]\|[a-f]\|[A-F]\)\+L"
+syn match routInteger "\<\d\+[Ee]+\=\d\+L"
 
 " number with no fractional part or exponent
-syn match rNumber "\<\d\+\>"
+syn match routNumber "\<\d\+\>"
+syn match routNegNum "-\<\d\+\>"
 " hexadecimal number 
-syn match rNumber "\<0x\([0-9]\|[a-f]\|[A-F]\)\+"
+syn match routNumber "\<0x\([0-9]\|[a-f]\|[A-F]\)\+"
 
 " floating point number with integer and fractional parts and optional exponent
-syn match rFloat "\<\d\+\.\d*\([Ee][-+]\=\d\+\)\="
+syn match routFloat "\<\d\+\.\d*\([Ee][-+]\=\d\+\)\="
+syn match routNegFloat "-\<\d\+\.\d*\([Ee][-+]\=\d\+\)\="
 " floating point number with no integer part and optional exponent
-syn match rFloat "\<\.\d\+\([Ee][-+]\=\d\+\)\="
+syn match routFloat "\<\.\d\+\([Ee][-+]\=\d\+\)\="
+syn match routNegFloat "-\<\.\d\+\([Ee][-+]\=\d\+\)\="
 " floating point number with no fractional part and optional exponent
-syn match rFloat "\<\d\+[Ee][-+]\=\d\+"
+syn match routFloat "\<\d\+[Ee][-+]\=\d\+"
+syn match routNegFloat "-\<\d\+[Ee][-+]\=\d\+"
 
 " complex number
-syn match rComplex "\<\d\+i"
-syn match rComplex "\<\d\++\d\+i"
-syn match rComplex "\<0x\([0-9]\|[a-f]\|[A-F]\)\+i"
-syn match rComplex "\<\d\+\.\d*\([Ee][-+]\=\d\+\)\=i"
-syn match rComplex "\<\.\d\+\([Ee][-+]\=\d\+\)\=i"
-syn match rComplex "\<\d\+[Ee][-+]\=\d\+i"
-
-if !exists("g:vimrplugin_routmorecolors")
-  let g:vimrplugin_routmorecolors = 0
+syn match routComplex "\<\d\+i"
+syn match routComplex "\<\d\++\d\+i"
+syn match routComplex "\<0x\([0-9]\|[a-f]\|[A-F]\)\+i"
+syn match routComplex "\<\d\+\.\d*\([Ee][-+]\=\d\+\)\=i"
+syn match routComplex "\<\.\d\+\([Ee][-+]\=\d\+\)\=i"
+syn match routComplex "\<\d\+[Ee][-+]\=\d\+i"
+
+" dates and times
+syn match routDate "[0-9][0-9][0-9][0-9][-/][0-9][0-9][-/][0-9][-0-9]"
+syn match routDate "[0-9][0-9][-/][0-9][0-9][-/][0-9][0-9][0-9][-0-9]"
+syn match routDate "[0-9][0-9]:[0-9][0-9]:[0-9][-0-9]"
+
+if !exists("g:Rout_more_colors")
+    let g:Rout_more_colors = 0
 endif
 
-if g:vimrplugin_routmorecolors == 1
-  syn include @routR syntax/r.vim
-  syn region routColoredR start="^> " end='$' contains=@routR keepend
-  syn region routColoredR start="^+ " end='$' contains=@routR keepend
+if g:Rout_more_colors
+    syn include @routR syntax/r.vim
+    syn region routColoredR start="^>" end='$' contains=@routR keepend
+    syn region routColoredR start="^+" end='$' contains=@routR keepend
 else
-  " Comment
-  syn match routComment /^> .*/
-  syn match routComment /^+ .*/
+    " Input
+    syn match routInput /^>.*/
+    syn match routInput /^+.*/
 endif
 
 " Index of vectors
@@ -73,63 +80,111 @@ syn match routIndex /^\s*\[\d\+\]/
 syn match routError "^Error.*"
 syn match routWarn "^Warning.*"
 
+if v:lang =~ "^da"
+    syn match routError	"^Fejl.*"
+    syn match routWarn	"^Advarsel.*"
+endif
+
 if v:lang =~ "^de"
-  syn match routError	"^Fehler.*"
-  syn match routWarn	"^Warnung.*"
+    syn match routError	"^Fehler.*"
+    syn match routWarn	"^Warnung.*"
 endif
 
 if v:lang =~ "^es"
-  syn match routError	"^Error.*"
-  syn match routWarn	"^Aviso.*"
+    syn match routWarn	"^Aviso.*"
 endif
 
 if v:lang =~ "^fr"
-  syn match routError	"^Erreur.*"
-  syn match routWarn	"^Avis.*"
+    syn match routError	"^Erreur.*"
+    syn match routWarn	"^Avis.*"
 endif
 
 if v:lang =~ "^it"
-  syn match routError	"^Errore.*"
-  syn match routWarn	"^Avviso.*"
+    syn match routError	"^Errore.*"
+    syn match routWarn	"^Avviso.*"
 endif
 
 if v:lang =~ "^nn"
-  syn match routError	"^Feil.*"
-  syn match routWarn	"^Åtvaring.*"
+    syn match routError	"^Feil.*"
+    syn match routWarn	"^Åtvaring.*"
+endif
+
+if v:lang =~ "^pl"
+    syn match routError	"^BŁĄD.*"
+    syn match routError	"^Błąd.*"
+    syn match routWarn	"^Ostrzeżenie.*"
 endif
 
 if v:lang =~ "^pt_BR"
-  syn match routError	"^Erro.*"
-  syn match routWarn	"^Aviso.*"
+    syn match routError	"^Erro.*"
+    syn match routWarn	"^Aviso.*"
 endif
 
 if v:lang =~ "^ru"
-  syn match routError	"^Ошибка.*"
-  syn match routWarn	"^Предупреждение.*"
+    syn match routError	"^Ошибка.*"
+    syn match routWarn	"^Предупреждение.*"
 endif
 
-" LaTeX errors
-if syn_rout_latex == 1
-    syn match routWarn "^No file .*"
-    syn match routWarn "^Underfull .*"
-    syn match routWarn "^Overfull .*"
-    syn match routWarn "^LaTeX Warning: .*"
-    syn match routError "^! LaTeX Error: .*"
+if v:lang =~ "^tr"
+    syn match routError	"^Hata.*"
+    syn match routWarn	"^Uyarı.*"
 endif
 
 " Define the default highlighting.
-if g:vimrplugin_routmorecolors == 0
-  hi def link routComment	Comment
+if g:Rout_more_colors == 0
+    hi def link routInput	Comment
+endif
+
+if exists("g:rout_follow_colorscheme") && g:rout_follow_colorscheme
+    " Default when following :colorscheme
+    hi def link routNormal	Normal
+    hi def link routNumber	Number
+    hi def link routInteger	Number
+    hi def link routFloat	Float
+    hi def link routComplex	Number
+    hi def link routNegNum	Number
+    hi def link routNegFloat	Float
+    hi def link routDate	Number
+    hi def link routTrue	Boolean
+    hi def link routFalse	Boolean
+    hi def link routInf  	Number
+    hi def link routConst	Constant
+    hi def link routString	String
+    hi def link routIndex	Special
+    hi def link routError	ErrorMsg
+    hi def link routWarn	WarningMsg
+else
+    function s:SetGroupColor(group, cgui, c256, c16)
+        if exists("g:rout_color_" . tolower(a:group))
+            exe "hi rout" . a:group . eval("g:rout_color_" . tolower(a:group))
+        elseif has("gui_running")
+            exe "hi rout" . a:group . "guifg=" . a:cgui
+        elseif &t_Co == 256
+            exe "hi rout" . a:group . "ctermfg=" . a:c256
+        else
+            exe "hi rout" . a:group . "ctermfg=" . a:c16
+        endif
+    endfunction
+    call s:SetGroupColor("Input ",    "#9e9e9e",               "247",          "gray")
+    call s:SetGroupColor("Normal ",   "#00d700",               "40",           "darkgreen")
+    call s:SetGroupColor("Number ",   "#ffaf00",               "214",          "darkyellow")
+    call s:SetGroupColor("Integer ",  "#ffaf00",               "214",          "darkyellow")
+    call s:SetGroupColor("Float ",    "#ffaf00",               "214",          "darkyellow")
+    call s:SetGroupColor("Complex ",  "#ffaf00",               "214",          "darkyellow")
+    call s:SetGroupColor("NegNum ",   "#ff875f",               "209",          "darkyellow")
+    call s:SetGroupColor("NegFloat ", "#ff875f",               "209",          "darkyellow")
+    call s:SetGroupColor("Date ",     "#d7af5f",               "179",          "darkyellow")
+    call s:SetGroupColor("False ",    "#ff5f5f",               "203",          "darkyellow")
+    call s:SetGroupColor("True ",     "#5fd787",               "78",           "magenta")
+    call s:SetGroupColor("Inf ",      "#00afff",               "39",           "darkgreen")
+    call s:SetGroupColor("Const ",    "#00af5f",               "35",           "magenta")
+    call s:SetGroupColor("String ",   "#5fffaf",               "85",           "darkcyan")
+    call s:SetGroupColor("Error ",    "#ffffff guibg=#c00000", "15 ctermbg=1", "white ctermbg=red")
+    call s:SetGroupColor("Warn ",     "#c00000",               "1",            "red")
+    call s:SetGroupColor("Index ",    "#87afaf",               "109",          "darkgreen")
+    delfunction s:SetGroupColor
 endif
-hi def link rNumber	Number
-hi def link rComplex	Number
-hi def link rInteger	Number
-hi def link rBoolean	Boolean
-hi def link rConstant	Constant
-hi def link rFloat	Float
-hi def link routString	String
-hi def link routError	Error
-hi def link routWarn	WarningMsg
-hi def link routIndex	Special
 
 let   b:current_syntax = "rout"
+
+" vim: ts=8 sw=4