Author Topic: Help With Nedit [solved]  (Read 4251 times)

zi99y

  • Sr. Member
  • ****
  • Posts: 282
    • View Profile
Help With Nedit [solved]
« on: September 12, 2006, 01:46:59 pm »
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
« Last Edit: September 13, 2006, 03:12:12 am by zi99y »

zi99y

  • Sr. Member
  • ****
  • Posts: 282
    • View Profile
Help With Nedit [solved]
« Reply #1 on: September 12, 2006, 03:28:03 pm »
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: [Select]
    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

daniel3000

  • Hero Member
  • *****
  • Posts: 1003
    • View Profile
    • http://
Help With Nedit [solved]
« Reply #2 on: September 12, 2006, 04:41:20 pm »
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: [Select]
[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
SL-C3200 with weeXpc, based on pdaXrom 1.1.0beta3
HP 200LX with MS-DOS 5.0

zi99y

  • Sr. Member
  • ****
  • Posts: 282
    • View Profile
Help With Nedit [solved]
« Reply #3 on: September 13, 2006, 03:10:36 am »
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

daniel3000

  • Hero Member
  • *****
  • Posts: 1003
    • View Profile
    • http://
Help With Nedit [solved]
« Reply #4 on: September 13, 2006, 05:43:56 am »
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
« Last Edit: September 13, 2006, 05:48:06 am by daniel3000 »
SL-C3200 with weeXpc, based on pdaXrom 1.1.0beta3
HP 200LX with MS-DOS 5.0

danr

  • Full Member
  • ***
  • Posts: 138
    • View Profile
    • http://
Help With Nedit [solved]
« Reply #5 on: September 13, 2006, 06:19:17 am »
Quote
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: [Select]
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: [Select]
       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
SL-C860 running Debian EABI on top of Angstrom 2.6 kernel

daniel3000

  • Hero Member
  • *****
  • Posts: 1003
    • View Profile
    • http://
Help With Nedit [solved]
« Reply #6 on: September 13, 2006, 08:59:15 am »
Quote
Instead of .Xdefaults, edit .Xresources (which is very similar), and add the following:

Code: [Select]
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: [Select]

       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: [Select]
Nedit: syntax error in macro menu item:
{
_m<==

Any ideas?
And why not strip that macro down to just something like
Code: [Select]

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

Thanks a lot
daniel
« Last Edit: September 13, 2006, 09:03:49 am by daniel3000 »
SL-C3200 with weeXpc, based on pdaXrom 1.1.0beta3
HP 200LX with MS-DOS 5.0

zi99y

  • Sr. Member
  • ****
  • Posts: 282
    • View Profile
Help With Nedit [solved]
« Reply #7 on: September 13, 2006, 02:06:53 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

daniel3000

  • Hero Member
  • *****
  • Posts: 1003
    • View Profile
    • http://
Help With Nedit [solved]
« Reply #8 on: September 13, 2006, 03:34:46 pm »
Quote
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
[div align=\"right\"][a href=\"index.php?act=findpost&pid=141323\"][{POST_SNAPBACK}][/a][/div]

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

daniel
SL-C3200 with weeXpc, based on pdaXrom 1.1.0beta3
HP 200LX with MS-DOS 5.0

danr

  • Full Member
  • ***
  • Posts: 138
    • View Profile
    • http://
Help With Nedit [solved]
« Reply #9 on: September 14, 2006, 04:07:34 am »
Quote
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: [Select]
Nedit: syntax error in macro menu item:
{
_m<==

Any ideas?
And why not strip that macro down to just something like
Code: [Select]

 Â      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
SL-C860 running Debian EABI on top of Angstrom 2.6 kernel

daniel3000

  • Hero Member
  • *****
  • Posts: 1003
    • View Profile
    • http://
Help With Nedit [solved]
« Reply #10 on: September 14, 2006, 09:30:34 am »
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: [Select]
      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: [Select]
-- 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
SL-C3200 with weeXpc, based on pdaXrom 1.1.0beta3
HP 200LX with MS-DOS 5.0

daniel3000

  • Hero Member
  • *****
  • Posts: 1003
    • View Profile
    • http://
Help With Nedit [solved]
« Reply #11 on: October 04, 2006, 04:34:47 pm »
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
SL-C3200 with weeXpc, based on pdaXrom 1.1.0beta3
HP 200LX with MS-DOS 5.0

Drake01

  • Full Member
  • ***
  • Posts: 226
    • View Profile
Help With Nedit [solved]
« Reply #12 on: October 04, 2006, 09:46:49 pm »
Quote
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.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=143112\"][{POST_SNAPBACK}][/a][/div]

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.
Device: SL-C3200 running pdaXii13v2 build 5.5.0
Networking: Symbol Spectrum24 WLAN card; Kingston CIO10T CF NIC
Storage: 4GB Transcend 150x SD; 16GB Transcend 133x CF; 4GB Seagate CF HDD; 4GB Patriot SD
HID: Logitech V450 Laser Mouse; generic silicone USB keyboard; 2 generic optical mice; stock plastic stylus
GPS: generic "UT-41" USB GPS Receiver
Case: neoprene case from my old Palm foldable keyboard

daniel3000

  • Hero Member
  • *****
  • Posts: 1003
    • View Profile
    • http://
Help With Nedit [solved]
« Reply #13 on: October 05, 2006, 03:20:45 pm »
Quote
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>]

thanks, I could now make nedit start up in an almost full-screen window using
Code: [Select]
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.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=143146\"][{POST_SNAPBACK}][/a][/div]

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
SL-C3200 with weeXpc, based on pdaXrom 1.1.0beta3
HP 200LX with MS-DOS 5.0