Re: (G)Vim Oddity
2005/12/20, Joris Huizer <jorishuizer@planet.nl>:
> Heimdall Midgard wrote:
> > I just noticed something weird with my (G)Vim installation
> > when editing generic config files. The syntax highlighting
> > colors appear wrong. Could somebody do a test to confirm if
> > this is really a bug or just a misconfiguration on my end?
> >
> > To do the test, create two files both named "udev.rules"
> > (perhaps in two different directories to avoid any
> > collision).
> >
> > Put the following lines (with no blank lines above, below or
> > between them) in the first file:
> >
> > # Line 1 is a comment colored Blue
> > # Line 2 is a comment colored Blue
> > Line 3 is not a comment, so is colored Black
> > # Line 4 is a comment but colored Black
> >
> > And put the following lines (again with not blank lines
> > abover, below or between them) in the second file:
> >
> > # Line 1 is a comment colored Blue
> > # Line 2 is a comment colored Blue
> > Line 3 is not a comment, so is colored Black ()
> > # Line 4 is a comment now colored Blue
> >
> > Now open the file in GVim. The dummy text of the two files
> > should explain the problem. GVim displays the text in the
> > colors I listed for each line. The colors for console-mode
> > Vim should differ slightly but should display the same
> > pattern.
> >
> > Note how addition of a pair of parentheses to Line 3 of the
> > second file "causes" Line 4 to be displayed in the right
> > "comment" color.
> >
> > --
> > Albert Einstein: Phantasie ist wichtiger als Wissen, denn
> > Wissen ist begrenzt.
> >
> >
>
> Seeing this too... but I do not know much about gvim highlighting so I
> can only attach my ~/.vimrc to help ?
> (no system-wide changes made)
>
> HTH,
>
> Joris
>
>
> " An example for a vimrc file.
> "
> " Maintainer: Bram Moolenaar <Bram@vim.org>
> " Last change: 2002 May 28
> "
> " To use it, copy it to
> " for Unix and OS/2: ~/.vimrc
> " for Amiga: s:.vimrc
> " for MS-DOS and Win32: $VIM\_vimrc
> " for OpenVMS: sys$login:.vimrc
>
> " When started as "evim", evim.vim will already have done these settings.
> if v:progname =~? "evim"
> finish
> endif
>
> " Use Vim settings, rather then Vi settings (much better!).
> " This must be first, because it changes other options as a side effect.
> set nocompatible
>
> " allow backspacing over everything in insert mode
> set backspace=indent,eol,start
>
> set autoindent " always set autoindenting on
> "if has("vms")
> set nobackup " do not keep a backup file, use versions instead
> "else
> " set backup " keep a backup file
> "endif
> set history=50 " keep 50 lines of command line history
> set ruler " show the cursor position all the time
> set showcmd " display incomplete commands
> set incsearch " do incremental searching
>
> " For Win32 GUI: remove 't' flag from 'guioptions': no tearoff menu entries
> " let &guioptions = substitute(&guioptions, "t", "", "g")
>
> " Don't use Ex mode, use Q for formatting
> map Q gq
>
> " This is an alternative that also works in block mode, but the deleted
> " text is lost and it only works for putting the current register.
> "vnoremap p "_dp
>
> " 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
>
> " don't make it look like there are line breaks where there aren't:
> " set nowrap
>
> " use indents of 2 spaces, and have them copied down lines:
> set shiftwidth=2
> set shiftround
> set expandtab
> set autoindent
>
>
> au BufNewFile,BufRead * set cindent
> " au BufNewFile,BufRead *.c *.js *.cc *.cpp set cindent
>
>
> " Only do this part when compiled with support for autocommands.
> if has("autocmd")
>
> " Enable file type detection.
> " Use the default filetype settings, so that mail gets 'tw' set to 72,
> " 'cindent' is on in C files, etc.
> " Also load indent files, to automatically do language-dependent indenting.
> " filetype plugin indent on
>
> " For all text files set 'textwidth' to 78 characters.
> autocmd FileType text setlocal textwidth=78
>
> " When editing a file, always jump to the last known cursor position.
> " Don't do it when the position is invalid or when inside an event handler
> " (happens when dropping a file on gvim).
> autocmd BufReadPost *
> \ if line("'\"") > 0 && line("'\"") <= line("$") |
> \ exe "normal g`\"" |
> \ endif
>
> endif " has("autocmd")
>
>
>
>
1) what version ov vim?
2) syntax realted things are in
/usr/share/vim/vim63/syntax
how vim identify a file type shold be written in
/usr/share/vim/vim63/filetype.vim
anyway i do not think it is a bug. What files are supposed to be the
two you created? they have not a recognizable syntax. It is just that
vim thinks that your file is of a certain type and the related syntax
highlight is applied.
PAolo
--
If you feel is a good idea, pleas correct my poor English
if you have a minute to spend pleas visit my photogrphy site:
http://mypic.altervista.org
Reply to: