Mercurial > vim-gutentags
annotate README.md @ 181:0b4ccd0deceb
Fix broken test for whether the tag file is inside the project root.
| author | Ludovic Chabant <ludovic@chabant.com> |
|---|---|
| date | Thu, 23 Mar 2017 17:38:14 -0700 |
| parents | 02a94ff0db57 |
| children | bd641fccdae4 |
| rev | line source |
|---|---|
| 6 | 1 |
|
22
4e1b0253f71a
Renamed project to "Gutentags" (thanks Sylvain!).
Ludovic Chabant <ludovic@chabant.com>
parents:
18
diff
changeset
|
2 # Gutentags |
| 6 | 3 |
|
22
4e1b0253f71a
Renamed project to "Gutentags" (thanks Sylvain!).
Ludovic Chabant <ludovic@chabant.com>
parents:
18
diff
changeset
|
4 Gutentags is a plugin that takes care of the much needed management of tags |
| 6 | 5 files in Vim. It will (re)generate tag files as you work while staying |
| 6 completely out of your way. It will even do its best to keep those tag files | |
| 7 out of your way too. It has no dependencies and just works. | |
| 8 | |
|
172
02a94ff0db57
Add CONTRIBUTING file.
Ludovic Chabant <ludovic@chabant.com>
parents:
52
diff
changeset
|
9 |
| 6 | 10 ## How? |
| 11 | |
|
22
4e1b0253f71a
Renamed project to "Gutentags" (thanks Sylvain!).
Ludovic Chabant <ludovic@chabant.com>
parents:
18
diff
changeset
|
12 Install Gutentags like any other Vim plugin. I recommend something like |
| 6 | 13 [Pathogen][], so you can go: |
| 14 | |
| 15 cd ~/.vim/bundle | |
|
22
4e1b0253f71a
Renamed project to "Gutentags" (thanks Sylvain!).
Ludovic Chabant <ludovic@chabant.com>
parents:
18
diff
changeset
|
16 hg clone https://bitbucket.org/ludovicchabant/vim-gutentags |
| 6 | 17 |
| 18 Then you only need to do a `:call pathogen#helptags()` to generate the | |
|
42
5c1baa6007d8
Fix typo in `README` file.
Ludovic Chabant <ludovic@chabant.com>
parents:
22
diff
changeset
|
19 documentation tags (how ironic, eh?) and you can access Gutentags' help pages |
|
22
4e1b0253f71a
Renamed project to "Gutentags" (thanks Sylvain!).
Ludovic Chabant <ludovic@chabant.com>
parents:
18
diff
changeset
|
20 with `help gutentags`. |
| 6 | 21 |
| 22 | |
| 23 ## What? | |
| 24 | |
|
22
4e1b0253f71a
Renamed project to "Gutentags" (thanks Sylvain!).
Ludovic Chabant <ludovic@chabant.com>
parents:
18
diff
changeset
|
25 In order to generate tag files, Gutentags will have to figure out what's in |
| 6 | 26 your project. To do this, it will locate well-known project root markers like |
| 27 SCM folders (`.git`, `.hg`, etc.), any custom tags you define (with | |
|
22
4e1b0253f71a
Renamed project to "Gutentags" (thanks Sylvain!).
Ludovic Chabant <ludovic@chabant.com>
parents:
18
diff
changeset
|
28 `gutentags_project_root`), and even things you may have defined already with |
| 6 | 29 other plugins, like [CtrlP][]. |
| 30 | |
|
22
4e1b0253f71a
Renamed project to "Gutentags" (thanks Sylvain!).
Ludovic Chabant <ludovic@chabant.com>
parents:
18
diff
changeset
|
31 If the current file you're editing is found to be in such a project, Gutentags |
| 6 | 32 will make sure the tag file for that project is up to date. Then, as you work |
| 33 in files in that project, it will partially re-generate the tag file. Every | |
| 34 time you save, it will silently, in the background, update the tags for that | |
| 35 file. | |
| 36 | |
|
22
4e1b0253f71a
Renamed project to "Gutentags" (thanks Sylvain!).
Ludovic Chabant <ludovic@chabant.com>
parents:
18
diff
changeset
|
37 Usually, ctags can only append tags to an existing tag file, so Gutentags |
| 6 | 38 removes the tags for the current file first, to make sure the tag file is |
| 39 always consistent with the source code. | |
| 40 | |
|
22
4e1b0253f71a
Renamed project to "Gutentags" (thanks Sylvain!).
Ludovic Chabant <ludovic@chabant.com>
parents:
18
diff
changeset
|
41 Also, Gutentags is clever enough to not stumble upon itself by triggering |
| 6 | 42 multiple ctags processes if you save files to fast, or your project is really |
| 43 big. | |
| 44 | |
| 45 | |
| 46 ## Why? | |
| 47 | |
| 48 There are some similar Vim plugins out there ("vim-tags", "vim-autotag", | |
| 49 "vim-automatic-ctags", etc.). They all fail on one or more of the requirements | |
|
22
4e1b0253f71a
Renamed project to "Gutentags" (thanks Sylvain!).
Ludovic Chabant <ludovic@chabant.com>
parents:
18
diff
changeset
|
50 I set for myself with Gutentags: |
| 6 | 51 |
| 52 * No other dependency than running Vim: no Python, Ruby, or whatever. | |
|
172
02a94ff0db57
Add CONTRIBUTING file.
Ludovic Chabant <ludovic@chabant.com>
parents:
52
diff
changeset
|
53 * Cross-platform: should work on at least Ubuntu, Mac, and Windows. |
|
18
b13e1141aa5c
Fix wording in `README`.
Ludovic Chabant <ludovic@chabant.com>
parents:
6
diff
changeset
|
54 * Incremental tags generation: don't re-generate the whole project all the time. |
|
b13e1141aa5c
Fix wording in `README`.
Ludovic Chabant <ludovic@chabant.com>
parents:
6
diff
changeset
|
55 This may be fine for small projects, but it doesn't scale. |
|
b13e1141aa5c
Fix wording in `README`.
Ludovic Chabant <ludovic@chabant.com>
parents:
6
diff
changeset
|
56 * External process management: if the ctags process is taking a long time, don't |
|
172
02a94ff0db57
Add CONTRIBUTING file.
Ludovic Chabant <ludovic@chabant.com>
parents:
52
diff
changeset
|
57 run another one because I saved a file again. |
|
18
b13e1141aa5c
Fix wording in `README`.
Ludovic Chabant <ludovic@chabant.com>
parents:
6
diff
changeset
|
58 * Keep the tag file consistent: don't just append the current file's tags to the |
|
b13e1141aa5c
Fix wording in `README`.
Ludovic Chabant <ludovic@chabant.com>
parents:
6
diff
changeset
|
59 tag file, otherwise you will still "see" tags for deleted or renamed classes |
|
b13e1141aa5c
Fix wording in `README`.
Ludovic Chabant <ludovic@chabant.com>
parents:
6
diff
changeset
|
60 and functions. |
| 6 | 61 * Automatically create the tag file: you open something from a freshly forked |
|
18
b13e1141aa5c
Fix wording in `README`.
Ludovic Chabant <ludovic@chabant.com>
parents:
6
diff
changeset
|
62 project, it should start indexing it automatically, just like in Sublime Text |
|
b13e1141aa5c
Fix wording in `README`.
Ludovic Chabant <ludovic@chabant.com>
parents:
6
diff
changeset
|
63 or Visual Studio or any other IDE. |
| 6 | 64 |
|
22
4e1b0253f71a
Renamed project to "Gutentags" (thanks Sylvain!).
Ludovic Chabant <ludovic@chabant.com>
parents:
18
diff
changeset
|
65 I hope Gutentags will bring you as much closure as me regarding tag files. I know |
|
18
b13e1141aa5c
Fix wording in `README`.
Ludovic Chabant <ludovic@chabant.com>
parents:
6
diff
changeset
|
66 I don't want to have to think about it, and probably neither do you. |
| 6 | 67 |
| 68 | |
|
52
586c3a86adac
Added link to pathogen in readme
Rathesan Iyadurai <rad.iyadurai@gmail.com>
parents:
42
diff
changeset
|
69 [Pathogen]: https://github.com/tpope/vim-pathogen |
| 6 | 70 [ctrlp]: https://github.com/kien/ctrlp.vim |
| 71 |
