Collin Reynolds
Collin Reynolds

Reputation: 397

Python-mode in Vim not autoindenting on newline

I have the python-mode vim plugin installed, and it checks syntax correctly, but it does not automatically indent code when I start a new line.

I'm not sure what might be preventing this, so here's my vimrc.

.vimrc:

"" Pathogen settings
filetype off
call pathogen#infect()
call pathogen#helptags()
filetype plugin on

set nocompatible

" Change leader
let mapleader = ","

" Set color scheme
colorscheme badwolf

" Code settings
syntax on
set textwidth=100
set colorcolumn=100
set tabstop=8
set softtabstop=4
set shiftwidth=4
set autoindent
set expandtab
set nowrap
set textwidth=0 wrapmargin=0

set relativenumber
set number
set ruler

" Make it so jk returns to normal mode
inoremap jk <esc>

" Easy editing/sourcing of vimrc
nnoremap <leader>ev :vsplit $MYVIMRC<cr>
nnoremap <leader>sv :source $MYVIMRC<cr>

" Useful shortcuts
nnoremap <leader>w :w<cr>
nnoremap <leader>q :q<cr>
nnoremap <leader><space> bi<space><esc>ea<space><esc>

" Plugin shortcuts
nnoremap <c-n> :NERDTreeToggle<cr>
nnoremap <c-k> <c-w>k
nnoremap <c-j> <c-w>j
nnoremap <c-l> <c-w>l
nnoremap <c-h> <c-w>h

nnoremap <leader>l :TagbarToggle<cr>
nnoremap <leader>td <Plug>TaskList
nnoremap <leader>g :GundoToggle<cr>


" Vimscript file settings ---------- {{{
augroup filetype_vim
  autocmd!
  autocmd FileType vim setlocal foldmethod=marker
augroup END
" }}}

" Python file settings ---------- {{{
augroup filetype_python
  autocmd!
  autocmd FileType python setlocal foldmethod=indent
  autocmd FileType python set foldlevel=99
" }}}

Plugins I have installed:

ack        git        minibufexpl.vim  snipmate  tagbar
command-t  gundo      nerdtree         supertab  tasklist
fugitive   makegreen  python-mode      surround  vim-airline

Upvotes: 1

Views: 561

Answers (1)

Alex
Alex

Reputation: 19104

Change filetype plugin on to filetype indent plugin on

Upvotes: 2

Related Questions