Permalink
Browse files

Version 100728: * Adapted the code to build a Debian package.

  • Loading branch information...
jalvesaq authored and vim-scripts committed Jul 28, 2010
1 parent b2c6bd0 commit a4d6be0b918ebd9e6b7ad172ddb9914da71ca83b
Showing with 111 additions and 65 deletions.
  1. +3 −3 after/syntax/r.vim
  2. +39 −47 doc/r-plugin.txt
  3. +23 −5 ftplugin/r.vim
  4. +23 −5 ftplugin/rhelp.vim
  5. +23 −5 ftplugin/rnoweb.vim
View
@@ -15,9 +15,9 @@ syn match rOperator /[\*\!\%\&\+\-\<\>\=\^\|\~\`/:@]/
syn match rOperator /%o%\|%x%\|xor\|isTRUE/
syn match rDollar /\$/
" Load functions file
-let g:rfunfile = expand("<sfile>:h:h:h") . "/r-plugin/functions.vim"
-if filereadable(g:rfunfile)
- exe "source " . g:rfunfile
+let s:rfunfile = b:user_vimfiles . "/r-plugin/functions.vim"
+if filereadable(s:rfunfile)
+ exe "source " . s:rfunfile
endif
syn keyword rPreProc library require
View
@@ -6,7 +6,7 @@
Authors: Jakson A. Aquino <jalvesaq@gmail.com>
José Cláudio Faria
-Version: 100719
+Version: 100728
For Vim version 7.2 and above
@@ -421,7 +421,7 @@ code to other R processes then put the following in your |vimrc|:
>
This is the default behavior when using Vim with the screen.vim plugin, and,
thus, there is no need to use this option if already running Vim with the
-option |vimrplugin_screenplugin|(see below). The
+option |vimrplugin_screenplugin| (see below). 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
@@ -514,7 +514,7 @@ Then, follow the instructions below to activate the new functions.
The R function args() list 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 <LocalLeader>ra, in addition to editing your
-~/.Rprofile as explained above, you have to add to your |.vimrc|:
+~/.Rprofile as explained above, you have to add to your |vimrc|:
>
let vimrplugin_listmethods = 1
<
@@ -524,7 +524,7 @@ of its methods. If you want that the plugin calls the function
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 <LocalLeader>rg if you edit your ~/.Rprofile as explained above and put
-the following line in your |.vimrc|:
+the following line in your |vimrc|:
>
let vimrplugin_specialplot = 1
<
@@ -641,45 +641,34 @@ You should replace <Leader>rk with the key binding that you want to use and
The following files are part of the plugin and should be in your ~/.vim
directory after the installation:
- .vim
- |-- after
- | `-- syntax
- | `-- r.vim
- |-- autoload
- | `-- rcomplete.vim
- |-- bitmaps
- | |-- r-close.xpm
- | |-- r-control-clearall.png
- | |-- r-control-clear.png
- | |-- r-control-listspace.png
- | |-- ricon.png
- | |-- ricon.xbm
- | |-- r-send-block.png
- | |-- r-send-file.png
- | |-- r-send-function.png
- | |-- r-send-line.png
- | |-- r-send-paragraph.png
- | |-- r-send-selection.png
- | `-- r-start.xpm
- |-- doc
- | `-- r-plugin.txt
- |-- ftdetect
- | `-- r.vim
- |-- ftplugin
- | |-- rhelp.vim -> r.vim
- | |-- rnoweb.vim -> r.vim
- | `-- r.vim
- |-- indent
- | `-- r.vim
- |-- r-plugin
- | |-- build_omni_list.R
- | |-- functions.vim
- | |-- omnilist
- | |-- rpager.sh
- | `-- specialfuns.R
- `-- syntax
- `-- rout.vim
-
+ after/syntax/r.vim
+ autoload/rcomplete.vim
+ bitmaps/r-close.xpm
+ bitmaps/r-control-clear.png
+ bitmaps/r-control-clearall.png
+ bitmaps/r-control-listspace.png
+ bitmaps/r-send-block.png
+ bitmaps/r-send-file.png
+ bitmaps/r-send-function.png
+ bitmaps/r-send-line.png
+ bitmaps/r-send-paragraph.png
+ bitmaps/r-send-selection.png
+ bitmaps/r-start.xpm
+ bitmaps/ricon.png
+ bitmaps/ricon.xbm
+ doc/r-plugin.txt
+ ftdetect/r.vim
+ ftplugin/r.vim
+ ftplugin/rhelp.vim
+ ftplugin/rnoweb.vim
+ indent/r.vim
+ r-plugin/build_omni_list.R
+ r-plugin/etags2ctags.R
+ r-plugin/functions.vim
+ r-plugin/omnilist
+ r-plugin/rpager.sh
+ r-plugin/specialfuns.R
+ syntax/rout.vim
------------------------------------------------------------------------------
10. FAQ and tips~
@@ -696,9 +685,9 @@ directory after the installation:
<
10.2. How do marked blocks work?~
- Vim allows several marks (bookmarks). The most commonly used marks are |a..z|.
- If the cursor is between any two marks, the plugin will send all of the
- lines between them to R.
+ 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:
@@ -763,6 +752,9 @@ directory after the installation:
------------------------------------------------------------------------------
11. News~
*r-plugin-news*
+100728 (2010-07-28)
+ * Adapted the plugin to allow the creation of a Debian package.
+
100719 (2010-07-19)
* Added options vimrplugin_listmethods and vimrplugin_specialplot.
* Improved syntax highlight of R batch output (.Rout files).
@@ -868,4 +860,4 @@ directory after the installation:
090507 (2009-05-08)
* Initial upload
-vim:tw=78:ts=8:ft=help:norl:fenc=utf-8
+vim:tw=78:ts=8:ft=help:norl
View
@@ -19,7 +19,7 @@
"
" Based on previous work by Johannes Ranke
"
-" Last Change: Sun Jul 18, 2010 12:29PM
+" Last Change: Wed Jul 28, 2010 09:36AM
"
" Please see doc/r-plugin.txt for usage details.
"==========================================================================
@@ -84,9 +84,27 @@ endif
" Save r plugin home - necessary to make vim-r-plugin2 work with pathogen
let b:r_plugin_home = expand("<sfile>:h:h")
+" Save user_vimfiles
+let b:user_vimfiles = split(&runtimepath, ",")[0]
+
+
+" Create r-plugin directory if it doesn't exist yet:
+if !isdirectory(b:user_vimfiles . "/r-plugin")
+ call mkdir(b:user_vimfiles . "/r-plugin", "p")
+ " Find omnilist and rfunctions.vim and copy them
+ if filereadable(b:r_plugin_home . "/r-plugin/omnilist")
+ let x = readfile(b:r_plugin_home . "/r-plugin/omnilist")
+ call writefile(x, b:user_vimfiles . "/r-plugin/omnilist")
+ endif
+ if filereadable(b:r_plugin_home . "/r-plugin/functions.vim")
+ let x = readfile(b:r_plugin_home . "/r-plugin/omnilist")
+ call writefile(x, b:user_vimfiles . "/r-plugin/functions.vim")
+ endif
+endif
+
" Keeps the libraries object list in memory to avoid the need of reading the file
" repeatedly:
-let b:local_omni_filename = b:r_plugin_home . "/r-plugin/omnilist"
+let b:local_omni_filename = b:user_vimfiles . "/r-plugin/omnilist"
let b:flines1 = readfile(b:local_omni_filename)
@@ -718,7 +736,7 @@ function! RBuildSyntaxFile()
call add(res, line)
endif
endfor
- call writefile(res, b:r_plugin_home . "/r-plugin/functions.vim")
+ call writefile(res, b:user_vimfiles . "/r-plugin/functions.vim")
call RWarningMsg("The syntax will be updated next time you load an R file.")
endfunction
@@ -748,9 +766,9 @@ function! RStartDebug()
call RWarningMsg(rlog)
return
endif
- call SendCmdToScreen('source("' . b:r_plugin_home . '/r-plugin/Clnt.r")')
+ call SendCmdToScreen('source("' . b:user_vimfiles . '/r-plugin/Clnt.r")')
let curline = line(".")
- let scmd = "screen -S VimRdebug -X stuff 'source(\"" . b:r_plugin_home . "/r-plugin/Srvr.r\") ; editsrvr(vimserver=\"" . v:servername . "\") ; quit(\"no\")" . "\<C-M>'"
+ let scmd = "screen -S VimRdebug -X stuff 'source(\"" . b:user_vimfiles . "/r-plugin/Srvr.r\") ; editsrvr(vimserver=\"" . v:servername . "\") ; quit(\"no\")" . "\<C-M>'"
sleep 3
let rlog = system(scmd)
if v:shell_error
View
@@ -19,7 +19,7 @@
"
" Based on previous work by Johannes Ranke
"
-" Last Change: Sun Jul 18, 2010 12:29PM
+" Last Change: Wed Jul 28, 2010 09:36AM
"
" Please see doc/r-plugin.txt for usage details.
"==========================================================================
@@ -84,9 +84,27 @@ endif
" Save r plugin home - necessary to make vim-r-plugin2 work with pathogen
let b:r_plugin_home = expand("<sfile>:h:h")
+" Save user_vimfiles
+let b:user_vimfiles = split(&runtimepath, ",")[0]
+
+
+" Create r-plugin directory if it doesn't exist yet:
+if !isdirectory(b:user_vimfiles . "/r-plugin")
+ call mkdir(b:user_vimfiles . "/r-plugin", "p")
+ " Find omnilist and rfunctions.vim and copy them
+ if filereadable(b:r_plugin_home . "/r-plugin/omnilist")
+ let x = readfile(b:r_plugin_home . "/r-plugin/omnilist")
+ call writefile(x, b:user_vimfiles . "/r-plugin/omnilist")
+ endif
+ if filereadable(b:r_plugin_home . "/r-plugin/functions.vim")
+ let x = readfile(b:r_plugin_home . "/r-plugin/omnilist")
+ call writefile(x, b:user_vimfiles . "/r-plugin/functions.vim")
+ endif
+endif
+
" Keeps the libraries object list in memory to avoid the need of reading the file
" repeatedly:
-let b:local_omni_filename = b:r_plugin_home . "/r-plugin/omnilist"
+let b:local_omni_filename = b:user_vimfiles . "/r-plugin/omnilist"
let b:flines1 = readfile(b:local_omni_filename)
@@ -718,7 +736,7 @@ function! RBuildSyntaxFile()
call add(res, line)
endif
endfor
- call writefile(res, b:r_plugin_home . "/r-plugin/functions.vim")
+ call writefile(res, b:user_vimfiles . "/r-plugin/functions.vim")
call RWarningMsg("The syntax will be updated next time you load an R file.")
endfunction
@@ -748,9 +766,9 @@ function! RStartDebug()
call RWarningMsg(rlog)
return
endif
- call SendCmdToScreen('source("' . b:r_plugin_home . '/r-plugin/Clnt.r")')
+ call SendCmdToScreen('source("' . b:user_vimfiles . '/r-plugin/Clnt.r")')
let curline = line(".")
- let scmd = "screen -S VimRdebug -X stuff 'source(\"" . b:r_plugin_home . "/r-plugin/Srvr.r\") ; editsrvr(vimserver=\"" . v:servername . "\") ; quit(\"no\")" . "\<C-M>'"
+ let scmd = "screen -S VimRdebug -X stuff 'source(\"" . b:user_vimfiles . "/r-plugin/Srvr.r\") ; editsrvr(vimserver=\"" . v:servername . "\") ; quit(\"no\")" . "\<C-M>'"
sleep 3
let rlog = system(scmd)
if v:shell_error
View
@@ -19,7 +19,7 @@
"
" Based on previous work by Johannes Ranke
"
-" Last Change: Sun Jul 18, 2010 12:29PM
+" Last Change: Wed Jul 28, 2010 09:36AM
"
" Please see doc/r-plugin.txt for usage details.
"==========================================================================
@@ -84,9 +84,27 @@ endif
" Save r plugin home - necessary to make vim-r-plugin2 work with pathogen
let b:r_plugin_home = expand("<sfile>:h:h")
+" Save user_vimfiles
+let b:user_vimfiles = split(&runtimepath, ",")[0]
+
+
+" Create r-plugin directory if it doesn't exist yet:
+if !isdirectory(b:user_vimfiles . "/r-plugin")
+ call mkdir(b:user_vimfiles . "/r-plugin", "p")
+ " Find omnilist and rfunctions.vim and copy them
+ if filereadable(b:r_plugin_home . "/r-plugin/omnilist")
+ let x = readfile(b:r_plugin_home . "/r-plugin/omnilist")
+ call writefile(x, b:user_vimfiles . "/r-plugin/omnilist")
+ endif
+ if filereadable(b:r_plugin_home . "/r-plugin/functions.vim")
+ let x = readfile(b:r_plugin_home . "/r-plugin/omnilist")
+ call writefile(x, b:user_vimfiles . "/r-plugin/functions.vim")
+ endif
+endif
+
" Keeps the libraries object list in memory to avoid the need of reading the file
" repeatedly:
-let b:local_omni_filename = b:r_plugin_home . "/r-plugin/omnilist"
+let b:local_omni_filename = b:user_vimfiles . "/r-plugin/omnilist"
let b:flines1 = readfile(b:local_omni_filename)
@@ -718,7 +736,7 @@ function! RBuildSyntaxFile()
call add(res, line)
endif
endfor
- call writefile(res, b:r_plugin_home . "/r-plugin/functions.vim")
+ call writefile(res, b:user_vimfiles . "/r-plugin/functions.vim")
call RWarningMsg("The syntax will be updated next time you load an R file.")
endfunction
@@ -748,9 +766,9 @@ function! RStartDebug()
call RWarningMsg(rlog)
return
endif
- call SendCmdToScreen('source("' . b:r_plugin_home . '/r-plugin/Clnt.r")')
+ call SendCmdToScreen('source("' . b:user_vimfiles . '/r-plugin/Clnt.r")')
let curline = line(".")
- let scmd = "screen -S VimRdebug -X stuff 'source(\"" . b:r_plugin_home . "/r-plugin/Srvr.r\") ; editsrvr(vimserver=\"" . v:servername . "\") ; quit(\"no\")" . "\<C-M>'"
+ let scmd = "screen -S VimRdebug -X stuff 'source(\"" . b:user_vimfiles . "/r-plugin/Srvr.r\") ; editsrvr(vimserver=\"" . v:servername . "\") ; quit(\"no\")" . "\<C-M>'"
sleep 3
let rlog = system(scmd)
if v:shell_error

0 comments on commit a4d6be0

Please sign in to comment.