Permalink
Browse files

Merge branch 'readme-improvements'

* Convert the README to markdown format (its README.md now).
* Add instructions for minimum setup.
* Provide clearer description of g:clang_library_path.
  • Loading branch information...
2 parents c7f5673 + 5335b3c commit e536ca69f275a1c615550fc4aada5e320802262a @xaizek xaizek committed Sep 25, 2016
Showing with 75 additions and 31 deletions.
  1. +0 −27 README
  2. +64 −0 README.md
  3. +11 −4 doc/clang_complete.txt
View
27 README
@@ -1,27 +0,0 @@
-This plugin uses clang for accurately completing C and C++ code.
-
-To build and install in one step, type:
-$ make install
-
-To build and install in two steps, type:
-$ make
-$ vim clang_complete.vmb -c 'so %' -c 'q'
-
-Alternatively, you can also put the files in ~/.vim/
-
-You need Vim 7.3 or higher, compiled with python support and ideally, with
-the conceal feature.
-
-See doc/clang_complete.txt for help and license.
-
-#### Troubleshooting
-
-The first step is to check values of 'omnifunc' and 'completefunc' options in
-a C++ buffer where completion doesn't work (the value should be ClangComplete).
-This can be done with the following command: set omnifunc? completefunc?
-
-Output of :messages command after startup could also show something useful in
-case there were problems with plugin initialization.
-
-If everything is fine, next step might be to load only clang_complete plugin
-and see if anything changes.
View
64 README.md
@@ -0,0 +1,64 @@
+This plugin uses clang for accurately completing C and C++ code.
+
+## Installation
+
+- To build and install in one step, type: `$ make install`
+
+- To build and install in two steps, type:
+
+```
+$ make
+$ vim clang_complete.vmb -c 'so %' -c 'q'
+```
+
+- Alternatively, you can also put the files in `~/.vim/`
+
+You need Vim 7.3 or higher, compiled with python support and ideally, with
+the conceal feature.
+
+## Minimum Configuration
+
+- Set the `clang_library_path` to the directory containing file named
+ libclang.{dll,so,dylib} (for Windows, Unix variants and OS X respectively) or
+ the file itself, example:
+
+```vim
+ " path to directory where library can be found
+ let g:clang_library_path='/usr/lib/llvm-3.8/lib'
+ " or path directly to the library file
+ let g:clang_library_path='/usr/lib64/libclang.so.3.8'
+```
+
+- Compiler options can be configured in a `.clang_complete` file in each project
+ root. Example of `.clang_complete` file:
+
+```
+-DDEBUG
+-include ../config.h
+-I../common
+-I/usr/include/c++/4.5.3/
+-I/usr/include/c++/4.5.3/x86_64-slackware-linux/
+```
+
+## Usage
+
+The plugin provides list of matches, after that you pick completion from a
+generic completion menu where <kbd>Ctrl+N</kbd>, <kbd>Ctrl+P</kbd> and alike
+work and wrap around ends of list.
+
+## License
+
+See doc/clang_complete.txt for help and license.
+
+## Troubleshooting
+
+The first step is to check values of `'omnifunc'` and `'completefunc'` options
+in a C++ buffer where completion doesn't work (the value should be
+`ClangComplete`). This can be done with the following command:
+`:set omnifunc? completefunc?`
+
+Output of `:messages` command after startup could also show something useful in
+case there were problems with plugin initialization.
+
+If everything is fine, next step might be to load only clang_complete plugin
+and see if anything changes.
View
15 doc/clang_complete.txt
@@ -1,4 +1,4 @@
-*clang_complete.txt* For Vim version 7.3. Last change: 2014 Apr 13
+*clang_complete.txt* For Vim version 7.3. Last change: 2016 Sep 24
clang_complete plugin documentation
@@ -239,11 +239,18 @@ Default: 1
*clang_complete-library_path*
*g:clang_library_path*
-If libclang is not in your library search path, set this to the absolute path
-where libclang is available. This should either be a directory containing a
-file named libclang.[dll/so/dylib] or the clang shared library file itself.
+If libclang is not in the library search path of your system, you should set
+this variable to the absolute path of either directory containing
+libclang.{dll,so,dylib} (for Windows, Unix variants and OS X respectively) or
+to that file itself.
Default: ""
+Example: >
+ " path to directory where library can be found
+ let g:clang_library_path='/usr/lib/llvm-3.8/lib'
+ " or path directly to the library file
+ let g:clang_library_path='/usr/lib64/libclang.so.3.8'
+<
*clang_complete-sort_algo*
*g:clang_sort_algo*
How results are sorted (alpha, priority, none). Currently only works with

0 comments on commit e536ca6

Please sign in to comment.