From baf49c557635764a73e82a42d963f1a795b2e8ba Mon Sep 17 00:00:00 2001 From: Kevin MacMartin Date: Mon, 6 Apr 2015 12:36:19 -0400 Subject: [PATCH] Restore original expandtab value after modifying tabs with t and T --- vim/config/keyboard.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vim/config/keyboard.vim b/vim/config/keyboard.vim index 681ba73..d3bc27b 100644 --- a/vim/config/keyboard.vim +++ b/vim/config/keyboard.vim @@ -729,8 +729,8 @@ nnoremap F ':Autoformat:echo "The document has been formatted with :Autoformat"' "convert tabs to spaces and spaces to tabs - nnoremap t ':set expandtab:retab!:echo "Tabs have been converted to spaces"' - nnoremap T ':set noexpandtab:%retab!:echo "Spaces have been converted to tabs"' + nnoremap t ':let b:et=&expandtab:set expandtab:retab!:let &expandtab=b:et:echo "Tabs have been converted to spaces"' + nnoremap T ':let b:et=&expandtab:set noexpandtab:%retab!:let &expandtab=b:et:echo "Spaces have been converted to tabs"' "remove trailing whitespace nnoremap w ':FixWhitespace:echo "Trailing whitespace has been removed"'