LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-17-2005, 10:18 AM   #1
Avatar
Member
 
Registered: May 2001
Location: Canada
Distribution: old ones
Posts: 555

Rep: Reputation: 33
Exclamation 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.
 
Old 02-17-2005, 10:46 AM   #2
KimVette
Senior Member
 
Registered: Dec 2004
Location: Lee, NH
Distribution: OpenSUSE, CentOS, RHEL
Posts: 1,794

Rep: Reputation: 46
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?
 
Old 02-17-2005, 10:49 AM   #3
enemorales
Member
 
Registered: Jul 2004
Location: Santiago, Chile
Distribution: Ubuntu
Posts: 410

Rep: Reputation: 31
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 .
 
Old 02-17-2005, 11:15 AM   #4
Greg Haynes
Member
 
Registered: Oct 2004
Location: Houston, TX
Distribution: Gentoo
Posts: 30

Rep: Reputation: 15
...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!
 
Old 02-17-2005, 11:46 AM   #5
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
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.
 
Old 02-17-2005, 12:29 PM   #6
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 53
this seems like a no brainer

emacs
 
Old 02-17-2005, 12:56 PM   #7
Okie
Senior Member
 
Registered: Mar 2002
Location: Oklahoma
Posts: 1,154

Rep: Reputation: 187Reputation: 187
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
 
Old 02-17-2005, 02:39 PM   #8
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
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.)
 
Old 02-17-2005, 02:51 PM   #9
__J
Senior Member
 
Registered: Dec 2004
Distribution: Slackware, ROCK
Posts: 1,973

Rep: Reputation: 46
mcedit has syntax highlighting at the console level ( it comes with mc - the midnight commander).
 
Old 03-07-2005, 05:53 PM   #10
Zettai
LQ Newbie
 
Registered: Feb 2005
Location: Japan
Distribution: SUSE 9.1
Posts: 5

Rep: Reputation: 0
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.
 
Old 03-22-2005, 12:32 PM   #11
Avatar
Member
 
Registered: May 2001
Location: Canada
Distribution: old ones
Posts: 555

Original Poster
Rep: Reputation: 33
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.
 
Old 03-22-2005, 12:39 PM   #12
rgawenda
LQ Newbie
 
Registered: Mar 2005
Location: Ourense, Spain, EU
Distribution: Gentoo, Debian, Kubuntu
Posts: 29

Rep: Reputation: 15
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

Last edited by rgawenda; 03-22-2005 at 12:41 PM.
 
Old 03-22-2005, 07:06 PM   #13
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
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.
 
Old 03-23-2005, 12:49 AM   #14
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
Others have already mentioned this, but I will repeat it. Emacs running in a terminal emulator has syntax highlighting, so give it a shot.
 
Old 03-30-2005, 10:21 AM   #15
Avatar
Member
 
Registered: May 2001
Location: Canada
Distribution: old ones
Posts: 555

Original Poster
Rep: Reputation: 33
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Which light text editor can copy text from file and paste in browser? davidas Linux - Software 9 03-06-2006 11:28 AM
How to find and change a specific text in a text file by using shell script Bassam Programming 1 07-18-2005 07:15 PM
text editor dauphinfay Linux - General 2 02-29-2004 09:37 PM
vi text editor keevitaja Linux - Newbie 4 08-23-2002 03:13 PM
How to 'Find and Replace' text in vi editor? concoran Programming 2 11-21-2001 09:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration