Page 2 of 15 FirstFirst 123412 ... LastLast
Results 11 to 20 of 148

Thread: Vim R plugin installation issue

  1. #11
    Join Date
    Nov 2006
    Beans
    7

    Re: Vim R plugin installation issue

    I am also using the plugin for vim posted by jalvesaq. It is working well, and I appreciate your work. One issue I have had with it is the scrolling with using help() in R. Ordinarily R will allow vim keybindings to be used for scrolling a help file (for instance when using the R command "help(density)"). When I use the vim R plugin, however, neither vim keybindings nor arrow keys nor page up/page down will work to scroll help files in R. I am using gnome-terminal rather than xterm, if that makes any difference, with the latest version of the R plugin.

  2. #12
    Join Date
    Aug 2007
    Beans
    68

    Re: Vim R plugin installation issue

    Hi,

    I am also using the plugin provided by jalvesaq, and so far it's working well. I do have a related question though, which also applies to the previous version of the plugin: is there no way of getting a better GUI for R? I mean, compared to the Windows GUI, the xterm is not very good. It tends to truncate lines of code sent to it, colour coding for errors would be useful, and there's also the scrolling issue when consulting help files. As you have probably noticed by now I'm completely new to this, and just wondering if there are any things I can change to the setup to improve the experience! Any help or suggestions are very welcome! Thanks for any help you can give me, and for the great plugins!

    bgc

  3. #13
    Join Date
    Nov 2006
    Location
    New Zealand
    Beans
    422

    Re: Vim R plugin installation issue

    If you want a better GUI, you may want to try something other than vim. Rkward is an excellent GUI for R, JGR is another. Rkward is in the repositories (sudo apt-get install rkward), not sure about JGR.

    Vim is for people who don't want a GUI!

  4. #14
    Join Date
    Sep 2007
    Location
    Brazil
    Beans
    77

    Re: Vim R plugin installation issue

    Quote Originally Posted by azvoleff View Post
    [...] One issue I have had with it is the scrolling with using help() in R. Ordinarily R will allow vim keybindings to be used for scrolling a help file (for instance when using the R command "help(density)"). When I use the vim R plugin, however, neither vim keybindings nor arrow keys nor page up/page down will work to scroll help files in R. I am using gnome-terminal rather than xterm, if that makes any difference, with the latest version of the R plugin.
    I added a new key binding, <C-H>, which calls R's help().

    The scroll issue affects both xterm and gnome-terminal. It seems that R doesn't use GNU Readline when called through a pipe. That's why you can't complete object names with <Tab> in the terminal window (and that's why I created the omni function for Vim). The best solution for me is to do "help.start()" in the terminal window before using help().

  5. #15
    Join Date
    Sep 2007
    Location
    Brazil
    Beans
    77

    Re: Vim R plugin installation issue

    Quote Originally Posted by samden View Post
    If you want a better GUI, you may want to try something other than vim. Rkward is an excellent GUI for R, JGR is another. Rkward is in the repositories (sudo apt-get install rkward), not sure about JGR.

    Vim is for people who don't want a GUI!
    Vim is for people who want an editor with advanced features, like complex search and replace, record of macros, etc. For those who prefer do not have to remember a lot of keyboard commands, it's better to use GUI for R like JGR or Rkward, as suggested by samden.

  6. #16
    Join Date
    Sep 2007
    Location
    Brazil
    Beans
    77

    Re: Vim R plugin installation issue

    Quote Originally Posted by bgc View Post
    [...] xterm is not very good. It tends to truncate lines of code sent to it, colour coding for errors would be useful [...].
    I also would like to have color coding of errors in R's output, but I don't know how to get them without patching R source code.

    The truncated lines are not a xterm limitation, but an issue with running R through a pipe (and I don't know how to solve it). However, although annoying, I don't see this problem as a serious bug because you still have the entire lines in the script that you are editing with Vim. You can also break the lines in Vim before sending them to R, and, in my opinion, the code will even become more readable.

    As far as I know, the two most serious bugs of vim-r-plugin are:

    (1) You should never hit Ctrl+C in the terminal window.
    (2) Sending more than 4 k of text to R "obstructs" the pipe and freezes the terminal.

  7. #17
    Join Date
    Aug 2007
    Beans
    68

    Re: Vim R plugin installation issue

    Hi! I fear I might have not explained myself very well! Sorry! So...

    Samden: I'm actually very happy with Vim, and what I would want is not a GUI for Vim, but for R. And in fact, I think GUI isn't it either, just a somewhat better CLI (taking the better parts of the Windows implementation).

    jalvesaq: Thank you for your reply! And thanks for the plugin! I only ask out of ignorance, because I have had situations where I would have wished something that turned out to be possible by tweaking settings! In any case this plugin allows me to stay away from Windows, so thanks.

  8. #18
    Join Date
    Sep 2007
    Location
    Brazil
    Beans
    77

    Re: Vim R plugin installation issue

    Quote Originally Posted by bgc View Post
    [...] I only ask out of ignorance, because I have had situations where I would have wished something that turned out to be possible by tweaking settings! In any case this plugin allows me to stay away from Windows, so thanks.
    You are welcome! And, please, keep reporting bugs and wishes!

    I can't fix the scrolling problem, but now the plugin calls R's help.start() automatically the first time that <C-H> is pressed. This behavior can be customized or even disabled, and the details are explained in the plugin's documentation. I think this is better than having to remember of calling help.start() manually.

    The new version of the plugin has some other bug fixes:
    http://www.vim.org/scripts/script.php?script_id=2628

  9. #19
    Join Date
    Aug 2007
    Beans
    68

    Re: Vim R plugin installation issue

    That's great, and actually using help.start() or the method with the new version works great! I do have one question: how do you change settings, for instance the amount of indent (from 4 to 2 say)? Is it also possible to change any of the keybindings? Apologies in advance for probably very naive questions! Thank you!

  10. #20
    Join Date
    Sep 2007
    Location
    Brazil
    Beans
    77

    Re: Vim R plugin installation issue

    Quote Originally Posted by bgc View Post
    [...] I do have one question: how do you change settings, for instance the amount of indent (from 4 to 2 say)? Is it also possible to change any of the keybindings?
    To change the amount of indent, put in your vimrc:

    set shiftwidth=2

    To change the key bindings you can open the file ~/.vim/ftplugin/r.vim and edit the lines that begin with "noremap", "inoremap" or "vnoremap". For example, in the following line you could replace <C-F9> with another key combination:

    noremap <buffer> <C-F9> :call SendFunctionToR()<CR>

    On the next weekend I will try to find a way of doing these settings in the vimrc, so you and other people will not have to patch the plugin after each new release.

Page 2 of 15 FirstFirst 123412 ... LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •