Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
How to set VIM (higlight syntax and so on)
How to set VIM (higlight syntax and so on)
Hello,
I can not find how to set VIM so that it higlight syntax (for exapmle bash scripts). I installed VIM package by using aptitude, but I dont have file .vimrc in my home directory. I found out that settings have to be written in this file. I can use command in VIM :"syntax on" but VIM showes syntax terrible. I think that is cause by some color setting. Can anybody help me with VIM settings?
Thanks for help.
I can not find how to set VIM so that it higlight syntax (for exapmle bash scripts). I installed VIM package by using aptitude, but I dont have file .vimrc in my home directory. I found out that settings have to be written in this file. I can use command in VIM :"syntax on" but VIM showes syntax terrible. I think that is cause by some color setting. Can anybody help me with VIM settings?
Thanks for help.
Re: How to set VIM (higlight syntax and so on)
Code: Select all
:syntax enable
I wish for a conjugal visit and world peace. (Don't want to seem selfish.)
Re: How to set VIM (higlight syntax and so on)
Have you tried /etc/vim/vimrc?
I don't know how :syntax on looks like. I edit said file (either copy it to my home or do it there, cause i want hightlighting for all)
I don't know how :syntax on looks like. I edit said file (either copy it to my home or do it there, cause i want hightlighting for all)
"I am not fine with it, so there is nothing for me to do but stand aside." M.D.
Re: How to set VIM (higlight syntax and so on)
Did you only install vim-tiny?
on and enable both work fine here.
on and enable both work fine here.
I wish for a conjugal visit and world peace. (Don't want to seem selfish.)
Re: How to set VIM (higlight syntax and so on)
Can you advise me how to change color settings? I mean how to add various "color theme". I have VIM and VIM-TINY. But I dont see diffrence.
Re: How to set VIM (higlight syntax and so on)
Worked out of the box for me.
Do you have syntax in your addons directory as above?
Code: Select all
/usr/share/vim/addons$ ls
doc indent plugin syntax
I wish for a conjugal visit and world peace. (Don't want to seem selfish.)
Re: How to set VIM (higlight syntax and so on)
Code: Select all
polo@Lenny:~$ ls /usr/share/vim/addons/
doc plugin
Re: How to set VIM (higlight syntax and so on)
Code: Select all
aptitude install vim-common vim-runtime
vim +'help syntax'
vim +'help colorscheme'
Screenshots: http://vimcolorschemetest.googlecode.co ... dex-c.html
Use a 256 color one if you're using a terminal or console.
Last edited by dbbolton on 2010-09-25 00:26, edited 2 times in total.
- stoffepojken
- Posts: 705
- Joined: 2007-01-25 01:21
- Location: Stockholm, Sweden
Re: How to set VIM (higlight syntax and so on)
If you have dark background in your terminal you can try "set background=dark" in your vimrc
Re: How to set VIM (higlight syntax and so on)
Code: Select all
sudo aptitude install vim-common vim-runtime
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
Reading task descriptions... Done
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 162 not upgraded.
Need to get 0B of archives. After unpacking 0B will be used.
W: Duplicate sources.list entry http://security.debian.org lenny/updates/non-free Packages (/var/lib/apt/lists/security.debian.org_dists_lenny_updates_non-free_binary-i386_Packages)
W: Duplicate sources.list entry http://volatile.debian.org lenny/volatile/main Packages (/var/lib/apt/lists/volatile.debian.org_debian-volatile_dists_lenny_volatile_main_binary-i386_Packages)
W: You may want to update the package lists to correct these missing files
Writing extended state information... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
Reading task descriptions... Done
Code: Select all
locate *vimrc*
/etc/vim/vimrc
/etc/vim/vimrc.tiny
/usr/share/vim/vimrc
/usr/share/vim/vimrc.tiny
/usr/share/vim/vim71/gvimrc_example.vim
/usr/share/vim/vim71/vimrc_example.vim
- Telemachus
- Posts: 4574
- Joined: 2006-12-25 15:53
- Been thanked: 2 times
Re: How to set VIM (higlight syntax and so on)
Actually, I don't think it's strange. You don't have one until you create one.mono wrote:It is strange that I dont have .vimrc file in my HOME... I dont have .vimrc at all. Thanks for useful links. ...
For syntax highlighting and indenting, you can start with this:
Code: Select all
" Most general settings first
set nocompatible " Set Vim rather than Vi settings; must go first
set noeb " Set no audio or visual error beep
set bs=indent,eol,start " Backspace over everything in insert mode
set history=500 " Keep 50 lines of command line history
set scrolloff=3 " A little breathing room
" Set items for view @ bottom of windows
set ruler " Show the cursor position all the time
set showcmd " Display incomplete commands
set showmode " Display current mode
set ls=2 " Always show status bar
" Syntax basics
syntax on
filetype indent on
filetype plugin on
set autoindent
set smartindent
"We have not been faced with the need to satisfy someone else's requirements, and for this freedom we are grateful."
Dennis Ritchie and Ken Thompson, The UNIX Time-Sharing System
Dennis Ritchie and Ken Thompson, The UNIX Time-Sharing System