From f08cba5449b58d7619b54617bdf43fb267b07b23 Mon Sep 17 00:00:00 2001 From: Jannik Buhr Date: Mon, 24 Jun 2024 15:05:06 +0200 Subject: [PATCH] ipython interactive snippet --- lua/plugins/lsp.lua | 5 +++++ snips/snippets/quarto.json | 12 ++++++++++++ 2 files changed, 17 insertions(+) diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index beb2a4b..d886aa7 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -248,6 +248,11 @@ return { -- } -- } + -- lspconfig.ruff_lsp.setup { + -- capabilities = capabilities, + -- flags = lsp_flags, + -- } + -- See https://github.com/neovim/neovim/issues/23291 -- disable lsp watcher. -- Too lags on linux for python projects diff --git a/snips/snippets/quarto.json b/snips/snippets/quarto.json index a78a9e1..83a400b 100644 --- a/snips/snippets/quarto.json +++ b/snips/snippets/quarto.json @@ -1,4 +1,16 @@ { + "ipython_interactive": { + "prefix": ["ipyinteractive"], + "body": [ + "```{python}", + "from IPython.core.getipython import get_ipython", + "ip = get_ipython()", + "interactive = False", + "if ip is not None and 'interactiveshell.TerminalInteractiveShell' in str(ip):", + " interactive = True", + "```" + ] + }, "iframe": { "prefix": ["iframe"], "body": [