Sphinx integrations for Neovim.
This plugin is still under development, many things may and will change.
Install using vim-plug.
Put this in your init.vim
.
Plug 'stsewd/sphinx.nvim', { 'do': ':UpdateRemotePlugins' }
Source for cross-referencing roles,
i.e :ref:
, :doc:
, py:func
, etc.
Note: this plugin makes use of the inventory file from Sphinx, so you need to have built your docs at least once to get suggestions, and rebuild when your docs change to get the up to date suggestions. You can use sphinx-autobuild to rebuild your docs automatically when there is a change.
- List and open files with
SphinxFiles
. - List all references with
:SphinxRefs
or:SphinxRefs {role-name}
(tab completion supported!). Copy the reference name withEnter
or copy the link withCtrl-F
(they are copied to the default register"
, just pressp
to paste).
Note If you have fzf.vim installed,
this plugin will respect your g:fzf_command_prefix
setting.
Extra queries for rst
.
This includes highlights for Sphinx directives and roles,
and injections for directives from Sphinx and popular extensions (like code-block
or tabs
).
- Completion for roles and directives names.
Default values are shown in the code blocks.
Default role (words surrounded by `single back-quotes`
).
let g:sphinx_default_role = 'any'
Where to search for the local inventory file (objects.inv
).
The directories are relative to the conf.py
file.
let g:sphinx_html_output_dirs = [
\ '_build/html', 'build/html',
\ '../_build/html', '../build/html',
\ '_build/dirhtml', 'build/dirhtml',
\ '../_build/dirhtml', '../build/dirhtml',
\]
If you want to extend the defaults values from g:sphinx_html_output_dirs
and g:sphinx_doctrees_output_dirs
instead of replacing them.
let g:sphinx_default_dirs = 1
If results should include information from Intersphinx.
let g:sphinx_include_intersphinx_data = 1
Where to search for the environment file (environment.pickle
),
this file contains the inventories from Intersphinx.
The directories are relative to the conf.py
file.
let g:sphinx_doctrees_output_dirs = [
\ '_build/doctrees', 'build/doctrees',
\ '../_build/doctrees', '../build/doctrees',
\ '_build/html/.doctrees', 'build/html/.doctrees',
\ '../_build/html/.doctrees', '../build/html/.doctrees',
\ '_build/dirhtml/.doctrees', 'build/dirhtml/.doctrees',
\ '../_build/dirhtml/.doctrees', '../build/dirhtml/.doctrees',
\]
Always prefix the reference with the name of the target,
i.e use :ref:`<python:comparisons>`
instead of :ref:`<comparisons>`
to link to the label “comparisons” in the doc set “python”.
let g:sphinx_always_use_scoped_targets = 1