简介:以前使用ST2里面的Sublime NFFT插件比较顺手,最近安装了ST3,但是Sublime NFFT插件不支持ST3,就下载了SublimeTmpl从模版新建文件插件。在使用时,习惯在侧边栏右击目录-新建模版文件,然后保存在右击的目录下。但是SublimeTmpl插件不支持这功能,非常蛋疼。花了一点时间研究Sublime NFFT插件源码,对SublimeTmpl进行了改造,详情如下:

SublimeTmpl插件安装之后,首选项>浏览程序包>SublimeTmpl>sublime-tmpl.py,该文件修改如下(左侧是原来代码,右侧红色部分是修改之处):

修改之后完整代码:

 #!/usr/bin/env python
# -*- coding: utf-8 -*-
# + Python 3 support
# + sublime text 3 support import sublime
import sublime_plugin
# import sys
import os
import glob
import datetime
import zipfile
import re PACKAGE_NAME = 'SublimeTmpl'
TMLP_DIR = 'templates'
KEY_SYNTAX = 'syntax'
KEY_FILE_EXT = 'extension' # st3: Installed Packages/xx.sublime-package
BASE_PATH = os.path.abspath(os.path.dirname(__file__))
PACKAGES_PATH = sublime.packages_path() # for ST2 # sys.path += [BASE_PATH]
# sys.path.append(BASE_PATH)
# import sys;print(sys.path) IS_GTE_ST3 = int(sublime.version()[0]) >= 3
DISABLE_KEYMAP = None class SublimeTmplCommand(sublime_plugin.TextCommand): def run(self, edit, type='html', dirs=[]):
view = self.view
opts = self.get_settings(type)
tmpl = self.get_code(type) # print('global', DISABLE_KEYMAP, IS_GTE_ST3);
if DISABLE_KEYMAP:
return False # print(KEY_SYNTAX in opts)
self.tab = self.creat_tab(view) self.set_syntax(opts)
self.set_code(tmpl, type, dirs) def get_settings(self, type=None):
settings = sublime.load_settings(PACKAGE_NAME + '.sublime-settings') if not type:
return settings # print(settings.get('html')['syntax'])
opts = settings.get(type, [])
# print(opts)
return opts def open_file(self, path, mode='r'):
fp = open(path, mode)
code = fp.read()
fp.close()
return code def get_code(self, type):
code = ''
file_name = "%s.tmpl" % type
isIOError = False if IS_GTE_ST3:
tmpl_dir = 'Packages/' + PACKAGE_NAME + '/' + TMLP_DIR + '/'
user_tmpl_dir = 'Packages/User/' + \
PACKAGE_NAME + '/' + TMLP_DIR + '/'
# tmpl_dir = os.path.join('Packages', PACKAGE_NAME , TMLP_DIR)
else:
tmpl_dir = os.path.join(PACKAGES_PATH, PACKAGE_NAME, TMLP_DIR)
user_tmpl_dir = os.path.join(
PACKAGES_PATH, 'User', PACKAGE_NAME, TMLP_DIR) self.user_tmpl_path = os.path.join(user_tmpl_dir, file_name)
self.tmpl_path = os.path.join(tmpl_dir, file_name) if IS_GTE_ST3:
try:
code = sublime.load_resource(self.user_tmpl_path)
except IOError:
try:
code = sublime.load_resource(self.tmpl_path)
except IOError:
isIOError = True
else:
if os.path.isfile(self.user_tmpl_path):
code = self.open_file(self.user_tmpl_path)
elif os.path.isfile(self.tmpl_path):
code = self.open_file(self.tmpl_path)
else:
isIOError = True # print(self.tmpl_path)
if isIOError:
sublime.message_dialog('[Warning] No such file: ' + self.tmpl_path
+ ' or ' + self.user_tmpl_path) return self.format_tag(code) def format_tag(self, code):
code = code.replace('\r', '') # replace \r\n -> \n
# format
settings = self.get_settings()
format = settings.get('date_format', '%Y-%m-%d')
date = datetime.datetime.now().strftime(format)
if not IS_GTE_ST3:
code = code.decode('utf8') # for st2 && Chinese characters
code = code.replace('${date}', date) attr = settings.get('attr', {})
for key in attr:
code = code.replace('${%s}' % key, attr.get(key, ''))
return code def creat_tab(self, view):
win = view.window()
tab = win.new_file()
return tab def set_code(self, code, type, dirs):
tab = self.tab
tab.set_name('untitled.' + type)
# insert codes
tab.run_command('insert_snippet', {'contents': code})
if len(dirs) == 1:
tab.settings().set('default_dir', dirs[0]) def set_syntax(self, opts):
v = self.tab
# syntax = self.view.settings().get('syntax') # from current file
syntax = opts[KEY_SYNTAX] if KEY_SYNTAX in opts else ''
# print(syntax) # tab.set_syntax_file('Packages/Diff/Diff.tmLanguage')
v.set_syntax_file(syntax) # print(opts[KEY_FILE_EXT])
if KEY_FILE_EXT in opts:
v.settings().set('default_extension', opts[KEY_FILE_EXT]) class SublimeTmplEventListener(sublime_plugin.EventListener):
def on_query_context(self, view, key, operator, operand, match_all):
settings = sublime.load_settings(PACKAGE_NAME + '.sublime-settings')
disable_keymap_actions = settings.get('disable_keymap_actions', '')
# print ("key1: %s, %s" % (key, disable_keymap_actions))
global DISABLE_KEYMAP
DISABLE_KEYMAP = False;
if not key.startswith('sublime_tmpl.'):
return None
if not disable_keymap_actions: # no disabled actions
return True
elif disable_keymap_actions == 'all' or disable_keymap_actions == True: # disable all actions
DISABLE_KEYMAP = True;
return False
prefix, name = key.split('.')
ret = name not in re.split(r'\s*,\s*', disable_keymap_actions.strip())
# print(name, ret)
DISABLE_KEYMAP = True if not ret else False;
return ret def plugin_loaded(): # for ST3 >= 3016
# global PACKAGES_PATH
PACKAGES_PATH = sublime.packages_path()
TARGET_PATH = os.path.join(PACKAGES_PATH, PACKAGE_NAME)
# print(BASE_PATH, os.path.dirname(BASE_PATH))
# print(TARGET_PATH) # auto create custom_path
custom_path = os.path.join(PACKAGES_PATH, 'User', PACKAGE_NAME, TMLP_DIR)
# print(custom_path, os.path.isdir(custom_path))
if not os.path.isdir(custom_path):
os.makedirs(custom_path) # first run
if not os.path.isdir(TARGET_PATH):
os.makedirs(os.path.join(TARGET_PATH, TMLP_DIR))
# copy user files
tmpl_dir = TMLP_DIR + '/'
file_list = [
'Default.sublime-commands', 'Main.sublime-menu',
# if don't copy .py, ST3 throw: ImportError: No module named
'sublime-tmpl.py',
'README.md',
tmpl_dir + 'css.tmpl', tmpl_dir + 'html.tmpl',
tmpl_dir + 'js.tmpl', tmpl_dir + 'php.tmpl',
tmpl_dir + 'python.tmpl', tmpl_dir + 'ruby.tmpl',
tmpl_dir + 'xml.tmpl'
]
try:
extract_zip_resource(BASE_PATH, file_list, TARGET_PATH)
except Exception as e:
print(e) # old: *.user.tmpl compatible fix
files = glob.iglob(os.path.join(os.path.join(TARGET_PATH, TMLP_DIR), '*.user.tmpl'))
for file in files:
filename = os.path.basename(file).replace('.user.tmpl', '.tmpl')
# print(file, '=>', os.path.join(custom_path, filename));
os.rename(file, os.path.join(custom_path, filename)) # old: settings-custom_path compatible fix
settings = sublime.load_settings(PACKAGE_NAME + '.sublime-settings')
old_custom_path = settings.get('custom_path', '')
if old_custom_path and os.path.isdir(old_custom_path):
# print(old_custom_path)
files = glob.iglob(os.path.join(old_custom_path, '*.tmpl'))
for file in files:
filename = os.path.basename(file).replace('.user.tmpl', '.tmpl')
# print(file, '=>', os.path.join(custom_path, filename))
os.rename(file, os.path.join(custom_path, filename)) if not IS_GTE_ST3:
sublime.set_timeout(plugin_loaded, 0) def extract_zip_resource(path_to_zip, file_list, extract_dir=None):
if extract_dir is None:
return
# print(extract_dir)
if os.path.exists(path_to_zip):
z = zipfile.ZipFile(path_to_zip, 'r')
for f in z.namelist():
# if f.endswith('.tmpl'):
if f in file_list:
# print(f)
z.extract(f, extract_dir)
z.close()

