Copyright (C) 2002-2010 Philippe Fremy
Copyright (C) 2013-2018 Steven Myint
This program is distributed under the BSD license. You should have received
a copy of the file LICENSE.txt
along with this software.
indent-finder is a vim plugin that detects the indentation of a file and sets vim's indentation settings appropriately to match.
Make sure set nocompatible
is in your ~/.vimrc
.
To install this plugin, copy the contents of the plugin directory to your
~/.vim/plugin
directory:
$ git clone https://github.com/myint/indent-finder $ mkdir -p ~/.vim/plugin/ $ cp -r ./indent-finder/plugin/* ~/.vim/plugin/
Or to install it using pathogen.vim:
$ cd ~/.vim/bundle $ git clone https://github.com/myint/indent-finder
To use from command line:
$ ./indent_finder.py test_files/space1/one.cc space 1
- Always use tabs for makefiles.
- Clean up code.
- Respect user's
expandtab
andshiftwidth
settings. - Detect indentation on all files and not just files with
.
in them.
- Support one-space indentation.
- Improve performance.
- Simplify installation process.
- Detect when files have no valid indentation.
- Add Python 3 support.
- Default to user's
tabstop
when necessary.
- Improve the heuristic, some file where incorrectly reported as tab when being mixed.
('tab', 4)
was returned instead ofDEFAULT_OUTPUT
when no decision could be made. This is now configurable.vim_output()
now includes a comment about the detected indentation.
- The --vim-output was not working. Fixed in this version.
- Remove indent_checker, this was a useless program.
- Improve the indentation algorithm to be able to detect mixed type indentation.
- Detect mixed type indentation, like the one used in Vim source files.
- Add indent_checker, to check the consistency of the indentation of a source tree.
- Improve the heuristic by detecting indentation steps.