-
Notifications
You must be signed in to change notification settings - Fork 390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Starting of the Documentation #1961
Changes from 2 commits
14b6746
28a292a
37079ea
1778c1f
a2843b7
da271d8
133558e
66ddf82
b4e77b4
6a59e1c
45be05e
feba98a
ad34f7e
9ddec6f
dab4804
d090c6a
3a4aff8
e5e6573
a721719
b7292da
66d9fae
055b3f0
ccc014d
762ff23
4e90554
0f27003
3b6a3dc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,17 @@ | ||
# Guide for code contributions | ||
|
||
<!-- START doctoc generated TOC please keep comment here to allow auto update --> | ||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> | ||
|
||
|
||
- [Branch model](#branch-model) | ||
- [Documentation style](#documentation-style) | ||
- [Code style](#code-style) | ||
- [Running tests](#running-tests) | ||
- [Documentation](#documentation) | ||
|
||
<!-- END doctoc generated TOC please keep comment here to allow auto update --> | ||
|
||
## Branch model | ||
|
||
VimTeX is developed mainly through the master branch, and pull requests should | ||
|
@@ -63,3 +75,89 @@ the executable by setting the environment variable `MYVIM` before running. To | |
run with vanilla vim, use `MYVIM="vim -T dumb --not-a-term --noplugin -n"`. | ||
Either export this in your shell, or prepend to `make`, that is, run | ||
`MYVIM="vim -T dumb --not-a-term --noplugin -n" make`. | ||
|
||
## Documentation | ||
lervag marked this conversation as resolved.
Show resolved
Hide resolved
|
||
This section should help you to understand the structure of this plugin and how | ||
it works. | ||
|
||
So first of all, we're taking a look into the first layer of the plugin, after | ||
that, we're going to through each necessary directory, if it needs some more | ||
description. We won't go through *every* file, because it would take a little | ||
bit too long the most should be probably self explained. | ||
lervag marked this conversation as resolved.
Show resolved
Hide resolved
|
||
``` | ||
vimtex | ||
├── after | ||
│ └── ftplugin | ||
│ └── tex.vim | ||
├── autoload | ||
│ ├── health | ||
│ ├── unite | ||
│ ├── vimtex | ||
│ └── vimtex.vim | ||
├── compiler | ||
│ ├── bibertool.vim | ||
│ ├── chktex.vim | ||
│ ├── lacheck.vim | ||
│ ├── style-check.vim | ||
│ ├── textidote.vim | ||
│ └── vlty.vim | ||
├── CONTRIBUTING.md | ||
├── doc | ||
│ ├── targets-textobj-cheatsheet.md | ||
│ └── vimtex.txt | ||
├── docker | ||
│ └── Dockerfile | ||
├── ftdetect | ||
│ └── tex.vim | ||
├── ftplugin | ||
│ ├── bib.vim | ||
│ └── tex.vim | ||
├── indent | ||
│ ├── bib.vim | ||
│ └── tex.vim | ||
├── LICENSE.md | ||
├── media | ||
│ └── quick_start.gif | ||
├── README.md | ||
├── rplugin | ||
│ └── python3 | ||
│ └── denite | ||
│ └── source | ||
│ └── vimtex.py | ||
├── syntax | ||
│ └── tex.vim | ||
├── test | ||
└── xclip | ||
``` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The problem with adding a listing like this is that it quickly becomes out-of-date because I (and other contributors) will forget to update it. Do we really need to list all of this? What's the main intent? Perhaps the structure? How about taking it one step back and instead explain the intent of the directories themselves, and not the individual files? We can point the user to the relevant sections in the vim help docs (e.g. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
You're right. I've got another idea: Let's create a table of contents, which should represent the directory-structure of VimTex. So if someone
Aye!
Yes, I'd also like to add a link to this awesome book which taught me vimscript ;) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I'm not sure I fully understand... "So if someone
Yes, feel free to add a link in the code documentation resource. I agree it is a good resource! |
||
So how does vimtex start? Well, it calls the `vimtex#init()` function at the | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please note that the plugin should be referred to as VimTeX (see latest release notes). :) |
||
beginning, if you open a `tex` or a `bib` file (see in `ftplugin`). So let's | ||
take a look, how vimtex initialises: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I propose to make initialization into a sub section. |
||
```vim | ||
function! vimtex#init() abort " {{{1 | ||
if exists('#User#VimtexEventInitPre') | ||
doautocmd <nomodeline> User VimtexEventInitPre | ||
endif | ||
|
||
call vimtex#options#init() | ||
|
||
call s:init_state() | ||
call s:init_buffer() | ||
call s:init_default_mappings() | ||
|
||
if exists('#User#VimtexEventInitPost') | ||
doautocmd <nomodeline> User VimtexEventInitPost | ||
endif | ||
|
||
augroup vimtex_main | ||
autocmd! | ||
autocmd VimLeave * call s:quit() | ||
augroup END | ||
endfunction | ||
``` | ||
So here're its steps: | ||
1. `vimtex#options#init()`: | ||
1. Create some new highlight-types, which are used in vimtex (for example, | ||
use the color of a vim-error-msg for all vimtex errors). | ||
2. Warn the user, if he/she is using deprecated settings | ||
3. Save the settings of vimtex which are provided from the user or load its | ||
default values (like `g:vimtex_compiler_enabled`) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is going in the right direction. The I think I would say that setting the options are the main part and should be number 1 here, while defining highlight groups is "less important". Also, it is important to use correct names here: there is no such thing as |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can see the value of doctoc, but I don't expect this file to change that much, so I would propose to remove the auto update tags.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm... but I'd like to let
there because, who know's how this file develops :)