增加侧边栏右键新增模版文件功能:

  1. 首选项>浏览程序包,在打开的目录新建跟插件名称一样的目录,这里是新建"SideBarEnhancements"。
  2. 选择当前目录上一级(Sublime Text 3)>Installed Packages找到"SideBarEnhancements.sublime-package",复制一份该文件到任意目录,修改文件后缀为.zip,用软件解压。
  3. 找到解压目录中以".sublime-menu"为结尾的文件,这里是"Side Bar.sublime-menu",复制一份到第一步新建的目录SideBarEnhancements中。
  4. 修改复制的"Side Bar.sublime-menu"文件,添加如下内容:
     {
"caption": "New File (SublimeTmpl)",
"id": "side-bar-new-file-SublimeTmpl",
"children": [
{
"caption": "HTML",
"command": "sublime_tmpl",
"args": {
"type": "html",
"dirs": []
}
},
{
"caption": "Javascript",
"command": "sublime_tmpl",
"args": {
"type": "js",
"dirs": []
}
},
{
"caption": "CSS",
"command": "sublime_tmpl",
"args": {
"type": "css",
"dirs": []
}
},
{
"caption": "PHP",
"command": "sublime_tmpl",
"args": {
"type": "php",
"dirs": []
}
},
{
"caption": "python",
"command": "sublime_tmpl",
"args": {
"type": "py",
"dirs": []
}
},
{
"caption": "ruby",
"command": "sublime_tmpl",
"args": {
"type": "rb",
"dirs": []
}
},
{"caption": "-"},
{
"command": "open_file",
"args": {"file": "${packages}/SublimeTmpl/Main.sublime-menu"},
"caption": "Menu"
}
]
},

