Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stsewd/sphinx.nvim
Sphinx integrations for Neovim
https://github.com/stsewd/sphinx.nvim
autocompletion intersphinx neovim neovim-plugin restructuredtext sphinx
Last synced: 2 days ago
JSON representation
Sphinx integrations for Neovim
- Host: GitHub
- URL: https://github.com/stsewd/sphinx.nvim
- Owner: stsewd
- License: mit
- Created: 2020-03-29T22:06:44.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-10-30T16:41:40.000Z (4 days ago)
- Last Synced: 2024-10-30T17:34:35.900Z (4 days ago)
- Topics: autocompletion, intersphinx, neovim, neovim-plugin, restructuredtext, sphinx
- Language: Python
- Homepage:
- Size: 229 KB
- Stars: 70
- Watchers: 7
- Forks: 4
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Funding: FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# sphinx.nvim
[![CI](https://github.com/stsewd/sphinx.nvim/workflows/CI/badge.svg)](https://github.com/stsewd/sphinx.nvim/actions?query=workflow%3ACI)
[Sphinx](https://www.sphinx-doc.org/) integrations for Neovim.
**This plugin is still under development, many things may and will change.**
![sphinx-nvim-coc](https://user-images.githubusercontent.com/4975310/105564899-353d8f80-5cf2-11eb-8f05-63b1ed5c3106.gif)
# Contents
* [Installation](#installation)
* [Available integrations](#available-integrations)
- [coc.nvim](#cocnvim)
- [nvim-treesitter](#nvim-treesitter)
- [fzf](#fzf)
* [Coming soon](#coming-soon)
* [Configuration](#configuration)# Installation
Install using [vim-plug](https://github.com/junegunn/vim-plug).
Put this in your `init.vim`.```vim
Plug 'stsewd/sphinx.nvim', { 'do': ':UpdateRemotePlugins' }
```# Available integrations
## [coc.nvim](https://github.com/neoclide/coc.nvim/)
Source for [cross-referencing roles](https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#cross-referencing-syntax),
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](https://github.com/GaretJax/sphinx-autobuild) to rebuild your docs automatically when there is a change.## [fzf](https://github.com/junegunn/fzf/)
- List and open files with `SphinxFiles`.
- List all references with `:SphinxRefs` or `:SphinxRefs {role-name}` (tab completion supported!).
Copy the reference name with `Enter` or copy the link with `Ctrl-F`
(they are copied to the default register `"`, just press `p` to paste).**Note** If you have [fzf.vim](https://github.com/junegunn/fzf.vim) installed,
this plugin will respect your `g:fzf_command_prefix` setting.## [nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter)
Extra [queries](after/queries/rst/) for `rst`.
This includes highlights for Sphinx directives and roles,
and injections for directives from Sphinx and popular extensions (like ``code-block`` or ``tabs``).# Coming soon
- Completion for roles and directives names.
# Configuration
Default values are shown in the code blocks.
## General settings
### g:sphinx_default_role
[Default role](https://www.sphinx-doc.org/page/usage/configuration.html#confval-default_role) (words surrounded by `` `single back-quotes` ``).
```vim
let g:sphinx_default_role = 'any'
```### g:sphinx_html_output_dirs
Where to search for the local inventory file (`objects.inv`).
The directories are relative to the `conf.py` file.```vim
let g:sphinx_html_output_dirs = [
\ '_build/html', 'build/html',
\ '../_build/html', '../build/html',
\ '_build/dirhtml', 'build/dirhtml',
\ '../_build/dirhtml', '../build/dirhtml',
\]
```### g:sphinx_default_dirs
If you want to extend the defaults values from `g:sphinx_html_output_dirs` and `g:sphinx_doctrees_output_dirs`
instead of replacing them.```vim
let g:sphinx_default_dirs = 1
```## Intersphinx related settings
### g:sphinx_include_intersphinx_data
If results should include information from Intersphinx.
```vim
let g:sphinx_include_intersphinx_data = 1
```### g:sphinx_doctrees_output_dirs
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.```vim
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',
\]
```### g:sphinx_always_use_scoped_targets
Always prefix the reference with the name of the target,
i.e use `` :ref:`` `` instead of `` :ref:`` ``
to link to the label “comparisons” in the doc set “python”.```vim
let g:sphinx_always_use_scoped_targets = 1
```