Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#21 How to make completion work?

version 2.1
open
nobody
None
5
2013-06-05
2013-06-04
Paul E Johnson
No

In 2010 and 2011, I was teaching people how to set up Notepad++ with the NPPTOR autocompletion xml file. That did work. I looked away for a couple of years... sorry. In my own work, I use Emacs, and only look at Notepad++ when students ask me.

Now, I'm here to ask how to make R autocompletion work in the newer NPPTOR. I see the announcement that NPPTOR has the auto-completion function that Yihue wrote. However, as far as I can see, it is doing nothing. I click your little R in the try, right click the build autocompletion, then nothing. It does not create an R xml file anywhere I can find. In the Notepad++ session, I've done these things:

  1. Choose Language R
  2. Under settings -> Backup/Completion I test both "work" and "function" autocompletion.

If I choose word, it is obvious that Notepad++ is scanning the words in a file and so when it sees a possible repeat, it suggests a fill in for me.

However, there's no R function completion.

I wonder if success here depends on the installation of Notepad++ or NPPTOR or R itself in particular folders? When I installed R this time, I noticed that NPPTOR could not find R and I had to manually set the R HOME folder in the NPPTOR settings. That was weird, because R HOME is just C:\Program Files\R\R-3.0.1. That's default. However, this is not a completely new Windows 8 install, and I've put in and removed R several times. I have had R installed other places, so I wasn't so surprised that NPPTOR did not find this current one. Would NPPTOR's autocomplete scan fail silently?

Well, that's all the guessing I want to do, I'm not very interested in Windows, to tell you the truth. But I am trying to help people who do use windows.

If you tell me what to do, I'll update documentation for our lab, and I gather some Googlers do find this:

http://crmda.ku.edu/computing/Windows:AdminTips#Other_Editors_that_Work_with_R

Paul Johnson
University of Kansas

Discussion

  • Paul E Johnson
    Paul E Johnson
    2013-06-05

    I dont know why autocomplete fails, but here's a workaround.

    1. Copy "make_R_xml.r" from NPPTOR install folder to a place where you can read write.

    2. Run that file in R. Can either run as batch or open with Notepad++ and step through line by line. That writes out R.xml file

    3. Copy that file into the place where you installed Notepad++. Go find that in C:\Program Files, then put R.xml in the subfolder Notepad++/plugins/APIs.

    4. Close Notepad++, then re-open it with an R file. Make these changes.
      A. Language menu, choose R.
      B. Settings menu, choose "Backup/Auto-completion"

    5. Turn on autocompletion for functions
    6. Turn on Function parameters hint.

    Go back to R document. As soon as you start to type function, the hint on completions pops up. Works well! After you hit "(", then a tooltip line appears reminding of the possible arguments.

    Cheers!