资源简介
SideBarEnhancements插件一个增强侧边栏文件夹浏览功能的插件,比较不错,具有很多对于文件列表进行操作的功能。
代码片段和文件信息
# coding=utf8
import sublime sublime_plugin
import os
import threading time
from sidebar.SideBarItem import SideBarItem
from sidebar.SideBarSelection import SideBarSelection
from sidebar.SideBarProject import SideBarProject
from send2trash import send2trash
# needed for getting local app data path on windows
if sublime.platform() == ‘windows‘:
import _winreg
def expand_vars(path):
for k v in os.environ.iteritems():
# dirty hack this should be autofixed in python3
try:
k = unicode(k.encode(‘utf8‘))
v = unicode(v.encode(‘utf8‘))
path = path.replace(‘%‘+k+‘%‘ v).replace(‘%‘+k.lower()+‘%‘ v)
except:
pass
return path
#NOTES
# A “directory“ for this plugin is a “directory“
# A “directory“ for a user is a “folder“
s = sublime.load_settings(‘Side Bar.sublime-settings‘)
def check_version():
version = ‘11.13.2012.1305.0‘;
if s.get(‘version‘) != version:
SideBarItem(sublime.packages_path()+‘/SideBarEnhancements/messages/‘+version+‘.txt‘ False).edit();
s.set(‘version‘ version);
sublime.save_settings(‘Side Bar.sublime-settings‘)
sublime.set_timeout(lambda:check_version() 3000);
class SideBarNewFile2Command(sublime_plugin.WindowCommand):
def run(self paths = [] name = ““):
import functools
self.window.run_command(‘hide_panel‘);
self.window.show_input_panel(“File Name:“ name functools.partial(SideBarNewFileCommand(sublime_plugin.WindowCommand).on_done paths True) None None)
class SideBarNewFileCommand(sublime_plugin.WindowCommand):
def run(self paths = [] name = ““):
import functools
self.window.run_command(‘hide_panel‘);
self.window.show_input_panel(“File Name:“ name functools.partial(self.on_done paths False) None None)
def on_done(self paths relative_to_project name):
if relative_to_project and s.get(‘new_files_relative_to_project_root‘):
paths = SideBarProject().getDirectories()
if paths:
paths = [SideBarItem(paths[0] False)]
if not paths:
paths = SideBarSelection(paths).getSelectedDirectoriesOrDirnames()
else:
paths = SideBarSelection(paths).getSelectedDirectoriesOrDirnames()
if not paths:
paths = SideBarProject().getDirectories()
if paths:
paths = [SideBarItem(paths[0] False)]
if not paths:
sublime.active_window().new_file()
else:
for item in paths:
item = SideBarItem(item.join(name) False)
if item.exists():
sublime.error_message(“Unable to create file file or folder exists.“)
self.run(paths name)
return
else:
try:
item.create()
item.edit()
except:
sublime.error_message(“Unable to create file:\n\n“+item.path())
self.run(paths name)
return
SideBarProject().refresh();
class SideBarNewDirectoryCommand(sublime_plugin.WindowCommand):
def run(self paths = [] name = ““):
import functools
self.window.run_command(‘hide_panel‘);
self.window.show_input_panel(“Folder Name:“ name functools.partial(self.on_done paths) None None)
def on_done(self path
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2014-02-05 16:14 SideBarEnhancements\
文件 33 2013-10-22 00:40 SideBarEnhancements\.gitignore
文件 2247 2013-10-22 00:40 SideBarEnhancements\Commands.sublime-commands
文件 220 2013-10-22 00:40 SideBarEnhancements\Default.sublime-keymap
目录 0 2014-02-05 16:14 SideBarEnhancements\disable_default\
文件 146 2013-10-22 00:40 SideBarEnhancements\disable_default\Side Bar Mount Point.sublime-menu.txt
文件 673 2013-10-22 00:40 SideBarEnhancements\disable_default\Side Bar.sublime-menu.txt
目录 0 2014-02-05 16:14 SideBarEnhancements\hurry\
文件 2166 2013-10-22 00:40 SideBarEnhancements\hurry\filesize.py
文件 2055 2013-10-22 00:40 SideBarEnhancements\hurry\PKG-INFO
文件 1113 2013-10-22 00:40 SideBarEnhancements\hurry\README.txt
文件 0 2013-10-22 00:40 SideBarEnhancements\hurry\__init__.py
文件 924 2013-10-22 00:40 SideBarEnhancements\license.txt
文件 2584 2013-10-22 00:40 SideBarEnhancements\Main.sublime-menu
目录 0 2014-02-05 16:14 SideBarEnhancements\messages\
文件 571 2013-10-22 00:40 SideBarEnhancements\messages\11.13.2012.1305.0.txt
文件 155 2013-10-22 00:40 SideBarEnhancements\readme.md
目录 0 2014-02-05 16:14 SideBarEnhancements\send2trash\
文件 1634 2013-10-22 00:40 SideBarEnhancements\send2trash\plat_osx.py
文件 5288 2013-10-22 00:40 SideBarEnhancements\send2trash\plat_other.py
文件 1586 2013-10-22 00:40 SideBarEnhancements\send2trash\plat_win.py
文件 468 2013-10-22 00:40 SideBarEnhancements\send2trash\__init__.py
文件 10845 2013-10-22 00:40 SideBarEnhancements\Side Bar.sublime-menu
文件 1051 2013-10-22 00:40 SideBarEnhancements\Side Bar.sublime-settings
目录 0 2014-02-05 16:14 SideBarEnhancements\sidebar\
目录 0 2014-02-05 16:14 SideBarEnhancements\sidebar\desktop\
文件 17223 2013-10-22 00:40 SideBarEnhancements\sidebar\desktop\dialog.py
文件 8000 2013-10-22 00:40 SideBarEnhancements\sidebar\desktop\windows.py
文件 8910 2013-10-22 00:40 SideBarEnhancements\sidebar\desktop\__init__.py
文件 13740 2013-10-22 00:40 SideBarEnhancements\sidebar\SideBarItem.py
文件 4036 2013-10-22 00:40 SideBarEnhancements\sidebar\SideBarProject.py
............此处省略6个文件信息
相关资源
- 适用于notepad++7.5.6.0的NppExec插件
- VC Comment注释插件
- js 导出xlsx,xls,csv插件
- 千图网素材解析插件
- sublime3豆沙绿主题
- idea2017的sublime3 monokai配色
- Notepad++插件管理器-gpup.exe
- 腾讯通飞鸽传书插件ipmsgplugin
- EXCEL最小化插件
- Unity3D4.6.3P4+破解文件+UVS插件联动VS编
- elasticsearch-analysis-pinyin-1.6.0
- Fiddler插件Watcher
- windows资源管理系统 自启工具
- chromecj.com.rar
- 编辑过程中自动保存插件10.0_V2.0.rar
- DISCUZ 插件--个人免签约购VIP会员
- vs2017 MomoKai字体及颜色
- CAD坐标标注插件
- PresentationTranslator(PPT全文翻译插件)
- pinchzoom手机图片缩放插件
- atom的linter-gcc插件集合
- IDEA主题插件4款主题插件
- 人像美容磨皮润肤PS插件
- 4.8-接插件-脚距3.96.SchLib
- 换行插件.rar
- 图形化流程插件
- 水杉导出pmx插件 ExportPMX
- idea vuejs插件
- ENVI气溶胶反演最新插件(2018)
- 3dmaxAO插件
评论
共有 条评论