From ee1230cee4ed4b6ea600afd473925ef128cd0703 Mon Sep 17 00:00:00 2001 From: Dmitri Gribenko Date: Wed, 9 Jan 2013 22:18:55 +0000 Subject: ClangFormat.rst: improve formatting git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172007 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/ClangFormat.rst | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'docs/ClangFormat.rst') diff --git a/docs/ClangFormat.rst b/docs/ClangFormat.rst index 2fae3904d4..3272458e13 100644 --- a/docs/ClangFormat.rst +++ b/docs/ClangFormat.rst @@ -10,7 +10,7 @@ standalone tool and editor integrations. Standalone Tool =============== -`clang-format` is part of the `clang/tools/extra` (see +:program:`clang-format` is part of the `clang/tools/extra` (see :doc:`ClangTools `) repository and can be used to format C/C++/Obj-C code. @@ -42,10 +42,10 @@ C/C++/Obj-C code. Vim Integration =============== -There is an integration for `vim` which lets you run the `clang-format` -standalone tool on your current buffer, optionally selecting regions to -reformat. The integration has to form of a `python`-file which can be found -under `clang/tools/extra/clang-format/clang-format.py`. +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 to form of a `python`-file +which can be found under `clang/tools/extra/clang-format/clang-format.py`. This can be integrated by mapping the following to your `.vimrc`: @@ -54,9 +54,9 @@ This can be integrated by mapping the following to your `.vimrc`: map :pyf /clang-format.py imap :pyf /clang-format.pyi -The first line enables `clang-format` for NORMAL and VISUAL mode, the second -line adds support for INSER` mode. Change "C-I" to another binding if you -need clang-format on a different key (C-I stands for Ctrl+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). 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 @@ -71,7 +71,7 @@ Script for patch reformatting ============================= The python script `clang/tools/extra/clang-format-diff.py` parses the output of -a unified diff and reformats all contained lines with `clang-format`. +a unified diff and reformats all contained lines with :program:`clang-format`. .. code-block:: console @@ -84,11 +84,11 @@ a unified diff and reformats all contained lines with `clang-format`. -p P strip the smallest prefix containing P slashes -style STYLE formatting style to apply (LLVM, Google) -So to reformat all the lines in the latest `git` commit, just do: +So to reformat all the lines in the latest :program:`git` commit, just do: .. code-block:: console git diff -U0 HEAD^ | clang-format-diff.py - -The `-U0` will create a diff without context lines (the script would format + +The :option:`-U0` will create a diff without context lines (the script would format those as well). -- cgit v1.2.3