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. |
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? |
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 ;).
|
...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!
|
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.
|
this seems like a no brainer
emacs |
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 |
Quote:
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.) |
mcedit has syntax highlighting at the console level ( it comes with mc - the midnight commander).
|
Quote:
syntax on In the Vim doco it says to put: syntax enable Both work. |
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. |
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
|
Quote:
Code:
" Switch syntax highlighting on, when the terminal has colors Code:
prefersyntax 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. |
Others have already mentioned this, but I will repeat it. Emacs running in a terminal emulator has syntax highlighting, so give it a shot.
|
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. |