Disable autocomplete in studio R

Does anyone know how to completely disable automatic improvements in Rstudio?

I do not see the options in it in "Tools"> "Global Options"; only way to turn it into "Manual (tab)" or "When Triggered". I cannot enter a tab while entering the code, and it drives me crazy.

+5
source share
1 answer

I agree that this is very annoying. RStudio completely ignores user preferences for quick code completion, and I checked this in the source code. I found the following workaround, which disables the automatic completion of TAB both in the console and in its original form, leaving intact autofill using the CTRL-SPACE (Control-Space) keys.

This workaround involves executing a custom RStudio build (the last major 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 in accordance with instructions.

As a workaround, I commented on triggers with completed TAB code in the following files, then created a release version via cmake (as instructed) and sudo make install:

In the catalog: SRC / GWT / SRC / org / rstudio / studio / client / workbench / view

./console/shell/help/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/help/RCompletionManager.java

 Line 1156: // if (firstLine.matches("^\\s*$")) 

=====

./source/Source.java

 Lines 382-383: /* commands.codeCompletion().setShortcut( new KeyboardShortcut(KeyCodes.KEY_TAB)); */ 
+2
source

Source: https://habr.com/ru/post/1247146/


All Articles