代码拉取完成,页面将自动刷新
剪切板
中,imgtogitee
原理是把剪切板中的图片存到临时文件夹,然后再上传到gitee
,最后把返回的图片URL插入到markdown
文本中,提高写作效率。名称 |
快捷键 |
描述 |
---|---|---|
imgtogitee.getemo |
ctrl+numpad1 |
添加随机表情,如🍓 |
imgtogitee.paste |
ctrl+numpad2 |
上传剪切板图片到gitee |
imgtogitee.pasteLocal |
ctrl+numpad3 |
上传本地板图片到gitee |
配置项名称 |
描述 |
默认值 |
---|---|---|
imgtogitee.gitee_token |
gitee 的token |
空 |
imgtogitee.gitee_url |
gitee 的仓库地址 |
空 |
kudsu
imgtogitee
imgs
npm install -g yo generator-code
yo code
大多是异步的问题,用awite,等有返回值了再使用
let log = vscode.window.createOutputChannel("sober-monkey/log");
log.show();
log.appendLine(data);
vscode.env.clipboard.readText().then((text)=>{
clipboard_content = text;
/* code */
});
或者
let clipboard_content = await vscode.env.clipboard.readText();
/* code */
function insertToEnd(text: string, type?: number): Promise<boolean> {
if (type === undefined) { type = InsertType.cursor; };
return new Promise((resolve, reject) => {
const editor = vscode.window.activeTextEditor;
if (editor) {
editor.edit(editBuilder => {
switch (type) {
case InsertType.start:
editBuilder.insert(new vscode.Position(0, 0), text);
break;
case InsertType.end:
let linenumber = vscode.window.activeTextEditor?.document.lineCount || 1;
let pos = vscode.window.activeTextEditor?.document.lineAt(linenumber - 1).range.end || new vscode.Position(0, 0);
editBuilder.insert(pos, text);
break;
case InsertType.cursor:
editBuilder.insert(editor.selection.active, text);
break;
default:
break;
}
}).then(resolve);
}
});
}
enum InsertType {
start = 1,
end = 2,
cursor=3
}
Add-Type -AssemblyName System.Windows.Forms
$clipboard = [System.Windows.Forms.Clipboard]::GetDataObject()
if ($clipboard.ContainsImage()) {
$filename='c:\temp\test3.png'
[System.Drawing.Bitmap]$clipboard.getimage().Save($filename, [System.Drawing.Imaging.ImageFormat]::Png)
Write-Output "clipboard content saved as $filename"
} else {
Write-Output "clipboard does not contains image data"
}
##下面也可以
#get-clipboard -format image
#$img = get-clipboard -format image
#$img.save("c:\temp\temp.jpg")
"contributes": {
"configuration": {
"type": "object",
// 显示在配置页左侧
"title": "Code插件demo",
"properties": {
// 全局唯一的配置ID
"vscodePluginDemo.yourName": {
"type": "string",
"default": "guest",
"description": "你的名字"
},
"vscodePluginDemo.showTip": {
"type": "boolean",
"default": true,
"description": "启动时显示自定义欢迎页"
}
}
}
}
// 如果没有设置,返回undefined
const result = vscode.workspace.getConfiguration().get('vscodePluginDemo.yourName');
🥈Enjoy!
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。