1

What happens in my vim editor is --> LOOK AT THE CURSOR...

int main() {|

After pressing enter.. The cursor always comes at the beginning of the line, it does not indent automatically !!

int main() {
|
}

OR

int main() {
    if () {
|
    }
}

What I want is...

int main() {
    |
}

the cursor to have 2 or 4 white-space indentation !!

How can I do this ??

My .vimcr:

" when I close tab, remove the buffer
set nohidden

" Highlight things that we find with the search
set hlsearch

" Incremental searching 
set incsearch

set smartcase

" Enable mouse support in console
set mouse=a

" Line numbers PWN!
set number 

set shiftwidth=3
set softtabstop=3

set smarttab

set autoindent
set smartindent 
set tabstop=4
set shiftwidth=4
set expandtab

inoremap {<cr> {<CR><CR>}<Esc>-cc
1
  • Add the ouput of :filetype and :set filetype? Commented Dec 16, 2019 at 17:09

1 Answer 1

1

Well I sorted out the solution myself, just remove smartindent !!!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.