vim-indent-detect

A Vim plugin for handeling indentation.
git clone https://git.ce9e.org/vim-indent-detect.git

commit
4c3b7716ce118b562eae9fea8ba2981c7ecbb8eb
parent
1b3f70681c53d54eb676b6477f501a2616090e6d
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2023-06-06 13:40
rm detectindent_preferred_expandtab

Diffstat

M README.md 4 ++--
M autoload/detectindent.vim 6 +++---
M plugin/detectindent.vim 3 ---

3 files changed, 5 insertions, 8 deletions


diff --git a/README.md b/README.md

@@ -10,8 +10,8 @@ A Vim plugin for handeling indentation.
   10    10 -	The settings can be overwritten manually by using the `Spaces [width]` and
   11    11 	`Tabs [width]` commands.
   12    12 
   13    -1 -	You can change the defaults by setting `g:detectindent_preferred_expandtab`
   14    -1 	and `g:detectindent_preferred_indent`.
   -1    13 -	You can change the default tab width by setting
   -1    14 	`g:detectindent_preferred_indent`.
   15    15 
   16    16 Inspired by [detectindent](https://github.com/ciaranm/detectindent) and
   17    17 [vim-sleuth](https://github.com/tpope/vim-sleuth).

diff --git a/autoload/detectindent.vim b/autoload/detectindent.vim

@@ -1,6 +1,6 @@
    1    -1 function! detectindent#Set(...)
    2    -1 	let &l:expandtab = get(a:, 1, g:detectindent_preferred_expandtab)
    3    -1 	let l:width = get(a:, 2, g:detectindent_preferred_indent)
   -1     1 function! detectindent#Set(expandtab, ...)
   -1     2 	let &l:expandtab = a:expandtab
   -1     3 	let l:width = get(a:, 1, g:detectindent_preferred_indent)
    4     4 
    5     5 	let &l:tabstop = l:width
    6     6 	let &l:shiftwidth = l:width

diff --git a/plugin/detectindent.vim b/plugin/detectindent.vim

@@ -1,9 +1,6 @@
    1     1 if !exists('g:detectindent_preferred_indent')
    2     2 	let g:detectindent_preferred_indent = 4
    3     3 endif
    4    -1 if !exists('g:detectindent_preferred_expandtab')
    5    -1 	let g:detectindent_preferred_expandtab = 1
    6    -1 endif
    7     4 
    8     5 command! -nargs=? Tabs call detectindent#Set(0, <f-args>)
    9     6 command! -nargs=? Spaces call detectindent#Set(1, <f-args>)