简体   繁体   中英

Disable code completion for a shortcut in PhpStorm

I stumbled across this, when I tried solving this: Searching for Live Template in PhpStorm, from abbreviation (wrong expansion?) .

TL;DR

In PhpStorm, in a markdown-file, when I write 3 back-ticks and press enter, it expands to this:

```angular2html

```

And I would like PhpStorm to stop helping me here, and just type what I typed:

```

```

Detailed description and solution attempts

In a Markdown-file ( readme.md ), I use it often to write a code block with three ticks:

```

But when I do so, PhpStorm suggest a bunch of stuff:

反引号在 PhpStorm 中扩展 - angular2html

So if I press Enter here, then it expands to:

```angular2html

```

So how do I change this behaviour?


Solution attempt 1: Deactivate the bundled Angular-plugin

There is a (bundled) plugin called: 'Angular and AngularJS'. If I deactivate that, then it looks like this:

反引号在 PhpStorm 中扩展 - apacheconf

and expands to this:

```apacheconf

```

Solution attempt 2: Ensure Markdown is supported

I'm really baffled why this happens. Does PhpStorm not realize that I'm in an .md -file? And/or is this the usual desired behaviour, when people write three backticks in a and .md -file?

I can confirm that I have an active (bundled) plugin called: 'Markdown' (version 222.3739.61).

Solution attempt 3: Add a new Live Template

This actually works, by making a new Live Template, to be this:

```
$END$

Remember the blank line underneath. This is since I would like to press Enter , and that replaces the first 3 ticks with this, but not the ones PhpStorm automatically adds dues to auto-closing of brackets and backticks.

This solution attempt seems quite hacky, though. :-/

From https://youtrack.jetbrains.com/issue/IDEA-266239

The pop up was created to make specification of code fence language easier and to enable automatic code injection. We can't disable it since it would affect a lot of users using it for fast code injection.

angular2html is the first entry in your case. Somebody else may have another language ID (eg aidl ).

Right now it cannot be disabled or customized. So you will have to either use your own workaround (with Live Template) or press Esc before hitting Enter .

Other than that: watch that IDEA-266239 ticket (star/vote/comment) to get notified with any progress. No better suggestions right now.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM