I am trying to re-indent a foo.html.erb
file, however when I do gg=G
everything gets aligned to the beginning of the line. I couldn't figure out why that happens. I've tried installing polyglot or putting eruby.vim
into ftplugin
but none of them worked.
:set filetype?
returns filetype=eruby
Here is my .vimrc
:
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
Plugin 'Valloric/YouCompleteMe'
Plugin 'bling/vim-airline' " Lean & mean status/tabline for vim
Plugin 'vim-airline/vim-airline-themes'
Plugin 'tpope/vim-rails'
Plugin 'tpope/vim-bundler'
Plugin 'tpope/vim-surround'
Plugin 'tpope/vim-commentary'
Plugin 'flazz/vim-colorschemes'
" Plugin 'vim-syntastic/syntastic'
Plugin 'preservim/nerdtree'
Plugin 'ntpeters/vim-better-whitespace'
Plugin 'jiangmiao/auto-pairs'
" Markdown support
Plugin 'godlygeek/tabular'
Plugin 'plasticboy/vim-markdown'
" ----------------
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList - lists configured plugins
" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
filetype on
filetype plugin on
filetype plugin indent on
" " ------- Syntastic options -------
" set statusline+=%#warningmsg#
" set statusline+=%{SyntasticStatuslineFlag()}
" set statusline+=%*
" let g:syntastic_always_populate_loc_list = 1
" let g:syntastic_auto_loc_list = 1
" let g:syntastic_check_on_open = 0
" let g:syntastic_check_on_wq = 0
" " ----------------------------------
autocmd FileType ruby setlocal shiftwidth=2 ts=2
autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab
set ai
set encoding=utf-8
set number
set ruler
set relativenumber
set clipboard=unnamed
set autoindent
set expandtab
set shiftwidth=4
set softtabstop=4
set tabstop=4
set textwidth=120
set pastetoggle=<F10>
nmap <F6> :NERDTreeToggle<CR>
" Search settings
"=====================================================
set hlsearch
" Syntastic options
let g:syntastic_ruby_checkers = ['rubocop']
" CTRLP vim
set runtimepath^=~/.vim/bundle/ctrlp.vim