LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-18-2008, 05:51 PM   #1
ufmale
Member
 
Registered: Feb 2007
Posts: 386

Rep: Reputation: 30
color syntax in vi for root


I am trying to setup a color syntax for vi. I was successfully set it up by creating writing "syntax on" in the .vimrc at the home/user1/ directory.

However, i cannot get it to work for root user. I copy the .vimrc from /home/user1/.vimrc to the /root/ . I am not sure if there is any limitation on using this file for root user? i am using fedora 7.
 
Old 01-18-2008, 05:56 PM   #2
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,836
Blog Entries: 1

Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251
Try:

Quote:
/usr/share/vim/vimrc
System wide Vim initializations.
 
Old 01-18-2008, 06:27 PM   #3
ufmale
Member
 
Registered: Feb 2007
Posts: 386

Original Poster
Rep: Reputation: 30
I don't have the /usr/share/vim/vimrc file,
but there are /usr/share/vim/vim71/ and /usr/share/vim/vimfiles

I try to create that file under vim71, but it did not work.
 
Old 01-18-2008, 07:18 PM   #4
marciobarbalho
Member
 
Registered: Dec 2007
Location: Brazil
Distribution: slackware 13
Posts: 151

Rep: Reputation: 30
Quote:
Originally Posted by ufmale View Post
I don't have the /usr/share/vim/vimrc file,
but there are /usr/share/vim/vim71/ and /usr/share/vim/vimfiles

I try to create that file under vim71, but it did not work.
In order to create the .vimrc file you have to run gvim on terminal:

root@localhost~# gvim &

then... menu Edit -> Startup Settings

type "i" to edit file and feel for typing anything you want
 
Old 02-06-2009, 07:29 AM   #5
sircharles4848
LQ Newbie
 
Registered: Feb 2009
Posts: 5

Rep: Reputation: 0
Quote:
Originally Posted by ufmale View Post
I am trying to setup a color syntax for vi. I was successfully set it up by creating writing "syntax on" in the .vimrc at the home/user1/ directory.

However, i cannot get it to work for root user. I copy the .vimrc from /home/user1/.vimrc to the /root/ . I am not sure if there is any limitation on using this file for root user? i am using fedora 7.

All I did was alias vi to vim, in my .bashrc file, then reload .bashrc

vi ~/.bashrc
alias vi='vim'
(save and exit)
(then run)
. ~/.bashrc
 
1 members found this post helpful.
Old 05-30-2012, 08:22 AM   #6
gacanepa
Member
 
Registered: May 2012
Location: San Luis, Argentina
Distribution: Debian
Posts: 205

Rep: Reputation: 27
Post

Quote:
Originally Posted by ufmale View Post
I am trying to setup a color syntax for vi. I was successfully set it up by creating writing "syntax on" in the .vimrc at the home/user1/ directory.

However, i cannot get it to work for root user. I copy the .vimrc from /home/user1/.vimrc to the /root/ . I am not sure if there is any limitation on using this file for root user? i am using fedora 7.
I apologize if replying to this post after such a long time is considered "bad forum practice" - just wanted to add something in case someone else is looking for the same answer. Besides, I think it contributes to document the solution.
In my case, I am running Debian Squeeze and the system-wide options for VI are located in /etc/vim/vimrc. Just uncomment the line "syntax on" and you're ready to go.
Also, if you want to show line numbers, add "set number" on another line.
 
  


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
CScope with color syntax ON amitpardesi Linux - General 2 09-22-2011 09:40 PM
how to use vim has color syntax on ubuntu pk_kala Ubuntu 4 09-08-2007 04:17 PM
VIM Color Syntax Highliting bsg Linux - Newbie 5 10-07-2005 08:31 PM
syntax highlighting/color FC4/vi overlord73 Fedora 3 07-15-2005 03:48 AM
emacs color-syntax highlighting with perl SerfurJ Linux - Software 2 09-22-2003 08:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:54 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