修改之后完成代码:

[
{
"caption": "aaaaa_side_bar",
"id": "aaaaa_side_bar",
"command": "aaaaa_side_bar",
"args": {
"paths": []
}
},
{
"caption": "-",
"id": "side-bar-start-separator"
},
{
"caption": "New File…",
"id": "side-bar-new-file",
"command": "side_bar_new_file",
"args": {
"paths": []
}
},
{
"caption": "New Folder…",
"id": "side-bar-new-directory",
"command": "side_bar_new_directory",
"args": {
"paths": []
}
},
{
"caption": "-",
"id": "side-bar-start-separator"
},
{
"caption": "New File (SublimeTmpl)",
"id": "side-bar-new-file-SublimeTmpl",
"children": [
{
"caption": "HTML",
"command": "sublime_tmpl",
"args": {
"type": "html",
"dirs": []
}
},
{
"caption": "Javascript",
"command": "sublime_tmpl",
"args": {
"type": "js",
"dirs": []
}
},
{
"caption": "CSS",
"command": "sublime_tmpl",
"args": {
"type": "css",
"dirs": []
}
},
{
"caption": "PHP",
"command": "sublime_tmpl",
"args": {
"type": "php",
"dirs": []
}
},
{
"caption": "python",
"command": "sublime_tmpl",
"args": {
"type": "py",
"dirs": []
}
},
{
"caption": "ruby",
"command": "sublime_tmpl",
"args": {
"type": "rb",
"dirs": []
}
},
{"caption": "-"},
{
"command": "open_file",
"args": {"file": "${packages}/SublimeTmpl/Main.sublime-menu"},
"caption": "Menu"
}
]
},
{
"caption": "-",
"id": "side-bar-new-separator"
}, {
"caption": "Edit",
"id": "side-bar-edit",
"command": "side_bar_edit",
"args": {
"paths": []
}
},
{
"caption": "Edit to Right",
"id": "side-bar-edit-to-right",
"command": "side_bar_edit_to_right",
"args": {
"paths": []
}
},
{
"caption": "Open / Run",
"id": "side-bar-open",
"command": "side_bar_open",
"args": {
"paths": []
}
},
{
"caption": "Open In Browser",
"id": "side-bar-open-in-browser",
"children": [
{
"caption": "Default",
"command": "side_bar_open_in_browser",
"args": {
"paths": []
}
},
{
"caption": "-"
},
{
"caption": "Firefox",
"command": "side_bar_open_in_browser",
"args": {
"paths": [],
"type": "testing",
"browser": "firefox"
}
},
{
"caption": "-"
},
{
"caption": "Chromium",
"command": "side_bar_open_in_browser",
"args": {
"paths": [],
"type": "testing",
"browser": "chromium"
}
},
{
"caption": "Chrome",
"command": "side_bar_open_in_browser",
"args": {
"paths": [],
"type": "testing",
"browser": "chrome"
}
},
{
"caption": "Canary",
"command": "side_bar_open_in_browser",
"args": {
"paths": [],
"type": "testing",
"browser": "canary"
}
},
{
"caption": "-"
},
{
"caption": "Opera",
"command": "side_bar_open_in_browser",
"args": {
"paths": [],
"type": "testing",
"browser": "opera"
}
},
{
"caption": "Safari",
"command": "side_bar_open_in_browser",
"args": {
"paths": [],
"type": "testing",
"browser": "safari"
}
},
{
"caption": "-"
},
{
"caption": "Internet Explorer",
"command": "side_bar_open_in_browser",
"args": {
"paths": [],
"type": "testing",
"browser": "ie"
}
},
{
"caption": "Edge",
"command": "side_bar_open_in_browser",
"args": {
"paths": [],
"type": "testing",
"browser": "edge"
}
},
{
"caption": "-"
},
{
"caption": "Open In All Browsers",
"command": "side_bar_open_browsers"
}
]
},
{
"caption": "Open In New Window",
"id": "side-bar-open-in-new-window",
"command": "side_bar_open_in_new_window",
"args": {
"paths": []
}
},
{
"caption": "Open With Finder",
"id": "side-bar-open-with-finde",
"command": "side_bar_open_with_finder",
"args": {
"paths": []
}
},
{
"caption": "Open With",
"id": "side-bar-files-open-with", "children": [ {
"caption": "-",
"id": "side-bar-files-open-with-edit-application-separator"
},
{
"caption": "Edit Applications…",
"id": "side-bar-files-open-with-edit-applications",
"command": "side_bar_files_open_with_edit_applications",
"args": {
"paths": []
}
},
{
"caption": "-",
"id": "side-bar-files-open-with-edit-applications-separator"
} ]
},
{
"caption": "Reveal",
"id": "side-bar-reveal",
"command": "side_bar_reveal",
"args": {
"paths": []
}
}, {
"caption": "-",
"id": "side-bar-edit-open-separator"
}, {
"caption": "Find & Replace…",
"id": "side-bar-find-selected",
"command": "side_bar_find_in_selected",
"args": {
"paths": []
}
},
{
"caption": "Find Files Named…",
"id": "side-bar-find-files",
"command": "side_bar_find_files_path_containing",
"args": {
"paths": []
}
},
{
"caption": "Find Advanced",
"id": "side-bar-find-advanced",
"children": [
{
"caption": "In Parent Folder…",
"id": "side-bar-find-parent",
"command": "side_bar_find_in_parent",
"args": {
"paths": []
}
},
{
"caption": "-",
"id": "side-bar-find-parent-separator"
},
{
"caption": "In Project…",
"id": "side-bar-find-in-project",
"command": "side_bar_find_in_project",
"args": {
"paths": []
}
},
{
"caption": "In Project Folder…",
"id": "side-bar-find-project-folder",
"command": "side_bar_find_in_project_folder",
"args": {
"paths": []
}
},
{
"caption": "In Project Folders…",
"id": "side-bar-find-project-folders",
"command": "side_bar_find_in_project_folders"
},
{
"caption": "-",
"id": "side-bar-find-project-separator"
},
{
"id": "side-bar-find-in-files-with-extension",
"command": "side_bar_find_in_files_with_extension",
"args": {
"paths": []
}
},
{
"caption": "In Paths Containing…",
"id": "side-bar-find-files-path-containing",
"command": "side_bar_find_files_path_containing",
"args": {
"paths": []
}
},
{
"caption": "-",
"id": "side-bar-mass-rename-separator"
},
{
"caption": "Mass Rename Selection…",
"id": "side-bar-mass-rename",
"command": "side_bar_mass_rename",
"args": {
"paths": []
}
} ]
},
{
"caption": "-",
"id": "side-bar-find-separator"
},
{
"caption": "Cut",
"id": "side-bar-clip-cut",
"command": "side_bar_cut",
"args": {
"paths": []
}
},
{
"caption": "Copy",
"id": "side-bar-clip-copy",
"command": "side_bar_copy",
"args": {
"paths": []
}
},
{
"caption": "Copy Name",
"id": "side-bar-clip-copy-name",
"command": "side_bar_copy_name",
"args": {
"paths": []
}
},
{
"caption": "Copy Path",
"id": "side-bar-clip-copy-path",
"command": "side_bar_copy_path_absolute_from_project_encoded",
"args": {
"paths": []
}
},
{
"caption": "Copy Path (Windows)",
"id": "side-bar-clip-copy-path-windows",
"command": "side_bar_copy_path_absolute_from_project_encoded_windows",
"args": {
"paths": []
}
},
{
"caption": "Copy Dir Path",
"id": "side-bar-clip-copy-dir-path",
"command": "side_bar_copy_dir_path",
"args": {
"paths": []
}
},
{
"caption": "Copy as Text",
"id": "side-bar-clip-copy-as",
"children": [
{
"caption": "Relative Path From View Encoded",
"id": "side-bar-clip-copy-path-relative-from-view-encoded",
"command": "side_bar_copy_path_relative_from_view_encoded",
"args": {
"paths": []
}
},
{
"caption": "Relative Path From View",
"id": "side-bar-clip-copy-path-relative-from-view",
"command": "side_bar_copy_path_relative_from_view",
"args": {
"paths": []
}
},
{
"caption": "-",
"id": "side-bar-clip-copy-path-relative-from-view-separator"
}, {
"caption": "Relative Path From Project Encoded",
"id": "side-bar-clip-copy-path-relative-from-project-encoded",
"command": "side_bar_copy_path_relative_from_project_encoded",
"args": {
"paths": []
}
},
{
"caption": "Relative Path From Project",
"id": "side-bar-clip-copy-path-relative-from-project",
"command": "side_bar_copy_path_relative_from_project",
"args": {
"paths": []
}
},
{
"caption": "-",
"id": "side-bar-clip-copy-path-relative-from-project-separator"
}, {
"caption": "Absolute Path From Project Encoded",
"id": "side-bar-clip-copy-path-absolute-from-project-encoded",
"command": "side_bar_copy_path_absolute_from_project_encoded",
"args": {
"paths": []
}
},
{
"caption": "Absolute Path From Project",
"id": "side-bar-clip-copy-path-absolute-from-project",
"command": "side_bar_copy_path_absolute_from_project",
"args": {
"paths": []
}
},
{
"caption": "-",
"id": "side-bar-clip-copy-path-absolute-from-project-separator"
}, {
"caption": "Path as URI",
"id": "side-bar-clip-copy-path-encoded",
"command": "side_bar_copy_path_encoded",
"args": {
"paths": []
}
},
{
"caption": "Path",
"id": "side-bar-clip-copy-path",
"command": "side_bar_copy_path",
"args": {
"paths": []
}
},
{
"caption": "-",
"id": "side-bar-clip-copy-path-separator"
}, {
"caption": "Name Encoded",
"id": "side-bar-clip-copy-name-encoded",
"command": "side_bar_copy_name_encoded",
"args": {
"paths": []
}
},
{
"caption": "-",
"id": "side-bar-clip-copy-name-encoded-separator"
}, {
"caption": "URL",
"id": "side-bar-clip-copy-url",
"command": "side_bar_copy_url",
"args": {
"paths": []
}
},
{
"caption": "URL Decoded",
"id": "side-bar-clip-copy-url-decoded",
"command": "side_bar_copy_url_decoded",
"args": {
"paths": []
}
},
{
"caption": "-",
"id": "side-bar-clip-copy-url-separator"
}, {
"caption": "Tag a",
"id": "side-bar-clip-copy-tag-a",
"command": "side_bar_copy_tag_ahref",
"args": {
"paths": []
}
},
{
"caption": "Tag img",
"id": "side-bar-clip-copy-tag-img",
"command": "side_bar_copy_tag_img",
"args": {
"paths": []
}
},
{
"caption": "Tag script",
"id": "side-bar-clip-copy-tag-script",
"command": "side_bar_copy_tag_script",
"args": {
"paths": []
}
},
{
"caption": "Tag style",
"id": "side-bar-clip-copy-tag-style",
"command": "side_bar_copy_tag_style",
"args": {
"paths": []
}
},
{
"caption": "-",
"id": "side-bar-clip-copy-tag-separator"
},
{
"caption": "Project Folders",
"id": "side-bar-clip-copy-project-directories",
"command": "side_bar_copy_project_directories",
"args": {
"paths": []
}
},
{
"caption": "-",
"id": "side-bar-clip-copy-project-directories-separator"
},
{
"caption": "Content as UTF-8",
"id": "side-bar-clip-copy-content-utf8",
"command": "side_bar_copy_content_utf8",
"args": {
"paths": []
}
},
{
"caption": "Content as Data URI",
"id": "side-bar-clip-copy-content-base-64",
"command": "side_bar_copy_content_base64",
"args": {
"paths": []
}
}
]
}, {
"caption": "Paste",
"id": "side-bar-clip-paste",
"command": "side_bar_paste",
"args": {
"paths": [],
"in_parent": "False"
}
},
{
"caption": "Paste in Parent",
"id": "side-bar-clip-paste-in-parent",
"command": "side_bar_paste",
"args": {
"paths": [],
"in_parent": "True"
}
},
{
"caption": "-",
"id": "side-bar-clip-separator"
},
{
"caption": "Duplicate…",
"id": "side-bar-duplicate",
"command": "side_bar_duplicate",
"args": {
"paths": []
}
},
{
"caption": "-",
"id": "side-bar-duplicate-separator"
}, {
"caption": "Rename…",
"id": "side-bar-rename",
"command": "side_bar_rename",
"args": {
"paths": []
}
},
{
"caption": "Move…",
"id": "side-bar-move",
"command": "side_bar_move",
"args": {
"paths": []
}
},
{
"caption": "-",
"id": "side-bar-rename-move-separator"
}, {
"caption": "Delete",
"id": "side-bar-delete",
"command": "side_bar_delete",
"args": {
"paths": []
}
},
{
"caption": "Empty",
"id": "side-bar-empty",
"command": "side_bar_empty",
"args": {
"paths": []
}
},
{
"caption": "-",
"id": "side-bar-delete-separator"
}, {
"caption": "Refresh",
"id": "side-bar-refresh",
"command": "refresh_folder_list"
},
{
"caption": "-",
"id": "side-bar-refresh-separator"
},
{
"caption": "Project",
"id": "side-bar-project",
"children": [
{
"caption": "Edit Project",
"id": "side-bar-project-open-file",
"command": "side_bar_project_open_file",
"args": {
"paths": []
}
},
{
"caption": "Edit Preview URLs",
"id": "side-bar-preview-edit-urls",
"command": "side_bar_preview_edit_urls",
"args": {
"paths": []
}
},
{
"caption": "-",
"id": "side-bar-project-open-file-separator"
},
{
"command": "prompt_add_folder",
"caption": "Add Folder to Project…",
"mnemonic": "d"
},
{
"caption": "-",
"id": "side-bar-promote-as-project-folder-separator"
},
{
"caption": "Promote as Project Folder",
"id": "side-bar-project-item-add",
"command": "side_bar_project_item_add",
"args": {
"paths": []
}
},
{
"caption": "Hide From Sidebar (In theory exclude from project)",
"id": "side-bar-project-item-exclude",
"command": "side_bar_project_item_exclude",
"args": {
"paths": []
}
},
{
"caption": "-",
"id": "side-bar-project-item-separator"
},
{
"id": "side-bar-project-item-exclude-from-index-item",
"command": "side_bar_project_item_exclude_from_index",
"args": {
"paths": [],
"type": "item"
}
},
{
"id": "side-bar-project-item-exclude-from-index-relative",
"command": "side_bar_project_item_exclude_from_index",
"args": {
"paths": [],
"type": "relative"
}
},
{
"id": "side-bar-project-item-exclude-from-index-directory",
"command": "side_bar_project_item_exclude_from_index",
"args": {
"paths": [],
"type": "directory"
}
},
{
"id": "side-bar-project-item-exclude-from-index-file",
"command": "side_bar_project_item_exclude_from_index",
"args": {
"paths": [],
"type": "file"
}
},
{
"id": "side-bar-project-item-exclude-from-index-extension",
"command": "side_bar_project_item_exclude_from_index",
"args": {
"paths": [],
"type": "extension"
}
},
{
"caption": "-",
"id": "side-bar-project-item-separator"
},
{
"caption": "Remove Folder from Project",
"id": "side-bar-project-item-remove-folder",
"command": "side_bar_project_item_remove_folder",
"args": {
"paths": []
}
} ]
},
{
"caption": "-",
"id": "side-bar-donate-separator"
},
{
"caption": "Donate",
"command": "side_bar_donate",
"args": {
"paths": []
}
},
{
"caption": "-",
"id": "side-bar-end-separator"
},
{
"caption": "zzzzz_side_bar",
"id": "zzzzz_side_bar",
"command": "zzzzz_side_bar",
"args": {
"paths": []
}
},
]

