Friday, October 28, 2011

Filetype error

For the longest of times my .vimrc has looked as follows:

"Because some options may not be vi compatible
set nocompatible

"Turns on filetype plugins
filetype plugin on
filetype indent on

"Ignore case when searching
set ignorecase
set smartcase

"Highlight searches
set hlsearch

"Toggles the highliting off with ctrl+n
:map <silent> <C-n> :set invhlsearch<CR>

"Shows matches as they are found
set incsearch

"Remove trailing whitespace
autocmd FileType c,cpp,java,php,js,python,ruby autocmd BufWritePre <buffer> :call setline(1,map(getline(1,"$"),'substitute(v:val,"\\s\\+$","","")'))

"use spaces instead of tab
set expandtab
set smarttab

"Changes tab amount
set shiftwidth=4
set softtabstop=4

"Maps jj to esc for faster exit of insert modes 
imap jj <Esc>

"Turns on syntax coloring
syntax on

"Enable line numbers
set number
set numberwidth=3

"Normal backspace operation
set backspace=indent,eol,start

But now for some reason whenever I type the comment character for the particular language I am using, the character is repeated on the next line.  For example if i am editing test.cpp if i type:

//Comment

Then press enter the file now looks as follows:
//Comment
//

Through editing out the different options I have boiled the problem down to the filetype plugin on.  And was wondering if anyone knows a fix for this.  And if it helps, my .vim/ftplugin directory is empty.

--
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: