我的 Sublime text 之路

本文介绍两款Sublime Text插件:TrailingSpacer用于高亮多余空格和Tab,帮助代码洁癖者清理代码;SideBarEnhancements则增强侧边栏功能,实现文件路径复制与浏览器预览,提升开发效率。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

插件系列:

TrailingSpacer 高亮显示多余的空格和Tab


有时候在代码结尾打多了几个空格或Tab,一般不会察觉,TrailingSpacer这款插件能高亮显示多余的空格和Tab,并可以一键删除它们,有代码洁癖的朋友应该会喜欢这个插件。
Deletion
The main feature you gain from using this plugin is that of deleting all trailing spaces in the currently edited document. In order to use this deletion feature, you may either:
click on "Edit / Trailing Spaces / Delete";
bind the deletion command to a keyboard shortcut:
To add a key binding, open "Preferences / Key Bindings - User" and add:
{ "keys": ["ctrl+shift+t"], "command": "delete_trailing_spaces" }
With this setting, pressing Ctrl + Shift + t will delete all trailing spaces at once in the current file! For OSX users, quoting wbond: "When porting a key binding across OSes, it is common for the ctrl key on Windows and Linux to be swapped out for super on OS X" (eg. use "super+ctrl+t" instead).
Beware: the binding from this example overrides the default ST's mapping for reopening last closed file. You can look at the default bindings in "Preferences / Key Bindings - Default".
sublimeplug2


SideBarEnhancements 侧边栏增强



SideBarEnhancements本是增强侧边栏的插件,这里将教大家如何用来做sublime text 3浏览器预览插件,并可自定义浏览器预览的快捷键。
sublimeplug5
安装此插件,点击工具栏的preferences > package setting > side bar > Key Building-User,键入以下代码,这里设置按Ctrl+Shift+C复制文件路径,按F1~F2分别在firefox,chrome 浏览器预览效果,当然你也可以自己定义喜欢的快捷键,最后注意代码中的浏览器路径要以自己电脑里的文件路径为准。
	{ "keys": ["ctrl+shift+c"], "command": "copy_path" },
    //firefox
    { "keys": ["f1"], "command": "side_bar_files_open_with",
             "args": {
                "paths": [],
                "application": "/usr/lib64/firefox/firefox",
                "extensions":".*" //匹配任何文件类型
            }
    },
    //chrome
    { "keys": ["f2"], "command": "side_bar_files_open_with",
            "args": {
                "paths": [],
                "application": "/opt/google/chrome/google-chrome",
                "extensions":".*"
            }
     }



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值