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

推荐订阅源

Cisco Talos Blog
Cisco Talos Blog
阮一峰的网络日志
阮一峰的网络日志
云风的 BLOG
云风的 BLOG
D
Docker
Vercel News
Vercel News
IT之家
IT之家
Recent Announcements
Recent Announcements
Last Week in AI
Last Week in AI
V
Visual Studio Blog
Engineering at Meta
Engineering at Meta
腾讯CDC
Google DeepMind News
Google DeepMind News
I
InfoQ
博客园 - 三生石上(FineUI控件)
Apple Machine Learning Research
Apple Machine Learning Research
The GitHub Blog
The GitHub Blog
博客园 - Franky
The Cloudflare Blog
A
About on SuperTechFans
有赞技术团队
有赞技术团队
Y
Y Combinator Blog
T
Tenable Blog
P
Proofpoint News Feed
Recorded Future
Recorded Future
Security Latest
Security Latest
H
Hackread – Cybersecurity News, Data Breaches, AI and More
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
博客园 - 聂微东
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Google Online Security Blog
Google Online Security Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Simon Willison's Weblog
Simon Willison's Weblog
The Last Watchdog
The Last Watchdog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
N
News and Events Feed by Topic
TaoSecurity Blog
TaoSecurity Blog
U
Unit 42
The Hacker News
The Hacker News
Martin Fowler
Martin Fowler
T
Threat Research - Cisco Blogs
NISL@THU
NISL@THU
F
Full Disclosure
M
MIT News - Artificial intelligence
人人都是产品经理
人人都是产品经理
Hugging Face - Blog
Hugging Face - Blog
V
V2EX
Project Zero
Project Zero

噜啦 - 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 修改新标签页默认语法

 •