[cfe-commits] r172007 - /cfe/trunk/docs/ClangFormat.rst

Daniel Jasper djasper at google.com
Wed Jan 9 14:21:14 PST 2013


Thank you!


On Wed, Jan 9, 2013 at 11:18 PM, Dmitri Gribenko <gribozavr at gmail.com>wrote:

> Author: gribozavr
> Date: Wed Jan  9 16:18:55 2013
> New Revision: 172007
>
> URL: http://llvm.org/viewvc/llvm-project?rev=172007&view=rev
> Log:
> ClangFormat.rst: improve formatting
>
> Modified:
>     cfe/trunk/docs/ClangFormat.rst
>
> Modified: cfe/trunk/docs/ClangFormat.rst
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/ClangFormat.rst?rev=172007&r1=172006&r2=172007&view=diff
>
> ==============================================================================
> --- cfe/trunk/docs/ClangFormat.rst (original)
> +++ cfe/trunk/docs/ClangFormat.rst Wed Jan  9 16:18:55 2013
> @@ -10,7 +10,7 @@
>  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 <ClangTools>`) repository and can be used to format
>  C/C++/Obj-C code.
>
> @@ -42,10 +42,10 @@
>  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 @@
>    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
>
> -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 @@
>  =============================
>
>  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 @@
>      -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).
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130109/87ac0fa5/attachment.html>


More information about the cfe-commits mailing list