[clang-tools-extra] r282480 - [include-fixer] Add customized editor settings documents.
Haojian Wu via cfe-commits
cfe-commits at lists.llvm.org
Tue Sep 27 03:43:39 PDT 2016
Author: hokein
Date: Tue Sep 27 05:43:38 2016
New Revision: 282480
URL: http://llvm.org/viewvc/llvm-project?rev=282480&view=rev
Log:
[include-fixer] Add customized editor settings documents.
Reviewers: bkramer
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D24719
Modified:
clang-tools-extra/trunk/docs/include-fixer.rst
Modified: clang-tools-extra/trunk/docs/include-fixer.rst
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/include-fixer.rst?rev=282480&r1=282479&r2=282480&view=diff
==============================================================================
--- clang-tools-extra/trunk/docs/include-fixer.rst (original)
+++ clang-tools-extra/trunk/docs/include-fixer.rst Tue Sep 27 05:43:38 2016
@@ -81,13 +81,40 @@ Make sure vim can find :program:`clang-i
You can customize the number of headers being shown by setting
``let g:clang_include_fixer_maximum_suggested_headers=5``
+Customized settings in `.vimrc`:
+
+- ``let g:clang_include_fixer_path = "clang-include-fixer"``
+
+ Set clang-include-fixer binary file path.
+
+- ``let g:clang_include_fixer_maximum_suggested_headers = 3``
+
+ Set the maximum number of ``#includes`` to show. Default is 3.
+
+- ``let g:clang_include_fixer_increment_num = 5``
+
+ Set the increment number of #includes to show every time when pressing ``m``.
+ Default is 5.
+
+- ``let g:clang_include_fixer_jump_to_include = 0``
+
+ Set to 1 if you want to jump to the new inserted ``#include`` line. Default is
+ 0.
+
+- ``let g:clang_include_fixer_query_mode = 0``
+
+ Set to 1 if you want to insert ``#include`` for the symbol under the cursor.
+ Default is 0. Compared to normal mode, this mode won't parse the source file
+ and only search the sysmbol from database, which is faster than normal mode.
+
See ``clang-include-fixer.py`` for more details.
Integrate with Emacs
--------------------
To run `clang-include-fixer` on a potentially unsaved buffer in Emacs.
-Ensure that Emacs finds ``clang-include-fixer.el`` by adding the directory containing the file to the ``load-path``
-and requiring the `clang-include-fixer` in your ```.emacs``:
+Ensure that Emacs finds ``clang-include-fixer.el`` by adding the directory
+containing the file to the ``load-path`` and requiring the `clang-include-fixer`
+in your ``.emacs``:
.. code-block:: console
@@ -100,6 +127,19 @@ Make sure Emacs can find :program:`clang
- Add the path to :program:`clang-include-fixer` to the PATH environment variable.
+Customized settings in `.emacs`:
+
+- ``(custom-set-variables '(clang-include-fixer-executable "/path/to/include-fixer"))``
+
+ Set clang-include-fixer binary file path.
+
+- ``(custom-set-variables '(clang-include-fixer-query-mode t))``
+
+ Set to `t` if you want to insert ``#include`` for the symbol under the cursor.
+ Default is `nil`. Compared to normal mode, this mode won't parse the source
+ file and only search the sysmbol from database, which is faster than normal
+ mode.
+
See ``clang-include-fixer.el`` for more details.
How it Works
More information about the cfe-commits
mailing list