Does anyone know how to completely disable automatic completions in Rstudio?
I don't see an option for it in Tools > Global Options; only a way to turn it to 'Manual (tab)' or 'When Triggered'. I can't enter a tab while typing code and it's driving me crazy.
This is possible on versions of RStudio IDE 1.0+ by going to Tools > Global Options > Code > Completion and unchecking "Allow automatic completions in console".
I agree this is very annoying. RStudio completely ignores the user preference for code completion shortcut, and I verified this in the source code. I found the following workaround, which disables TAB auto-completion in both the console and source views, while leaving intact auto-completion using the CTRL-SPACE (Control-Space) keys.
This workaround involves doing a custom build of RStudio (latest master branch at https://github.com/rstudio/rstudio.git).
Note: On Mac OS X El Capitan/Sierra, the Java SDK must be installed, and Apache Ant and OpenSSL must be installed (i.e. via Homebrew -- brew install ant; brew install openssl), in addition to the listed dependencies, before running cmake per the instructions.
For the workaround, I commented out the hard-coded TAB completion triggers in the following files, then built the release version via cmake (per instructions) and sudo make install:
In directory: src/gwt/src/org/rstudio/studio/client/workbench/views
./console/shell/assist/CompletionUtils.java
Lines 27-28:
return /*( event.getKeyCode() == KeyCodes.KEY_TAB && modifier == KeyboardShortcut.NONE)
|| */ (event.getKeyCode() == KeyCodes.KEY_SPACE && modifier == KeyboardShortcut.CTRL);
=====
./console/shell/shell.java
Lines 517-518:
/* if (event.getNativeKeyCode() == KeyCodes.KEY_TAB)
event.preventDefault(); */
=====
./console/shell/assist/RCompletionManager.java
Line 1156:
// if (firstLine.matches("^\\s*$"))
=====
./source/Source.java
Lines 382-383:
/* commands.codeCompletion().setShortcut(
new KeyboardShortcut(KeyCodes.KEY_TAB)); */
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With