Page 12 of 15 FirstFirst ... 21011121314 ... LastLast
Results 111 to 120 of 148

Thread: Vim R plugin installation issue

  1. #111
    Join Date
    Jan 2011
    Beans
    6

    Re: Vim R plugin installation issue

    Hi,

    Thank you so much for your work on this. I have decided to switch from textmate to vim for my R development, and the plugin is extremely useful for that.

    But just following up on the previous post, the indentation is not perfect, and the only thing that separates it from being great is indenting the arguments of function declarations and function calls that do not fit in a single line.

    I have used ESS with emacs for considerable time before, and the indentation of R code there is just perfect. That seems to be the only software that does it. There are hacks that allow to use ESS indentation in textmate, and this is what I have been doing.

    I understand that the indentation as of now in vim-R-plugin is ok, and there could be other important issues to deal with, but please consider that improving it to at least correct multiline function argument indentation would save a significant amount of time.

    Thanks again for great work!

  2. #112
    Join Date
    Sep 2007
    Location
    Brazil
    Beans
    77

    Re: Vim R plugin installation issue

    Quote Originally Posted by snesterko View Post
    [...]
    I have used ESS with emacs for considerable time before, and the indentation of R code there is just perfect. That seems to be the only software that does it.

    [...]

    I understand that the indentation as of now in vim-R-plugin is ok, and there could be other important issues to deal with, but please consider that improving it to at least correct multiline function argument indentation would save a significant amount of time.
    I released a new version improving the indentation, including alignment of function arguments. A few bugs in the indentation of R code remain, but some of the differences between the way ESS and Vim-R-plugin indent code are intentional. For example, Vim-R-plugin and ESS indent differently the following code:

    Code:
    for(i1 in list1)
        for(i2 in list2)
            for(i3 in list3)
                for(i4 in list4)
                    cat(i1, i2, i3, i4, "\n")
    The variables r_indent_ess_comments and r_indent_ess_compatible make the indentation a bit more similar to the one done by ESS.

    People that prefer the old style of indentation of function arguments, should put the following in their vimrc:

    Code:
    let r_indent_align_args = 0
    The section 10.8 of the plugin's documentation explains the details.

  3. #113
    Join Date
    Jan 2011
    Beans
    6

    Re: Vim R plugin installation issue

    Thank you !

    I got the updated version of indentation, and it seems to be working like a charm!

    I have another quick, very minor question. Please feel free to ignore it in case this is too basic (as I am indeed new to vim). Here it is:

    Is there support of automatically creating ## comment symbols when going to a new line from a commented line? For example, in case I am typing comments like this

    ## this is a comment, but it is too long, so I'd like to go to another line right now<CR>

    is there a way to have ## inserted on new line automatically, and the cursor being aligned with the first letter of 'this', on the second line?

    Does this question make sense at all? In any case, thank you so much for indentation, this works great.

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

    Re: Vim R plugin installation issue

    Quote Originally Posted by snesterko View Post
    Is there support of automatically creating ## comment symbols when going to a new line from a commented line?
    The last version, 110208, released on February, 8, do it, because I added the following option to ftplugin/r.vim:

    setlocal comments=b:#,b:##,b:###

  5. #115
    Join Date
    Jan 2011
    Beans
    6

    Re: Vim R plugin installation issue

    Somehow this doesn't work for me.. I am on a Mac, and use simple Vim-R, with your syntax and indent files, and also rsyntax and functions files.

    I took those two lines from the ftplugin/r.vim file, and copied them into syntax file, to no effect. Maybe, this was too naive?

    Also, the syntax folding is an amazing feature, but seems to have some bugs. For example, when in insert mode, Shift-9 will unfold all folds in the buffer.

    Thank you so much for you hard work on the plugin.

  6. #116
    Join Date
    Apr 2008
    Beans
    275
    Distro
    Ubuntu 10.04 Lucid Lynx

    Talking Re: Vim R plugin installation issue

    @jalvesaq: Just another thank-you for this plugin. It works perfectly and I use it often.

  7. #117
    Join Date
    Sep 2007
    Location
    Brazil
    Beans
    77

    Re: Vim R plugin installation issue

    Quote Originally Posted by snesterko View Post
    Somehow this doesn't work for me.. I am on a Mac, and use simple Vim-R, with your syntax and indent files, and also rsyntax and functions files.
    I don't know if the Mac version of Vim is compiled with support to auto format the lines as they are typed, but I suppose it is.

    Quote Originally Posted by snesterko View Post
    I took those two lines from the ftplugin/r.vim file, and copied them into syntax file, to no effect. Maybe, this was too naive?
    Any option may be in any file. The effect is the same, unless you have different values in different files. Then, the last one will prevail. See :h --startuptime to know the order in which the scrips are read.

    The automatic formating of the line is controlled by 'formatoptions'. Do you have this variable set in your vimrc? Please, see :h 'formatoptions' for details.

    Quote Originally Posted by snesterko View Post
    Also, the syntax folding is an amazing feature, but seems to have some bugs. For example, when in insert mode, Shift-9 will unfold all folds in the buffer.
    Nothing happens here when I type Shift-9. I use zi in Normal mode to fold/unfold all folds. Please, see :h zi

    I my keyboard, Shift-9 is the open parenthesis key: '('. Did you map the key ( to something in your vimrc?

  8. #118
    Join Date
    Jan 2011
    Beans
    6

    Re: Vim R plugin installation issue

    Thanks for the response. I dont' know what is wrong. '(' must be then mapped to, or in conflict with something on my macvim. But in insert mode, repeated '(' has weird behaviour. Press double (, and folds unfold. This is a little bizarre, but I am not sure where to look for a solution.

    For the comments, I have tormatoptions=tcq, and comments=b:#,b:##,b:### when I am editing a file. This should work, but it doesn't. I don't know how to address this, but will look into this further. Thank you for your help and hard work on this.

  9. #119
    Join Date
    Sep 2007
    Location
    Brazil
    Beans
    77

    Re: Vim R plugin installation issue

    Quote Originally Posted by snesterko View Post
    Thanks for the response. I dont' know what is wrong. '(' must be then mapped to, or in conflict with something on my macvim. But in insert mode, repeated '(' has weird behaviour. Press double (, and folds unfold. This is a little bizarre, but I am not sure where to look for a solution.

    For the comments, I have tormatoptions=tcq, and comments=b:#,b:##,b:### when I am editing a file. This should work, but it doesn't. I don't know how to address this, but will look into this further. Thank you for your help and hard work on this.
    Perhaps you could start by making a backup of your current ~/.vimrc and test whether a very simple vimrc works. Below is an example of simple vimrc:

    Code:
    set nocompatible
    syntax enable
    filetype plugin on
    filetype indent on
    let r_syntax_folding = 1
    set nofoldenable
    autocmd FileType r setlocal formatoptions=cq
    If the above works, you could add new options, copying them from your original vimrc...

  10. #120
    Join Date
    Jan 2011
    Beans
    6

    Re: Vim R plugin installation issue

    Thanks for the response!

    No, that doesn't work. I replaced the settings in my .vimrc with what you have recommended, and the behaviour is unchanged. There is no autocommenting and the ( has weird behaviour.

    For autocommenting, it works for say .vim files, where " is the comment symbol, but doesn't for R files. This is bizarre.

Page 12 of 15 FirstFirst ... 21011121314 ... 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
  •