MyNixOS website logo
Description

Hippie Code Completion in 'RStudio'.

An 'RStudio' Addin for Hippie Expand (AKA Hippie Code Completion or Cyclic Expand Word). This type of completion searches for matching tokens within the user's current source editor file, regardless of file type. By searching only within the current source file, 'hippie' offers a fast way to identify and insert completions that appear around the user's cursor.

Hippie Code Completion


GitHub Actions workflow status

An RStudio addin for Hippie Code Completion

  • Speed. Hit fewer keystrokes in getting the word you want
  • More completions in R. Extends completions to string comments, string literals, and all throughout Roxygen blocks
  • Completions outside R. Get completions in files where you otherwise can't - .yml, .txt, .md, etc.

About

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.

Why Hippie?

  • Speed. Often times the word you want appears right around your cursor, or you know you've used it recently in your current file. 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.

  • Completions everywhere. Hippie works in areas where normal autocomplete doesn't. In R code, you can get completions in literals, comments, and everywhere in your Roxygen blocks.

    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.

Installation

  • Install the R package. You can get the stable version from CRAN with:

    install.packages("hippie")
    

    ...Or the development version with:

    # 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:

    • You can add a shortcut for both up and down, which refers to the direction hippie will look for the next matching token (above or below the cursor). You only need to use one direction, as hippie will cycle from the bottom to the top of the document and vice versa, but it can be faster if you know which direction to move next.

    • Type whichever keys you want to use for the shortcut in the Shortcut box, then hit Apply. Hippie Completion will now work whenever you're in an RStudio editor (no need to call library(hippie)).

Thanks to

  • Anders Holst, the creator of Hippie Expand in Emacs, both for the original idea of Hippie Completion and also for the fun name. According to Holst:

    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

Learning more

Metadata

Version

0.1.0

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows