Skip to content

Commit 233b0d6

Browse files
committed
ipynb support
1 parent d95e681 commit 233b0d6

File tree

7 files changed

+48
-5
lines changed

7 files changed

+48
-5
lines changed

conda/.condarc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
auto_activate_base: false
1+
auto_activate_base: true
22
changeps1: false
33
channel_priority: strict
44
channels:

mamba/.mambarc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
auto_activate_base: false
1+
auto_activate_base: true
22
changeps1: false
33
channel_priority: strict
44
channels:
+3-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
return {
2-
{import = 'plugins.code.markdown'}
3-
}
2+
{import = 'plugins.code.markdown'},
3+
{import = 'plugins.code.jupyter'}
4+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
return {
2+
"kiyoon/jupynium.nvim",
3+
build = "micromamba install -n base --yes nb_conda_kernels 2> /dev/null && micromamba run -a \"\" -n base pip install ~/.local/share/nvim/lazy/jupytext.nvim/.",
4+
enabled = vim.fn.isdirectory(vim.fn.expand "~/micromamba/envs/base"),
5+
dependencies = {
6+
"rcarriga/nvim-notify", -- optional
7+
"stevearc/dressing.nvim", -- optional, UI for :JupyniumKernelSelect
8+
},
9+
opts = {
10+
python_host = { "micromamba", "run", "-a", "\"\"", "-n", "base", "python" },
11+
jupyter_command = { "micromamba", "run", "-a", "\"\"", "-n", "base", "jupyter" },
12+
auto_start_server = {
13+
enable = true,
14+
file_pattern = { "*.ju.*", "*.ipynb" },
15+
},
16+
auto_attach_to_server = {
17+
enable = true,
18+
file_pattern = { "*.ju.*", "*.ipynb", "*.md" },
19+
},
20+
auto_sync_server = {
21+
enable = true,
22+
file_pattern = { "*.ju.*", "*.ipynb", "*.md"},
23+
},
24+
jupynium_file_pattern = { "*.ju.*", "*.ipynb" },
25+
}
26+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
return {
2+
"GCBallesteros/jupytext.nvim",
3+
config = true,
4+
build = "pip3 install --user jupytext"
5+
-- Depending on your nvim distro or config you may need to make the loading not lazy
6+
-- lazy=false,
7+
}

nvim/.config/nvim/lua/plugins/code/markdown/markdown-preview.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ return {
77
},
88
ft = { "markdown" },
99
build = function() vim.fn["mkdp#util#install"]() end,
10-
}
10+
}

nvim/.config/nvim/lua/plugins/editor/cmp.lua

+9
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ return {
2626

2727
cmp.setup({
2828
sources = {
29+
{name = "jupynium", priority = 1000 },
2930
{name = 'nvim_lsp'},
3031
{name = 'luasnip'},
3132
{name = 'path'},
@@ -98,6 +99,14 @@ return {
9899
require('luasnip').lsp_expand(args.body)
99100
end,
100101
},
102+
sorting = {
103+
priority_weight = 1.0,
104+
comparators = {
105+
cmp.config.compare.score, -- Jupyter kernel completion shows prior to LSP
106+
cmp.config.compare.recently_used,
107+
cmp.config.compare.locality,
108+
},
109+
}
101110
})
102111
end
103112
}

0 commit comments

Comments
 (0)