Jump to content

What do you use to store code snippets?


Recommended Posts

I am using SciTe from site. But I really want to add ready text blocks code snippets and store them for another case. But I haven't found in SciTe. Tell me pls the program for this or how to do it? Here on the forum I just found old versions from 2006, they do not start now.

Edited by mike2003
Link to comment
Share on other sites

  • Moderators

As you begin to write more code, potentially in multiple languages, keeping snippets/functions/etc. in a single file becomes unwieldy. I would suggest becoming comfortable now with an online repository like Git. Aside from allowing you to organize your code, it provides ready access from anywhere.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

The double click is there to prevent closing the window/app by misclicks.

If you do not like it, the source code is in the archive.

Change the following code 

Case $GUI_EVENT_CLOSE
            If $closecounter = 1 Then
                If TimerDiff($TimeHandle) <= 1000 Then
                    ExitLoop
                EndIf
            EndIf
            If $closecounter = 0 Then
                $closecounter = 1
                $TimeHandle = TimerInit()
                WinSetTitle($h_SnipForm, "", "Doubleclick to close")
            EndIf

Into

Case $GUI_EVENT_CLOSE
                    ExitLoop

And the main window will close on single click.

 

Then seek the

Case $GUI_EVENT_CLOSE, $BTN_EXIT
                If $closecounter = 1 Then
                    If TimerDiff($TimeHandle) <= 1000 Then
                        $snipeditclose = 0
                        If $snipeditchanged = True Then
                            $iMsgBoxAnswer = MsgBox(8244, "Exit without saving ?", "Do you want to close the editor without saving the changes ?")
                            If $iMsgBoxAnswer = 7 Then $snipeditclose = 1       ;No
                        EndIf
                        If $snipeditclose = 0 Then
                            GUIDelete($Form1)
                            ExitLoop
                        EndIf
                        WriteToolBar("Please save your file.")
                    EndIf
                EndIf
                If $closecounter = 0 Then
                    $closecounter = 1
                    $TimeHandle = TimerInit()
                    WinSetTitle($Form1, "", "Doubleclick to close")
                EndIf

code and change it into:

Case $GUI_EVENT_CLOSE, $BTN_EXIT
                        $snipeditclose = 0
                        If $snipeditchanged = True Then
                            $iMsgBoxAnswer = MsgBox(8244, "Exit without saving ?", "Do you want to close the editor without saving the changes ?")
                            If $iMsgBoxAnswer = 7 Then $snipeditclose = 1       ;No
                        EndIf
                        If $snipeditclose = 0 Then
                            GUIDelete($Form1)
                            ExitLoop
                        EndIf
                        WriteToolBar("Please save your file.")

And the editor will close on single click.

Edited by Dan_555

Some of my script sourcecode

Link to comment
Share on other sites

on this site (http://www.garybeene.com/index.htm), among other freeware, there is gbSnippets,  which also offers a special set of optional features for programmers.
"It is a powerful code librarian with syntax highlighting and other editing features and software analysis tools specifically written to work with source code. Multiple languages are supported and snippet libraries are provided for several languages.
The programmer/code librarian features (
http://www.garybeene.com/sw/gbsnippetshelpa.htm) are hidden by default - kept out of the way unless needed - but available at the press of single button! "

 

image.jpeg.9f1a974c98e9f77d824b358729b089b0.jpeg Chimp

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Link to comment
Share on other sites

Alternatively, you can use this to store snippets, as well:

http://www.freesoftland.net/dtt.html

It saves all in one database (so far i know).

and, (i guess) this could be used as a note/snippet tool as well:

https://sourceforge.net/projects/keynote/

 

I'm using KeyNote for note/passwordkeeping.

 

The Developer Tricks and Tips (DTT) are ok, but you need to copy and paste the text (from dtt to your code) by yourself.

Well, while the app is ok in itself, there is a little annoyance: The select all button works only if the editor field is active (and it is not at the first time you select the snippet).

So basically i  need 3 clicks to get the text into the clipboard, and then to use the ctrl v for the paste. 

 

That's why i have written the Simple Snippet Manager.

And i was going for the simplicity and ease of use.

It keeps the files in a folder, and all you need to do is to select the snippet, to switch to the app, and to press ctrl /strg + b (within a minute - to prevent copying text into wrong apps by missclicks)

You can add snippets, by saving them from the Scite editor into the folder. 

Edited by Dan_555

Some of my script sourcecode

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...