text editor suggestion?

A

Alexander Jakopin

John Salerno said:
Ok, I know it's been asked a million times, but I have a more specific
question so hopefully this won't be just the same old post. I've tried a
few different editors, and I really like UltraEdit, but it's
Windows-only and I'm working more on Linux nowadays.

Here are my criteria:

1. syntax highlighting (highly customizable)
2. auto/smart indenting
3. ability to run script
4. light-weight text editor, not an IDE
5. cross-platform (not really necessary, but nice)

That's pretty much all I need. It's nice when you can customize a bunch
of other stuff too, but those are the most important.

I've tried vim, but I really don't feel like taking the time to learn
how to use it, given that I just like to casually program (not to
mention that I prefer to use the mouse when navigating a document
sometimes).

Vim is rather nice once you know it, but i can understand that not
everyone has the time to learn it.

There is Cream[1] which is supposed to be a more modern configuration of
VIM. I also remember using JED[2] for a while, but i can't remember the
features of it well, so i can't say if they fullfill your requirements
or not.

[1] http://cream.sourceforge.net/
[2] http://www.jedsoft.org/jed/

-- setrodox
 
S

Sybren Stuvel

John Salerno enlightened us with:
But what about customizing syntax coloring? Is this also in the same
file? I've noticed a separate file called python.vim (in Windows,
this file exists in a 'syntax' folder, and also another file of the
same name in an 'indent' folder, so I'm *still* confused about which
files are used for which settings.

And you're also confused about what things are settings and what
aren't. The colour scheme used by VIM is not a setting. The syntax
files define the "role" of words and symbols in a certain file. The
colour scheme then defines colous for those "roles". For instance, the
syntax/python.vim file defines that "if" is a keyword. The colour
scheme "default" then defines it should be brown, for example.

If you want different colours, choose another colour scheme or create
your own. You could also do ":help color" and read that.

Sybren
 
J

Jorgen Grahn

And they're installable on Windows, and they will be ported to anything
you're likely to encounter, for the rest of your life.

That's an important point, IMHO. At least if you're living in Unix, plain
old text editing is one of the most common tasks you do, and you rarely end
up in situations where you're forced to use domain-specific editors (except
when using web applications, where you are often limited to the text editing
facilities of your web browser).

I usually don't like the idea of becoming addicted to one simgle program,
but I make an exception for text editing. I'm so much more productive in
emacs than anywhere else, and the things I learn while (say) programming in
Python translate directly to writing documentation, writing C code, or
massaging and browsing large data sets.
I'd really like to learn vim, but I spent days just trying to figure out
how to get the syntax highlighting and indentation working, where these
settings are and how to edit them, and it still doesn't work for me.

That's to be expected, and to be honest, you'd have the same problem with
the editor I'd suggest, emacs.

I've accepted that there are huge areas of emacs that I don't know and which
would be useful to me if I had known them. It took almost ten years to
discover dabbrev-expand, and I only found out about open-rectangle last
week.

And noone can tell me /which/ features I'm missing, because everyone uses
their editor in a different way.

/Jorgen
 
R

Roberto Bonvallet

John said:
I'd really like to learn vim, but I spent days just trying to figure out
how to get the syntax highlighting and indentation working, where these
settings are and how to edit them, and it still doesn't work for me. It
just feels so insurmountable that I can't even start working with it yet
because I don't know how to tailor the settings.

Create a vimrc file (if you use Unix: ~/.vimrc) with the following lines in
it:

syntax on
set autoindent
set smartindent

