File LICENSE changed (mode: 100644) (index e69de29..a23956e) |
|
1 |
|
Copyright (c) 2013 Deon Poncini |
|
2 |
|
|
|
3 |
|
Permission is hereby granted, free of charge, to any person or organization |
|
4 |
|
obtaining a copy of the software and accompanying documentation covered by |
|
5 |
|
this license (the "Software") to use, reproduce, display, distribute, |
|
6 |
|
execute, and transmit the Software, and to prepare derivative works of the |
|
7 |
|
Software, and to permit third-parties to whom the Software is furnished to |
|
8 |
|
do so, all subject to the following: |
|
9 |
|
|
|
10 |
|
The copyright notices in the Software and this entire statement, including |
|
11 |
|
the above license grant, this restriction and the following disclaimer, |
|
12 |
|
must be included in all copies of the Software, in whole or in part, and |
|
13 |
|
all derivative works of the Software, unless such copies or derivative |
|
14 |
|
works are solely in the form of machine-executable object code generated by |
|
15 |
|
a source language processor. |
|
16 |
|
|
|
17 |
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|
18 |
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|
19 |
|
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT |
|
20 |
|
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE |
|
21 |
|
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, |
|
22 |
|
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
|
23 |
|
DEALINGS IN THE SOFTWARE. |
File README.md added (mode: 100644) (index 0000000..2ecc26e) |
|
1 |
|
--- |
|
2 |
|
Title: Include Fixer for Vim |
|
3 |
|
Description: Categorize and Alphabetize C and C++ #include directives |
|
4 |
|
Author: Deon Poncini |
|
5 |
|
Created: 2013 Dec 14 |
|
6 |
|
Modified: 2013 Dec 14 |
|
7 |
|
|
|
8 |
|
--- |
|
9 |
|
|
|
10 |
|
Include Fixer for Vim |
|
11 |
|
============================= |
|
12 |
|
|
|
13 |
|
Developed by Deon Poncini <dex1337@gmail.com> |
|
14 |
|
|
|
15 |
|
Downloads |
|
16 |
|
--------- |
|
17 |
|
|
|
18 |
|
[github]: https://github.com/DeonPoncini/includefixer |
|
19 |
|
|
|
20 |
|
Installation |
|
21 |
|
------------ |
|
22 |
|
|
|
23 |
|
### Option 1: Manual installation |
|
24 |
|
|
|
25 |
|
1. Move `includefixer.vim` to your `.vim/plugin` directory. |
|
26 |
|
|
|
27 |
|
$ cd includefixer/plugin |
|
28 |
|
$ mv includfixer.vim ~/.vim/plugin/ |
|
29 |
|
|
|
30 |
|
### Option 2: Pathogen installation ***(recommended)*** |
|
31 |
|
|
|
32 |
|
1. Download and install Tim Pope's [Pathogen]. |
|
33 |
|
|
|
34 |
|
2. Next, move or clone the `includefixer` directory so that it is |
|
35 |
|
a subdirectory of the `.vim/bundle` directory. |
|
36 |
|
|
|
37 |
|
a. **Clone:** |
|
38 |
|
|
|
39 |
|
$ cd ~/.vim/bundle |
|
40 |
|
$ git clone https://github.com/DeonPoncini/includefixer.git |
|
41 |
|
|
|
42 |
|
b. **Move:** |
|
43 |
|
|
|
44 |
|
In the parent directory of includefixer: |
|
45 |
|
|
|
46 |
|
$ mv includefixer ~/.vim/bundle/ |
|
47 |
|
|
|
48 |
|
Usage |
|
49 |
|
--------- |
|
50 |
|
:FixIncludes |
|
51 |
|
|
|
52 |
|
For more extensive information, please see the documentation inside |
|
53 |
|
doc/includefixer.txt |
|
54 |
|
|
|
55 |
|
License |
|
56 |
|
--------- |
|
57 |
|
Copyright (c) 2013 Deon Poncini |
|
58 |
|
|
|
59 |
|
Permission is hereby granted, free of charge, to any person or organization |
|
60 |
|
obtaining a copy of the software and accompanying documentation covered by |
|
61 |
|
this license (the "Software") to use, reproduce, display, distribute, |
|
62 |
|
execute, and transmit the Software, and to prepare derivative works of the |
|
63 |
|
Software, and to permit third-parties to whom the Software is furnished to |
|
64 |
|
do so, all subject to the following: |
|
65 |
|
|
|
66 |
|
The copyright notices in the Software and this entire statement, including |
|
67 |
|
the above license grant, this restriction and the following disclaimer, |
|
68 |
|
must be included in all copies of the Software, in whole or in part, and |
|
69 |
|
all derivative works of the Software, unless such copies or derivative |
|
70 |
|
works are solely in the form of machine-executable object code generated by |
|
71 |
|
a source language processor. |
|
72 |
|
|
|
73 |
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|
74 |
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|
75 |
|
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT |
|
76 |
|
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE |
|
77 |
|
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, |
|
78 |
|
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
|
79 |
|
DEALINGS IN THE SOFTWARE. |
File doc/includefixer.txt changed (mode: 100644) (index e69de29..13ec6ce) |
|
1 |
|
*includefixer.txt* for Vim version 7.3 or newer Last change: 2013 December 14 |
|
2 |
|
|
|
3 |
|
Include Fixer for Vim by Deon Poncini~ |
|
4 |
|
|
|
5 |
|
Include Fixer *includefixer* |
|
6 |
|
*includefixer-help* |
|
7 |
|
|
|
8 |
|
Include Fixer organizes C and C++ #include header files to be in specific |
|
9 |
|
categories, as well as organizing alphabetically. Default categories are |
|
10 |
|
provided, as well as the option to customize categories |
|
11 |
|
|
|
12 |
|
0. Install |includefixer-install| |
|
13 |
|
1. Usage |includefixer-usage| |
|
14 |
|
2. Categories |includefixer-categories| |
|
15 |
|
3. Configuration |includefixer-configuration| |
|
16 |
|
4. License |includefixer-license| |
|
17 |
|
5. Contributing |includefixer-contributing| |
|
18 |
|
6. Credits |includefixer-credits| |
|
19 |
|
|
|
20 |
|
============================================================================== |
|
21 |
|
0. Install *includefixer-install* |
|
22 |
|
|
|
23 |
|
Note: I recommend using Tim Pope's pathogen plugin to install this plugin. See |
|
24 |
|
https://github.com/tpope/vim-pathogen. If you've installed pathogen properly |
|
25 |
|
you can install Include Fixer with the following commands: |
|
26 |
|
|
|
27 |
|
$ cd ~/.vim/bundle |
|
28 |
|
$ git clone https://github.com/DeonPoncini/includefixer.git |
|
29 |
|
|
|
30 |
|
If you aren't using pathogen, you can use the following steps to install: |
|
31 |
|
1. Checkout the git repository above |
|
32 |
|
2. Move `includefixer.vim` to your `plugins` directory |
|
33 |
|
3. Move this help file into the `doc` directory |
|
34 |
|
|
|
35 |
|
============================================================================== |
|
36 |
|
1. Usage *includefixer-usage* |
|
37 |
|
|
|
38 |
|
Once installed, use the following command to organize include files: |
|
39 |
|
`:FixIncludes` |
|
40 |
|
|
|
41 |
|
The command will search for lines containing `#include` directives, and organize |
|
42 |
|
them into different categories and alphabetically within those categories. |
|
43 |
|
Note: this includes whether the include is written as `"file.h"` or `<file.h>`. |
|
44 |
|
All includes starting with " will preceed those starting with < |
|
45 |
|
|
|
46 |
|
============================================================================== |
|
47 |
|
2. Categories *includefixer-categories* |
|
48 |
|
|
|
49 |
|
The plugin comes with a number of default categories. Each category is |
|
50 |
|
separated from the others with a blank line. The default categories are |
|
51 |
|
arranged in the following order: |
|
52 |
|
`module` |
|
53 |
|
`local` |
|
54 |
|
`boost` |
|
55 |
|
`qt` |
|
56 |
|
`c` `std` `library` |
|
57 |
|
`c++` `std` `library` |
|
58 |
|
|
|
59 |
|
The module header is any #include that has the same name as the current file, |
|
60 |
|
not including the extension. For example, for a file called test.cpp, the |
|
61 |
|
module header would be test.h, test.hpp, test, etc. |
|
62 |
|
|
|
63 |
|
Local headers are defined as any headers that do not fall into any other |
|
64 |
|
category |
|
65 |
|
|
|
66 |
|
Boost headers are those associated with the boost project, and match the |
|
67 |
|
regular expression `[<"]boost/.*[>"]` |
|
68 |
|
|
|
69 |
|
Qt headers are those associated with the Qt project, and match the regular |
|
70 |
|
expression `[<"]Q[A-Zt].*[>"]` |
|
71 |
|
|
|
72 |
|
The C and C++ standard library headers are all headers that are defined by the |
|
73 |
|
C and C++ ISO standards. For a complete list of these, please see |
|
74 |
|
http://www.cplusplus.com/reference |
|
75 |
|
|
|
76 |
|
For the C standard library headers, it matches both C and C++ forms, i.e. it |
|
77 |
|
matches both `<cmath>` and `<math.h>` |
|
78 |
|
|
|
79 |
|
============================================================================== |
|
80 |
|
3. Configuration *includefixer-configuration* |
|
81 |
|
|
|
82 |
|
The above categories can be extended with custom categories defined by the |
|
83 |
|
user. To define a custom category, define a list of regular expressions that |
|
84 |
|
match the type of headers you wish to separate. Assign these to the following |
|
85 |
|
global variable in your .vimrc file `g:include_fixer_custom` |
|
86 |
|
|
|
87 |
|
The custom categories will be inserted after the `local` includes and before the |
|
88 |
|
`boost` includes |
|
89 |
|
|
|
90 |
|
An example of how to set this value: If you have a project with two groups of |
|
91 |
|
headers, ones under MyProject and another set under MyLibrary and you wish to |
|
92 |
|
have these categorized, set the value like this inside your .vimrc file: |
|
93 |
|
|
|
94 |
|
`let` `g:include_fixer_custom` `=` |
|
95 |
|
`\` `['[<"]MyLibrary/.*[>"]','[<"]MyProject/.*[>"]']` |
|
96 |
|
|
|
97 |
|
Now the Library files will be separated out from the Project files and from |
|
98 |
|
other local includes. |
|
99 |
|
|
|
100 |
|
============================================================================== |
|
101 |
|
4. License *includefixer-license* |
|
102 |
|
|
|
103 |
|
This plugin is distributed under the `Boost` `Software` `License` `v1.0`. A copy of |
|
104 |
|
this license is included in the `LICENSE` file included with this plugin. A |
|
105 |
|
copy can also be obtained at the following website: |
|
106 |
|
http://www.boost.org/LICENSE_1_0.txt |
|
107 |
|
|
|
108 |
|
============================================================================== |
|
109 |
|
5. Contributing *includefixer-contributing* |
|
110 |
|
|
|
111 |
|
To contribute patches to this plugin, please submit a pull request at |
|
112 |
|
https://github.com/DeonPoncini/includefixer |
|
113 |
|
|
|
114 |
|
============================================================================== |
|
115 |
|
5. Credits *includefixer-credits* |
|
116 |
|
|
|
117 |
|
Developed by Deon Poncini, email to dex1337@gmail.com |