From 18335cc569f2aefb773898826cb1a7dffc3c8214 Mon Sep 17 00:00:00 2001 From: DarkWiiPlayer Date: Wed, 1 Nov 2017 06:54:16 +0100 Subject: [PATCH] Streamlined ruby autoretabbing --- vimrc | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/vimrc b/vimrc index 3d8b0ba..3f3934d 100644 --- a/vimrc +++ b/vimrc @@ -419,15 +419,11 @@ endfunction augroup rbindent autocmd! - au BufNewFile,BufRead *.rb :set noexpandtab - au BufNewFile,BufRead *.rb :retab! + au BufNewFile,BufRead *.rb :set noexpandtab :retab! - au BufWritePre *.rb :set expandtab - au BufWritePre *.rb :set tabstop=2 " TODO: find a way to change it back to whatever it was before - au BufWritePre *.rb :retab + au BufWritePre *.rb :let ts = &tabstop | set expandtab | set tabstop=2 | retab | let &tabstop=ts - au BufWritepost *.rb :set noexpandtab - au BufWritepost *.rb :silent! :undo :normal + au BufWritepost *.rb :set noexpandtab :silent! :undo :normal augroup END " --- Lua Stuff ---