Delete jupytex & add more firefox extensions
This commit is contained in:
parent
964fc2af28
commit
500f79cbdf
7 changed files with 15 additions and 55 deletions
dotfiles/neovim/lua/my/plugins
|
@ -1,43 +0,0 @@
|
|||
local env = require("my.helpers.env")
|
||||
|
||||
local M = {
|
||||
"goerz/jupytext.vim",
|
||||
ft = "ipynb",
|
||||
cond = env.vscode.not_active(),
|
||||
}
|
||||
|
||||
function M.config()
|
||||
-- Use %% as cell delimiter
|
||||
vim.g.jupytext_fmt = "py:percent"
|
||||
end
|
||||
|
||||
function M.init()
|
||||
vim.cmd([[
|
||||
function GetJupytextFold(linenum)
|
||||
if getline(a:linenum) =~ "^#\\s%%"
|
||||
" start fold
|
||||
return ">1"
|
||||
elseif getline(a:linenum + 1) =~ "^#\\s%%"
|
||||
return "<1"
|
||||
else
|
||||
return "-1"
|
||||
endif
|
||||
endfunction
|
||||
]])
|
||||
|
||||
-- Set the correct foldexpr
|
||||
vim.api.nvim_create_autocmd("BufEnter", {
|
||||
pattern = { "*.ipynb" },
|
||||
group = vim.api.nvim_create_augroup("JupytextFoldExpr", {}),
|
||||
callback = function()
|
||||
vim.cmd([[
|
||||
setlocal foldexpr=GetJupytextFold(v:lnum)
|
||||
setlocal foldmethod=expr
|
||||
" Deletes and pastes all text. Used to refresh folds.
|
||||
:norm ggVGdpggdd
|
||||
]])
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
return M
|
Loading…
Add table
Add a link
Reference in a new issue