LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Help me find a text editor!!!! (https://www.linuxquestions.org/questions/linux-software-2/help-me-find-a-text-editor-291404/)

Avatar 02-17-2005 10:18 AM

Help me find a text editor!!!!
 
Hi everyone, sorry for all the !!!! but I'm at my wit's end. (spent 2 full days on this so far.)

I have Debian woody kernel 2.4.18. This machine DOES NOT HAVE X-WINDOWS. So I need a console editor with the following features.

- syntax highlighting of HTML/PHP using colours!!! not fonts.

well that's all I really need.
I've been using vi so far, on Mandrake vi does the syntax highlighting but not on Debian.
I've downloaded Elvis, which displays HTML in yellow and hides the formatting tags. There is supposed to be a command to reveal the tags (:list) but it only reveals them for the current line, and also, displays them in yellow same as the text.

Please help me find a good syntax highlighting text editor. This is very important to me as I am a developer. Thanks.

KimVette 02-17-2005 10:46 AM

Syntax highlighting in a console app? That is a tall order nowadays, and you're unlikely to find one. The reason is: X (and the various libraries like gtk, kdelibs, etc.) offers a much richer API where a lot of the parsing and highlighting routines already exist - you just need to tell the environment what you want highlighted, and how. On X there is a myriad of options.

Is there any particular reason you can't or won't run X?

enemorales 02-17-2005 10:49 AM

I think that VI does not have syntax highlighting, but what usually happens is that when you run VI you get VIM (VI improved). So you should go for VIM. You can also try emacs, which will do a lot more things than highlighting ;).

Greg Haynes 02-17-2005 11:15 AM

...if you find one let me know
 
ive been looking around for good html/php editor and almost all of them depend on the same editor program in kde (or at least i believe its a kde app), so finding one that runs in console will be quite a feat, but if you do please tell me!

jtshaw 02-17-2005 11:46 AM

Vim and Emacs will certainly do syntax highlighting for php and both can run nicely on a console or in X. I'm a vim user myself, but some people perfer to use emacs.

foo_bar_foo 02-17-2005 12:29 PM

this seems like a no brainer

emacs

Okie 02-17-2005 12:56 PM

try mc highlight the text file you want edited and press F4 to edit, but for a graphical environment i prefer Nedit http://www.nedit.org/

just my personal taste in editors, and not necessarily that of LinuxQuestions.org

slakmagik 02-17-2005 02:39 PM

Quote:

Originally posted by KimVette
Syntax highlighting in a console app? That is a tall order nowadays, and you're unlikely to find one.
Huh? It's the other way around. joe just recently added syntax highlighting (finally), emacs and vim and their clones mostly all do it. mc's internal editor does it. I can't think of one specifically that doesn't do it but strict vi clones. X doesn't do crap that the console doesn't do except graphics and windows and networking - and with 'svgalib' and the like and split-screens, virtual consoles, or even 'twin', and with 'screen' even those things are a matter of degree or no difference at all.

Anyway - you may have to specifically enable syntax highlighting in vim if it's not in your ~/.vimrc. (And there is a flag to pass or something to set to make elvis display the damn markup instead of interpreting it.)

__J 02-17-2005 02:51 PM

mcedit has syntax highlighting at the console level ( it comes with mc - the midnight commander).

Zettai 03-07-2005 05:53 PM

Quote:

Originally posted by digiot
Huh? It's the other way around. joe just recently added syntax highlighting (finally), emacs and vim and their clones mostly all do it. mc's internal editor does it. I can't think of one specifically that doesn't do it but strict vi clones. X doesn't do crap that the console doesn't do except graphics and windows and networking - and with 'svgalib' and the like and split-screens, virtual consoles, or even 'twin', and with 'screen' even those things are a matter of degree or no difference at all.

Anyway - you may have to specifically enable syntax highlighting in vim if it's not in your ~/.vimrc. (And there is a flag to pass or something to set to make elvis display the damn markup instead of interpreting it.)

