search
HomeWeb Front-endHTML Tutorial面向 Web 开发者的 Sublime Text 插件_html/css_WEB-ITnose

Package Control

在 Sublime Text 上大家都用 Package Control 来管理安装插件,所以它是我们要安装的第一个插件,安装方法见这里。关于 Package Control 的使用方法这里不再赘述。

 

JSHint

 

Linter 是帮助你检查代码问题的一类工具,帮你发现潜在的错误或不好的代码习惯。JSHint 是检查 JavaScript 代码的好工具,支持很多编辑器和 IDE 。

Sublime 上要使用 JSHint 可以安装:SublimeLinter-JSHint 插件。注意安装这个插件前需要先安装 SublimeLinter 以及 jshint 命令本身,更多信息见 SublimeLinter-JSHint 安装说明。简单地说就是:

  1. 安装 jshint 命令:npm install -g jshint
  2. Package Control 安装:SublimeLinter ,重启 sublime
  3. Package Control 安装:SublimeLinter-jshint

注:JavaScript 有许多 linter 工具,如 JSLint 、JSHint 和 ESLint 。JSLint 是 JavaScript 大师 Douglas Crockford 创作和维护的。JSHint 是 JSLint 的 fork 版,由社区维护,更可扩展、更灵活,使用者也更多,Mozilla、jQuery 都在用 JSHint 。ESLint 是另一位 JavaScript 专家  Nicholas C. Zakas 主导的社区项目。

注:SublimeLinter 是 Sublime 上 linter 类插件的 framework,所以很多 linter 都依赖这个插件。Package Control: Install Package 中输入 SublimeLinter- 会列出大量 SublimeLinter- 开头的 linter 插件,如下图:

JSCS

代码中没有错误还不够,好的代码需要遵循一致的代码风格(代码不仅仅给机器用,还是给人看不是吗?)。JSCS 是检查代码风格的工具,可以配置很多代码风格规则,例如空格的要求、括号的位置等,还可以直接使用  jQuery、Google 等代码风格方案。

Sublime 上需要安装 SublimeLinter-JSCS 。这个插件同样依赖 SublimeLinter 以及 jscs 命令本身。简单安装说明如下:

  1. 安装 jscs 命令:npm install jscs -g
  2. Package Control 安装:SublimeLinter ,重启 sublime (如果你还没装 SublimeLinter 的话,否则请跳过)
  3. Package Control 安装:SublimeLinter-jscs

此外,你还可以安装一个 JSCS-Formatter 插件,实现自动代码格式化。

ColorHighliter

Color highlighter 插件可以自动显示 CSS 或 Sass 中声明的颜色,让你一目了然。默认配置下,当鼠标移到颜色变量上时背景就会变为声明的颜色。

还可以设置多种颜色显示方式,默认配置见: ‘Package Settings’ > ‘Color Highlighter’ > ‘Settings – Default’ 。例如,我们在该插件的 User 设置中做如下设置可以达到下图的显示效果:

 

1

2

3

{

  "ha_style": "filled"

}

Gutter Color 和 Color Picker 是另外两个颜色相关的插件。

AutoFileName

AutoFileName 在你在输入文件名是提供自动提示,减少人为的输入错误。

Autoprefixer

Autoprefixer 插件让帮你自动添加 CSS 厂商前缀,个人使用比较方便。如果是正式的项目,可以使用其它自动构建工具在构建过程中统一实现。

作者:韩国恺。本系列文章以 Addy & Matt 的系列视频 Totally Tooling Tips 的内容为基础重新整理而成,主要介绍一些(前端)开发者喜欢的工具和技巧。

Statement
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
What are boolean attributes in HTML? Give some examples.What are boolean attributes in HTML? Give some examples.Apr 25, 2025 am 12:01 AM

