For SciTE Users: Snippets

To all SciTE users,

SciTE Snippets

I have written a Lua module for SciTE that mimicks Textmate’s snippet
system quite well. It’s a few months old, so hopefully it’s fairly
stable.

http://caladbolg.net/scite.php#snippets
Please read the documentation thoroughly!

Take care,
-Mitchell;

mitchell foral schrieb:

SciTE Snippets


Hi Mitchell!

Very nice. I searched a textmate clone for windows a long time. And here
it is. A speedview window for file opening ala textmate would be cool.
Great work, go on!

Nice color theme in the videos. Can you post your color config as well?

g,

Daniel Völkerts wrote:

Nice color theme in the videos. Can you post your color config as well?

If you haven’t figured already, all my SciTE stuff is in the SVN
repository at
http://opensvn.csie.org/scite_tools/
(links are provided all over the http://caladbolg.net/scite.php page)

I’m glad you find it useful :slight_smile:
-Mitchell;

mitchell schrieb:

If you haven’t figured already, all my SciTE stuff is in the SVN
repository at
http://opensvn.csie.org/scite_tools/
(links are provided all over the http://caladbolg.net/scite.php page)

Oh I’m sorry, didn’t explorer the site as it was a sunny sunday :wink: Have
a look next week. Thank you very much!

g,

mitchell foral skrev:

Please read the documentation thoroughly!

Take care,
-Mitchell;

Hello Mitchell,

Looked on the screencasts and it’s really nice. I installed scite
(windows) and downloaded your stuff. I downloaded all except /src (I’m
not that into compiling on windows). Do I need /src for other things?

Everything seems to work except “functions” thingy.

If I do

def hello(msg)
puts msg
end

hello(|) #pressing C+S+l, nothing happens

#pressing C+A+l here and nothing happens

I have functions.lua in /scripts.

Everything else seems to work fine. Any ideas?

/Marcus

Marcus A. wrote:

def hello(msg)

/Marcus

Make sure the file is saved as a Ruby file (.rb extension). Then the
ruby.properties file will kick in. You can tell if a function is
available by looking in the Tools menu.

Note: Since you didn’t compile from the src directory, a maximum of 50
commands are available to you. In the *.properties files for commands
dealing with functions.lua, I have assigned those commands numbers 50
and 51. You’ll have to change those numbers to be between 0 and 49.
I’ll make a note on the website.

So if you want to be able to call tools from the functions.lua file on
any file that is unsaved, you can copy the commands from
ruby.properties to your user or global properties file, but be aware
that subsequent calls to those commands work for only ruby code.

Thanks for your interest!

Take care,
-Mitchell;

mitchell skrev:

Note: Since you didn’t compile from the src directory, a maximum of 50
commands are available to you. In the *.properties files for commands
dealing with functions.lua, I have assigned those commands numbers 50
and 51. You’ll have to change those numbers to be between 0 and 49.
I’ll make a note on the website.

Thanks, that worked although they got mapped onto Ctrl +
number_of_command instead of the key mappings you’ve documented. I don’t
really know why your documented mappings doesn’t work in this case.
Snippets does. Auto-completion and toggle block was on Ctrl + 7 and Ctrl

    1. Is this expected? Or are they mapped somewhere else as well?

/Marcus

Marcus A. wrote:

Thanks, that worked although they got mapped onto Ctrl +
number_of_command instead of the key mappings you’ve documented. I don’t
really know why your documented mappings doesn’t work in this case.
Snippets does. Auto-completion and toggle block was on Ctrl + 7 and Ctrl

    1. Is this expected? Or are they mapped somewhere else as well?

/Marcus

Take a look at the SciTE documentation at
http://scintilla.sourceforge.net/SciTEDoc.html. Essentially, commands
0-9 are mapped automatically to the ctrl+[that number] keys.

Also, from my properties file:

$(CS)+L| 1150|
$(CA)+L| 1151|

You can see that the key mappings you are referencing to apply to the
command numbers of 50 and 51. Since your SciTE can only have commands
0-49, these numbers would have to be changed to something like 1148 and
1149 for example if your command numbers are 48 and 49. Again, read up
on the SciTE docs. It’s all there :slight_smile: I’ll add command shortcuts to the
properties files that use functions.lua so you don’t have to mess
around with the key shortcuts defined in user or global properties.
Look for it in SVN.

Take care,
-Mitchell;

mitchell skrev:

Take a look at the SciTE documentation at
http://scintilla.sourceforge.net/SciTEDoc.html. Essentially, commands
0-9 are mapped automatically to the ctrl+[that number] keys.

I’ll do that.

properties files that use functions.lua so you don’t have to mess
around with the key shortcuts defined in user or global properties.
Look for it in SVN.

Thanks a lot. It works now.

Feels like it’s time to learn the new language of the year (Lua) and to
get to know this text editor really good.

/Marcus

Volkan Civelek wrote:

the only thing that i couldn’t figured out is;
when you type an open brace lets say {
it auto completes and closes the brace }

do you know how can i disable this feature in scite?
i couldn’t find it somehow…

thanks,
-v

In macros.lua, ruby.lua, etc. the OnChar function has what you are
looking to remove.

-Mitchell;

mitchel,
great work. thank you for the contrubution.
the only thing that i couldn’t figured out is;
when you type an open brace lets say {
it auto completes and closes the brace }

do you know how can i disable this feature in scite?
i couldn’t find it somehow…

thanks,
-v

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs