diff options
author | Daniel Jasper <djasper@google.com> | 2013-03-22 12:44:20 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2013-03-22 12:44:20 +0000 |
commit | 41723757138cc1ce64fc445e85ae95609f14f2f8 (patch) | |
tree | 3254ccf8fcfddae4da7e2fbc4d6ab5e37e8c4267 /clang/docs/ClangFormat.rst | |
parent | ecbf64648fc164efce0570579a781d341369fc95 (diff) | |
download | bcm5719-llvm-41723757138cc1ce64fc445e85ae95609f14f2f8.tar.gz bcm5719-llvm-41723757138cc1ce64fc445e85ae95609f14f2f8.zip |
Update docs after moving clang-format from clang-tools-extra to cfe.
llvm-svn: 177729
Diffstat (limited to 'clang/docs/ClangFormat.rst')
-rw-r--r-- | clang/docs/ClangFormat.rst | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/clang/docs/ClangFormat.rst b/clang/docs/ClangFormat.rst index f5c0b4c1fb9..92d7fc319e1 100644 --- a/clang/docs/ClangFormat.rst +++ b/clang/docs/ClangFormat.rst @@ -10,9 +10,8 @@ standalone tool and editor integrations. Standalone Tool =============== -:program:`clang-format` is part of the `clang/tools/extra` (see -:doc:`ClangTools <ClangTools>`) repository and can be used to format -C/C++/Obj-C code. +:program:`clang-format` is located in `clang/tools/clang-format` and can be used +to format C/C++/Obj-C code. .. code-block:: console @@ -35,7 +34,7 @@ C/C++/Obj-C code. -length=<int> - Format a range of this length, -1 for end of file. -offset=<int> - Format a range starting at this file offset. -stats - Enable statistics output from program - -style=<string> - Coding style, currently supports: LLVM, Google. + -style=<string> - Coding style, currently supports: LLVM, Google, Chromium. -version - Display the version of this program @@ -45,18 +44,18 @@ Vim Integration There is an integration for :program:`vim` which lets you run the :program:`clang-format` standalone tool on your current buffer, optionally selecting regions to reformat. The integration has the form of a `python`-file -which can be found under `clang/tools/extra/clang-format/clang-format.py`. +which can be found under `clang/tools/clang-format/clang-format.py`. This can be integrated by adding the following to your `.vimrc`: .. code-block:: vim - map <C-I> :pyf <path-to-this-file>/clang-format.py<CR> - imap <C-I> <ESC>:pyf <path-to-this-file>/clang-format.py<CR>i + map <C-K> :pyf <path-to-this-file>/clang-format.py<CR> + imap <C-K> <ESC>:pyf <path-to-this-file>/clang-format.py<CR>i The first line enables :program:`clang-format` for NORMAL and VISUAL mode, the -second line adds support for INSERT mode. Change "C-I" to another binding if -you need :program:`clang-format` on a different key (C-I stands for Ctrl+i). +second line adds support for INSERT mode. Change "C-K" to another binding if +you need :program:`clang-format` on a different key (C-K stands for Ctrl+k). With this integration you can press the bound key and clang-format will format the current line in NORMAL and INSERT mode or the selected region in @@ -70,7 +69,7 @@ or save any files. To revert a formatting, just undo. Script for patch reformatting ============================= -The python script `clang/tools/extra/clang-format-diff.py` parses the output of +The python script `clang/tools/clang-format-diff.py` parses the output of a unified diff and reformats all contained lines with :program:`clang-format`. .. code-block:: console |