FingerText (A new snippet plugin)

erinata
2011-01-15
2013-09-09
<< < 1 2 3 4 5 .. 7 > >> (Page 3 of 7)
  • erinata

    erinata - 2011-01-29

    - Dynamic Hotspot, I have said many times and finally it's coming. There are currently 3 types of dynamic hotspots.
       - (Chain) This is indicated by $[!!]. When the snippet is triggered, this hotspot is replaced by the text generated from activating another snippet "somesnippet". You can trigger the snippet "chain" to see how it works
       - (Keyword) This is indicated by $[!!]. And XXXXX is some predefined keyword. You can refer to the readme and see what keyword is supported (say DATELONG). And the most important one is PASTE. This will replace the hotspot by any text in the clipboard. The is very useful when you are writing tag language or want to turn a bunch of code into a function. See the sample snippet "method"
       - (Command) This is indicated by $[!!]. And XXXXX is some command that you can run in the console. For example $[!!] will fill your hotspot with the output that you would see when you run dir in console. Of course you can run a batch file if you want. Try snippet "cmddir" and "cmdbat" to see it in action.

    The dynamic hotspot function is far from complete. More different types of dynamic hotspot is coming in the future.

    As usual, the link
    https://github.com/downloads/erinata/FingerText/FingerText%20-%200.4.15.zip

    And the source
    https://github.com/erinata/FingerText

    And in case you like sourceforge download more:
    https://sourceforge.net/projects/fingertext/

     
  • bbluemel

    bbluemel - 2011-01-29

    Hi erinata,

    Upgraded to 0.4.15, #2 is fixed - thanks, however (probably more of a personal request), could it take note of the character before the word, and if it is '<' then not process the snippet?
    e.g.
    if I have a snippet for cfq.
    With my plugin, typing in <cfq will bring up the autocomplete and have <cfquery highlighted.  pressing tab will complete the snippet with the < on the front.

    For #1..
    Open Notepad++ on Vista/Win7
    Open up one of the files in the Notepad++\themes\
    Make a change to the file (a space or whatever you feel like), Hit Save. You'll get the following dialogs:

    No = No more Dialogs.
    Yes =

    OK =

    As for compiling my coldfusion lexer plugin, have you taken a look at my page on compiling?  If you have any issues feel free to give me a shout (probably best in the thread for my plugin rather than "pollute" yours). :)

    Ben

     
  • erinata

    erinata - 2011-01-29

    Ben,

    Ar….I can reproduce the first bug now……This is an ugly bug and I will fix it in next release. (probably that will be the first beta release)

     
  • erinata

    erinata - 2011-01-29

    yes….I should probably email you to talk about that.

    And I should shout in my own thread. PLEASE UPDATE TO FingerText 0.4.15 !!!! IT'S AWESOME!!! (…….ok….that's enough=P)

     
  • erinata

    erinata - 2011-01-29

    Snippet like this 

    $[![(cmd)ruby $[![(key)DIRECTORY]!]\$[![(key)FILENAME]!]$[![(key)EXTNAME]!]]!][>END<]
    

    will call the interpreter (ruby in this case) to run your current file and paste the output at the place where you trigger this snippet. This should be simplified when I support more keywords in the future.(or if you set up chain snippets). But this is an example showing one of the many things you can do with dynamic hotspots.

    Am I eligible to open a thread in the Scripting plugin forum? I guess FingerText is slowly converging to a scripting plugin =P

     
  • bbluemel

    bbluemel - 2011-01-29

    @erinata

    And I should shout in my own thread. PLEASE UPDATE TO FingerText 0.4.15 !!!! IT'S AWESOME!!! (…….ok….that's enough=P)

    haha, yes I have and yes, it's awesome =D
    PASTE is genius!  I was going to suggest being able to have an option to move to the end of the snippet, however you can use $[!] as a marker for where you want to move to (if there's no other hotspots), so that's great.

    Have found a bug though (I like breaking things! lol!)…..
    -Create a snippet containing $[!!]
    -Put $[!!] in your clipboard.
    -execute snippet = Notepad++ locked in an infinite loop of reprocessing what's in the clipboard. =P

     
  • erinata

    erinata - 2011-01-29

    HAHA……you can do the same thing for $[!!]  and put $[!!] into snippet abc =P

    But this won't break notepad++ because I put a limit on the chain triggering (it's 20)
    and obviously I forget to put a limit in keyword and command =P

    I myself really like this PASTE function too.
    - If you are writing tag base language, you can cut something and trigger a snippet to wrap in tags
    - If you are writing markup documents, you can cut something and have it wrapped by markup syntax
    - If you are writing programs like c or java, you can cut something and wrap it into a function
    - If you are doing scripting you can type some code like "puts 1+1", cut it and trigger a snippet with $[![(cmd)ruby -e '$[!!]']!] and it will essentially do the "evaluate selection with ruby" function
    - Similarly PASTE can be use as passing parameter to any command line hotpots,

    If you want your cursor to go to somewhere I think putting a $[!!] is the way to go.

     
  • kRs

    kRs - 2011-01-30

    Hi Erinata, don't know if I missed something, but after installing the latest 0.4.15 version, I receive an alert with an error message each time i press tab, no matter if caret is on a snippet name, or any other words. The msgbox title says: PluginsManger::runPluginCommand Exception.. (then it's cut) while the text is "Unknown exception".

    Regards,
    Francesco

     
  • erinata

    erinata - 2011-01-30

    Francesco,

    um……I never see that kind of error. Would you mind doing me a favor and try to reinstall FingerText? (you need to delete or move away FingerText.dll in plugin folder, and FingerText.ini,FingerText.db3, snippeteditor.ftb  in config folder) Notice that this will clear all the snippet that you have made…..so please backup the db3 file before you do that.

    If the situation is still like that, would you mind trying this
    https://github.com/downloads/erinata/FingerText/FingerText%20-%200.4.15.2.zip
    and see if this newer version works or not?

    Thanks for your help in testing!

     
  • kRs

    kRs - 2011-01-30

    Hi, thanks for the support. Reinstalling (ie removing all config files) didn't work, while the new plugin version just worked fine.
    But now (being a developer myself :) ) I'm curious! What could have been the reason for this strange behavior on my system?
    What did you change in the .2 version?
    Thanks again,
    Francesco

     
  • erinata

    erinata - 2011-01-30

    I am curious too.

    If I have to make a guess, it's because I do some checking before I delete a buffer. Sometimes the logic in my code is too messy and I try to delete a buffer before I initialize it………. I also fixed the recursive PASTE problem pointed out by Ben, but that shouldn't be related to this issue.

    And the funny thing is I reinstall 0.4.15.0 and I never get that error >_<……………

     
  • kRs

    kRs - 2011-01-30

    I had tried with empty files, with php files (for which I had my snippets configured),  tried with the default db after reinstalling.
    No way, each time I was hitting TAB I got such error. Disabling fingertext though its menu option made the error go away.
    And it should have had to with the basic checks/search code, because it was happening even with an empty document, and not when the caret was on a snippet and I suppose the replacing / snippet handling code would have been executed.
    Anyway, :) if you'd need further testing, I'll be glad to help.
    Regards,
    Francesco

     
  • erinata

    erinata - 2011-01-30

    Thanks.

    If you continue to use this 0.4.15.2. notice that the chain snippet indicator changed from $[!!]  to $[!!]   (so that it line up better with other dynamic hotspot)    It's not documented as it has not been officially released yet.

     
  • erinata

    erinata - 2011-01-31

    A note for Ben:

    If you have time to upgrade to 0.4.16 …. you can try changing the escape_char_level in the FingerText.ini file from escape_char_level=0 to escape_char_level=1. See if this is something that you want for the < character's behaviour?

    (I am not putting it into default setting. And probably I will make this "escaping snippet" behaviour more customizable.

     
  • Johannes Kilian

    Johannes Kilian - 2011-02-02

    Great - you already have two of my greatest wishes implemented already - "chain"- and "keyword"-hotspots. Thanks for already implementing this.

    As usual no thanks without new wishes/suggestions… ;-)

    • You mentioned there are more keywords to come (at least I think, I've read this somewhere). I would be interested esp. in a keyword "YEAR" - to be used within a copyright notice …

    • Importing databases should be improved: if there are a lot of snippets in the new database which need to be overwritten, you have to confirm each overwriting … Maybe offering "Overwrite All" and "Ignore All" would be helpful …

    Just a few thoughts:
    What I'm currently asking about, is how to utilizeFingerText for XML-File editing.
    Assume I have 2 different XML-files each following its own schema (2 different XSD-files). Now I want to have snippets for XML-File 1 and different snippets for XML-File 2. What are possible solutions for this?

    • Using two different fileextension does not make sense, since other applications would not be aware of this

    • Using two different snippet databases - one for each XML-filetype. This can already be done with FingerText - but the "Overwrite"-Dialog box for each identical snippet is not very handy (therefore the improvement suggestion above). Unloading an entire Snippet-database would also be helpful for this: You only have the snippets available which are defined within the current database (and not aggregated snippets)….

    • FingerText currently offers snippets which are either GLOBAL or own to a defined file extension. Expanding the file extension mechanism to file patterns would also be an alternative: XML-file 1 follows pattern *_a.xml, XML-file 2 follows pattern *_b.xml. Allowing different snippets for pattern "_a.xml" and "_b.xml" would allow a "single snippet database" solution

    • Offering user definable groups for snippets. There are currently mainly "extension based" groups of snippets an the "GLOBAL" group. The possibility to define own named global groups (for example XML_A und XML_B) would also be great. of course there should be a possibilty to select which of the user groups should be activated. The snippets of the activated usergroups should be shown beneath GLOBAL snippets and extension specific snippets and should act like GLOBAL snippets

    As I said, just a few thoughts but would be helpful anyway …

    Johannes

     
  • erinata

    erinata - 2011-02-02

    Well……I am currently concentrating on debugging and performance improvement for 0.4.17 and I will make it 0.5.0 afterwards. I want to make this is relatively more stable version for those people who only want to use the plugin and less interested in finding out bugs. So all the new features will be on branches now and will not be merge until 0.5.1

    For sure YEAR is coming. And when I say more keywords to come, I really mean it. Please suggest more keywords.

    Overwrite all and ignore all……..it's a bug because it's not detecting the number of snippet imported correctly……let me look into it.

    And for questions about snippet groups (no matter you are talking about using 1 snippet set for many extensions or many snippet set for 1 extension), I was thinking about 4 but 2 is also viable. However I want to think about this problem more thoroughly before I work on it because I want to implement the namespace thing.( like you can have jbkilianstyle.cpp and erinatastyle.cpp in the same database and they still work in harmony) This will make snippet sharing a lot more easier. I think all these problems are related so that I want to tackle them as a whole. Thanks for your suggestions. They are helpful.

    Also, I think you should be able to write your snippet in simple ruby scripts when FingerText get to 0.6 or 0.7 (don't know when =P)…….by then you can can use conditional statement in snippets fairly easily. (but that's really IN THE FUTURE =P)

     
  • bbluemel

    bbluemel - 2011-02-03

    Hi erinata,

    A note for Ben:

    If you have time to upgrade to 0.4.16 …. you can try changing the escape_char_level in the FingerText.ini file from escape_char_level=0 to escape_char_level=1. See if this is something that you want for the < character's behaviour?

    (I am not putting it into default setting. And probably I will make this "escaping snippet" behaviour more customizable.

    Using escape_char_level=1 (was already in my ini file) doesn't see to do anything different to escape_char_level=0 ?  (Using 0.4.16.0, and restarting N++ when changing ini)

    Ben

     
  • Johannes Kilian

    Johannes Kilian - 2011-02-03

    Just for the case you're still looking for some suggestions … ;-)

    A fourth dynamic hotspot type - beneath <key>, <cha> and <cmd> - could be nice: <ask> - This opens a dialog box for user input. The user makes his input and the hotspot is replaced by the typed text …..
    The <ask> - dynamic hotspot should allow to have an parameter, to define a test that should be shown in the input box.
    For example: $[!!] - "Your name:" is the text shown as label on the input box: XXXXX is the default text.
    Closing the input box either the user typed text or the default text is inserted
    (This snippet feature is already offered in Komode/KomodoEdit by ActiveState)

    … and just for the case you like some positive feedback:
    I mentioned that I could not open the FingerText-Database with a Standard SQLite-Database explorer.
    I have to correct this: what I tried to open with a Standard SQLite-Database explorer was the *.ftb file - which failed, as Database Explorer says that file is encrypted.
    Now I've found the "real" database FingerText.db3 within the plugins/config folder of NotePad++ - this file could be opened by database explorer without any problems …
    So no need anymore to have any thoughts on this issue

     
  • erinata

    erinata - 2011-02-03

    Thanks Johannes, I would like to make this too…..but I really do not know why I cannot make an input box as easy as making a normal messagebox…….So if I am implementing this feature, I need to make the static dialogs myself so I wouldn't say this will come soon. Plus the fact that I like inline editing more than an input box(totally personal preference).

     
  • erinata

    erinata - 2011-02-03

    Ben, please try that again when after you update to 0.5.0………what I intend to do is, if you set escape_char_level=1, you cannot trigger the "mit" snippet by typing "<mit". But if the value is set to 0(default), when you type "<mit" the snippet will be triggered and the text will be put after the < character.

     
  • erinata

    erinata - 2011-02-03

    Ar…..notice that I move all the config files (FingerText.ini, FingerText.db3, FingerText.ftb) to a FingerText folder under the config folder. You do not need the old ini and ftb file but if you want to use your snippets in the new version you need to move the FingerText.db3 to the FingerText folder.

     
  • bbluemel

    bbluemel - 2011-02-03

    HI erinata,

    Ben, please try that again when after you update to 0.5.0………what I intend to do is, if you set escape_char_level=1, you cannot trigger the "mit" snippet by typing "<mit". But if the value is set to 0(default), when you type "<mit" the snippet will be triggered and the text will be put after the < character.

    Seems to be working fine :D

    Thanks

    Ben

     
<< < 1 2 3 4 5 .. 7 > >> (Page 3 of 7)