LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-03-2005, 04:36 AM   #1
Horos23
LQ Newbie
 
Registered: Jan 2005
Posts: 27

Rep: Reputation: 15
Insert code shortcuts - how?


Hello,

If you don't have time, read the last pharagraph. There is my question.

I am a web developer, I used for 3 years now Homesite 5. I used many shortcut combinations for inserting little pieces of needed html/php code, to be MUCH MORE productive. For instance:
Ctrl+Enter - </ br>
Ctrl+I - <img src='img/' alt="" border="">
Ctrl + M - <tr><td></td></tr>
etc....

I am planning carrefuly my migration to Linux (FC3), and I will switch for html/php developing to Eclipse , with the PhpEclipse plugin, which has debug, variable/function completion, templates, etc.

I didn't find any way, in Eclipse or any plugin for Eclipse to insert the text/code I want at a shortcut key, and the cursor will remain where I want. I know it is possible with templates, but I have to press some extra keys (Ctrl + Space, + first letters of template).

My question is not if this is possible in Eclipse, cause it's not. I would have posted in an Eclipse forum.

I know in Gnome it is possible to add custom shortcut keys to execute your custom scripts. How can I make a script to insert a code in the current document I am editing (independent of my application, or if it's not possible - just for Eclipse), and leave my cursor where I need.


So basically, I need a trick in Linux for making combination of keys (like Ctrl+Enter) for inserting custom text, and leave the cursor where I need.

Thank you.
Stefan.
 
Old 02-03-2005, 05:36 PM   #2
shengchieh
Member
 
Registered: Jul 2004
Location: Palo Alto, CA
Distribution: #! Korora
Posts: 472

Rep: Reputation: 30
I don't know about your distribution, but on Xandros,
you can pops up the "control center" move to
"General Setting" -> "Shortcut keys" and fiddle around.
Why don't you play around with your "control center"
and see if there are "shortcut keys"?

Sheng-Chieh
 
Old 02-03-2005, 11:15 PM   #3
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 53
i can't imagine you could do that (write to a buffer of an application with window manager shortcuts)

i don't know what eclipse is but emacs will record and play back macros like that as well as just about anything else you need it to do
 
Old 02-04-2005, 02:02 AM   #4
Horos23
LQ Newbie
 
Registered: Jan 2005
Posts: 27

Original Poster
Rep: Reputation: 15
Hey guys,

Thanks for answer. I use FC3 and Gnome. I can do that. I read a tutorial for Gnome, and I can execute whatever bash script I want when I press a combination of keys. The problem is how can I make that script insert some text in the current edited document of Eclipse (for example) and leave my cursor where I need.

Thanks,
Stefan.
 
Old 02-04-2005, 05:19 AM   #5
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
What foo_bar_foo means is that he can't imagine that one program can write in the buffer of another program (neither can I, by the way).

Don't forget that the shortcuts that you use in homesite, are controlled by homesite and not by the OS (windows). The same will apply to eclipse.

However, there is some hope. In the eclipse documentation (follow links on http://www.eclipse.org/documentation/main.html) you can read that you can add external editors that are displayed in the workbench. That might be the solution for you. Both vi and emacs support macros that can do the tricks for you.
 
Old 02-04-2005, 05:34 AM   #6
Cerulean
LQ Newbie
 
Registered: Dec 2004
Distribution: SuSE 9.1
Posts: 28

Rep: Reputation: 15
Quote:
The problem is how can I make that script insert some text in the current edited document of Eclipse (for example) and leave my cursor where I need.
If you were using Kate or KDevelop such a script is trivial - just call the insertText (or whatever it is called) DCOP function for the textedit.
 
Old 02-04-2005, 11:36 AM   #7
Horos23
LQ Newbie
 
Registered: Jan 2005
Posts: 27

Original Poster
Rep: Reputation: 15
Hey,

Yes you are right about the buffer I guess...
I tried with external editors for Eclipse. It doesn't work. They are not displayed in the workbench, they do not have the features of Eclipse/phpEditor syntax checking, coloring, breakpoints for debug etc. etc. So it's not Eclipse, it's that editor that I'm using.
I am convinced that there are a lot of great editors, but Eclipse I'll use also for java programming it is specialized in java programming, and the php plugin does my work in php much easier... so it's a php IDE also, I can't just use non-specialized editor. One example is I don't have debug, syntax checking or functions auto-complete.

You made me think my problem is more related to Eclipse and its code rather than Linux.
I'm just sad that this is the last unresolved problem on my list for migrating to Linux solved the others
Just need to keep my productivity.

I think I'll just try some Eclipse forums . Thanks for help.

Quote:
Originally posted by Wim Sturkenboom
What foo_bar_foo means is that he can't imagine that one program can write in the buffer of another program (neither can I, by the way).

Don't forget that the shortcuts that you use in homesite, are controlled by homesite and not by the OS (windows). The same will apply to eclipse.

However, there is some hope. In the eclipse documentation (follow links on http://www.eclipse.org/documentation/main.html) you can read that you can add external editors that are displayed in the workbench. That might be the solution for you. Both vi and emacs support macros that can do the tricks for you.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to insert characters by ascii code? J_Szucs Linux - General 14 06-17-2017 12:33 PM
small syntax problem with C code (implemented in Code Composer Studio) illiniguy3043 Programming 6 01-07-2008 02:14 AM
User Preferences: Use HTML code instead of vB code? (vB code is overrated) stefanlasiewski LQ Suggestions & Feedback 5 07-26-2005 01:37 AM
problem while trying to insert code in kernel using insmod himanshu Linux - Software 3 07-15-2005 02:11 PM
Editing buttons (quote, code etc.) add the code to the end vharishankar LQ Suggestions & Feedback 2 09-13-2004 09:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:32 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration