LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 02-10-2005, 10:27 PM   #1
pranith
Member
 
Registered: Sep 2004
Location: Hyd,India
Posts: 83

Rep: Reputation: 15
how to get colors in emacs and vim


hi,
I am using ubuntu.I want to get colors in emacs and vi editors plz tell me how to do that
thanks in anticipation
bye,
pranith
 
Old 02-11-2005, 12:35 AM   #2
hw-tph
Senior Member
 
Registered: Sep 2003
Location: Sweden
Distribution: Debian
Posts: 3,032

Rep: Reputation: 58
I'm not a big fan of emacs but I can help you with vim: Create two files in your home directory: ~/.vimrc and ~/.gvimrc.

Put this in your ~/.vimrc:
Code:
set nocompatible
syntax on
And here's a dead simple .gvimrc:
Code:
so ~/.vimrc
This tells vim not try to be fully compatible with the old vi editor, and it should display colors. The contents of the .gvimrc just makes gvim (vim with GTK2 graphical interface) use the same settings as when you run vim in console mode (it uses the ~/.vimrc file, which it normally wouldn't).

Here's my .vimrc:
Code:
set nocompatible
syntax on
set showmatch
set showmode
set ic
set vb
set mouse=a

" Make vim silent
set noerrorbells
set vb

" Tabs and indenting
set ts=4
set sw=4
set smarttab
set autoindent
set smartindent


""""" Mappings
" Get rid of highlighted search hits
nmap <silent> <C-N> :silent noh<CR>

" Indent the current code block
nmap <silent> <C-I> >i{
...and here's my .gvimrc:
Code:
so ~/.vimrc
set guifont=ProggySquareTT\ 12
colo oceanlight
Hope that helps!

Håkan
 
  


Reply



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
what controls colors in vi/vim? pfaendtner Linux - Software 3 03-24-2005 05:51 PM
regarding colors in vim and emacs pranith Linux - Newbie 0 02-10-2005 03:10 AM
vim colors Erik Thorsson Debian 1 02-09-2005 09:38 AM
VIM 6.3.13 Colors not displaying correctly schurt Fedora 0 07-22-2004 05:08 PM
vim suddenly changed colors??? spyghost Linux - Software 5 08-27-2003 10:13 AM

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

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