Skip to content

hippie.mode

Chris Baker edited this page Aug 24, 2022 · 5 revisions

hippie has two potential modes that you can be in. You choose the mode by setting an option called - hippie.mode.

  • hippie.mode = "insert" (the default). When you use this mode, the matching token/completion will simply be inserted into the source document.

  • hippie.mode = "select". In select mode, hippie will automatically select the completion after it's been inserted into the editor. A side effect of this is that RStudio will put a box around all instances where the completion can be found in the source editor.

Insert mode

There are pros and cons to each mode. With select mode, you get to see where the word appears in the document and hence get to situate yourself as you cycle through the candidate completions. You can also match to multigram tokens in string literals. However, Due to implementation details, you can only match to unigram tokens in insert mode. You also don't get to see where the candidate word appears in your document. The major limitation of select mode is that, once you've arrived at your desired completion, you have to press an additional key to deselect the word.

Clone this wiki locally