1

从崇高文本更新后 3 自动完成触发TABENTER

很难使用foreachPHP 中的代码片段

foreach($mark as $mark => $mark) {
    $mark
}

TAB您跳到下一个标记后的崇高文本 3 中,但现在发生了自动完成

我尝试了一些设置

"tab_completion": false,
"auto_complete_commit_on_tab": false,

不工作

找到键绑定

{ "keys": ["tab"], "command": "commit_completion", "context":
    [{ "key": "auto_complete_visible" }]
},

不知道怎么去掉

请帮忙,现在使用 Sublime 文本太难了

4

3 回答 3

0

我相信您正在寻找的是tab_completion: false. 当我将此添加到我的首选项中,并输入一些文本并点击选项卡时,它不再弹出自动完成模式,而是\t像我想要的那样插入。

于 2021-12-08T03:58:53.453 回答
0

不确定该解决方案的可移植性(尤其是对于不同版本的 Sublime)。我在 Linux (Fedora 34) 上,并使用他们官方 repo中最新的 Sublime (在撰写本文时构建 4121) 并具有注册许可证。

但我认为我遇到的问题与您的问题相似(您的帖子是“sublime disable auto complete on tab”的第一个duckduckgo结果)。基本上,我已经在我的首选项文件auto_completeauto_match_enabled设置了两者,false但如果我有一些文本,例如:

async:      false,

我将光标放在异步中的“c”之后,然后点击 TAB,它会尝试自动完成这个以“异步”开头的单词。但我想要的行为是让它从字面上插入一个 TAB ( \t) 字符,而不是使用 TAB 作为自动完成触发器。

阅读这篇文章后,我尝试"auto_complete_commit_on_tab": false了这似乎对我也不起作用。我不知道如何覆盖选择器键绑定,所以我开始在“shot弹枪方法”中禁用许多自动完成设置。我确实在网上搜索了设置,但大多只是脱离了设置文件的全局/左侧的描述。

我不确定执行此操作的确切设置,但它现在的行为与我想要的 TAB 一样,只是插入一个\t字符。我怀疑这"auto_complete_size_limit": 1可能是最相关的设置,但我不确定。

这是我的首选项文件供参考:

{
    "always_prompt_for_file_reload": true,
    "atomic_save": true,
    "auto_close_tags": true,
    "auto_complete": false,
    "auto_complete_size_limit": 1,
    "auto_complete_selector": "",
    "auto_complete_commit_on_tab": false,
    "auto_complete_with_fields": false,
    "auto_complete_cycle": false,
    "auto_complete_use_index": false,
    "auto_complete_use_history": false,
    "auto_complete_trailing_symbols": false,
    "auto_complete_include_snippets": false,
    "auto_complete_include_snippets_when_typing": false,
    "auto_match_enabled": false,
    "copy_with_empty_selection": false,
    "drag_text": false,
    "detect_indentation": true,
    "ensure_newline_at_eof_on_save": true,
    "font_size": 15,
    "highlight_modified_tabs": true,
    "show_encoding": true,
    "show_line_endings": true,
    "tab_completion": false,
    "translate_tabs_to_spaces": false,
    "trim_automatic_white_space": true,
    "trim_trailing_white_space_on_save": true,
    "update_check": false,
    "close_find_after_find_all": false,
    "close_find_after_replace_all": false
}
于 2021-11-26T18:50:52.523 回答
0

我尝试了一些解决方案,没有完美的。有一个可行的解决方案:[已解决] ST3:“tab_completion”:false 不起作用,但现在我想提供我的(受此链接 ↑ 启发,感谢@OdatNurd)。

1.首选项->键绑定

2. 在左侧窗口搜索'"keys": ["tab"]',然后你会得到一组结果。对我来说是这样的:

    { "keys": ["tab"], "command": "auto_complete", "args": {"mini": true, "default": "\t"},
        "context":
        [
            { "key": "auto_complete_visible", "operand": false },
            { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
            { "key": "setting.tab_completion", "operator": "equal", "operand": true },
            { "key": "preceding_text", "operator": "regex_match", "operand": ".*\\w", "match_all": true },
        ]
    },
    { "keys": ["tab"], "command": "expand_snippet", "context":
        [{ "key": "has_snippet" }, ]
    },
    { "keys": ["tab"], "command": "reindent", "context":
        [
            { "key": "setting.auto_indent", "operator": "equal", "operand": true },
            { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
            { "key": "preceding_text", "operator": "regex_match", "operand": "^$", "match_all": true },
            { "key": "following_text", "operator": "regex_match", "operand": "^$", "match_all": true }
        ]
    },
    { "keys": ["tab"], "command": "indent", "context":
        [{ "key": "text", "operator": "regex_contains", "operand": "\n" }]
    },
    { "keys": ["tab"], "command": "move", "args": {"by": "lines", "forward": true}, "context":
        [
            { "key": "overlay_has_focus", "operator": "equal", "operand": true }
        ]
    },
    { "keys": ["tab"], "command": "next_field", "context":
        [{ "key": "has_next_field", "operator": "equal", "operand": true }]
    },
    { "keys": ["tab"], "command": "commit_completion", "context":
        [{ "key": "auto_complete_visible" }]
    },

(我不想暗示它应该是什么样子,因为不同的 sublime 版本会有不同的设置。)

3. 将它们全部复制到右侧窗口中。

4. 删除(或只是注释掉)窗口右侧的“auto_complete”块和“commit_completion”块,不要更改任何其他内容。现在,我的用户键绑定是这样的:

  // Disable all autocompletion and tab completion. This overrides the default
  // binding for this key.
  { "keys": ["tab"], "command": "insert", "args": {"characters": "\t"} },
  // { "keys": ["tab"], "command": "auto_complete", "args": {"mini": true, "default": "\t"},
  //   "context":
  //   [
  //     { "key": "auto_complete_visible", "operand": false },
  //     { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
  //     { "key": "setting.tab_completion", "operator": "equal", "operand": true },
  //     { "key": "preceding_text", "operator": "regex_match", "operand": ".*\\w", "match_all": true },
  //   ]
  // },
  { "keys": ["tab"], "command": "expand_snippet", "context":
    [{ "key": "has_snippet" }, ]
  },
  { "keys": ["tab"], "command": "reindent", "context":
    [
      { "key": "setting.auto_indent", "operator": "equal", "operand": true },
      { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
      { "key": "preceding_text", "operator": "regex_match", "operand": "^$", "match_all": true },
      { "key": "following_text", "operator": "regex_match", "operand": "^$", "match_all": true }
    ]
  },
  { "keys": ["tab"], "command": "indent", "context":
    [{ "key": "text", "operator": "regex_contains", "operand": "\n" }]
  },
  { "keys": ["tab"], "command": "move", "args": {"by": "lines", "forward": true}, "context":
    [
      { "key": "overlay_has_focus", "operator": "equal", "operand": true }
    ]
  },
  { "keys": ["tab"], "command": "next_field", "context":
    [{ "key": "has_next_field", "operator": "equal", "operand": true }]
  },
  // { "keys": ["tab"], "command": "commit_completion", "context":
  //   [{ "key": "auto_complete_visible" }]
  // },
  1. 好好享受 。此解决方案不会破坏片段索引,您可以使用enter.
于 2022-02-17T08:08:32.263 回答