An RStudio addin for Hippie Code Completion
Hippie's a completion engine that looks in your active source file for words to suggest. This differs from traditional completion in RStudio, which is more focused on using the R execution environment for identifying suggestions. Using both completion methods allows you to supercharge your RStudio experience.
hippie
allows you to use this knowledge to provide a more relevant list of suggestions than what traditional code completion would offer. For example, with traditional completion I have to type 5 characters before starwars
appears as the first suggestion, and 4 characters before filter
appears as the first suggestion. With Hippie, it's 1 character each.
Even in larger files, you usually only need to type one or two characters before invoking the Hippie shortcut, and the first suggestion will be the one you want.
Hippie also extends to all file types, including text files, markdown, config files, etc. You can even get completions in the text sections of RMarkdown docs.
r
install.packages("hippie")
...Or the development version with:
r
# install.packages("devtools")
devtools::install_github("crew102/hippie")
Restart RStudio. RStudio will automatically detect the hippie
addin moving forward.
Add a shortcut.
Go to Tools, then Modify Keyboard Shortcuts. Search for hippie, and you should see something like this:
I came up with this try-function idea that tries one kind of expansion at a time, and lets the user press repeatedly to sequence through the alternatives. I called it Hippie Expand to signal that it's completely unrealistic, dreaming, kind of high. I was entirely convinced that it would not work in practice - that it would be necessary to press endlessly on the key it was bound to before the wanted expansion would show up.
PyCharm's implementation of hippie, which inspired this package
starship, whose README style I blatantly ripped off
hippie.mode
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.