New user: Various questions.

100 views
Skip to first unread message

Daniel Carrera

unread,
Jul 6, 2012, 9:14:26 AM7/6/12
to nicee...@googlegroups.com
Hello,

I'm getting started with NE. I've been reading through the documentation, so I have an idea of how it works, but I have a few questions:

1. Syntax highlighting is done automatically for a selection of file extensions. Is there a way I can edit this list of extensions? I program in Fortran 95 and 2003, which typically have file extension .f90. Currently NE only recognizes .f and .for as Fortran extensions, but those extensions mean different things when you compile Fortran code. Extensions .f and .for are used for the old, FORTRAN 77 formatting rules and .f90 is used for the new formatting rules introduced in Fortran 90.

2. What is the command to delete one line of text? In Pico you'd do this with "Ctrl-K" but in NE that means something different.

Thanks for the help,

Cheers,
Daniel.

Daniel Carrera

unread,
Jul 6, 2012, 9:23:39 AM7/6/12
to nicee...@googlegroups.com
Oh, I forgot to ask another question:

3. I'd like to know how to retain preferences such as TabSize, AutoIndent and so on. I tried using the menu to "save preferences", but I give it a file name and it doesn't do anything (it gives no error, but it doesn't create a file with my preferences).

utoddl

unread,
Jul 7, 2012, 8:44:37 AM7/7/12
to nicee...@googlegroups.com
 
Welcome to ne, Daniel. I hope you enjoy using it.

To take your second question first, "Ctrl-Y" will "yank" the current line out of the document. Internally it invokes the "DeleteLine" command. I.e., that's the command that would be recorded in a macro if you hit "Ctrl-Y" with macro recording turned on.

Other ways to get rid of a line include moving to the start of the line ("Ctrl-A"), start marking a block ("Ctrl-B"), cursor down and cut ("Ctrl-X").

Your first question about syntax highlighting is actually related to your followup question about retaining preferences. If you load a FORTRAN file with a .f90 extension, as you say ne will not recognise the extension so nothing gets highlighted. However, if you then enter the "syntax fortran" command, you should get FORTRAN highlighting. The trick then is to get ne to use that setting for subsequent ".f90" files. That's what "AutoPrefs" is all about. If you then execute the "SafeAutoPrefs" command (or select "Save AutoPrefs" from the "Prefs" menu, ne will create or update the file "~/.ne/f90#ap" which will contain a set of commands when get executed whenever you load a .f90 file. This includes things like setting the TabSize, UTF8Auto, AutoIndent, etc. as well as "Syntax fortran". So from then on, ne will behave as if the .f90 extension were mapped to the fortran syntax recogniser, at least for you.

The SavePrefs command lets you save a set of preferences to an arbitrary file, but ne doesn't automatically recognise or use that file for preferences. In fact, until I read your message I had forgotten all about it. I'm not even sure I ever realised it was there. I certainly have never used it.

Again, welcome to ne, and feel free to ask any questions you may come up with.

Daniel Carrera

unread,
Jul 8, 2012, 7:17:24 AM7/8/12
to nicee...@googlegroups.com

On Saturday, 7 July 2012 14:44:37 UTC+2, utoddl wrote:
 
Welcome to ne, Daniel. I hope you enjoy using it.

To take your second question first, "Ctrl-Y" will "yank" the current line out of the document. Internally it invokes the "DeleteLine" command. I.e., that's the command that would be recorded in a macro if you hit "Ctrl-Y" with macro recording turned on.

Other ways to get rid of a line include moving to the start of the line ("Ctrl-A"), start marking a block ("Ctrl-B"), cursor down and cut ("Ctrl-X").

Your first question about syntax highlighting is actually related to your followup question about retaining preferences. If you load a FORTRAN file with a .f90 extension, as you say ne will not recognise the extension so nothing gets highlighted. However, if you then enter the "syntax fortran" command, you should get FORTRAN highlighting. The trick then is to get ne to use that setting for subsequent ".f90" files. That's what "AutoPrefs" is all about. If you then execute the "SafeAutoPrefs" command (or select "Save AutoPrefs" from the "Prefs" menu, ne will create or update the file "~/.ne/f90#ap" which will contain a set of commands when get executed whenever you load a .f90 file. This includes things like setting the TabSize, UTF8Auto, AutoIndent, etc. as well as "Syntax fortran". So from then on, ne will behave as if the .f90 extension were mapped to the fortran syntax recogniser, at least for you.

The SavePrefs command lets you save a set of preferences to an arbitrary file, but ne doesn't automatically recognise or use that file for preferences. In fact, until I read your message I had forgotten all about it. I'm not even sure I ever realised it was there. I certainly have never used it.

Again, welcome to ne, and feel free to ask any questions you may come up with.



WHOO HOO!!!   That works!!  \o/

Thanks.
 

Daniel Carrera

unread,
Jul 8, 2012, 2:58:04 PM7/8/12
to nicee...@googlegroups.com
New question: How can I define syntax highlighting for new file types?

Specifically, I am working with IDL files (file extension .pro) and I want to make a syntax highlighting file for IDL scripts. It wouldn't be hard if I could get a copy of the Fortran syntax file because a lot of IDL's keywords are taken from Fortran.

Help?

Daniel.

John Gabriele

unread,
Jul 8, 2012, 3:13:36 PM7/8/12
to niceeditor
>
> > 1. Syntax highlighting is done automatically for a selection of file
> > extensions. Is there a way I can edit this list of extensions? I program in
> > Fortran 95 and 2003, which typically have file extension .f90. Currently NE
> > only recognizes .f and .for as Fortran extensions, but those extensions
> > mean different things when you compile Fortran code. Extensions .f and .for
> > are used for the old, FORTRAN 77 formatting rules and .f90 is used for the
> > new formatting rules introduced in Fortran 90.
>
>
> Your first question about syntax highlighting is actually related to your
> followup question about retaining preferences. If you load a FORTRAN file
> with a .f90 extension, as you say ne will not recognise the extension so
> nothing gets highlighted. However, if you then enter the "syntax fortran"
> command, you should get FORTRAN highlighting. The trick then is to get ne
> to use that setting for subsequent ".f90" files. That's what "AutoPrefs" is
> all about.

I'd always thought that the way to get new filename extensions
recognized as a particular existing filetype was to go into your ~/.ne/
syntax dir (creating it if necessary) and create a symlink to the
filetype syntax file you want. For example:

~~~
cd ~/.ne/syntax
ln -s path/to/share/ne/syntax/fortran.jsf f90.jsf
~~~

---John

John Gabriele

unread,
Jul 8, 2012, 3:18:34 PM7/8/12
to niceeditor
Hi Daniel,

The comments in the c.jsf file that comes with ne (ex. /usr/local/
share/ne/syntax/c.jsf) tell about how the system works. Then you might
have a look at some of the other .jsf files for more examples.

If you write your own jsf file, place it into your ~/.ne/syntax
directory so ne can find it.

---John
Reply all
Reply to author
Forward
0 new messages