Boolean attributes are special attributes in HTML that are activated without a value. 1. The Boolean attribute controls the behavior of the element by whether it exists or not, such as disabled disable the input box. 2.Their working principle is to change element behavior according to the existence of attributes when the browser parses. 3. The basic usage is to directly add attributes, and the advanced usage can be dynamically controlled through JavaScript. 4. Common mistakes are mistakenly thinking that values ​​need to be set, and the correct writing method should be concise. 5. The best practice is to keep the code concise and use Boolean properties reasonably to optimize web page performance and user experience.

How can you validate your HTML code?How can you validate your HTML code?Apr 24, 2025 am 12:04 AM

HTML code can be cleaner with online validators, integrated tools and automated processes. 1) Use W3CMarkupValidationService to verify HTML code online. 2) Install and configure HTMLHint extension in VisualStudioCode for real-time verification. 3) Use HTMLTidy to automatically verify and clean HTML files in the construction process.

HTML vs. CSS and JavaScript: Comparing Web TechnologiesHTML vs. CSS and JavaScript: Comparing Web TechnologiesApr 23, 2025 am 12:05 AM

HTML, CSS and JavaScript are the core technologies for building modern web pages: 1. HTML defines the web page structure, 2. CSS is responsible for the appearance of the web page, 3. JavaScript provides web page dynamics and interactivity, and they work together to create a website with a good user experience.

HTML as a Markup Language: Its Function and PurposeHTML as a Markup Language: Its Function and PurposeApr 22, 2025 am 12:02 AM

The function of HTML is to define the structure and content of a web page, and its purpose is to provide a standardized way to display information. 1) HTML organizes various parts of the web page through tags and attributes, such as titles and paragraphs. 2) It supports the separation of content and performance and improves maintenance efficiency. 3) HTML is extensible, allowing custom tags to enhance SEO.

The Future of HTML, CSS, and JavaScript: Web Development TrendsThe Future of HTML, CSS, and JavaScript: Web Development TrendsApr 19, 2025 am 12:02 AM

The future trends of HTML are semantics and web components, the future trends of CSS are CSS-in-JS and CSSHoudini, and the future trends of JavaScript are WebAssembly and Serverless. 1. HTML semantics improve accessibility and SEO effects, and Web components improve development efficiency, but attention should be paid to browser compatibility. 2. CSS-in-JS enhances style management flexibility but may increase file size. CSSHoudini allows direct operation of CSS rendering. 3.WebAssembly optimizes browser application performance but has a steep learning curve, and Serverless simplifies development but requires optimization of cold start problems.

HTML: The Structure, CSS: The Style, JavaScript: The BehaviorHTML: The Structure, CSS: The Style, JavaScript: The BehaviorApr 18, 2025 am 12:09 AM

The roles of HTML, CSS and JavaScript in web development are: 1. HTML defines the web page structure, 2. CSS controls the web page style, and 3. JavaScript adds dynamic behavior. Together, they build the framework, aesthetics and interactivity of modern websites.

The Future of HTML: Evolution and Trends in Web DesignThe Future of HTML: Evolution and Trends in Web DesignApr 17, 2025 am 12:12 AM

The future of HTML is full of infinite possibilities. 1) New features and standards will include more semantic tags and the popularity of WebComponents. 2) The web design trend will continue to develop towards responsive and accessible design. 3) Performance optimization will improve the user experience through responsive image loading and lazy loading technologies.

HTML vs. CSS vs. JavaScript: A Comparative OverviewHTML vs. CSS vs. JavaScript: A Comparative OverviewApr 16, 2025 am 12:04 AM

The roles of HTML, CSS and JavaScript in web development are: HTML is responsible for content structure, CSS is responsible for style, and JavaScript is responsible for dynamic behavior. 1. HTML defines the web page structure and content through tags to ensure semantics. 2. CSS controls the web page style through selectors and attributes to make it beautiful and easy to read. 3. JavaScript controls web page behavior through scripts to achieve dynamic and interactive functions.

See all articles

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

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools