第一步:
在sublimetext的tools中developer下面的new plugin输入,保存为copyfile.py:
import sublime, sublime_plugin, os
class FilenametoclipboardCommand(sublime_plugin.TextCommand):
def run(self, edit):
sublime.set_clipboard(os.path.basename(self.view.file_name()))
print(os.path.basename(self.view.file_name()))
第二步:
保存到pakages/user/filenametoclipboard.py
class ListOpenFilesCommand(sublime_plugin.TextCommand):
def run(self, edit):
window = sublime.active_window()
views = window.views()
fileNames = ''
for view in views:
if view and view.file_name():
fileNames += os.path.basename(view.file_name())+'\n'
window.new_file().insert(edit, 0, "List of open files:\n\n"+fileNames)
第三步:preferences下面的key-bindings-user下面添加:
然后取key-bindings下加如
{ "keys": ["ctrl+alt+c"], "command": "filenametoclipboard" },
{ "keys": ["ctrl+alt+l"], "command": "list_open_files" }
保存,重启sublitext,即可,简单吧,呵呵
来自:http://blog.csdn.net/zhuboyan123/article/details/41249685
在sublimetext的tools中developer下面的new plugin输入,保存为copyfile.py:
import sublime, sublime_plugin, os
class FilenametoclipboardCommand(sublime_plugin.TextCommand):
def run(self, edit):
sublime.set_clipboard(os.path.basename(self.view.file_name()))
print(os.path.basename(self.view.file_name()))
第二步:
保存到pakages/user/filenametoclipboard.py
class ListOpenFilesCommand(sublime_plugin.TextCommand):
def run(self, edit):
window = sublime.active_window()
views = window.views()
fileNames = ''
for view in views:
if view and view.file_name():
fileNames += os.path.basename(view.file_name())+'\n'
window.new_file().insert(edit, 0, "List of open files:\n\n"+fileNames)
第三步:preferences下面的key-bindings-user下面添加:
然后取key-bindings下加如
{ "keys": ["ctrl+alt+c"], "command": "filenametoclipboard" },
{ "keys": ["ctrl+alt+l"], "command": "list_open_files" }
保存,重启sublitext,即可,简单吧,呵呵
来自:http://blog.csdn.net/zhuboyan123/article/details/41249685
作者:jackxiang@向东博客 专注WEB应用 构架之美 --- 构架之美,在于尽态极妍 | 应用之美,在于药到病除
地址:https://jackxiang.com/post/8894/
版权所有。转载时必须以链接形式注明作者和原始出处及本声明!
评论列表