From 3dd614db61ed0c317c670d2f8cd0d2c5985e9927 Mon Sep 17 00:00:00 2001 From: ayazhafiz Date: Wed, 21 Aug 2019 21:43:24 -0500 Subject: [PATCH] docs: add information about running clang-format with Vim (#32254) A clang-format plugin for Vim must point to the npm-installed clang-format command. Add docs for this. PR Close #32254 --- docs/DEVELOPER.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/DEVELOPER.md b/docs/DEVELOPER.md index 054953f460..75b0b95952 100644 --- a/docs/DEVELOPER.md +++ b/docs/DEVELOPER.md @@ -107,6 +107,17 @@ It will automatically pick up the settings from Angular's [settings.json](../.vs 1. Add `/angular/node_modules/clang-format/bin//` where the OS options are: `darwin_x64`, `linux_x64`, and `win32`. +### Vim +1. Install [Vim Clang-Format](https://github.com/rhysd/vim-clang-format). +2. Create a [project-specific `.vimrc`](https://andrew.stwrt.ca/posts/project-specific-vimrc/) in + your Angular directory containing + +```vim +let g:clang_format#command = '$ANGULAR_PATH/node_modules/.bin/clang-format' +``` + +where `$ANGULAR_PATH` is an environment variable of the absolute path of your Angular directory. + ## Linting/verifying your source code You can check that your code is properly formatted and adheres to coding style by running: