OESF | ELSI | pdaXrom | OpenZaurus | Zaurus Themes | Community Links | Ibiblio

IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Help With Nedit [solved], key mappings are incorrect
zi99y
post Sep 12 2006, 09:46 AM
Post #1





Group: Members
Posts: 281
Joined: 9-August 06
Member No.: 10,709



Hi all,

I've been trying for ages to get Nedit working, it runs so fast and looks perfect for what I want - but I can't use it because the arrow keys do not work correctly - left and right moves the cursor to the start or end of the line (like home and end), so I am unable to navigate properly.

I've searched and searched and can find no answers, any ideas on this would make me very grateful.

ta

zi99y
Go to the top of the page
 
+Quote Post
zi99y
post Sep 12 2006, 11:28 AM
Post #2





Group: Members
Posts: 281
Joined: 9-August 06
Member No.: 10,709



Ok I searched a bit more (!) and found a way of mapping the keys with macros, if anyone has this problem, you can paste the following section into your ~/.nedit/nedit.rc file

CODE
    left:Left::: {\n\
 backward_character()\n\
    }\n\
    right:Right::: {\n\
 forward_character()\n\
    }\n\
    page down:Mod2+Down::: {\n\
 next_page()\n\
    }\n\
    page up:Mod2+Up::: {\n\
 previous_page()\n\
    }\n\
    select right:Shift+Right::: {\n\
 key_select("right")\n\
    }\n\
    select left:Shift+Left::: {\n\
 key_select("left")\n\
    }\n


Put this at the end of the nedit.macroCommands section.

Alternatively you can add the macros through the menu (Preferences > Default Settings > Customize Menus > Macro Menu) and use the actions from this page: http://webdocs.math.univ-rennes1.fr/NEdit/...on_Routines.htm
Go to the top of the page
 
+Quote Post
daniel3000
post Sep 12 2006, 12:41 PM
Post #3





Group: Members
Posts: 1,002
Joined: 28-April 05
From: Germany
Member No.: 7,027



Well, I have just installed teh nedit 5.5 IPK from the other thread you probably also have read.
Same problem, cursor keys don't move just one character.

However, I don't have an .nedit/nedit.rc file, so I created a new one, with the contents

CODE
[nedit.macroCommands]

left:Left::: {\n\
backward_character()\n\
}\n\
right:Right::: {\n\
forward_character()\n\
}\n\
page down:Mod2+Down::: {\n\
next_page()\n\
}\n\
page up:Mod2+Up::: {\n\
previous_page()\n\
}\n\
select right:Shift+Right::: {\n\
key_select("right")\n\
}\n\
select left:Shift+Left::: {\n\
key_select("left")\n\
}\n


However, this does not work. Cursor keys behave as before.
What did I do wrong?
How does your nedit.rc look?

Thanks
daniel
Go to the top of the page
 
+Quote Post
zi99y
post Sep 12 2006, 11:10 PM
Post #4





Group: Members
Posts: 281
Joined: 9-August 06
Member No.: 10,709



Ok delete the file you just created, go into nedit and click on preferences > save defaults, this will create the file for you, now go in and make the changes above.

I forgot to mention, this will also fix keys for selecting while holding shift, and page up & page down.

Let me know if you can't get it working, Nedit is really good and fast and I've imported a PHP syntax highlighting file so it now does everything I want smile.gif
Go to the top of the page
 
+Quote Post
daniel3000
post Sep 13 2006, 01:43 AM
Post #5





Group: Members
Posts: 1,002
Joined: 28-April 05
From: Germany
Member No.: 7,027



Okay, now I got it. Thanks!
nedit needs some tweaking though.

Bigger font size - done.

Change color for marked text - done.

Is it possible to change the fonts for the menus?

In the nedit maillist archives, I could find a macro mentioned which inserts a time and date stamp: "execute_command(date -u +'%%Y%%m%%d:%%H:%%M:%%S: ')". However, if I try this, nedit tries to execute the command with csh, which I don't have installed. Is there a way to let nedit use bash or sh instead?


The Del key (Fn-Backspace) acts like backspace.
I found this FAQ:
http://www.nedit.org/faq/sect_customization.php#N277
But the solution doesn't help here. In fact, there is no ~/.Xdefaults file and I could not find one in another location. Creating it with the parameter given at above URL does not help.

daniel
Go to the top of the page
 
+Quote Post
danr
post Sep 13 2006, 02:19 AM
Post #6





Group: Members
Posts: 138
Joined: 12-February 04
Member No.: 1,830



QUOTE(daniel3000 @ Sep 13 2006, 09:43 AM)
In the nedit maillist archives, I could find a macro mentioned which  inserts a time and date stamp: "execute_command(date -u +'%%Y%%m%%d:%%H:%%M:%%S: ')". However, if I try this, nedit tries to execute the command with csh, which I don't have installed. Is there a way to let nedit use bash or sh instead?

