Wednesday, September 19, 2012

Re: Yellow box at the end of each line

On Wednesday, September 19, 2012 9:22:27 AM UTC-5, rudra wrote:
> Dear friends,
>
> I am using vim-latex(http://vim-latex.sourceforge.net) and
>
> fortran_codecomplete(http://www.vim.org/scripts/script.php?script_id=2487)
>
>
>
> for my everyday use.
>
> My vimrc is as follows:
>
> $ cat .vimrc
>
> set autoindent
>
> set smartindent
>
> set hlsearch
>
> set incsearch
>
> set ignorecase
>
> set smartcase
>
> set novisualbell
>
> set paste
>
> set ruler
>
> set expandtab
>
> set smarttab
>
> set shiftwidth=3
>
> set softtabstop=3
>
> "set mouse=a "enable mouse
>
> set nu "show line number
>
> "set cul "highlight current line
>
>
>
> if version >= 700
>
> set spell spl=en_us
>
> set nospell
>
> nmap <F7> :set spell!
>
> endif
>
>
>
> " Fortran stuff
>
> let fortran_do_enddo=1
>
> let fortran_more_precise=1
>
> let fortran_free_source=1
>
>
>
> filetype on
>
> filetype plugin on
>
> filetype indent on
>
>
>
> syntax enable
>
>
>
> " Always jump to last edited line
>
> if has("autocmd")
>
> au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")
>
> \| exe "normal! g'\"" | endif
>
> endif
>
>
>
> "let g:Imap_UsePlaceHolders = 0
>
> set sw=2
>
> set iskeyword+=:
>
>
>
>
>
> The problem is, whenever I open a file with gvim, the last word of each
>
> line is ^M. Though, it does not create any problem in compilation, its
>
> odd and irritating to have a yellow box at each line.
>
> is there anyway to do with this?
>
>
>
> In my humble knowledge, this is caused by fortran codecomplete, but not
>
> sure. The fileformat, checked using set ff? returns unix.

It seems a file with DOS fileformat is not being detected properly by Vim.

What does this tell you?

:verbose set fileformats?

The string returned should contain "dos". The default for 'fileformats' contains "dos" on most systems, but a system .vimrc might be interfering. If so, setting it to "unix,dos" in your .vimrc might fix your problem.

If your 'fileformats' option already contains "dos", then likely the file you're editing does not actually contain a ^M on EVERY line, but just MOST lines (i.e. it is ALMOST DOS-format, but not quite). Try doing :e ++ff=dos after you've loaded the file.

See http://vim.wikia.com/wiki/Automatically_reload_files_with_mixed_line-endings_in_DOS_fileformat to make this happen automatically.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment