matiit
matiit

Reputation: 8017

Vim, 8 spaces after { <ENTER>

I need to use four spaces as indent in project I'm working in. That is my .vimrc:

"Autouzupelnianie nawiasow
"inoremap { {<CR>}<C-O>O
inoremap { {}<LEFT>
inoremap [ []<LEFT>
inoremap ( ()<LEFT>

syntax on

set autoindent
set number "pokazywanie numerow lini
set modifiable
set write
filetype indent on "wlaczenie rozpoznawania wciec                                                                                                                
set showmatch "nawiasy                                                                                                                                           

"Backup                                                                                                                                                          
set backup                                                                                                                                                       
set backupdir=/home/mat/Backup/vim/                                                                                                                              

let g:html_use_css="1" "htmle uzywaja css                                                                                                                        

"Wrap                                                                                                                                                            
set linebreak                                                                                                                                                    
set wrap                                                                                                                                                         
set nolist                                                                                                                                                       

"Tabulacja                                                                                                                                                       
"                                                                                                                                                                
"set smartindent                                                                                                                                                 
set tabstop=4                                                                                                                                                    
set expandtab                                                                                                                                                    
set shiftwidth=4                                                                                                                                                 
set softtabstop=4                                                                                                                                                

"Plugin snippMate                                                                                                                                                
filetype plugin on   

But when i hit { and then hit enter i've got:

{
        <8 spaces> SOMETHING

Upvotes: 3

Views: 669

Answers (2)

mdsiaofficial
mdsiaofficial

Reputation: 80

I faced the same problem.

The solution is to command this after a colon :

set autoindent
set tabstop=4

Or you can command:

set tabstop=4 autoindent

Upvotes: 1

intuited
intuited

Reputation: 24044

Depending on the filetype, a filetype plugin may be overriding your vimrc settings. Check in $VIMRUNTIME/ftplugin/{filetype}.vim and $VIMRUNTIME/after/ftplugin/{filetype}.vim. Also $VIMRUNTIME/indent/{filetype}.vim and the after version of that.

Upvotes: 3

Related Questions