Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

customise vim 1

Status
Not open for further replies.

hok1man

Technical User
Feb 16, 2008
102
Hi guys,

do you know how to customise vim in colour? because my vim has no colour,

Thanks,
Regards,
 
Hi

You mean to enable syntax highlighting ?
Code:
:syntax on
And if you do not like the default highlighting scheme, change it. For example :
Code:
:colorscheme blue

Feherke.
 
Hi Feherke,

Thanks for your reply,
after I put :syntax on
the reply is
Can't open file /opt/vim/5.4.0.0/solaris/share/vim/syntax/syntax.vim

that file doesn't exist.
is there anywhere I can download this file and change the path of this file?

thanks
 
Hi

Sorry, my knowledge ends here. I am not a [tt]vim[/tt] fan.

( By the way, this question has nothing to do with scripting. forum80 would be a better place to post it. )

Feherke.
 
I use vim on windows AND LOVE IT!!! If you are forced to edit files in a Windows environment and want to use vi then vim is the best tool EVER!

I don't know if my syntax.vim is the same, but here is the code for it. Just create the file you mentioned is missing and put this code in it. Good luck:
Code:
" Vim syntax support file
" Maintainer:	Bram Moolenaar <Bram@vim.org>
" Last Change:	2001 Sep 04

" This file is used for ":syntax on".
" It installs the autocommands and starts highlighting for all buffers.

if !has("syntax")
  finish
endif

" If Syntax highlighting appears to be on already, turn it off first, so that
" any leftovers are cleared.
if exists("syntax_on") || exists("syntax_manual")
  so <sfile>:p:h/nosyntax.vim
endif

" Load the Syntax autocommands and set the default methods for highlighting.
runtime syntax/synload.vim

" Load the FileType autocommands if not done yet.
if exists("did_load_filetypes")
  let s:did_ft = 1
else
  filetype on
  let s:did_ft = 0
endif

" Set up the connection between FileType and Syntax autocommands.
" This makes the syntax automatically set when the file type is detected.
augroup syntaxset
  au! FileType *	exe "set syntax=" . expand("<amatch>")
augroup END


" Execute the syntax autocommands for the each buffer.
" If the filetype wasn't detected yet, do that now.
" Always do the syntaxset autocommands, for buffers where the 'filetype'
" already was set manually (e.g., help buffers).
doautoall syntaxset FileType
if !s:did_ft
  doautoall filetypedetect BufRead
endif
However, if you are missing this file, I would think that your install of vim is incomplete. You would probably be better served getting a current complete vim install for your OS.

Einstein47 (Starbase47.com)
“Never put both feet in your mouth at the same time.
Because then you won't have a leg to stand on.“

- Unknown
 
Hi Einstein47,

I downloaded the package of vim runtime environment.
so got .vimrc now,

but I got other problem which is it showing bold font and underline...

do you how to customise the vim syntax.

I tried syntax on, but it didn't change anything...
is there any file that I should look on or check?

Thanks,
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top