You are right.my runtimepath is wrong.
I updated vim to 7.0 using apt-get, but left the old vimrc unchanged.
I checked the vimrc and replaced /usr/share/vim/vim63 to
/usr/share/vim/vim70,
It is OK now.
thank you!
Peter Hodge wrote:
--- wangxu <[EMAIL PROTECTED]> wrote:
the results are
filetype=
syntax=
Why could this happen?
Not sure? Do you get any results if you type
:au filetypedetect * *.sh
You should see something like:
--- Auto-Commands ---
filetypedetect BufNewFile
*.sh call SetFileTypeSH(getline(1))
filetypedetect BufRead
*.sh call SetFileTypeSH(getline(1))
If you don't see any commands like those above, then the syntax will not work;
perhaps your 'runtimepath' is wrong?
Also, check the value of 'eventignore', it might prevent the FileType detection
from activating:
:set eventignore?
should show:
eventignore=
regards,
Peter
Peter Hodge wrote:
Hello,
Also you can use
:set ft? syntax?
to see which filetype has been detected, and which syntax has been
activated.
regards,
Peter
--- Xi Juanjie <[EMAIL PROTECTED]> wrote:
"syntax on" should be ok.
Please use :version to confirm your vim was compiled with "+syntax"
function and keep the corresponding syntax file in vim runtime folder.
Also to check if there has any "syntax off" in /etc/vim/vimrc.local.
wangxu wrote:
Why don't I have the syntax highlighting when editing files like *.sh
*.xml,etc?
After commands like "syntax on",still nothing happened.
below is my /etc/vim/vimrc,what else should I do to turn the syntax
highlighting on?
Thanks,
shell.
set
runtimepath=~/.vim,/etc/vim,/usr/share/vim/vimfiles,/usr/share/vim/addons,/usr/share/vim/vim63,/usr/share/vim/vimfiles,/usr/share/vim/addons/after,~/.vim/after
set nocompatible " Use Vim defaults instead of 100% vi compatibility
set backspace=indent,eol,start " more powerful backspacing
set autoindent " always set autoindenting on
set textwidth=0 " Don't wrap lines by default
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
set
suffixes=.bak,~,.swp,.o,.info,.aux,.log,.dvi,.bbl,.blg,.brf,.cb,.ind,.idx,.ilg,.inx,.out,.toc
if &term =~ "xterm-debian" || &term =~ "xterm-xfree86" || &term =~
"xterm"
set t_Co=16
set t_Sf=[3%dm
set t_Sb=[4%dm
endif
vnoremap p <Esc>:let current_reg = @"<CR>gvdi<C-R>=current_reg<CR><Esc>
syntax on
if has("autocmd")
" Enabled file type detection
" Use the default filetype settings. If you also want to load indent
files
" to automatically do language-dependent indenting add 'indent' as well.
filetype plugin on
endif " has ("autocmd")
augroup filetype
au BufRead reportbug.* set ft=mail
au BufRead reportbug-* set ft=mail
augroup END
try
if filereadable('/etc/papersize')
let s:papersize = matchstr(system('/bin/cat /etc/papersize'), '\p*')
if strlen(s:papersize)
let &printoptions = "paper:" . s:papersize
endif
unlet! s:papersize
endif
catch /E145/
endtry
if filereadable("/etc/vim/vimrc.local")
source /etc/vim/vimrc.local
endif
if &t_Co > 2 || has("gui_running")
syntax on
set hlsearch
endif
Send instant messages to your online friends http://au.messenger.yahoo.com
Send instant messages to your online friends http://au.messenger.yahoo.com