jEdit Community - Resources for users of the jEdit Text Editor
Having trouble creating some macros
Submitted by AzizLight on Monday, 2 June, 2008 - 13:11
Hi everybody, During the last two month all I have done is test programmers' text editor. I'v tested Emacs, Smultron, Eclipse/PDT, Textmate, Notepad++ and of course jEdit. And everytime, I was going back to jEdit, even after using Textmate. However there are some thing in jEdit that are missing and that I have tried to do with macros and wasn't able (because I'm a newbie and I'm not good at creating macros :S) : 1. When I open ... well anything ( "{", "[", "(", "'", """, "<") I want the closing part to appear automatically. That's the easy part and I kind of managed to do it. However, the part I did not managed to do is: if i'm just before a closing one ( "]", ">", etc) and I close it again, then it goes out of it instead of creating a new one. 2. If I have a block that is between curly brackets for exemple, if I double-click just outsite the closing bracket, I want it to select the block that is inside the brackets. There are more macros that are very important and useful but I can't remeber what they are, I will update this post as soon as I remeber.. In a more general way, what I can't manage to do is create macros that make more than one thing (with conditions for exemple)... Voila. Can someone give me instructions, advice or even hints on how to achieve that please? Thanks in advance, Aziz Light
Comment viewing options
Select your preferred way to display the comments and click 'Save settings' to activate your changes.
I'm not sure about the first
by elberry on Mon, 02/06/2008 - 15:36
I'm not sure about the first one. I think I remember seeing a setting somewhere for automatically closing brackets, braces and the like. I'll have to do a bit more digging to see if I can find it. It might be part of a plugin.

The second part can already be done though. Look under "Edit" -> "Source". The action "Select Code Block" is there. It works inside the code block however, so if you're just outside the code block (to the right of your brace) just go one to the left of the brace and hit CTRL+[ and it'll select that code block.

Hope that helps.

Learn from the past. Live in the present. Plan for the future.
11101000
Blog
 
Thanks a lot for your answer.
by AzizLight on Mon, 02/06/2008 - 18:35
Thanks a lot for your answer. I found about the "Select Code Block" action about 12 seconds before reading your answer.

Also thanks to your answer, I went back to the plugin manager and downloaded about 8 new plugins and I am a lot more pleased with my new jEdit setup. However I was not able to find a plugin that automatically close brackets, braces, etc. I already have an extension that auto-close my html tags but that's what I need :S

I found a temporary solution: I created very simple macros that autoclose the brackets and other. What it does is when I insert a bracket, it replaces it with an open one and a closed one and it puts the caret in between them. This solution is not perfect because I have on macro for each character (one for the bracket, one for the curly bracket, etc). Also, when I add a closing bracket when there is a closing bracket right after, instead of moving the caret after the bracket, it adds another one..

For now I can handle that, but it would be nice to have one big macro that does everything.

Anyway I will look into that matter and update that post later.
Once again, thanks for your help
 
FirstMate Plugin
by Robert Schwenn on Mon, 02/06/2008 - 20:36
The FirstMate Plugin does auto-pairing for: () {} [] "". I like it very much.

For further auto-completion You may take a look at SuperAbbrevs and TextAutoComplete Plugins or the built-in abbreviations (see Global Options->Abbreviation and the help).

Robert
 
Nice! Thanks. The plugin is n
by AzizLight on Tue, 03/06/2008 - 08:50
Nice! Thanks. The plugin is not in jEdit's plugin library yet, that's why I did not find it by myself. I had to do a little search and I found it right away. Thanks a lot! At the same time, I found the site of the author where there is other cool jEdit stuff.

One last question though: is it possible to display the list of shortcuts (the one generated by the macro of the same name) in the dock?
As a matter of fact, it would also be nice to be able to access my macros via the doc too. This way, I would be able to use them a lot faster without having to create a million shortcuts...
So the more general question is: is there a way to dock...well anything??
 
No
by Robert Schwenn on Tue, 03/06/2008 - 20:14
Yes sorry, forgot that FirtMate plugin isn't released yet.

I suspect, the DockAnything Plugin You would have to write by Yourself Smiling.

In the meanwhile, maybe the ShortcutDisplay plugin could help You launching macros if You would assign shortcuts with a prefix (i.e. "C+m C+x"). Then, after C+m is pressed, a list is shown with all Your million shortcuts beginning with C+m.

A last hint: The LogViewer plugin lets You show a number of text files in one dockable. It's meant for log files - but why not use it as a docked shortcut list...

Robert
 
Thanks for the usefull hints.
by AzizLight on Wed, 04/06/2008 - 12:42
Thanks for the usefull hints. I have to say I had forgotten about the shortcut with prefixes. I use them all the time but I never actually thought of creating new ones before.
Also, the Loviewer idea is a pretty good idea. I already have QuickNotepad but it opens only one file at a time (it's useful to jott ideas and paste code snippets that I might use later).
About the DockAnything Plugin I would have loved to write it myself. Unfortunately, I don't know how to write jEdit plugins (yet) and I don't really have the time to learn now :S
Anyway thanks a lot for your hints, they were very useful.

Aziz
 
The DockAnything Plugin is ki
by elberry on Tue, 03/06/2008 - 21:00
The DockAnything Plugin is kind of built in to jEdit, you just need to create a plugin.

I did a bit of research and building a MacrosViewer plugin would be very simple to create.

If I have time this weekend I'll bang it out and submit it.

Cheers.

Learn from the past. Live in the present. Plan for the future.
11101000
Blog
sorry about the formatting, s
by AzizLight on Mon, 02/06/2008 - 14:21
sorry about the formatting, somehow when I created the post all whitespace has been deleted...I think it's a bug in the forum. (I'm still new to php, but I think the nl2br() function did't work :S)
User login
Browse archives
« March 2024  
MoTuWeThFrSaSu
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Poll
Are you interested in language packs for jEdit?
Yes, and I could help maintain translations
26%
Yes, I'd like to have translations
32%
Indifferent
35%
No, that'd be bad (please comment)
7%
Total votes: 1093
Syndication
file   ver   dls
German Localization light   4.4.2.1   82338
Context Free Art (*.cfdg)   0.31   46042
JBuilder scheme   .001   18486
BBEdit scheme   1.0   18107
ColdFusion scheme   1.0   18015
R Edit Mode - extensive version   0.1   17461
Advanced HTML edit mode   1.0   16194
Matlab Edit Mode   1.0   16056
jEdit XP icons   1.0   15220
XP icons for jEdit   1.1   14281