If you find that using vim is hard, try using evim (easy vim). It is part
of the standard vim distribution (actually it's the same program). Anyway,
I suggest learning the classic modal vim, it's really worth it.
 
J

John Salerno

Sybren said:
John Salerno enlightened us with:

And you're also confused about what things are settings and what
aren't.

No, my point was just that there are more files needed than just the
..vimrc file if you want to do some extra customization. I'd like to
change the syntax highlighting to specific colors for each group of
keywords, and you can't do that in the settings file. I'm not even sure
you can do that at all, or if you have to settle for pre-made color
schemes. I haven't looked into how difficult it is to make your own
color scheme. (And does vim support bold text?)
 
S

Sybren Stuvel

John Salerno enlightened us with:
No, my point was just that there are more files needed than just the
.vimrc file if you want to do some extra customization. I'd like to
change the syntax highlighting to specific colors for each group of
keywords, and you can't do that in the settings file. I'm not even
sure you can do that at all, or if you have to settle for pre-made
color schemes.

It's Open Source, so the people creating those pre-made colour schemes
are just normal folks like you and me.
I haven't looked into how difficult it is to make your own color
scheme.

It's very easy. Just take a look at the pre-made colour schemes.
(And does vim support bold text?)

It does, as long as your terminal supports it.

Sybren
 
S

sjdevnull

John said:
No, my point was just that there are more files needed than just the
.vimrc file if you want to do some extra customization. I'd like to
change the syntax highlighting to specific colors for each group of
keywords, and you can't do that in the settings file.

You can do all your color schemes/syntax highlighting changes in the
..vimrc file.

People normally split them out and :source other files to keep things
tidy, and there are some ways (plugins) to package things up nicely to
distribute to others, but fundamentally it's all just vim commands and
putting everything in the .vimrc is perfectly fine. E.g. if I want to
change it so that identifiers are in another color from the default I
just add:

:highlight Identifier guifg=DarkSlateGrey

to the .vimrc (or change ctermfg to a terminal color to change the
colors in non-gui vim)
I'm not even sure
you can do that at all, or if you have to settle for pre-made color
schemes. I haven't looked into how difficult it is to make your own
color scheme.

It's easy. You just use a bunch of highlight statements like the
above. There are examples in the vim runtime directory. You can try
them out with a simple:

:colorscheme koehler
:colorscheme desert
:colorscheme default

etc.
(And does vim support bold text?)

If your terminal supports it, yeah.
 
C

cga2000

Create a vimrc file (if you use Unix: ~/.vimrc) with the following lines in
it:

syntax on
set autoindent
set smartindent

If you find that using vim is hard, try using evim (easy vim). It is part
of the standard vim distribution (actually it's the same program). Anyway,
I suggest learning the classic modal vim, it's really worth it.

I'm not sure anyone else mentioned it.

One additional feature of Vim that you soon will appreciate is that you
get high quality (and timely) support from very knowledgeable users on
the (e-mail address removed) mailing list.

I am unsure whether simpler editors provide this type of thing.

As to creating one's own color schemes .. there are hundreds that can
be downloaded and installed in a matter of minutes and they're likely
much better than what I would be able to come up with.

Some people are just good at this kind of stuff and I'm not one of 'em.

:)

So, I tried out the ones that looked nice .. selected a few that I liked
more than the others .. and changed a few things that didn't suit me to
create my own modified versions of the originals.

Thanks

cga
 
J

jussij

John said:
The thing I liked about UltraEdit is that you can define your own
groups of words and put whatever words you want in there, so my
file had a group called '__builtins__' and it listed all the Python
built-in methods, and those would be highlighted. Most editors I
see don't seem to allow this...

The Zeus IDE uses this exact same approach but takes it one step
further by allowing you to encapsulate all this information inside
a document type:

http://www.zeusedit.com/forum/viewtopic.php?t=176

But alas Zeus is a Windows only editor.

Jussi Jumppanen
Author: Zeus for Windows IDE
http://www.zeusedit.com
 
R

Ravi Teja

I also just started using Scite, and I really like it, except I find its
syntax highlighting to be very inflexible. You aren't able to define
your own groups of words -- you have to use what's given, basically. One
thing I like about UltraEdit is that you simply define as many groups of
keywords as you want and then assign a style to each one. Scite has a
very strange and rigid method of highlighting.

Stick to SciTE. It takes almost no learning effort and meets everyone
of those requirements. As far as customerization goes, SciTE can be
customerized quite well. In fact, it can even be scripted with Lua. You
seem to be using the single file executable which does not come with
the configuration files. Otherwise, I cannot see how you could be
missing this ability.

Try this one instead if you are on Windows.
http://gisdeveloper.tripod.com/scite.html

You need to edit the file python.properties to add keywords.

Windows - C:\Program Files\SciTe\python.properties
Debian - /usr/share/scite/python.properties
 
S

sjdevnull

John said:
The thing I liked about UltraEdit is that you can define your own groups
of words and put whatever words you want in there, so my file had a
group called '__builtins__' and it listed all the Python built-in
methods, and those would be highlighted. Most editors I see don't seem
to allow this...they just figure out what a function or method is on
their own somehow.

In vim, you can just put "let python_highlight_builtins=1" in your
..vimrc for this particular example (other python syntax settings
include python_highlight_numbers, python_highlight_space_errors,
python_highlight_exceptions).

Use python_highlight_all to turn them all on.

To do it by hand and have it automatically come on in all .py buffers,
you could do:
au BufEnter *.py syntax keyword pythonFunction abs apply basestring
bool
au BufEnter *.py syntax keyword pythonFunction buffer callable chr

etc. Put as many as you want on one line. Use other syntax groups if
you want them highlighted as something other than functions.

Or, with vim's builtin python interpreter you could grab the list of
builtins directly, for instance have this in your vimrc:
pyf ~/.vim/vimrc.py

And have this in ~/.vim/vimrc.py:

import vim
# Might want to trim out exceptions/leading underscores/etc from
this...
builtins = ' '.join( [ b for b in dir(__builtins__)] )
vim.command('au BufEnter *.py syn keyword pythonFunction '+builtins)
 
J

John Salerno

Ravi said:
Stick to SciTE. It takes almost no learning effort and meets everyone
of those requirements. As far as customerization goes, SciTE can be
customerized quite well. In fact, it can even be scripted with Lua. You
seem to be using the single file executable which does not come with
the configuration files. Otherwise, I cannot see how you could be
missing this ability.

I really like Scite, but I find it's syntax highlighting abilities to be
quite limited. You can't specify your own groups of words, you can only
use what is already preset in the lexer files.
 
R

Ravi Teja

John said:
I really like Scite, but I find it's syntax highlighting abilities to be
quite limited. You can't specify your own groups of words, you can only
use what is already preset in the lexer files.

???

In the same file, near the top.

keywordclass.python=and assert break class continue def del elif \
else except exec finally for from global if import in is lambda None \
not or pass print raise return try while yield

I could add my own keywords to it.
 
J

John Salerno

Ravi said:
???

In the same file, near the top.

keywordclass.python=and assert break class continue def del elif \
else except exec finally for from global if import in is lambda None \
not or pass print raise return try while yield

I could add my own keywords to it.

But I don't want all my keywords to be highlighted in the same way. I
have different colors for Python keywords, functions and methods,
exceptions, other words like 'self', etc. and there's no way to do this
without rewriting the lexer file (which is in C++) and recompiling Scite
to build the changes into it.
 
R

Ravi Teja

John said:
But I don't want all my keywords to be highlighted in the same way. I
have different colors for Python keywords, functions and methods,
exceptions, other words like 'self', etc. and there's no way to do this
without rewriting the lexer file (which is in C++) and recompiling Scite
to build the changes into it.

I don't know if SciTE somehow supports function highlighting but the
properties file for php will perhaps give you some ideas on having
seperate groups with different highlight properties. I recall
repurposing something similar when I used to use Spyce for web apps.

http://mailman.lyra.org/pipermail/scite-interest/attachments/20050912/c9d5e51b/html-0001.obj
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,211
Latest member
NelleWilde

Latest Threads

Top