Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hey everyone.
I just loaded FC4, and I noticed that when I open a file, such as /etc/inittab, it doesn't show it in color. It's just plain old gray on black.
I have some Linux experience, but never had to deal with configuring vi.
My FC3 machine has vi with colors, and it was like that ever since it was installed.
"enable syntax highlighting
syntax on
:colorscheme peachpuff (on my system)
Make certain that the syntax line is not commented out, and syntax highlighting is turned on.
For colorschemes, on SuSE, they're in two locations:
/opt/kde/share/vim/vim61/colors/peachpuff.vim and
/usr/share/vim/vim61/colors/peachpuff.vim
" 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
Now, I am in runlevel 3, so I *think* the above disables it...
I tried adding a " before the "if" and "endif", and it changed nothing.
Do I need to do anything to make changes in the vimrc active?
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")
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
You may not have vi aliased to vim.
The original vi does not have colours, it's a straight monochrome editor.
however a lot of systems alias vi => vim, which is vi_improved, which does colours and a lot more.
I have this cmd at the bottom of my .bash_profile file:
Thank you all.
The developers of FC4 changed the script for vi, under /etc/profile.d/ named vimrc.sh.
There are two lines that were added (lines 3 and 4). If you comment these out, you get vi aliased to vim. Go figure. Actually, I think that commenting only #4 will do the trick as well.
I personally think that there's an error in the script.
It runs the id command with the -u option, which generates a zero as a reply if you're root (root's uid is 0). It compares that number to 100, and if it's equal or less, it runs the "return" command, i.e. gets out of the script.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.