Skip to content

Commit

Permalink
docs: rearrange, esp. about folding
Browse files Browse the repository at this point in the history
  • Loading branch information
kiyoon authored Aug 16, 2023
1 parent eba4b53 commit c6ac04e
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,27 +68,29 @@ pip3 install --upgrade pip

### Install Jupynium

<details>
<summary>
Click to see vim-plug and packer installation.
</summary>

With vim-plug:

```vim
Plug 'kiyoon/jupynium.nvim', { 'do': 'pip3 install --user .' }
" Plug 'kiyoon/jupynium.nvim', { 'do': 'conda run --no-capture-output -n jupynium pip install .' }
Plug 'hrsh7th/nvim-cmp' " optional, for completion
Plug 'rcarriga/nvim-notify' " optional
Plug 'stevearc/dressing.nvim' " optional, UI for :JupyniumKernelSelect
Plug 'kevinhwang91/nvim-ufo' " optional, folds for :lua require("jupynium").get_folds()
```
With packer.nvim:
```lua
use { "kiyoon/jupynium.nvim", run = "pip3 install --user ." }
-- use { "kiyoon/jupynium.nvim", run = "conda run --no-capture-output -n jupynium pip install ." }
use { "hrsh7th/nvim-cmp" } -- optional, for completion
use { "rcarriga/nvim-notify" } -- optional
use { "stevearc/dressing.nvim" } -- optional, UI for :JupyniumKernelSelect
use { "kevinhwang91/nvim-ufo" } -- optional, folds for :lua require("jupynium").get_folds()
```
</details>
With 💤lazy.nvim:
Expand All @@ -99,10 +101,8 @@ With 💤lazy.nvim:
-- build = "conda run --no-capture-output -n jupynium pip install .",
-- enabled = vim.fn.isdirectory(vim.fn.expand "~/miniconda3/envs/jupynium"),
},
"hrsh7th/nvim-cmp", -- optional, for completion
"rcarriga/nvim-notify", -- optional
"stevearc/dressing.nvim", -- optional, UI for :JupyniumKernelSelect
"kevinhwang91/nvim-ufo", -- optional, folds for :lua require("jupynium").get_folds()
```
#### Configure Jupynium
Expand Down Expand Up @@ -261,6 +261,17 @@ cmp.setup {
}
```
#### Optionally, configure `nvim-ufo` to fold cells
There is an API serving as a folds provider, which will return a table with format `{startLine=#num, endLine=#num}`.
```lua
require("jupynium").get_folds()
```
You should use it with a fold plugin like [nvim-ufo](https://github.com/kevinhwang91/nvim-ufo).
See [#88](https://github.com/kiyoon/jupynium.nvim/pull/88) for more detail and an example configuration.
## 🏃 Quick Start
- Open a `*.ju.py` file.
Expand Down Expand Up @@ -488,13 +499,6 @@ if status_ok then
end
```
There is also an API serving as a folds provider(see [#88](https://github.com/kiyoon/jupynium.nvim/pull/88) for more detail), which will return a table with format `{startLine=#num, endLine=#num}`.
```lua
require("jupynium").get_folds()
```
You should use it with a fold plugin like [nvim-ufo](https://github.com/kevinhwang91/nvim-ufo), an example is [example config](https://github.com/fecet/nvim/blob/6d8606987b73d03a7c7dc802065303b9ed09dcdb/lua/modules/configs/editor/ufo.lua).
## 👨‍💻️ Command-Line Usage (attach to remote Neovim)
**You don't need to install the vim plugin to use Jupynium.** The plugin is responsible of adding `:JupyniumStartAndAttachToServer` etc. that just calls the command line program, plus it has textobjects and shortsighted support.
Expand Down

0 comments on commit c6ac04e

Please sign in to comment.