简体   繁体   English

创建新的用户工具以使用EditPlus粘贴文本

[英]Create new user tool to paste text with EditPlus

I use EditPlus 3.30 as my code editor, but this question also applies to earlier versions. 我将EditPlus 3.30用作代码编辑器,但是此问题也适用于早期版本。 I would like to create a new user tool item on the user tool bar. 我想在用户工具栏上创建一个新的用户工具项。 The default set-up allows you to open a template when you click on an icon. 默认设置允许您在单击图标时打开模板。 I would like to create an item that instead pastes code from a libray file (*.ctl) or any other text file. 我想创建一个项目,而不是从libray文件(* .ctl)或任何其他文本文件粘贴代码。 In the end, the new user tool item would function just like one of the icons on the hml tool bar. 最后,新的用户工具项将像hml工具栏上的图标之一一样起作用。

I don't have extensive programming experience. 我没有丰富的编程经验。

EditPlus text editor: How to create a toolbar user tool icon to paste custom code snippets. EditPlus文本编辑器:如何创建工具栏用户工具图标以粘贴自定义代码段。

Configure the Preference/Tools dialog like this: 像这样配置“首选项/工具”对话框:

Command        CScript.exe C:\Your Path\Pastetext.js
Argument         //NoLogo $(CurRow)
leave initial directory blank
Action         Run as text (Insert)

Save the flowing five lines as Pastetext.js 将流畅的五行另存为Pastetext.js

var cArgs =                  WScript.Arguments;
var rStr =                  cArgs(0);
var rStr ="<item id='file1' media-type='application/xhtml+xml' href='aSample.html'/>";
// Print filler string
WScript.StdOut.Write(rStr);

//The rStr variable will print where your cursor is in an open document. // rStr变量将在您的光标在打开的文档中的位置打印。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM