have a panel (like the file explorer) where you can store code snippets. the code snippet dialog would offer a before and after the caret field. so if i highlighted a block of code and double clicked the code snippet the before would go before the block and the after would go after the block. if there was no code highlighted, double clicking the code snippet would just insert the code.
also- the ability to assign arbitrary keystrokes to a particular snippet.
also- the ability to save snippets in a snippet library.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It would be great to have a place to store lines of code rather that collecting them within a second program. Something like this would help to this end. Judging by the lack of comments regarding this post no one else want it to happen. might I also suggest a page or two on this forum for snippets of code.
By the way I do know about QuickText, but I don't feel it is that great... Sorry!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Some of what he wants could be done that way, but there are a couple of drawbacks:
1) It's not quite as convenient as just double-clicking on a code snippet. Even if you store your code snippets in your favorites, you still have to select it off of the list before you click Run, which is a couple of extra steps.
2) If you don't have any text selected, it will treat the entire document as the selected text.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Perhaps you could create or read a setting from the script itself, which specifies whether automatically all text will be selected, or anything will be done at the current cursor position on the empty selection.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi fidvo, Just a comment as I'm no programmer. Although Simple Script seems to be very powerful, it doesn't seem to allow some operations that can be done in Macro Recording. For example... Move the cursor point by # of lines or # of characters, use of the TAB and Enter keys, or inserting and deleting any single character on the keyboard at the cursor location. Is there a way to combine Simple Script and Macro Recording? Maybe a function that runs a predefined macro. You have included a Search and Replace function, but I can't find a standalone Find function??? There is many times when I would like to find a word or character without replacing it (i.e., set to bold, underline, insert a tab...etc). I realize that since I am new at using Simple Scripe some of these functions could currently exist and I just havent't found them. Will you be adding more function in the future? Thank you for a very handy plugin. DM
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
> Although Simple Script seems to be very powerful, it doesn't seem to allow some operations that can be done in Macro Recording.
You're right, and this is by design. Simple Script is for text processing only; everything else is outside of its scope.
> Move the cursor point by # of lines or # of characters
Simple Script doesn't even have a concept of the cursor position because the text may change so much during the script that it wouldn't even make sense to keep track of the cursor.
> use of the TAB and Enter keys
In any function that uses a text parameter, you can use "\t" for TAB and "\r\n" for a line break as part of the text of the parameter.
> inserting and deleting any single character on the keyboard at the cursor location
I might consider an option to allow you to use a script to insert text at the cursor position. Deleting text at the cursor position, probably not. As I mentioned above, during the execution of the script it has no concept of cursor position.
> Is there a way to combine Simple Script and Macro Recording?
While the idea is intriguing, unfortunately it's impossible the way it's programmed. Since all of the text processing is done behind the scenes and it doesn't even put it back into the document until the script has been run on it, running a macro in the middle wouldn't work because a macro could only work on the document, not on the text stored temporarily in memory.
> You have included a Search and Replace function, but I can't find a standalone Find function?
Again, a Find is not a text processing action, and you usually want it to be isolated anyway, so the regular and advanced Finds should be sufficient.
> i.e., set to bold, underline, insert a tab...etc
Depending on what you mean by bold, underline, etc. these can be done with a replace. For example, the function to boldface a word in HTML would be:
replace("wordtobold","<b>wordtobold</b>")
> Will you be adding more function in the future?
Yes. I have quite a few new functions in mind, but sadly, not really the types of things you're after, it looks like.
Thanks for the suggestions, even though I'm afraid I can't give you what you want.
By the way, just in general, the concept of code snippets sounds very similar to the concept of templates, which I'm considering adding to Simple Script. So that we don't hijack this thread, if you want to continue the discussion of modifying Simple Script to do this, please post here:
Thanks Fidvo, for responding to my questions. You have shed some light on my understanding of Simple Script. I see (by your suggestions) that I'll have to learn a little about HTML code in order to do some things I wanted to do (as I said... I'm not a programmer). I suppose I need to ask the programmer responsible for Macro Recording about a Find operation.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
here my vision about a good code snipped plugin is to combine the current available QuickText plugin with the available Clipboard plugin in a docked version.
The features:
The docked window contains a tree view with all available languages of Notepad++ and one additional item at top - the Clipboard. Within the tree there are the Tags listed like QuickText have. The preview is shown on top of the tree in an edit box. So you can add/modify the (new) Tags. A tag can consist a code snippet or template. Tags can be paste similar to QuickText by typing the tagname and processing a specific shortcut or by double click on the item.
Everytime, when user copy/cuts a text into windows clipboard, the snipped is now list also in under Clipboard item with a short name.
When user switches between files with different languages, tree do an automatic expand/unexpand.
Best Regards
Jens
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
have a panel (like the file explorer) where you can store code snippets. the code snippet dialog would offer a before and after the caret field. so if i highlighted a block of code and double clicked the code snippet the before would go before the block and the after would go after the block. if there was no code highlighted, double clicking the code snippet would just insert the code.
also- the ability to assign arbitrary keystrokes to a particular snippet.
also- the ability to save snippets in a snippet library.
Hi all,
It would be great to have a place to store lines of code rather that collecting them within a second program. Something like this would help to this end. Judging by the lack of comments regarding this post no one else want it to happen. might I also suggest a page or two on this forum for snippets of code.
By the way I do know about QuickText, but I don't feel it is that great... Sorry!
Perhaps you could use the Simple Script Plug-In. Read more about it on the Plug-In forum.
Some of what he wants could be done that way, but there are a couple of drawbacks:
1) It's not quite as convenient as just double-clicking on a code snippet. Even if you store your code snippets in your favorites, you still have to select it off of the list before you click Run, which is a couple of extra steps.
2) If you don't have any text selected, it will treat the entire document as the selected text.
Perhaps you could create or read a setting from the script itself, which specifies whether automatically all text will be selected, or anything will be done at the current cursor position on the empty selection.
Hi fidvo, Just a comment as I'm no programmer. Although Simple Script seems to be very powerful, it doesn't seem to allow some operations that can be done in Macro Recording. For example... Move the cursor point by # of lines or # of characters, use of the TAB and Enter keys, or inserting and deleting any single character on the keyboard at the cursor location. Is there a way to combine Simple Script and Macro Recording? Maybe a function that runs a predefined macro. You have included a Search and Replace function, but I can't find a standalone Find function??? There is many times when I would like to find a word or character without replacing it (i.e., set to bold, underline, insert a tab...etc). I realize that since I am new at using Simple Scripe some of these functions could currently exist and I just havent't found them. Will you be adding more function in the future? Thank you for a very handy plugin. DM
> Although Simple Script seems to be very powerful, it doesn't seem to allow some operations that can be done in Macro Recording.
You're right, and this is by design. Simple Script is for text processing only; everything else is outside of its scope.
> Move the cursor point by # of lines or # of characters
Simple Script doesn't even have a concept of the cursor position because the text may change so much during the script that it wouldn't even make sense to keep track of the cursor.
> use of the TAB and Enter keys
In any function that uses a text parameter, you can use "\t" for TAB and "\r\n" for a line break as part of the text of the parameter.
> inserting and deleting any single character on the keyboard at the cursor location
I might consider an option to allow you to use a script to insert text at the cursor position. Deleting text at the cursor position, probably not. As I mentioned above, during the execution of the script it has no concept of cursor position.
> Is there a way to combine Simple Script and Macro Recording?
While the idea is intriguing, unfortunately it's impossible the way it's programmed. Since all of the text processing is done behind the scenes and it doesn't even put it back into the document until the script has been run on it, running a macro in the middle wouldn't work because a macro could only work on the document, not on the text stored temporarily in memory.
> You have included a Search and Replace function, but I can't find a standalone Find function?
Again, a Find is not a text processing action, and you usually want it to be isolated anyway, so the regular and advanced Finds should be sufficient.
> i.e., set to bold, underline, insert a tab...etc
Depending on what you mean by bold, underline, etc. these can be done with a replace. For example, the function to boldface a word in HTML would be:
replace("wordtobold","<b>wordtobold</b>")
> Will you be adding more function in the future?
Yes. I have quite a few new functions in mind, but sadly, not really the types of things you're after, it looks like.
Thanks for the suggestions, even though I'm afraid I can't give you what you want.
By the way, just in general, the concept of code snippets sounds very similar to the concept of templates, which I'm considering adding to Simple Script. So that we don't hijack this thread, if you want to continue the discussion of modifying Simple Script to do this, please post here:
http://sourceforge.net/forum/forum.php?thread_id=1907273&forum_id=482781
Thanks Fidvo, for responding to my questions. You have shed some light on my understanding of Simple Script. I see (by your suggestions) that I'll have to learn a little about HTML code in order to do some things I wanted to do (as I said... I'm not a programmer). I suppose I need to ask the programmer responsible for Macro Recording about a Find operation.
Hello at all,
here my vision about a good code snipped plugin is to combine the current available QuickText plugin with the available Clipboard plugin in a docked version.
The features:
The docked window contains a tree view with all available languages of Notepad++ and one additional item at top - the Clipboard. Within the tree there are the Tags listed like QuickText have. The preview is shown on top of the tree in an edit box. So you can add/modify the (new) Tags. A tag can consist a code snippet or template. Tags can be paste similar to QuickText by typing the tagname and processing a specific shortcut or by double click on the item.
Everytime, when user copy/cuts a text into windows clipboard, the snipped is now list also in under Clipboard item with a short name.
When user switches between files with different languages, tree do an automatic expand/unexpand.
Best Regards
Jens