...
But the solution doesn't help here. In fact, there is no ~/.Xdefaults file and I could not find one in another location. Creating it with the parameter given at above URL does not help.


Instead of .Xdefaults, edit .Xresources (which is very similar), and add the following:

CODE
nedit*shell: /bin/bash


I have the following in my nedit.rc file to enter a date in my diary file as "-- <dayname> <day>/<month>/<year>":

CODE
       Date:Alt+D::: {\n\_main()\n\                                            
               d="-- " shell_command("date +\\"%a %d/%m/%y\\"", "") "\\n"\n\  
               insert_string(substring(d, 0, length(d)-1))\n\
       }\n  


Not sure how to change the menu font size. Any ideas anyone?

Dan
Go to the top of the page
 
+Quote Post
daniel3000
post Sep 13 2006, 04:59 AM
Post #7





Group: Members
Posts: 1,002
Joined: 28-April 05
From: Germany
Member No.: 7,027



QUOTE(danr @ Sep 13 2006, 12:19 PM)
Instead of .Xdefaults, edit .Xresources (which is very similar), and add the following:

CODE
nedit*shell: /bin/bash


There must be something I don't understand yet...
so I created a ~/.Xresources file (it didn't exist yet) and added the line you gave.
After restarting X,when I try to issue a shell command, it still says "Error starting shell: /bin/csh".
I found an existing filr /etc/X11/xdm/Xresources and appended your line to the end if that one. Same result.

What am I doing wrong?

I could work around this problem with an ln -s /bin/bash /bin/csh but that is certainly not such an elegant solution...

QUOTE
I have the following in my nedit.rc file to enter a date in my diary file as "-- <dayname> <day>/<month>/<year>":

CODE

       Date:Alt+D::: {\n\_main()\n\                                            
               d="-- " shell_command("date +\\"%a %d/%m/%y\\"", "") "\\n"\n\  
               insert_string(substring(d, 0, length(d)-1))\n\
       }\n  


strange... here nedit says on startup:

CODE
Nedit: syntax error in macro menu item:
{
_m<==


Any ideas?
And why not strip that macro down to just something like
CODE

      Date:Alt+D::: {\n\                                            
               shell_command("date +\\"%a %d/%m/%y\\"", ")\n\  
       }\n


Thanks a lot
daniel
Go to the top of the page
 
+Quote Post
zi99y
post Sep 13 2006, 10:06 AM
Post #8





Group: Members
Posts: 281
Joined: 9-August 06
Member No.: 10,709



I found a similar page referring to .Xdefaults or .Xresources (which I don't have either), and could not get it working. I get the same error looking for /bin/csh.

Can you tell me how you changed color for marked text - I can't find that option and the light grey is very hard to see.

Ta
Go to the top of the page
 
+Quote Post
daniel3000
post Sep 13 2006, 11:34 AM
Post #9





Group: Members
Posts: 1,002
Joined: 28-April 05
From: Germany
Member No.: 7,027



QUOTE(zi99y @ Sep 13 2006, 08:06 PM)
I found a similar page referring to .Xdefaults or .Xresources (which I don't have either), and could not get it working. I get the same error looking for /bin/csh.

Can you tell me how you changed color for marked text - I can't find that option and the light grey is very hard to see.

Ta
*


Sure:
Preferences -> Default Settings -> Colors:
I changed "Selection background" from cc/cc/cc (I believe) to 88/88/88.
Much darker grey :-)

daniel
Go to the top of the page
 
+Quote Post
danr
post Sep 14 2006, 12:07 AM
Post #10





Group: Members
Posts: 138
Joined: 12-February 04
Member No.: 1,830



QUOTE(daniel3000 @ Sep 13 2006, 12:59 PM)
After restarting X,when I try to issue a shell command, it still says "Error starting shell: /bin/csh".
I found an existing filr /etc/X11/xdm/Xresources and appended your line to the end if that one. Same result.

What am I doing wrong?


I don't know - perhaps look on the nedit wiki for suggestions?

QUOTE
strange... here nedit says on startup:

CODE
Nedit: syntax error in macro menu item:
{
_m<==


Any ideas?
And why not strip that macro down to just something like
CODE

      Date:Alt+D::: {\n\                                            
               shell_command("date +\\"%a %d/%m/%y\\"", ")\n\  
       }\n


In my previous message I took the code from my nedit.rc file, so maybe it didn't paste correctly in the web browser. However, I like to have '-- ' prepended to the date so as to show up as a comment, so you won't need that bit. Anyway, I found this date macro on this nedit macro page, so have a play around with the date macro to get it to do what you want it to do.

Dan
Go to the top of the page
 
+Quote Post
daniel3000
post Sep 14 2006, 05:30 AM
Post #11





Group: Members
Posts: 1,002
Joined: 28-April 05
From: Germany
Member No.: 7,027



Hi Dan,

well, the macros page doesn't mention that _main() function for "insert date" macro. However, if I omit it, it works!

Thanks for the info.

What I have added to my nedit.rc loos that way:

CODE
      Date:Alt+D::: {\n\                                            
              d="-- " shell_command("date +\\"%d.%m.%Y (%a)\\"", "") "\\n"\n\  
              insert_string(substring(d, 0, length(d)-1))\n\
      }\n  


which makes nedit write a time stamp at the current cursor position if I hit Alt-D of the format

CODE
-- 14.09.2006 (Thu)



nice!

The issue with the shell is "solved" by an ln -s /bin/bash /bin/csh. No problems so far. If anyone knows how to do it on pdaXrom on a nicer way, please let me know!

daniel
Go to the top of the page
 
+Quote Post
daniel3000
post Oct 4 2006, 12:34 PM
Post #12





Group: Members
Posts: 1,002
Joined: 28-April 05
From: Germany
Member No.: 7,027



Nedit is now my main editor.
However, two problems remain:

1. How can I start nedit in maximized-window mode? On startup, the window is larger than the screen, making it difficult to work. Ctrl-Alt-M helps, but I'd like to avoid having to press this key combo each time I start up nedit.

2. the font selection does not show the fonts I need (Bitstream Vera fonts would be nice for example - they are installed on my system).
I have set it to the "fixed" font set with size 20, but these fonts do not have the German Umlauts.
I am not so familiar with all that font stuff, so please could someone give advice why I cannot select ehe Vera fonts and maybe how I can make these available to nedit?

Thanks a lot!
daniel
Go to the top of the page
 
+Quote Post
Drake01
post Oct 4 2006, 05:46 PM
Post #13





Group: Members
Posts: 226
Joined: 29-March 06
Member No.: 9,483



QUOTE(daniel3000 @ Oct 4 2006, 03:34 PM)
1. How can I start nedit in maximized-window mode? On startup, the window is larger than the screen, making it difficult to work. Ctrl-Alt-M helps, but I'd like to avoid having to press this key combo each time I start up nedit.
*


I'm using nedit as my primary editor on my desktop. There's a command-line option for setting initial window geometry. I'm assuming that this will work for the Zaurus version, as well.

-geometry geometry (or -g geometry)
The initial size and/or location of editor windows. The argument geometry has the form:

[<width>x<height>][+|-][<xoffset>[+|-]<yoffset>]

where <width> and <height> are the desired width and height of the window, and <xoffset> and <yoffset> are the distance from the edge of the screen to the window, + for top or left, - for bottom or right. -geometry can be specified for individual files on the command line.


BTW, how long does nedit take to load on the Z? If it's fairly snappy, I may switch from Leafpad. For most tasks, however, I would be frustrated if there's a significant lag in opening.
Go to the top of the page
 
+Quote Post
daniel3000
post Oct 5 2006, 11:20 AM
Post #14





Group: Members
Posts: 1,002
Joined: 28-April 05
From: Germany
Member No.: 7,027



QUOTE(Drake01 @ Oct 5 2006, 03:46 AM)
I'm using nedit as my primary editor on my desktop.  There's a command-line option for setting initial window geometry.  I'm assuming that this will work for the Zaurus version, as well.

[font=Courier]-geometry geometry (or -g geometry)
The initial size and/or location of editor windows.  The argument geometry has the form:

  [<width>x<height>][+|-][<xoffset>[+|-]<yoffset>]


thanks, I could now make nedit start up in an almost full-screen window using
CODE
alias n="nedit -g 61x17+0+0"

(the values for x and y are not pixels but characters!)

QUOTE
BTW, how long does nedit take to load on the Z?  If it's fairly snappy, I may switch from Leafpad.  For most tasks, however, I would be frustrated if there's a significant lag in opening.
*


Here it takes about 10 seconds to load, so it is not as snappy as leafpad. But once it is loaded it is reasonably fast and well usable (after creating some macros to maike the cursor keys work as expected, see above).


Regarding the Umlauts:
I was wrong. The used font HAS the umlauts They are shown corectly when I load ISO-8859-1 coded files with nedit. But when pressing the key codes for Umlauts (Fn-a, Fn-o etc. on my system, works in Console and most other apps), no Umlauts are generated in nedit but rather two-byte character combinations. Looks a bit like a unicode problem, such as the keys generating unicode (two-byte) characters which nedit cannot display.
The Umlauts which are shown correctly are indeed no unicode Umlauts but ISO-8859-1 coding.

Any idea how I can make the keys work correctly in nedit? Possibly also using macros...

daniel
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 15th September 2014 - 11:28 PM