总结: 本人python语言完全不懂,根据Sublime NFFT插件修改,不妥之处欢迎拍砖。

sublime text 3插件改造之添加从模版新增文件到指定目录的更多相关文章

  1. sublime text 3插件改造之AutoFileName去掉.vue文件中img标签后面的width和height,完全去掉!!

    在.vue文件中img标签使用autofilename提示引入文件时,会在文件后面插入宽度高度,如下图: 文件后面会自动插入height和width,其实这两玩意儿在大多数时候并没卵用,然后就开始了百 ...

  2. Sublime Text通过插件编译Sass为CSS及中文编译异常解决

    虽然PostCSS才是未来,但是Sass成熟稳定,拥有一大波忠实的使用者,及开源项目,且最近Bootstrap 4 alpha也从Less转到Sass了.所以了解Sass还是非常有必要的. 基于快速开 ...

  3. 推荐!Sublime Text 最佳插件列表

    本文由 伯乐在线 - 艾凌风 翻译,黄利民 校稿.英文出处:ipestov.com.欢迎加入翻译组. 本文收录了作者辛苦收集的Sublime Text最佳插件,很全. 最佳的Sublime Text ...

  4. Sublime Text各种插件使用方法

    有快捷键冲突的时候可以修改快捷键,建议修改插件快捷键而不是Sublime Text的快捷键,我的有冲突的一律将插件快捷键设置成:Ctrl+Alt+A(B...) Package Control 通俗易 ...

  5. 转: sublime text常用插件和快捷键

    Sublime Text 2是一个轻量.简洁.高效.跨平台的编辑器.博主之前一直用notepdd++写前端代码,用得也挺顺手了,早就听说sublime的大名,一直也懒得去试试看,认为都是工具用着顺手就 ...

  6. Sublime Text 最佳插件列表

    http://blog.jobbole.com/79326/ 推荐!Sublime Text 最佳插件列表 2014/07/25 · 工具与资源 · 26.1K 阅读 · 2 评论 · Sublime ...

  7. 开发者最常用的 8 款 Sublime Text 3 插件

    转载于:http://www.itxuexiwang.com/a/liunxjishu/2016/0228/177.html?1456925631Sublime Text作为一个尽为人知的代码编辑器, ...

  8. 安装Sublime Text 3插件的方法

    直接安装 安装Sublime text 3插件很方便,可以直接下载安装包解压缩到Packages目录(菜单->preferences->packages). 使用Package Contr ...

  9. 8款实用Sublime text 3插件推荐

    Sublime Text作为一个尽为人知的代码编辑器,其优点不用赘述.界面整洁美观.文本功能强大,且运行速度极快,非常适合编写代码,写文章做笔记.Sublime Text还支持Mac.Windows和 ...

