LinuxQuestions.org
Help answer threads with 0 replies.
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 09-24-2013, 08:30 AM   #1
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 537

Rep: Reputation: 32
vi color


Hi,

The vi editor on one of the Linux hat no colors. I compare the /etc/vimrc with that on other Linux machines and they are the identical (100% the same).

Even I open the vi and type :syntax on, it doesn't change.

What could be the probelm?
 
Old 09-24-2013, 09:07 AM   #2
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian Jessie / sid
Posts: 1,471

Rep: Reputation: 444Reputation: 444Reputation: 444Reputation: 444Reputation: 444
maybe your vi is an 'original' vi or vim.tiny which do not support syntax highlighting
 
Old 09-25-2013, 01:59 AM   #3
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 537

Original Poster
Rep: Reputation: 32
Quote:
Originally Posted by Firerat View Post
maybe your vi is an 'original' vi or vim.tiny which do not support syntax highlighting
I don't think so. I just type vi by both maschines and they show the same information and version.
 
Old 09-25-2013, 02:15 AM   #4
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian Jessie / sid
Posts: 1,471

Rep: Reputation: 444Reputation: 444Reputation: 444Reputation: 444Reputation: 444
my .vimrc
Code:
" Uncomment the following to have Vim jump to the last position when
" reopening a file
if has("autocmd")
  au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
endif
" syntax highlighting
syntax on
if I do vim.tiny I get this
Code:
Error detected while processing /home/firerat/.vimrc:
line    7:
E319: Sorry, the command is not available in this version: syntax on
Press ENTER or type command to continue
and I get no syntax highlighting, but I do with vim, and vi ( both are symlinks to vim.basic via debian's 'update-alternatives' config )

actually.. just had a thought

what do you get from
Code:
ls {~/.vim/,/usr/share/vim/vim74/}{colors,syntax}
 
Old 09-25-2013, 04:07 AM   #5
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 537

Original Poster
Rep: Reputation: 32
I found out something.

If I type vim filename, the text is colored. And I can use syntax on/off to turn on/off the color. But strangely is: When I simply type vi, it shows followings:

Code:
~                                                                   VIM - Vi IMproved
~
~                                                                    version 7.0.237
~                                                               by Bram Moolenaar et al.
~                                                      Vim is open source and freely distributable
~
~                                                             Become a registered Vim user!
~                                                    type  :help register<Enter>   for information
~
~                                                    type  :q<Enter>               to exit
~                                                    type  :help<Enter>  or  <F1>  for on-line help
~                                                    type  :help version7<Enter>   for version info
I've even de-install the vim and install it again. The same result.
 
Old 09-25-2013, 04:17 AM   #6
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian Jessie / sid
Posts: 1,471

Rep: Reputation: 444Reputation: 444Reputation: 444Reputation: 444Reputation: 444
check what vi actually is

Code:
ls -l $(which vi)
probably a link to vim.tiny

, mine is version 7.4 ( debian ) , it could be that 7.0 fails silently


Which disto(s) are you using?

mind you, since vim is working might be best you just use that
 
Old 09-25-2013, 04:34 AM   #7
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 537

Original Poster
Rep: Reputation: 32
A very good tip.

On the machine where no color is, it links to /bin/vi

On the other machine where there is color is links to /usr/bin/vim

I think this is the point!

And I find on this machine if I type which vi, I get

Code:
# which vi
alias vi='vim'
        /usr/bin/vim
I wonder where is this alias defined?

Last edited by thomas2004ch; 09-25-2013 at 04:36 AM.
 
Old 09-25-2013, 04:53 AM   #8
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian Jessie / sid
Posts: 1,471

Rep: Reputation: 444Reputation: 444Reputation: 444Reputation: 444Reputation: 444
Don't know which distro you are using

try ~/.bashrc

But at the end of the day it is probably easier to use vim to get full functionality

if vim is started via a symlink or alias named vi , it will 'fall back' to vi compatibility mode and turn features off.
 
1 members found this post helpful.
  


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
Is there a palette app with a movable glass to convert text color code into a color? Xl1NntniNH7F Linux - General 2 08-08-2011 02:11 AM
Desktop environment color settings: do they affect web browser color? stf92 Linux - Newbie 2 06-14-2011 04:17 PM
Color registration bars on output: Lexmark C510 Color Laser printer spud_linux Linux - Hardware 2 10-06-2008 01:46 PM
REQ: Gimp plugin fo automatic color correction and color masks Rick069 Linux - Software 1 04-15-2007 04:10 PM
[COLOR=red]ENCORE WIRELESS PCI Card 802.11b [/COLOR] enrique145 Linux - Hardware 3 07-07-2004 03:31 PM

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

All times are GMT -5. The time now is 09:07 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration