Set Vim's shiftwidth and tabstop based on directory
问题 I have a project I'm working on currently where the coding standard is to use 2 space indentation. On other projects, however, I use 4 space indentation. Is there an easy way to tell vim that all files within a certain directory should have a tabstop of 2 spaces? 回答1: The venerable Tim Pope just released a plugin call Sleuth, which automagically determines shiftwidth and tabstop (among other buffer options) based on what's used in the current file (or, incredibly, if it's a new buffer, based