随机推荐

  1. Spring Boot整合Mybatis完成级联一对多CRUD操作

    在关系型数据库中,随处可见表之间的连接,对级联的表进行增删改查也是程序员必备的基础技能.关于Spring Boot整合Mybatis在之前已经详细写过,不熟悉的可以回顾Spring Boot整合Myb ...

  2. ChineseNumber 转换

    中文数字转换 /** * <html> * <body> * <P> Copyright 1994 JsonInternational</p> * &l ...

  3. Win10家庭版升级到企业版的方法

    一.家庭版升级企业版 1.右键单击[此电脑]——>属性 2.点击更改产品密钥 3.输入密钥:NPPR9-FWDCX-D2C8J-H872K-2YT43 4.点击下一步,验证结束后点击开始升级,然 ...

  4. Raft选举算法

    目标:分布式集群中,选举Leader,保持数据一致性   集群中每个节点都有三种状态: Follower:纯小弟 Candidate:候选人.我原来是小弟,但我现在想当老大 Leader:老大 集群状 ...

  5. 视频网站大杂烩--HTML+CSS练手项目1【Frameset】

    [本文为原创,转载请注明出处] 技术[CSS+HTML]   布局[Frameset] -------------------------------------------------------- ...

  6. day 08作业 预科

    有如下值集合 [11,22,33,44,55,66,77,88,99,90...],将所有大于 66 的值保存至字典的第一个key中,将小于 66 的值保存至第二个key的值中 lt=[11,22,3 ...

  7. Web渗透

  8. plsql连接数据库后备注乱码|plsql连接数据库后中文乱码

    -- 背景:连接开发库后查阅单表备注信息时发现所有的备注都显示为"???????". -- 解决方案: -- (1). 首先先确认数据库的编码格式字符集,查询数据库编码格式. -- ...

  9. JSON是什么

    JSON是一种取代XML的数据结构,和xml相比,它更小巧但描述能力却不差,由于它的小巧所以网络传输数据将减少更多流量从而加快速度, 那么,JSON到底是什么? JSON就是一串字符串 只不过元素会使 ...

  10. wordpress调用自定义菜单

    wordpress要调用自定义菜单首先要注册菜单,将代码添加到主题文件夹下的function.php中,比如wordpress自带主题2019的定义如下 // This theme uses wp_n ...