Sublime Text can set up auto-completion by following these steps: Install the code completion plug-in. Enable auto-completion and check the box. Customize completion triggers (default triggers are ., (, ", '). Specify the completion source (e.g. "source.python"). Take advantage of advanced options (e.g. snippets, syntax checking, delay).
Set auto-completion in Sublime
Sublime Text is a popular text editor that provides a wealth of features to assist with coding, including auto-completion.
Setup steps:
-
Install code completion plug-ins: Such as AutoComplete, AutoFileName or Emmet.
-
Enable auto-complete:Select "Tools" > "Settings" in the menu bar, then enter "auto_complete" in the "Search Settings" box. Check "Automatic Completion" checkbox.
-
Custom completion triggers: Find the "auto_complete_triggers" setting and modify it as needed. By default, it is set to
.
, (
, "
, and '
. You can add or remove triggers to customize the behavior of completion.
-
Specify completion source: You can also specify the source to be used for completion. In the "auto_complete_selector" settings field, enter the file type or range for which you want autocompletion to apply. For example, you can set it to "source.python" to enable autocompletion in Python files.
Advanced options:
-
Using Snippet: You can extend autocompletion using code snippets. In the "auto_complete_snippets" setting field, enter the code snippets you wish to use.
-
Enable syntax checking: In the "auto_complete_use_syntax_check" setting, Enable syntax checking to only suggest completions that comply with the file's syntax rules.
-
Set Delay: Use the "auto_complete_delay" setting to fine-tune the delay of the autocompletion trigger.
By following these steps, you can easily set up autocompletion in Sublime Text and customize it to your needs. It will greatly simplify your coding workflow and increase your efficiency.
The above is the detailed content of How to set up auto-completion in sublime. For more information, please follow other related articles on the PHP Chinese website!