Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 18th August 2006, 09:55 PM
bbeverage Offline
Registered User
 
Join Date: Jul 2006
Age: 40
Posts: 8
VI syntax highlighting as root

If I use vi as a regular user it highlights perfectly. If I change to root and edit something it only displays as white background and black text.
Can vi be set to syntax highlight as root just as a regular user?

Thanks in advance,
Brian
Reply With Quote
  #2  
Old 19th August 2006, 01:13 AM
icydog Offline
Registered User
 
Join Date: Nov 2005
Posts: 447
I'd like to know how to get this working as well...
Reply With Quote
  #3  
Old 19th August 2006, 02:17 AM
ccrvic Offline
Registered User
 
Join Date: Apr 2006
Posts: 1,092
Quote:
Originally Posted by bbeverage
Can vi be set to syntax highlight as root just as a regular user?
Yes.

Have a look in /root for any .vimrc files you might find - they'll override /etc/vimrc, which is normally where you'd find the config.

If there's nothing there, have a look through /etc/vimrc to see if there's anything in there that turns off colouring for root...

Vic.
Reply With Quote
  #4  
Old 19th August 2006, 12:46 PM
pete_1967 Online
Clueless in a Cuckooland
 
Join Date: Mar 2006
Location: Here now, elsewhere tomorrow.
Posts: 3,929
Just copy your .vimrc from user to /root, if you use Gvim (aka evim), copy .gvimrc as well. Plugins and extensions etc you can either keep in user space or always install into /usr/share/vim#
Reply With Quote
  #5  
Old 19th August 2006, 10:23 PM
bbeverage Offline
Registered User
 
Join Date: Jul 2006
Age: 40
Posts: 8
I made a copy of .vimrc under user and put it in root. changed the owner and group to root. Still not working for root. I also looked through the .vimrc file I can not see anywhere that makes an exception for highlighting as root.
Reply With Quote
  #6  
Old 19th August 2006, 10:33 PM
bbeverage Offline
Registered User
 
Join Date: Jul 2006
Age: 40
Posts: 8
here is a copy of the vimrc file:
if v:lang =~ "utf8$" || v:lang =~ "UTF-8$"
set fileencodings=utf-8,latin1
endif

set nocompatible " Use Vim defaults (much better!)
set bs=2 " allow backspacing over everything in insert mode
"set ai " always set autoindenting on
"set backup " keep a backup file
set viminfo='20,\"50 " read/write a .viminfo file, don't store more
" than 50 lines of registers
set history=50 " keep 50 lines of command line history
set ruler " show the cursor position all the time

" Only do this part when compiled with support for autocommands
if has("autocmd")
" In text files, always limit the width of text to 78 characters
autocmd BufRead *.txt set tw=78
" When editing a file, always jump to the last cursor position
autocmd BufReadPost *
\ if line("'\"") > 0 && line ("'\"") <= line("$") |
\ exe "normal! g'\"" |
\ endif
endif

if has("cscope") && filereadable("/usr/bin/cscope")
set csprg=/usr/bin/cscope
set csto=0
set cst
set nocsverb
" add any database in current directory
if filereadable("cscope.out")
cs add cscope.out
" else add database pointed to by environment
elseif $CSCOPE_DB != ""
cs add $CSCOPE_DB
endif
set csverb
endif

" 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

if &term=="xterm"
set t_Co=8
set t_Sb=[4%dm
set t_Sf=[3%dm
endif


Thanks,
Brian
Reply With Quote
Reply

Tags
highlighting, root, syntax

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
emacs: syntax highlighting daniel_I_l Using Fedora 1 3rd October 2008 08:46 AM
turn on syntax highlighting in vi as root susmit_koirala Using Fedora 2 11th September 2007 04:39 PM
No syntax and color highlighting kishore25 Using Fedora 4 13th July 2006 08:57 AM
Emacs syntax highlighting wrong for c++ Anomaly Using Fedora 3 19th April 2005 08:51 AM


Current GMT-time: 08:36 (Friday, 24-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat