suppose I have set cindent
in .vimrc
def func()
followed by Enter
, and then type end
, it is indented(not aligned to the def
)
How to reindent the end
keyword(align it to the def
).
Even using endwise.vim plugin
doesn't fix the problem
https://github.com/tpope/vim-endwise.git
It adds automatically the end
keyword but again indented
Try using smartindent
instead of cindent
(which follows C-like indent behaviour), and turn on the filetype specific indent.
You'll also probably need to turn off vi compatibility.
Try adding this to you .vimrc:
" Turn off vi compatibility
set nocompatible
set smartindent
set autoindent
" load indent file for the current filetype
filetype indent on