Streamlined ruby autoretabbing

This commit is contained in:
Talia 2017-11-01 06:54:16 +01:00 committed by GitHub
parent ebf84e7d34
commit 18335cc569

10
vimrc
View file

@ -419,15 +419,11 @@ endfunction
augroup rbindent augroup rbindent
autocmd! autocmd!
au BufNewFile,BufRead *.rb :set noexpandtab au BufNewFile,BufRead *.rb :set noexpandtab :retab!
au BufNewFile,BufRead *.rb :retab!
au BufWritePre *.rb :set expandtab au BufWritePre *.rb :let ts = &tabstop | set expandtab | set tabstop=2 | retab | let &tabstop=ts
au BufWritePre *.rb :set tabstop=2 " TODO: find a way to change it back to whatever it was before
au BufWritePre *.rb :retab
au BufWritepost *.rb :set noexpandtab au BufWritepost *.rb :set noexpandtab :silent! :undo :normal <S-tab>
au BufWritepost *.rb :silent! :undo :normal <S-tab>
augroup END augroup END
" --- Lua Stuff --- " --- Lua Stuff ---