diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2026-10-17 11:34:02 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-10-17 11:34:02 -0400 |
| commit | 0851e7dabed9fc9c019e22088029f36e9f3ec3e3 (patch) | |
| tree | 35a1abb6a3d08b49e6a45ad3de089b622e1605ae /runtime/doc/if_pyth.txt | |
| parent | f8b704e019ed8194a5e873773670b263abd3dedf (diff) | |
| download | rneovim-master.tar.gz rneovim-master.tar.bz2 rneovim-master.zip | |
docs(help): specify h4 "function signature" format #42434master
Work towards enabling ["flow" layout](https://github.com/neovim/neovim/blob/9244da12e400ec0291450a5e9400d995e7a29b83/src/gen/gen_help_html.lua#L86-L88)
in all `:help` files.
Problem:
The final boss of vimdoc pseudo-structure: Vim's quasi-headings on
function signatures and excmd docs is visually distinctive but too
inconsistent for a nice parse rule.
Solution:
- Define the quasi-heading format as an "h4" variant, specified at
`:help help-tag-heading`.
- For simplicity and predictability, it is defined as any line that
ends with a help tag(s) preceded by 2 or more spaces (or 1 tab).
- Update existing docs.
- This one-time update has a lot of changes, but is very unlikely to
conflict with ported Vim-patches because (1) Vim rarely adds new
*excmds* that we want, and (2) *function* docs are auto-generated.
ref https://github.com/neovim/tree-sitter-vimdoc/issues/110
Diffstat (limited to 'runtime/doc/if_pyth.txt')
| -rw-r--r-- | runtime/doc/if_pyth.txt | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/runtime/doc/if_pyth.txt b/runtime/doc/if_pyth.txt index 3a09a41742..d899ae179d 100644 --- a/runtime/doc/if_pyth.txt +++ b/runtime/doc/if_pyth.txt @@ -13,8 +13,7 @@ See |provider-python| for more information. ============================================================================== Commands *python-commands* - *:python* *:py* *E263* *E264* *E887* -:[range]py[thon] {stmt} +:[range]py[thon] {stmt} *:python* *:py* *E263* *E264* *E887* Execute Python statement {stmt}. A simple check if the `:python` command is working: >vim :python print("Hello") @@ -52,8 +51,8 @@ https://docs.python.org/3/library/os.html#os.environ Note: Python is very sensitive to indenting. Make sure the "class" line and "EOF" do not have any indent. - *:pydo* -:[range]pydo {body} Execute Python function "def _vim_pydo(line, linenr): +:[range]pydo {body} *:pydo* + Execute Python function "def _vim_pydo(line, linenr): {body}" for each line in the [range], with the function arguments being set to the text of each line in turn, without a trailing <EOL>, and the current @@ -79,8 +78,7 @@ python. For example: >vim EOF :'<,'>py3do return py_vim_string_replace(line) < - *:pyfile* *:pyf* -:[range]pyf[ile] {file} +:[range]pyf[ile] {file} *:pyfile* *:pyf* Execute the Python script in {file}. The whole argument is used as a single file name. @@ -593,13 +591,12 @@ with "python3" in the current version. However, code that aims to support older versions of Nvim, as well as Vim, should prefer to use "python3" variants explicitly if Python 3 is required. - *:py3* *:python3* -:[range]py3 {stmt} +:[range]py3 {stmt} *:py3* :[range]py3 << [trim] [{endmarker}] {script} {endmarker} -:[range]python3 {stmt} +:[range]python3 {stmt} *:python3* :[range]python3 << [trim] [{endmarker}] {script} {endmarker} @@ -610,8 +607,8 @@ explicitly if Python 3 is required. To see what version of Python you have: >vim :py3 import sys :py3 print(sys.version) -< *:py3file* -:[range]py3f[ile] {file} +< +:[range]py3f[ile] {file} *:py3file* The `:py3file` command works similar to `:pyfile`. *:py3do* :[range]py3do {body} |