Tip 28Setting Buffer-Local Configuration Per Project

Autocommands and ftplugins allow you to apply settings to all files of a particular filetype. But what if you want to apply settings to files within a directory? Vim doesn’t have a built-in mechanism for this, but you can achieve this effect using the Projectionist plugin.

Preparation

In this tip, you’ll use two plugins: Projectionist by Tim Pope,[57] and ALE by Andrew Wray.[58] You can install these to your bundle package like this:

=> $ cd $VIMCONFIG/pack/bundle/start
=> $ git clone https://github.com/tpope/vim-projectionist.git
=> $ git clone https://github.com/w0rp/ale.git

Run :helptags ALL to index the documentation for these plugins.

The Projectionist plugin is the main ...

Get Modern Vim now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.