From 9c6ecb6426e2bc1c346ad70b8d79bf887590436c Mon Sep 17 00:00:00 2001 From: DarkWiiPlayer Date: Fri, 17 Jul 2020 13:24:51 +0200 Subject: [PATCH] Extract vim indent code into plugin --- vim/plugin/indent.vim | 21 +++++++++++++++++++++ vim/plugin/shame.vim | 17 ----------------- 2 files changed, 21 insertions(+), 17 deletions(-) create mode 100644 vim/plugin/indent.vim diff --git a/vim/plugin/indent.vim b/vim/plugin/indent.vim new file mode 100644 index 0000000..a28cce6 --- /dev/null +++ b/vim/plugin/indent.vim @@ -0,0 +1,21 @@ +if exists("$EXPANDTAB") + set expandtab +else + set noexpandtab +end + +if exists("$TABSTOP") + let &tabstop=str2nr($TABSTOP) +else + set tabstop=3 +end + +" Just use the value of &tabstop +set shiftwidth=0 +" I use proper tabstop anyway +set softtabstop=0 +" Don't use shiftwidth for indentation +set nosmarttab +set autoindent +set smartindent +set smarttab diff --git a/vim/plugin/shame.vim b/vim/plugin/shame.vim index 0f078a9..2a1e27b 100644 --- a/vim/plugin/shame.vim +++ b/vim/plugin/shame.vim @@ -74,23 +74,6 @@ set nowb " set noswapfile set swapfile -" Indentation, etc. -if exists("$EXPANDTAB") - set expandtab -else - set noexpandtab -end -if exists("$TABSTOP") - let &tabstop=str2nr($TABSTOP) -else - set tabstop=3 -end -set shiftwidth=0 " Not needed -set softtabstop=0 " Not needed -set smarttab -set autoindent -set smartindent -set smarttab set gdefault " set wrap