Home Web Front-end JS Tutorial Let .vue be highlighted in Sublime Text's new template

Let .vue be highlighted in Sublime Text's new template

Apr 16, 2018 pm 03:40 PM
sublime text

This time I will bring to you how to highlight .vue in a new Sublime Text template and how to highlight .vue in a new Sublime Text template. What are the precautions?. The following is a practical case. Get up and take a look.

This article introduces Sublime Text’s new .vue template and highlights (picture and text tutorial), share it with everyone, and leave a note for yourself.

Preparation

  1. DownloadInstallNew file template plug-in SublimeTmpl

  2. Download and install vue syntax highlighting plug-in Vue Syntax Highlight

There are two ways to install plug-ins for Sublime Text:

1. Use Package Control, the installation library that comes with Sublime Text, to install

Click Preferences -> Package Control in the menu bar or use the shortcut key CTRL SHIFT P to open a terminal window, enter Install and select Package Control: Install Package to install

2. Download and put it directly into the package directory (Preferences / Browse Packages) Chinese: (Preferences / Package Browser) folder

  1. SublimeTmpl

  2. Vue Syntax Highlight

Create .vue template and enable syntax highlighting

After installing Vue Syntax Highlight, you can already highlight files in .vue format when you open them. Now let's set up shortcut keys to directly create files in .vue format.

SublimeTmpl has only 6 syntax templates by default:

  1. html ctrl alt h

  2. javascript ctrl alt j

  3. css ctrl alt c

  4. php ctrl alt p

  5. ruby ctrl alt r

  6. python ctrl alt shift p

We now add a new template to create vue format

1. Create vue file template

Directly open the folder of the plug-in package Preferences -> Browse Packages

Preferences -> Browse Packages

Package folder

Open the folder templates where the templates are stored, copy any item and rename it vue.tmpl

Create vue.tmplvue.tmpl and change the content to the template you want

vue.tmpl content

2. Modify the new menu and add new vue options

SublimeTmpl's new menu does not have vue by default,

New -> New File (SublimeTmpl)

Click the Menu option, or open Preferences -> Package Settings -> SublimeTmpl -> Settings - Menu,

Open menu configuration item

Copy an item, then paste and change it to vue item,

Added vue item

After saving the changes, the vue item

will appear in the new menu. vue item

appears Click on the new vue item in the picture above, and the previously set template content will appear, but there is no syntax highlighting, and it is in plain text format

Create a new vue file

3. Template binding vue syntax highlighting

Open Preferences -> Package Settings -> SublimeTmpl -> Settings - Default,

Open the default settings

Copy an item and modify it to vue, the path is as follows

Binding vue syntax

For the binding syntax associated file path, please check the directory Sublime Text3DataCache, find the vue highlighting syntax plug-in name, and open

Sublime Text3DataCache directory

Sublime Text3DataCachevue-syntax-highlight

Create a new vue menu again and the syntax will be highlighted,

Create a new vue file

4. Bind the shortcut key for creating a new vue file

Open Preferences -> Package Settings -> SublimeTmpl -> Key Bindings - Default,

Open the setting shortcut key file

Copy an item, paste it to create a new vue shortcut key is ctrl alt v,

Create shortcut keys

After saving, the new menu will also be available,

New file menu

Try it, perfect!

at last

Preferences -> Package Settings -> SublimeTmpl -> Settings - Commands The file seems to be for configuring commands, and the configuration method is the same as above, just copy the cat and the tiger~

last of the last

In this way, other language templates can also be created by yourself.

I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other related articles on the php Chinese website!

Recommended reading:



The above is the detailed content of Let .vue be highlighted in Sublime Text's new template. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What should I do if the notepad file is too large to open? What should I do if the notepad file is too large to open? Apr 08, 2024 am 03:15 AM

When Notepad files get too large, here are some solutions you can try: Use another text editor like Sublime Text as they don’t have file size limits. Split the file into smaller parts. Enable large file support via Registry Editor. Try using an alternative method such as Notepad++, WordPad, or Microsoft Word to open the file. Zip the file and open it with an archive tool.

How to align text columns in notepad How to align text columns in notepad Apr 08, 2024 am 01:00 AM

There are three methods to achieve text column alignment in Notepad: 1. Use tabs; 2. Use spaces and adjust manually; 3. Use third-party tools (such as Notepad++, Sublime Text) to provide automatic alignment.

What should I use to open html? What should I use to open html? Apr 21, 2024 am 11:33 AM

To open HTML files you need to use a browser such as Google Chrome or Mozilla Firefox. To open an HTML file using a browser, follow these steps: 1. Open your browser. 2. Drag and drop the HTML file into the browser window, or click the File menu and select Open.

What software is good for python programming? What software is good for python programming? Apr 20, 2024 pm 08:11 PM

IDLE and Jupyter Notebook are recommended for beginners, and PyCharm, Visual Studio Code and Sublime Text are recommended for intermediate/advanced students. Cloud IDEs Google Colab and Binder provide interactive Python environments. Other recommendations include Anaconda Navigator, Spyder, and Wing IDE. Selection criteria include skill level, project size and personal preference.

How to open local file in html How to open local file in html Apr 22, 2024 am 09:39 AM

HTML can be used to open local files as follows: Create a .html file and import the jQuery library. Create an input field that allows the user to select a file. Listen to the file selection event and use a FileReader() object to read the file contents. Display the read file contents on the web page.

How to create py file in python How to create py file in python May 05, 2024 pm 07:57 PM

Steps to create a .py file in Python: Open a text editor (such as Notepad, TextMate, or Sublime Text). Create a new file and enter the Python code, paying attention to indentation and syntax. When saving the file, use a .py extension (for example, my_script.py).

How to use the copied code in python How to use the copied code in python Apr 20, 2024 pm 06:26 PM

Here are the steps to use copied code in Python: Copy and paste the code into a text editor. Create a Python file. Run the code from the command line. Understand what the code is for and how it works. Modify the code as needed and rerun it.

How to open html files on mobile phone How to open html files on mobile phone Apr 05, 2024 am 08:06 AM

You can open HTML files on your phone by using your default browser and entering the file path or URL in the address bar. Using your file manager, navigate to the file location and click the HTML file. Download the text editor, navigate to the file location and double-click the HTML file. Download HTML Viewer from the App Store, navigate to the file location and tap on the HTML file.

See all articles