I have SUSE and this doesn't turn on by default like FC2 so in my ~/.vimrc file I put:
syntax on

In the Vim doco it says to put:
syntax enable

Both work.

Avatar 03-22-2005 12:32 PM

Thanks all, I just wanted to post the results.

I have Debian woody installed, VI doesn't do highlighting. Tried Elvis but it interpreted the code rather than showed the markup, as an earlier poster stated, and it drove me nuts so I deleted it.

Now I'm using "jed" because it has a console "menu" system (similar to DOS). It shows the colour-coding for HTML but not PHP.

I just tried to get "emacs":
# apt-get install emacs
Reading Package Lists... Done
Building Dependency Tree... Done
Package emacs has no available version, but exists in the database. This typically means that the package was mentioned in a dependency and never uploaded, has been obsoleted or is not available with the contents of sources.list
E: Package emacs has no installation candidate

So... no emacs for me

I did just download/install VIM, however typing "vim filename.html" shows NO colour-coding of the markup, and I can't find any ".vimrc" file (I'm logged on as root.... I know, I know, its bad.... but otherwise I can't use mysql or save/edit any files under /var/www)

So I guess it's "jed" for me for now. Thanks for all the replies.

rgawenda 03-22-2005 12:39 PM

I'd go with vim, but there was something more like an IDE, DOS-Style, that remembered me the Borland Turbo-X compilers, called (x)wpe. But it's quite old and I don't know if it's being maintained so it could miss the PHP syntax hilight

slakmagik 03-22-2005 07:06 PM

Quote:

Originally posted by Avatar
I did just download/install VIM, however typing "vim filename.html" shows NO colour-coding of the markup, and I can't find any ".vimrc" file (I'm logged on as root.... I know, I know, its bad.... but otherwise I can't use mysql or save/edit any files under /var/www)

So I guess it's "jed" for me for now. Thanks for all the replies.

There should be a '/usr/share/vim/vimrc_example.vim' you can copy over. If not, you can create it with something like
Code:

" Switch syntax highlighting on, when the terminal has colors
" Also switch on highlighting the last used search pattern.
if &t_Co > 2 || has("gui_running")
  syntax on
  set hlsearch
endif

And from the elvis readme I followed from freshmeat:
Code:

prefersyntax
    You can set the prefersyntax option to one of "never", "writable", "local", or "always" to
control when elvis should start displaying a file in the "syntax" display modes rather than one of
the markup display modes such as "html". For example, after ":set prefersyntax=writable",
whenever you edit an HTML file that is writable Elvis will start in "syntax html" mode, but
readonly files (including anything read via the HTTP protocol) will still start in "html" display
mode.

But if jed suits you, all's well.

And, as always, I forget how, but I've set up mysql for my regular account before. (Though I gave up on actually *using* it. "SELECT simple damn database WHERE machine equals desktop and USER equals idiot.") As far as writing to /var/www, seems like you could set up a group or use sudo or something.

reddazz 03-23-2005 12:49 AM

Others have already mentioned this, but I will repeat it. Emacs running in a terminal emulator has syntax highlighting, so give it a shot.

Avatar 03-30-2005 10:21 AM

well I did eventually figure out how to set up VIM. the file is called vimrc (no leading ".") and it's in /usr/sbin/vim or somewhere like that, not in home directory. And now it works! Thanks everyone.

As for emacs. yes I will definitely give it a try too.

*** off topic ***

The reason I prefer to be root is that when I set up one thing (i.e. mysql, /var/www) to be used as a regular user, I find another thing is restricted (i.e. enabling colours in VIM, editing any *.conf files, restarting apache, setting up PHP support, using apt-get...) the list is just too long so it's much easier for me to get my work done as root. Id rather be working on my computer than trying to find workarounds for non-root users. I know this is bad.... been told many times.. and probably one day I will make a boo-boo... but for now, it works.

*** /off-topic ***

And I'd like to thank all those who gave their input for editors. I'm quite happy with VIM now and will be trying out emacs as well.


All times are GMT -5. The time now is 06:24 PM.