惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

N
Netflix TechBlog - Medium
V
Vulnerabilities – Threatpost
Google Online Security Blog
Google Online Security Blog
Hugging Face - Blog
Hugging Face - Blog
L
LINUX DO - 热门话题
云风的 BLOG
云风的 BLOG
P
Proofpoint News Feed
D
Docker
C
Cyber Attacks, Cyber Crime and Cyber Security
MyScale Blog
MyScale Blog
P
Palo Alto Networks Blog
T
Tenable Blog
P
Privacy International News Feed
Google DeepMind News
Google DeepMind News
小众软件
小众软件
Cisco Talos Blog
Cisco Talos Blog
aimingoo的专栏
aimingoo的专栏
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
A
Arctic Wolf
C
Cybersecurity and Infrastructure Security Agency CISA
C
Cisco Blogs
T
Threat Research - Cisco Blogs
NISL@THU
NISL@THU
The Hacker News
The Hacker News
Project Zero
Project Zero
AWS News Blog
AWS News Blog
Simon Willison's Weblog
Simon Willison's Weblog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
T
Threatpost
V
Visual Studio Blog
The GitHub Blog
The GitHub Blog
The Cloudflare Blog
Last Week in AI
Last Week in AI
Jina AI
Jina AI
Cyberwarzone
Cyberwarzone
The Register - Security
The Register - Security
C
CXSECURITY Database RSS Feed - CXSecurity.com
Vercel News
Vercel News
D
Darknet – Hacking Tools, Hacker News & Cyber Security
MongoDB | Blog
MongoDB | Blog
U
Unit 42
Scott Helme
Scott Helme
A
About on SuperTechFans
WordPress大学
WordPress大学
F
Fortinet All Blogs
大猫的无限游戏
大猫的无限游戏
G
GRAHAM CLULEY
Latest news
Latest news
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
S
Schneier on Security

噜啦 - Sublime

Sublime配置C/C++ - 噜啦
sublime 修改新标签页默认语法 - 噜啦
博主: 噜啦 · 2019-07-07 · via 噜啦 - Sublime
  1. 首页
  2. 正文  

本文方法来自 简书 @zhysv

sublime在新建标签页的时候,默认文件类型是plain text,每次需要手动更换的话确实有点麻烦,博主网上找了许久,终于发现了这篇可用教程,固自己详细写一下方法,以备后用

教程开始,以C++为例

创建新标签页,选择语言类型,我的是C++

菜单栏 打开 View > Show Console 调出控制台

也可以使用 ctrl + `

8a1532d77f6c0d7b4cb8983afccf3602.png

输入 view.settings().get('syntax'),回车

复制以Packages开头的Packages/C++/C++.sublime-syntax

8ca82c633fc49077b0a8f3c6c4e308d5.png

菜单栏 Tools > Developer > New Snippet...

输入以下代码

import sublime, sublime_plugin

class EverythingIsPowerShell(sublime_plugin.EventListener):
    def on_new(self, view):
        view.set_syntax_file('Packages/C++/C++.sublime-syntax')

其中Packages/C++/C++.sublime-syntax改为你刚才复制的内容,保存文件名为 DefaultLanguage.py

没错,是保存为python文件!

路径 插件文件夹/Packages/User/

7f27234079cb92d0aa9d97bc34d8d41f.png

重启Sublime,新建标签页时会发现默认的文件语言类型都是C++了,以后更换的时候只需要更换文件文件中步骤二中复制的内容即可


之前我写过sublime配置 C/C++ 环境的教程,想配置的同学可以参考这篇文章

赞赏作者

如果觉得我的文章对你有用,请随意赞赏

sublime 修改新标签页默认语法

 •