Compare commits

...

27 commits

Author SHA1 Message Date
fd01c8aac2
nvim: Add whichkey group for codecompanion 2025-02-06 14:10:56 +01:00
99eada00b8
nvim: Improve custom toggle terms
Added euporia term to split it from other python variations. Fixed
python command selection. Improved mapping and which key display.
Removed indentline settings since that is responsibility of indentline.
2025-02-06 14:10:55 +01:00
101937a8c2
nvim: Fix image.nvim functionality
Track master since no new version has been tagged. Change some settings
around and make installation more robust using the new lazy rocks
system.
2025-02-06 14:10:54 +01:00
9d15bc79f4
nvim: Clean up markdown/quarto key maps 2025-02-06 13:09:28 +01:00
7d616c1cb5
nvim: Improve indentscope disables
Improved conditional disabling of indentscope lines, e.g. in lazy and
mason floats, terminals and helpfiles.
2025-02-06 12:02:18 +01:00
50d78cbb2f
nvim: Overhaul prose preview keys 2025-02-05 19:05:50 +01:00
9421ef807d
nvim: Remove lsp-setup.nvim plugin
Removed the plugin since all its functionality can be replicated with an
equal amount of lines without it nowadays. Should be even simpler in the
future when we can just have individual lsp server config files in the
config dir.
2025-02-05 18:37:55 +01:00
ad3c8a6139
nvim: Lazy load completion on insert mode only 2025-02-05 18:28:51 +01:00
ba6a8c16ce
nvim: Simplify statusline python check 2025-02-05 18:28:17 +01:00
4d98c9ab46
nvim: Fix quarto jupyter kernel setup
Creates a hidden kernel file with the current filename and
'.kernel.json' suffix by default (in the file directory).
But 'JupyterStart' command can also be given an argument to use as the
filename / file path for the kernel file. That way we can also attach to
already running kernels for longer running projects.
2025-02-03 16:43:42 +01:00
6edd3143cb
nvim: Show markdown code blocks in full width 2025-02-03 16:38:38 +01:00
90161be418
nvim: Add check for local .venv python dir 2025-02-03 16:38:18 +01:00
8b5e4dc097
nvim: Do not always run ruff_fix
Ruff fix removes unused imports etc. which is sometimes more annoying
than helpful.
2025-02-01 10:46:22 +01:00
a5d28351cd
nvim: Ensure FeMaCo newline in codefence injections
When formatting femaco buffers it would sometimes remove the newline
necessary at the end of code fences to have the (```) remain on its own
line. This attempts to fix it.
2025-02-01 10:45:52 +01:00
ddaaa69795
nvim: Check if code evaluation maps set before overriding
If we already have <lleader>cc/cx mappings set before we come to set
them for markdown filetypes we will not override them.
2025-02-01 10:44:57 +01:00
d7d5c5f908
nvim: Update plugins 2025-01-31 12:38:06 +01:00
1848ec168b
nvim: Add simple LLM assisted programming
Added codecompanion as a test for LLM assistance during programming.
Will see how much I end up using it.
2025-01-31 12:37:56 +01:00
0f77a110d3
nvim: Track master for plenary
Ensure that we run the master branch version of plenary and do not
adhere to any versioned release since the newest is now multiple years
back.
2025-01-31 12:37:04 +01:00
8486f8f0f6
nvim: Change select all mapping
I only rarely use it these days, and it takes up a valuable 'menu'
space. Simply capitalize for now so it is more out of the way.
2025-01-31 12:36:09 +01:00
f4da232b79
nvim: Add pandoc completion to blink 2025-01-31 12:35:27 +01:00
3a10d7a849
nvim: Switch nvim-cmp for blink.cmp completion
Switched completion engines. Blink is supposedly faster and so on but
what I really love is the batteries-included style.
I don't have to set up the basic lsp, path, buffer and cmdline
completions, nor styling for basic kind displays and more.
Hundreds of lines of config shrink down to 60, very nice.
2025-01-31 09:51:05 +01:00
2618eb55b8
nvim: Add cmp completion for render-markdown items 2025-01-31 09:44:33 +01:00
49c9dfcc9b
nvim: Get beancount python env from dynamic home env
While we are still hacking our way around a specific pipx venv (which
has to change), we are at least not hardcoding my own home directory
name anymore.
2025-01-31 09:44:32 +01:00
ce78b89597
jrnl: Update config for new version 2025-01-31 09:44:31 +01:00
5e1a20adf0
task: Rename today completed report to donetoday 2025-01-31 09:44:30 +01:00
99c4f67fbc
nvim: Enable formatting through typst lsp 2025-01-31 09:44:29 +01:00
3c7c0e1e87
nvim: Do not hide away html comments in md files
Why would I want to completely hide comments I left for myself.
2025-01-31 09:44:28 +01:00
19 changed files with 588 additions and 711 deletions

View file

@ -11,35 +11,37 @@ if require("core.util").is_available("zk") and require("zk.util").notebook_root(
map("n", "<CR>", "<cmd>lua vim.lsp.buf.definition()<cr>", { silent = true }) map("n", "<CR>", "<cmd>lua vim.lsp.buf.definition()<cr>", { silent = true })
end end
-- edit code cells with full lsp access
map("n", "<localleader>ce", "<cmd>FeMaco<cr>", { silent = true, desc = "edit code block" })
-- execute code cells -- execute code cells
map("n", "<localleader>cc", "<cmd>MdEval<cr>", { silent = true, desc = "evaluate code block" }) if vim.fn.mapcheck("<localleader>cc") == "" then
map("n", "<localleader>cx", "<cmd>MdEvalClean<cr>", { silent = true, desc = "clear code results" }) map("n", "<localleader>cc", require("mdeval").eval_code_block, { silent = true, desc = "evaluate code block" })
end
if vim.fn.mapcheck("<localleader>cx") == "" then
map("n", "<localleader>cx", require("mdeval").eval_clean_results, { silent = true, desc = "clear code results" })
end
-- jump to beginning of previous/ next cell code -- jump to beginning of previous/ next cell code
map("n", "]c", "/^```<cr>}:nohl<cr>", { desc = "next code cell" }) map("n", "]c", "/^```<cr>}:nohl<cr>", { desc = "next code cell" })
map("n", "[c", "?^```<cr>n}:nohl<cr>", { desc = "previous code cell" }) map("n", "[c", "?^```<cr>n}:nohl<cr>", { desc = "previous code cell" })
-- insert cell header above/below -- insert cell header above/below
map("n", "<localleader>co", "o```python<cr><cr>```<esc>k", { desc = "Insert quarto cell below" }) map("n", "<localleader>co", "o```python<cr><cr>```<esc>k", { desc = "Insert code cell below" })
map("n", "<localleader>cO", "O```python<cr><cr>```<esc>k", { desc = "Insert quarto cell above" }) map("n", "<localleader>cO", "O```python<cr><cr>```<esc>k", { desc = "Insert code cell above" })
if require("core.util").is_available("which-key") then if require("core.util").is_available("which-key") then
require("which-key").add({ "<localleader>p", group = "prose" }) require("which-key").add({ "<localleader>p", group = "prose" })
end end
-- show nice md preview in browser (auto-syncs scrolling) -- show nice md preview in browser (auto-syncs scrolling)
local peek_key = "<localleader>po"
if require("core.util").is_available("peek") then if require("core.util").is_available("peek") then
map("n", peek_key, function()
local peek = require("peek") local peek = require("peek")
local function togglePeek()
if peek.is_open() then if peek.is_open() then
peek.close() peek.close()
else else
peek.open() peek.open()
end end
end end, { desc = "show md preview" })
map("n", "<leader>po", togglePeek, { desc = "show md preview" }) elseif vim.fn.exists(":MarkdownPreviewToggle") > 0 then
else map("n", peek_key, "<Plug>MarkdownPreviewToggle", { desc = "show md preview" })
map("n", "<leader>po", "<Plug>MarkdownPreviewToggle", { desc = "show md preview" })
end end
-- create mindmaps directly from markdown! requires external executable -- create mindmaps directly from markdown! requires external executable

View file

@ -1,17 +1,24 @@
local default_buffer_session = function() if require("core.util").is_available("quarto") then
local buffer_path = vim.api.nvim_buf_get_name(0) or vim.fn.tempname() vim.keymap.set("n", "<localleader>po", require("quarto").quartoPreview, { desc = "show quarto preview" })
local temp_path = vim.fn.stdpath("run") .. "/molten-sessions" .. buffer_path .. ".json"
local dir = vim.fn.fnamemodify(temp_path, ":p:h")
if vim.fn.getftype(dir) ~= "dir" then
vim.fn.mkdir(dir, "p")
end end
return temp_path
-- TODO: Puths kernel into local file dir currently,
-- could take an argument to put it into temporary dir instead.
local kernel_filename = function()
local buf = vim.api.nvim_buf_get_name(0)
if not buf or buf:match("^$") then
vim.fn.tempname()
end
local path, name = buf:match("(.-)([^\\/]-%.?([^%.\\/]*))$")
return path .. "." .. name .. ".kernel.json"
end end
-- Start quarto session -- Start quarto session
local startsession = function(file, args) local startsession = function(opts)
file = file or default_buffer_session() local args = opts.fargs
local kernel_filen = args[1] or kernel_filename()
vim.b["sessionfile"] = kernel_filen
local path = require("core.util").get_python_venv_bin() local path = require("core.util").get_python_venv_bin()
if not path then if not path then
@ -19,39 +26,53 @@ local startsession = function(file, args)
end end
vim.g["python3_host_prog"] = path vim.g["python3_host_prog"] = path
if vim.fn.executable("jupyter-console") ~= 1 then -- simply attach to existing if exists
if vim.fn.filereadable(kernel_filen) == 1 then
vim.cmd("MoltenInit " .. kernel_filen)
return return
end end
if args then -- look for session maker
file = args[0] local exec_name = "jupyter-kernel"
local exec_path = (require("core.util").get_python_venv_basefolder() or "") .. "/bin/" .. exec_name
if vim.fn.filereadable(exec_path) ~= 1 then
exec_path = exec_name
if vim.fn.executable(exec_path) ~= 1 then
return
end end
end
-- make our own session
local once = false local once = false
vim.fn.jobstart({ "jupyter", "console", "-f", file }, { vim.fn.jobstart({ exec_path, "--KernelManager.connection_file", kernel_filen }, {
on_stdout = function(_) on_stderr = function(_, data)
if not once then if not once then
vim.cmd("MoltenInit " .. file) for _, v in pairs(data) do
end if v:find("connect a client") then
vim.cmd("MoltenInit " .. kernel_filen)
once = true once = true
end
end
end
end, end,
on_exit = function(_) on_exit = function(_)
vim.notify(string.format("jupyter kernel stopped: %s", file), vim.log.levels.INFO) vim.notify(string.format("jupyter kernel stopped: %s", kernel_filen), vim.log.levels.INFO)
end, end,
stdin = nil, stdin = nil,
}) })
end end
vim.api.nvim_create_user_command("JupyterStart", function()
startsession(vim.b["sessionfile"] or default_buffer_session()) vim.api.nvim_create_user_command("JupyterStart", function(opts)
end, {}) startsession(opts)
end, { nargs = "?" })
vim.keymap.set("n", "<localleader>cS", ":JupyterStart<cr>", { desc = "start code session", silent = true })
if vim.g.quarto_auto_init_molten_session then if vim.g.quarto_auto_init_molten_session then
vim.api.nvim_create_autocmd({ "InsertEnter", "BufEnter" }, { vim.api.nvim_create_autocmd({ "BufEnter" }, {
callback = function() callback = function()
if vim.b["sessionfile"] == nil then if vim.b["sessionfile"] == nil then
local path = default_buffer_session() vim.schedule(function()
vim.b["sessionfile"] = path startsession()
vim.schedule_wrap(function()
startsession(path)
end) end)
end end
end, end,

View file

@ -0,0 +1,3 @@
if vim.fn.exists(":TypstPreviewToggle") > 0 then
vim.keymap.set("n", "<localleader>po", "<cmd>TypstPreviewToggle<cr>", { desc = "show typst preview" })
end

View file

@ -1,47 +1,36 @@
{ {
"Arduino.nvim": { "branch": "main", "commit": "5988e7b08d8d6dc0a2d37e805cbed57dc13d869a" }, "Arduino.nvim": { "branch": "main", "commit": "5988e7b08d8d6dc0a2d37e805cbed57dc13d869a" },
"FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" }, "FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" },
"LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" },
"Navigator.nvim": { "branch": "master", "commit": "91d86506ac2a039504d5205d32a1d4bc7aa57072" }, "Navigator.nvim": { "branch": "master", "commit": "91d86506ac2a039504d5205d32a1d4bc7aa57072" },
"aerial.nvim": { "branch": "master", "commit": "9c29a1a66eb31384888e413e510ba72496e06770" },
"bats.vim": { "branch": "master", "commit": "6a5d2ef22b0ede503d867770afd02ebb1f97b709" }, "bats.vim": { "branch": "master", "commit": "6a5d2ef22b0ede503d867770afd02ebb1f97b709" },
"cmp-beancount": { "branch": "main", "commit": "29e23297c06b9d69771e4b14e0fb3b9d583a150e" }, "blink.cmp": { "branch": "main", "commit": "b6f11a0aa33e601c469a126e3ed6e35208fe3ea3" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "blink.compat": { "branch": "main", "commit": "1176525a78319a208300a1910b6fd9e0cfabff25" },
"cmp-calc": { "branch": "main", "commit": "5947b412da67306c5b68698a02a846760059be2e" }, "cmp-calc": { "branch": "main", "commit": "5947b412da67306c5b68698a02a846760059be2e" },
"cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, "cmp-pandoc.nvim": { "branch": "main", "commit": "30faa4456a7643c4cb02d8fa18438fd484ed7602" },
"cmp-latex-symbols": { "branch": "main", "commit": "165fb66afdbd016eaa1570e41672c4c557b57124" },
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
"cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "031e6ba70b0ad5eee49fd2120ff7a2e325b17fa7" },
"cmp-pandoc-references": { "branch": "master", "commit": "2c808dff631a783ddd2c554c4c6033907589baf6" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp-rg": { "branch": "master", "commit": "70a43543f61b6083ba9c3b7deb9ccee671410ac6" },
"cmp-spell": { "branch": "master", "commit": "694a4e50809d6d645c1ea29015dad0c293f019d6" }, "cmp-spell": { "branch": "master", "commit": "694a4e50809d6d645c1ea29015dad0c293f019d6" },
"cmp-treesitter": { "branch": "master", "commit": "958fcfa0d8ce46d215e19cc3992c542f576c4123" }, "codecompanion.nvim": { "branch": "main", "commit": "7cc8c94b373a60f86ef40bfc4ecc7c83a9771231" },
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, "conform.nvim": { "branch": "master", "commit": "80b57f662b5e13ae8c2c7c38639966084625fa5e" },
"completion-vcard": { "branch": "master", "commit": "2220fd517a985ececed1adcf0e5be8f2815564c7" }, "copilot.vim": { "branch": "release", "commit": "87038123804796ca7af20d1b71c3428d858a9124" },
"conform.nvim": { "branch": "master", "commit": "6239d9986f51ca93ded99ecdb1af0e287eabb651" }, "dial.nvim": { "branch": "master", "commit": "34bbd9c387c358190e61ce71017faad3dffa7a74" },
"dial.nvim": { "branch": "master", "commit": "46b4375e84e8eb771129bff6b2b1e47746601ef9" }, "dressing.nvim": { "branch": "master", "commit": "3a45525bb182730fe462325c99395529308f431e" },
"dressing.nvim": { "branch": "master", "commit": "43b8f74e0b1e3f41e51f640f8efa3bcd401cea0d" }, "fidget.nvim": { "branch": "main", "commit": "9238947645ce17d96f30842e61ba81147185b657" },
"fidget.nvim": { "branch": "main", "commit": "ef99df04a1c53a453602421bc0f756997edc8289" },
"flash.nvim": { "branch": "main", "commit": "ec0bf2842189f65f60fd40bf3557cac1029cc932" }, "flash.nvim": { "branch": "main", "commit": "ec0bf2842189f65f60fd40bf3557cac1029cc932" },
"friendly-snippets": { "branch": "main", "commit": "de8fce94985873666bd9712ea3e49ee17aadb1ed" }, "friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" },
"fwatch.nvim": { "branch": "main", "commit": "a691f7349dc66285cd75a1a698dd28bca45f2bf8" }, "fwatch.nvim": { "branch": "main", "commit": "a691f7349dc66285cd75a1a698dd28bca45f2bf8" },
"git-conflict.nvim": { "branch": "main", "commit": "4bbfdd92d547d2862a75b4e80afaf30e73f7bbb4" }, "git-conflict.nvim": { "branch": "main", "commit": "4bbfdd92d547d2862a75b4e80afaf30e73f7bbb4" },
"gitsigns.nvim": { "branch": "main", "commit": "0b04035bb7b3c83e999b9676e2fb46fd0aa9f910" }, "gitsigns.nvim": { "branch": "main", "commit": "0b04035bb7b3c83e999b9676e2fb46fd0aa9f910" },
"glance.nvim": { "branch": "master", "commit": "17ee84e29ac33e7e5d91609f675cee8477586bda" }, "glance.nvim": { "branch": "master", "commit": "1a08824835d7582457b67acbe23ca33487912a5e" },
"grug-far.nvim": { "branch": "main", "commit": "9a2f78219390b47d67795ab09390d7f092e23976" }, "grug-far.nvim": { "branch": "main", "commit": "635e69adf3a714621bd0a289314bc23c5848babb" },
"helpview.nvim": { "branch": "main", "commit": "34be34afd0811dee17e6b0c46176d9140659fe8e" }, "helpview.nvim": { "branch": "main", "commit": "34be34afd0811dee17e6b0c46176d9140659fe8e" },
"hunk.nvim": { "branch": "master", "commit": "eb89245a66bdfce10436d15923bf4deb43d23c96" }, "image.nvim": { "branch": "master", "commit": "6ffafab2e98b5bda46bf227055aa84b90add8cdc" },
"image.nvim": { "branch": "master", "commit": "da64ce69598875c9af028afe129f916b02ccc42e" },
"img-clip.nvim": { "branch": "main", "commit": "28a32d811d69042f4fa5c3d5fa35571df2bc1623" }, "img-clip.nvim": { "branch": "main", "commit": "28a32d811d69042f4fa5c3d5fa35571df2bc1623" },
"jupytext.nvim": { "branch": "main", "commit": "c8baf3ad344c59b3abd461ecc17fc16ec44d0f7b" }, "jupytext.nvim": { "branch": "main", "commit": "c8baf3ad344c59b3abd461ecc17fc16ec44d0f7b" },
"lazy.nvim": { "branch": "main", "commit": "7967abe55752aa90532e6bb4bd4663fe27a264cb" }, "lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" },
"lazydev.nvim": { "branch": "main", "commit": "f59bd14a852ca43db38e3662395354cb2a9b13e0" }, "lazydev.nvim": { "branch": "main", "commit": "f59bd14a852ca43db38e3662395354cb2a9b13e0" },
"lsp-setup.nvim": { "branch": "main", "commit": "6e4e977512ce426d8b52c27f3b6e6aefc73e1452" }, "ltex_extra.nvim": { "branch": "dev", "commit": "09dc879b1873001f855bca5ad1f024ca15b9bbaf" },
"ltex_extra.nvim": { "branch": "dev", "commit": "57192d7ae5ba8cef3c10e90f2cd62d4a7cdaab69" },
"lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" }, "lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" },
"luarocks.nvim": { "branch": "main", "commit": "1db9093915eb16ba2473cfb8d343ace5ee04130a" }, "luarocks.nvim": { "branch": "main", "commit": "1db9093915eb16ba2473cfb8d343ace5ee04130a" },
"luvit-meta": { "branch": "main", "commit": "57d464c4acb5c2e66bd4145060f5dc9e96a7bbb7" }, "luvit-meta": { "branch": "main", "commit": "1df30b60b1b4aecfebc785aa98943db6c6989716" },
"markmap.nvim": { "branch": "main", "commit": "5fb6755cf5434511cc23a4936c9eb76b9142fba5" }, "markmap.nvim": { "branch": "main", "commit": "5fb6755cf5434511cc23a4936c9eb76b9142fba5" },
"mason-conform.nvim": { "branch": "main", "commit": "abce2be529f3b4b336c56d0ba6336a9144e0fee6" }, "mason-conform.nvim": { "branch": "main", "commit": "abce2be529f3b4b336c56d0ba6336a9144e0fee6" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "25c11854aa25558ee6c03432edfa0df0217324be" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "25c11854aa25558ee6c03432edfa0df0217324be" },
@ -49,54 +38,51 @@
"mason.nvim": { "branch": "main", "commit": "c43eeb5614a09dc17c03a7fb49de2e05de203924" }, "mason.nvim": { "branch": "main", "commit": "c43eeb5614a09dc17c03a7fb49de2e05de203924" },
"mdeval.nvim": { "branch": "master", "commit": "0e1b248db174a9659a9ab16eb8c90ff3aec55264" }, "mdeval.nvim": { "branch": "master", "commit": "0e1b248db174a9659a9ab16eb8c90ff3aec55264" },
"mini.nvim": { "branch": "main", "commit": "64e95aa77587d04f97a5579b2106a82a08a7d968" }, "mini.nvim": { "branch": "main", "commit": "64e95aa77587d04f97a5579b2106a82a08a7d968" },
"molten-nvim": { "branch": "main", "commit": "66ee5c0a0fbe3e014b867d04db44592f2d3eb30f" }, "molten-nvim": { "branch": "main", "commit": "c621baf53459a6c45dfd98dcc11cbba7a7ae9470" },
"neo-tree.nvim": { "branch": "main", "commit": "a77af2e764c5ed4038d27d1c463fa49cd4794e07" }, "neo-tree.nvim": { "branch": "main", "commit": "5d172e8315444dbc32867d1c7b04d8e7e68ec4e1" },
"neogen": { "branch": "main", "commit": "dc50715c009f89b8111197fd2f282f6042daa7ea" }, "neogen": { "branch": "main", "commit": "b2e78708876f4da507839726816010a68e33fec8" },
"neotest": { "branch": "master", "commit": "6d3d22cdad49999ef774ebe1bc250a4994038964" }, "neotest": { "branch": "master", "commit": "d66cf4e05a116957f0d3a7755a24291c7d1e1f72" },
"neotest-python": { "branch": "master", "commit": "a2861ab3c9a0bf75a56b11835c2bfc8270f5be7e" }, "neotest-python": { "branch": "master", "commit": "a2861ab3c9a0bf75a56b11835c2bfc8270f5be7e" },
"nui.nvim": { "branch": "main", "commit": "a0fd35fcbb4cb479366f1dc5f20145fd718a3733" }, "nui.nvim": { "branch": "main", "commit": "a0fd35fcbb4cb479366f1dc5f20145fd718a3733" },
"nvim-FeMaco.lua": { "branch": "main", "commit": "96bbf843595dbe865838b3f2484b73557f34700c" }, "nvim-FeMaco.lua": { "branch": "main", "commit": "96bbf843595dbe865838b3f2484b73557f34700c" },
"nvim-cmp": { "branch": "main", "commit": "ca4d3330d386e76967e53b85953c170658255ecb" }, "nvim-colorizer.lua": { "branch": "master", "commit": "39142aa1390d6ccdca57cb6dc5b2c7bfed460ffe" },
"nvim-colorizer.lua": { "branch": "master", "commit": "4acf88d31b3a7a1a7f31e9c30bf2b23c6313abdb" }, "nvim-coverage": { "branch": "main", "commit": "a939e425e363319d952a6c35fb3f38b34041ded2" },
"nvim-coverage": { "branch": "main", "commit": "aa4b4400588e2259e87e372b1e4e90ae13cf5a39" }, "nvim-lint": { "branch": "master", "commit": "789b7ada1b4f00e08d026dffde410dcfa6a0ba87" },
"nvim-lint": { "branch": "master", "commit": "6b46370d02cd001509a765591a3ffc481b538794" }, "nvim-lspconfig": { "branch": "master", "commit": "bf81bef7d75a0f4a0cf61462b318ea00b3c97cc8" },
"nvim-lspconfig": { "branch": "master", "commit": "7b0a2f6b14485bb5a237fc1328a487ff3e4a08c5" }, "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" },
"nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" }, "nvim-surround": { "branch": "main", "commit": "ae298105122c87bbe0a36b1ad20b06d417c0433e" },
"nvim-surround": { "branch": "main", "commit": "9f0cb495f25bff32c936062d85046fbda0c43517" }, "nvim-toggleterm.lua": { "branch": "main", "commit": "50ea089fc548917cc3cc16b46a8211833b9e3c7c" },
"nvim-toggleterm.lua": { "branch": "main", "commit": "022ff5594acccc8d90d2e46dc43994f7722ebdf7" },
"nvim-treesitter": { "branch": "master", "commit": "cfc6f2c117aaaa82f19bcce44deec2c194d900ab" }, "nvim-treesitter": { "branch": "master", "commit": "cfc6f2c117aaaa82f19bcce44deec2c194d900ab" },
"nvim-treesitter-context": { "branch": "master", "commit": "920999bf53daa63ddf12efdeb5137a7cea1cc201" }, "nvim-treesitter-context": { "branch": "master", "commit": "bece284c5322ddf6946fa4bdc383a2bc033269d7" },
"nvim-treesitter-endwise": { "branch": "master", "commit": "8b34305ffc28bd75a22f5a0a9928ee726a85c9a6" }, "nvim-treesitter-endwise": { "branch": "master", "commit": "8b34305ffc28bd75a22f5a0a9928ee726a85c9a6" },
"nvim-treesitter-textsubjects": { "branch": "master", "commit": "a8d2844bba925d9450ef7ab215f3b054028288ca" }, "nvim-treesitter-textsubjects": { "branch": "master", "commit": "a8d2844bba925d9450ef7ab215f3b054028288ca" },
"nvim-ts-autotag": { "branch": "main", "commit": "f2d24aca1bcbbd2c0306fd93d52e3697027b77ff" }, "nvim-ts-autotag": { "branch": "main", "commit": "1cca23c9da708047922d3895a71032bc0449c52d" },
"nvim-ts-context-commentstring": { "branch": "main", "commit": "9c74db656c3d0b1c4392fc89a016b1910539e7c0" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "1b212c2eee76d787bbea6aa5e92a2b534e7b4f8f" },
"nvim-web-devicons": { "branch": "master", "commit": "5b9067899ee6a2538891573500e8fd6ff008440f" }, "nvim-web-devicons": { "branch": "master", "commit": "5b9067899ee6a2538891573500e8fd6ff008440f" },
"otter.nvim": { "branch": "main", "commit": "ca9ce67d0399380b659923381b58d174344c9ee7" }, "otter.nvim": { "branch": "main", "commit": "7b42ce1f9deabc596214fc3b80e5ab4fd5b32726" },
"parrot.nvim": { "branch": "main", "commit": "413679a79cf220c261a4700cee5a01cadd99db53" },
"peek.nvim": { "branch": "master", "commit": "5820d937d5414baea5f586dc2a3d912a74636e5b" }, "peek.nvim": { "branch": "master", "commit": "5820d937d5414baea5f586dc2a3d912a74636e5b" },
"plenary.nvim": { "branch": "master", "commit": "50012918b2fc8357b87cff2a7f7f0446e47da174" }, "plenary.nvim": { "branch": "master", "commit": "3707cdb1e43f5cea73afb6037e6494e7ce847a66" },
"popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" },
"quarto-nvim": { "branch": "main", "commit": "23083a0152799ca7263ac9ae53d768d4dd93d24e" }, "quarto-nvim": { "branch": "main", "commit": "1cb2d24d7793241bd43f38e3a6f99a6d11f84458" },
"rainbow-delimiters.nvim": { "branch": "master", "commit": "e0f9b3efe150724af2d2ed59997d5ece373840e3" }, "rainbow-delimiters.nvim": { "branch": "master", "commit": "dc788723f717bdd3041838b8db34cce53c9aa920" },
"render-markdown": { "branch": "main", "commit": "6096cf3608b576a38fd1396227dbc0473091714d" }, "render-markdown": { "branch": "main", "commit": "16369540a005ad0cf267498162aedca6dfca1b9c" },
"smartcolumn.nvim": { "branch": "main", "commit": "d01b99355c7fab13233f48d0f28dc097e68a03f7" }, "smartcolumn.nvim": { "branch": "main", "commit": "d01b99355c7fab13233f48d0f28dc097e68a03f7" },
"stickybuf.nvim": { "branch": "master", "commit": "2160fcd536d81f5fa43f7167dba6634e814e3154" }, "stickybuf.nvim": { "branch": "master", "commit": "2160fcd536d81f5fa43f7167dba6634e814e3154" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "dae2eac9d91464448b584c7949a31df8faefec56" },
"telescope-jj.nvim": { "branch": "main", "commit": "9527e39f30eded7950ca127698422ec412d633c4" },
"telescope-luasnip.nvim": { "branch": "master", "commit": "11668478677de360dea45cf2b090d34f21b8ae07" },
"telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
"texpresso.vim": { "branch": "main", "commit": "1cc949fde8ed3220968039b6b1b6ccdd9f475087" }, "texpresso.vim": { "branch": "main", "commit": "907838c08bbf99ad6bed3c908f1d0551a92ab4e0" },
"todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" }, "todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" },
"trouble.nvim": { "branch": "main", "commit": "40c5317a6e90fe3393f07b0fee580d9e93a216b4" }, "trouble.nvim": { "branch": "main", "commit": "40c5317a6e90fe3393f07b0fee580d9e93a216b4" },
"twilight.nvim": { "branch": "main", "commit": "8bb7fa7b918baab1ca81b977102ddb54afa63512" }, "twilight.nvim": { "branch": "main", "commit": "8bb7fa7b918baab1ca81b977102ddb54afa63512" },
"typst-preview.nvim": { "branch": "master", "commit": "c1100e8788baabe8ca8f8cd7fd63d3d479e49e36" },
"undotree": { "branch": "main", "commit": "eab459ab87dd249617b5f7187bb69e614a083047" }, "undotree": { "branch": "main", "commit": "eab459ab87dd249617b5f7187bb69e614a083047" },
"vifm.vim": { "branch": "master", "commit": "a8130c37d144b51d84bee19f0532abcd3583383f" }, "vifm.vim": { "branch": "master", "commit": "a8130c37d144b51d84bee19f0532abcd3583383f" },
"vim-criticmarkup": { "branch": "master", "commit": "d15dc134eb177a170c79f6377f81eb02a9d20b02" }, "vim-criticmarkup": { "branch": "master", "commit": "d15dc134eb177a170c79f6377f81eb02a9d20b02" },
"vim-numbertoggle": { "branch": "main", "commit": "df9b1fe616507340718716204ba7f434125bdf7a" }, "vim-numbertoggle": { "branch": "main", "commit": "df9b1fe616507340718716204ba7f434125bdf7a" },
"vim-spellsync": { "branch": "master", "commit": "3d6dd50de9c4d953cc16638112a6ae196df41463" }, "vim-spellsync": { "branch": "master", "commit": "3d6dd50de9c4d953cc16638112a6ae196df41463" },
"wezterm.nvim": { "branch": "main", "commit": "f73bba23ab4becd146fa2d0a3a16a84b987eeaca" }, "wezterm.nvim": { "branch": "main", "commit": "f73bba23ab4becd146fa2d0a3a16a84b987eeaca" },
"which-key.nvim": { "branch": "main", "commit": "9b365a6428a9633e3eeb34dbef1b791511c54f70" }, "which-key.nvim": { "branch": "main", "commit": "8ab96b38a2530eacba5be717f52e04601eb59326" },
"wrapping.nvim": { "branch": "master", "commit": "3a823200c297885b70515fa8d974e1763c578e26" }, "wrapping.nvim": { "branch": "master", "commit": "3a823200c297885b70515fa8d974e1763c578e26" },
"zen-mode.nvim": { "branch": "main", "commit": "04b52674b8c800f8b7d4609e8bd8d0212e3ffa79" }, "zen-mode.nvim": { "branch": "main", "commit": "04b52674b8c800f8b7d4609e8bd8d0212e3ffa79" },
"zk-nvim": { "branch": "main", "commit": "469e7562b8dbf1bcbfe1be245ca5d1724917f5c6" } "zk-nvim": { "branch": "main", "commit": "50d92038d22ad9a537dcfd463c38527591430df6" }
} }

View file

@ -120,7 +120,7 @@ map("n", "<leader>\\", ":vsp<cr>", { desc = "open vert split" })
map("n", "<leader>T", ":tabedit | Vifm<cr>", { desc = "open tab" }) map("n", "<leader>T", ":tabedit | Vifm<cr>", { desc = "open tab" })
-- select the whole buffer with <leader>-a -- select the whole buffer with <leader>-a
map("n", "<leader>a", "ggVG", { desc = "select all" }) map("n", "<leader>A", "ggVG", { desc = "select all" })
-- Format current Paragraph (esp useful in prose writing) -- Format current Paragraph (esp useful in prose writing)
map("n", "<localleader>q", "gqap", { silent = true, desc = "Format current paragraph" }) map("n", "<localleader>q", "gqap", { silent = true, desc = "Format current paragraph" })

View file

@ -64,6 +64,11 @@ function T.get_python_venv_basefolder(workspace)
return venv_path_cached return venv_path_cached
end end
local match local match
match = vim.fn.finddir(".venv", "**1")
if match ~= "" then
venv_path_cached = match
return venv_path_cached
end
-- Look downwards for file, can be nested. Limit to 1 depth for speed rn -- Look downwards for file, can be nested. Limit to 1 depth for speed rn
-- TODO: Maybe not hardcode 1-depth but allow choice. -- TODO: Maybe not hardcode 1-depth but allow choice.
match = vim.fn.findfile("pyvenv.cfg", "**1") match = vim.fn.findfile("pyvenv.cfg", "**1")
@ -79,8 +84,8 @@ function T.get_python_venv_basefolder(workspace)
if obj.code ~= 0 then if obj.code ~= 0 then
return return
end end
local venv_base_folder = obj.stdout:match("^%s*(.-)%s*$") match = obj.stdout:match("^%s*(.-)%s*$")
venv_path_cached = venv_base_folder venv_path_cached = match
return venv_path_cached return venv_path_cached
end end
end end

View file

@ -203,6 +203,32 @@ return {
draw = { animation = require("mini.indentscope").gen_animation.none() }, draw = { animation = require("mini.indentscope").gen_animation.none() },
options = { indent_at_cursor = false }, options = { indent_at_cursor = false },
}) })
-- disable indentlines for terminals
vim.api.nvim_create_autocmd("TermOpen", {
pattern = "*",
callback = function()
vim.b.miniindentscope_disable = true
end,
})
vim.api.nvim_create_autocmd("FileType", {
pattern = {
"lazy",
"mason",
"help",
"lspinfo",
"packer",
"checkhealth",
"man",
"gitcommit",
"TelescopePrompt",
"TelescopeResults",
"trouble",
},
callback = function()
vim.b.miniindentscope_disable = true
end,
})
require("mini.map").setup() require("mini.map").setup()
require("mini.move").setup() require("mini.move").setup()
require("mini.operators").setup() require("mini.operators").setup()
@ -251,4 +277,6 @@ return {
{ "stevearc/stickybuf.nvim", config = true }, { "stevearc/stickybuf.nvim", config = true },
-- make it a little less painful to open really big (>2mb) files by disabling features -- make it a little less painful to open really big (>2mb) files by disabling features
-- { "LunarVim/bigfile.nvim", lazy = false }, -- { "LunarVim/bigfile.nvim", lazy = false },
-- set plenary to follow master branch here, but let individual plugins actually load it
{ "nvim-lua/plenary.nvim", version = false, optional = true },
} }

View file

@ -1,270 +1,69 @@
local completion_engine = {
{
"hrsh7th/nvim-cmp",
branch = "main",
version = false, -- new releases (>2022) are sadly not versioned
dependencies = {
-- TODO: Move to lsp
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-nvim-lsp-signature-help",
"hrsh7th/cmp-path",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-calc",
"hrsh7th/cmp-cmdline",
-- TODO: Move me into a separate load?
"cbarrete/completion-vcard",
"f3fora/cmp-spell",
"jc-doyle/cmp-pandoc-references",
-- TODO: Decide: get rid or just enable in very specific circumstances
"lukas-reineke/cmp-rg",
-- TODO: Move to treesitter
{ "ray-x/cmp-treesitter", dependencies = { "nvim-treesitter/nvim-treesitter" } },
},
opts = function()
local cmp = require("cmp")
-- style 'ghosttext' which appears behind cursor, showing current completion
vim.api.nvim_set_hl(0, "CmpGhostText", { link = "Comment", default = true })
local has_words_before = function()
---@diagnostic disable-next-line:deprecated
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0
and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
end
local kind_icons = {
Text = "",
Method = "",
Function = "󰊕",
Constructor = "",
Field = "",
Variable = "",
Class = "",
Interface = "",
Module = "",
Property = "",
Unit = "",
Value = "V",
Enum = "",
Keyword = "",
Snippet = "",
Color = "",
File = "",
Reference = "",
Folder = "",
EnumMember = "",
Constant = "",
Struct = "",
Event = "",
Operator = "",
TypeParameter = "",
}
-- `/` cmdline setup.
cmp.setup.cmdline("/", {
completion = { completeopt = "menu,menuone,noinsert,noselect" },
preselect = cmp.PreselectMode.None,
mapping = cmp.mapping.preset.cmdline(),
sources = { { name = "buffer" } },
})
-- `:` cmdline setup.
cmp.setup.cmdline(":", {
completion = { completeopt = "menu,menuone,noinsert,noselect" },
preselect = cmp.PreselectMode.None,
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({ { name = "path" } }, {
{ name = "cmdline", option = { ignore_cmds = { "Man", "!" } } },
}),
})
return { return {
window = { documentation = cmp.config.window.bordered() }, -- full documentation here: https://cmp.saghen.dev/
-- add noselect to not automatically select first item "saghen/blink.cmp",
completion = { completeopt = "menu,menuone,noinsert" },
preselect = cmp.PreselectMode.Item, -- not sure what this changes diff than above?
experimental = {
ghost_text = {
hl_group = "CmpGhostText",
},
},
sources = {
{ name = "nvim_lsp" },
{ name = "nvim_lsp_signature_help" },
{ name = "pandoc_references" },
{ name = "calc" },
{ name = "path" },
{ name = "buffer", keyword_length = 3 },
{ name = "spell", keyword_length = 3 },
-- { name = 'rg', keyword_length = 5 },
{ name = "vCard" },
},
mapping = cmp.mapping.preset.insert({
["<C-b>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<CR>"] = cmp.mapping({
i = function(fallback)
if cmp.visible() and cmp.get_active_entry() then
cmp.confirm({
behavior = cmp.ConfirmBehavior.Replace,
select = false,
})
else
fallback()
end
end,
s = cmp.mapping.confirm({ select = true }),
c = cmp.mapping.confirm({
behavior = cmp.ConfirmBehavior.Replace,
select = false,
}), -- disable selection in cmd mode
}),
["<Tab>"] = cmp.mapping(function(fallback)
-- expand_or_jumpable() will always jump
-- expand_or_locally_jumpable() only jumps when still inside snippet region
if cmp.visible() then
cmp.select_next_item()
elseif has_words_before() then
cmp.complete()
else
fallback()
end
end, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
else
fallback()
end
end, { "i", "s" }),
}),
formatting = {
expandable_indicator = true,
fields = { "kind", "abbr", "menu" },
format = function(entry, vim_item)
-- Kind icons, removing kind text leaving only icon
-- vim_item.kind = string.format('%s %s', kind_icons[vim_item.kind], vim_item.kind)
vim_item.kind = string.format("%s", kind_icons[vim_item.kind])
-- Source
vim_item.menu = ({
buffer = "",
calc = "󰃬",
digraphs = "",
latex_symbols = "𝓧",
luasnip = "",
nvim_lsp = "",
nvim_lua = "󰢱",
pandoc_references = "",
spell = "󰓆",
vCard = "󰛋",
})[entry.source.name]
return vim_item
end,
},
}
end,
event = { "InsertEnter", "CmdlineEnter" },
},
}
--
-- TODO: Enable more lazy loaded startup? And integrate into
-- cmp as insert source instead of in its setup config below.
local snippet_engine = {
"nvim-cmp",
dependencies = { dependencies = {
"L3MON4D3/LuaSnip", "saghen/blink.compat",
"rafamadriz/friendly-snippets", "rafamadriz/friendly-snippets",
"saadparwaiz1/cmp_luasnip", "hrsh7th/cmp-calc",
"f3fora/cmp-spell",
{ {
"benfowler/telescope-luasnip.nvim", "aspeddro/cmp-pandoc.nvim",
dependencies = { { "nvim-telescope/telescope.nvim", optional = true } }, dependencies = {
config = function() "nvim-lua/plenary.nvim",
if require("core.util").is_available("telescope") then },
require("telescope").load_extension("luasnip") opts = {
end filetypes = { "pandoc", "markdown", "quarto", "rmd" },
end, },
}, },
}, },
event = { "InsertEnter" }, event = { "InsertEnter" },
build = "make install_jsregexp", opts = {
opts = function(_, opts) keymap = { preset = "default" },
local cmp = require("cmp")
local luasnip = require("luasnip")
require("luasnip.loaders.from_vscode").lazy_load({ exclude = { "markdown", "quarto" } }) appearance = {
require("luasnip.loaders.from_snipmate").lazy_load() -- Sets the fallback highlight groups to nvim-cmp's highlight groups
-- Useful for when your theme doesn't support blink.cmp
opts.snippet = { -- Will be removed in a future release
expand = function(item) use_nvim_cmp_as_default = true,
require("luasnip").lsp_expand(item.body) -- Set to 'mono' for 'Nerd Font Mono' or 'normal' for 'Nerd Font'
end, -- Adjusts spacing to ensure icons are aligned
} nerd_font_variant = "mono",
local has_words_before = function()
---@diagnostic disable-next-line:deprecated
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
end
table.insert(opts.sources, { name = "luasnip", keyword_length = 1 })
opts.mapping["<Tab>"] = cmp.mapping(function(fallback) -- expand_or_jumpable() will always jump
-- expand_or_locally_jumpable() only jumps when still inside snippet region
if luasnip.expand_or_locally_jumpable() then
luasnip.expand_or_jump()
elseif cmp.visible() then
cmp.select_next_item()
elseif has_words_before() then
cmp.complete()
else
fallback()
end
end, { "i", "s" })
opts.mapping["<S-Tab>"] = cmp.mapping(function(fallback)
if luasnip.locally_jumpable(-1) then
luasnip.jump(-1)
elseif cmp.visible() then
cmp.select_prev_item()
else
fallback()
end
end, { "i", "s" })
end,
}
local beancount_cmp = {
"nvim-cmp",
dependencies = {
"crispgm/cmp-beancount",
}, },
ft = "beancount", completion = {
opts = function(_, opts) documentation = { auto_show = true, auto_show_delay_ms = 500 },
vim.g.python3_host_prog = "/home/marty/.local/pipx/venvs/beancount/bin/python" -- ghost_text = { enabled = true },
table.insert(opts.sources, { },
name = "beancount", signature = {
-- option = { enabled = true,
-- -- TODO: implement dynamically
-- -- I believe if we don't supply this it automatically takes
-- -- from the open file which would be good enough
-- account = "/home/marty/documents/records/budget/main.beancount",
-- },
})
end,
}
local latex_cmp = {
"nvim-cmp",
dependencies = {
-- TODO: Needs better lazy loading
"kdheepak/cmp-latex-symbols",
}, },
event = "CursorHold",
opts = function(_, opts)
table.insert(opts.sources, { name = "latex_symbols" })
end,
}
return { -- Default list of enabled providers defined so that you can extend it
completion_engine, -- elsewhere in your config, without redefining it, due to `opts_extend`
snippet_engine, sources = {
beancount_cmp, default = {
latex_cmp, "pandoc",
"calc",
"lsp",
"path",
"snippets",
"buffer",
"spell",
},
providers = {
calc = {
name = "calc",
module = "blink.compat.source",
},
spell = {
name = "spell",
module = "blink.compat.source",
},
pandoc = {
name = "cmp_pandoc",
module = "blink.compat.source",
},
},
},
},
opts_extend = { "sources.default" },
} }

View file

@ -15,7 +15,6 @@ return {
dependencies = { dependencies = {
"jmbuhr/otter.nvim", "jmbuhr/otter.nvim",
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",
"hrsh7th/nvim-cmp",
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
{ "benlubas/molten-nvim", optional = true }, { "benlubas/molten-nvim", optional = true },
}, },
@ -41,10 +40,11 @@ return {
map("n", "<localleader>ca", require("quarto.runner").run_above, { desc = "run cells above" }) map("n", "<localleader>ca", require("quarto.runner").run_above, { desc = "run cells above" })
map("n", "<localleader>cb", require("quarto.runner").run_below, { desc = "run cells below" }) map("n", "<localleader>cb", require("quarto.runner").run_below, { desc = "run cells below" })
map("n", "<localleader>cA", require("quarto.runner").run_all, { desc = "run all similar cells" }) map("n", "<localleader>cA", require("quarto.runner").run_all, { desc = "run all similar cells" })
-- TODO: overwritten by other moves, i.e. comment?
map("n", "]c", "/^```{<cr>}:nohl<cr>", { desc = "Codecell forward" }) map("n", "]c", "/^```{<cr>}:nohl<cr>", { desc = "Codecell forward" })
map("n", "[c", "?^```<cr>n}:nohl<cr>", { desc = "Codecell last" }) map("n", "[c", "?^```<cr>n}:nohl<cr>", { desc = "Codecell last" })
map("n", "<localleader>co", "o```{python}<cr><cr>```<esc>k", { desc = "Insert quarto cell below" }) map("n", "<localleader>co", "o```{python}<cr><cr>```<esc>k", { desc = "Insert code cell below" })
map("n", "<localleader>cO", "O```{python}<cr><cr>```<esc>k", { desc = "Insert quarto cell above" }) map("n", "<localleader>cO", "O```{python}<cr><cr>```<esc>k", { desc = "Insert code cell above" })
if require("core.util").is_available("which-key") then if require("core.util").is_available("which-key") then
require("which-key").add({ "<localleader>c", group = "codecells" }) require("which-key").add({ "<localleader>c", group = "codecells" })
@ -53,6 +53,11 @@ return {
ft = { "quarto" }, ft = { "quarto" },
}, },
-- image display
{
"3rd/image.nvim",
version = false,
dependencies = {
{ {
"vhyrro/luarocks.nvim", "vhyrro/luarocks.nvim",
priority = 1001, -- this plugin needs to run before anything else priority = 1001, -- this plugin needs to run before anything else
@ -60,41 +65,32 @@ return {
rocks = { "magick" }, rocks = { "magick" },
}, },
}, },
-- image display { "nvim-treesitter/nvim-treesitter", optional = true },
{ },
"3rd/image.nvim", opts = {
dependencies = { "luarocks.nvim", { "nvim-treesitter/nvim-treesitter", optional = true } }, backend = "kitty",
cond = vim.fn.executable("magick") == 1, -- only runs if imagemagick installed editor_only_render_when_focused = true,
config = function() -- TODO: Check that this works without TS md parser, norg or typst installed
local integrations = {} -- If errors go back to commit before 87691932 when this check was still here
if vim.treesitter.language.get_lang("markdown") then integrations = {
integrations["markdown"] = { markdown = {
enabled = true,
clear_in_insert_mode = true,
download_remote_images = true,
only_render_image_at_cursor = true, only_render_image_at_cursor = true,
filetypes = { "markdown", "vimwiki", "quarto" }, filetypes = { "markdown", "vimwiki", "quarto" },
} },
end neorg = {
if vim.treesitter.language.get_lang("norg") then
integrations["neorg"] = {
enabled = true,
clear_in_insert_mode = true,
download_remote_images = true,
only_render_image_at_cursor = true, only_render_image_at_cursor = true,
filetypes = { "norg" }, },
} typst = {
end only_render_image_at_cursor = true,
if next(integrations) ~= nil then -- only set up if we have at least 1 TS parser },
require("image").setup({ },
backend = "kitty", },
integrations = integrations, config = function(_, opts)
}) require("image").setup(opts)
vim.g.molten_image_provider = "image.nvim" vim.g.molten_image_provider = "image.nvim"
pcall(vim.fn.MoltenUpdateOption, "molten_image_provider", "image.nvim") pcall(vim.fn.MoltenUpdateOption, "molten_image_provider", "image.nvim")
end
end, end,
ft = { "markdown", "vimwiki", "quarto", "norg", "python" }, ft = { "markdown", "vimwiki", "quarto", "norg", "typst", "python" },
priority = 60, priority = 60,
}, },
-- REPL work -- REPL work
@ -145,7 +141,7 @@ return {
":noautocmd :MoltenEnterOutput<cr>", ":noautocmd :MoltenEnterOutput<cr>",
{ silent = true, desc = "show output" } { silent = true, desc = "show output" }
) )
map("n", "<localleader>cP", function() map("n", "<localleader>cx", function()
vim.cmd("MoltenHideOutput") vim.cmd("MoltenHideOutput")
vim.cmd("MoltenDelete") vim.cmd("MoltenDelete")
end, { silent = true, desc = "hide output" }) end, { silent = true, desc = "hide output" })
@ -192,9 +188,9 @@ return {
ft = { "norg", "quarto", "python" }, ft = { "norg", "quarto", "python" },
keys = { keys = {
{ "<leader>vn", ":MoltenInfo<cr>" }, { "<leader>vn", ":MoltenInfo<cr>" },
{ "<localleader>cJ", ":JupyterStart<cr>", desc = "start jupyter", silent = true },
}, },
cmd = { cmd = {
"JupyterStart",
"MoltenInfo", "MoltenInfo",
"MoltenInit", "MoltenInit",
"MoltenDeinit", "MoltenDeinit",
@ -225,25 +221,29 @@ return {
-- Edit code blocks in md/quarto using whatever language is -- Edit code blocks in md/quarto using whatever language is
{ {
"AckslD/nvim-FeMaco.lua", "AckslD/nvim-FeMaco.lua",
cmd = { cmd = { "FeMaco" },
"FeMaco", ft = { "markdown", "rmd", "quarto" },
opts = {
ensure_newline = function(base_ft)
if base_ft == "quarto" or base_ft == "markdown" then
return true
end
return false
end,
}, },
ft = { "markdown", "quarto" }, config = function(_, opts)
opts = {}, vim.keymap.set("n", "<localleader>ce", ":FeMaco<cr>", { desc = "edit codecell" })
require("femaco").setup(opts)
end,
dependencies = { dependencies = {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
}, },
keys = {
{ "<localleader>ce", ":FeMaco<cr>", desc = "edit codecell" },
},
}, },
-- MARKDOWN ONLY -- MARKDOWN ONLY
-- Evaluate markdown code blocks -- Evaluate markdown code blocks
{ { -- TODO: Have results appear as virtual text instead of real text?
"jubnzv/mdeval.nvim", "jubnzv/mdeval.nvim",
cmd = { cmd = { "MdEval" },
"MdEval",
},
ft = { "markdown" }, ft = { "markdown" },
opts = { opts = {
require_confirmation = false, require_confirmation = false,
@ -271,7 +271,7 @@ return {
}, },
}, },
}, },
cond = vim.fn.executable("jupytext") == 1, -- only runs if imagemagick installed cond = vim.fn.executable("jupytext") == 1, -- only runs if jupytext installed
lazy = false, -- does not work in lazy mode lazy = false, -- does not work in lazy mode
}, },
} }

View file

@ -14,7 +14,7 @@ local formatters = {
lua = { "stylua" }, lua = { "stylua" },
markdown = { "prettier", "injected" }, markdown = { "prettier", "injected" },
nim = { "nimpretty" }, nim = { "nimpretty" },
python = { "ruff_fix", "ruff_format", "ruff_organize_imports" }, python = { "ruff_format", "ruff_organize_imports" },
quarto = { "prettier", "injected" }, quarto = { "prettier", "injected" },
sh = { "shfmt" }, sh = { "shfmt" },
sql = { "sleek" }, sql = { "sleek" },

View file

@ -12,17 +12,18 @@ return {
}, },
dependencies = { dependencies = {
{ "Bilal2453/luvit-meta" }, -- optional `vim.uv` typings { "Bilal2453/luvit-meta" }, -- optional `vim.uv` typings
{ -- optional completion source for require statements and module annotations -- FIXME: Set up to work with blink.cmp
"hrsh7th/nvim-cmp", -- { -- optional completion source for require statements and module annotations
opts = function(_, opts) -- "hrsh7th/nvim-cmp",
opts.sources = opts.sources or {} -- opts = function(_, opts)
table.insert(opts.sources, { -- opts.sources = opts.sources or {}
name = "lazydev", -- table.insert(opts.sources, {
group_index = 0, -- set group index to 0 to skip loading LuaLS completions -- name = "lazydev",
}) -- group_index = 0, -- set group index to 0 to skip loading LuaLS completions
end, -- })
optional = true, -- end,
}, -- optional = true,
-- },
}, },
}, },
} }

View file

@ -0,0 +1,54 @@
return {
-- TODO: Add completion w blink, see https://codecompanion.olimorris.dev/installation.html
{
"olimorris/codecompanion.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter",
"github/copilot.vim",
},
init = function(_)
if require("core.util").is_available("which-key") then
require("which-key").add({ "<leader>a", group = "codecompanion" })
end
end,
opts = {
strategies = {
chat = { adapter = "groq" },
inline = { adapter = "groq" },
},
adapters = {
groq = function()
return require("codecompanion.adapters").extend("openai", {
env = {
api_key = "GROQ_API_KEY",
},
name = "Groq",
url = "https://api.groq.com/openai/v1/chat/completions",
schema = {
model = {
default = "llama-3.1-8b-instant",
choices = {
"llama-3.3-70b-versatile",
"mixtral-8x7b-32768",
},
},
},
max_tokens = {
default = 4096,
},
temperature = {
default = 1,
},
})
end,
},
},
keys = {
{ "<leader>aa", "<cmd>CodeCompanionActions<cr>", desc = "Actions", silent = true, mode = { "n", "v" } },
{ "<leader>ac", "<cmd>CodeCompanionChat Toggle<cr>", desc = "Toggle chat", silent = true },
{ "<leader>ac", "<cmd>CodeCompanionChat Add<cr>", desc = "Add to chat", silent = true, mode = "v" },
},
cmd = { "CodeCompanionActions", "CodeCompanionChat", "CodeCompanion", "CodeCompanionCmd" },
},
}

View file

@ -35,22 +35,28 @@ local servers = {
serve_d = {}, serve_d = {},
taplo = {}, taplo = {},
texlab = {}, texlab = {},
tinymist = {}, tinymist = {
settings = {
formatterMode = "typstyle",
},
},
ts_ls = {}, ts_ls = {},
yamlls = {}, yamlls = {},
} }
return { local lsp = {
-- lsp setup { -- pretty lsp 'peek' menus
{ "DNLHC/glance.nvim",
"junnplus/lsp-setup.nvim", opts = { border = { enable = true }, theme = { enable = true, mode = "auto" } },
dependencies = { cmd = { "Glance" },
{
"neovim/nvim-lspconfig",
-- will sometimes not keep up with lsp changes if set to stable
version = false,
}, },
{ {
"neovim/nvim-lspconfig",
dependencies = {
{
"williamboman/mason-lspconfig.nvim",
opts = { automatic_installation = true },
dependencies = {
"williamboman/mason.nvim", "williamboman/mason.nvim",
cmd = { cmd = {
"Mason", "Mason",
@ -60,158 +66,24 @@ return {
"MasonLog", "MasonLog",
"MasonUpdate", "MasonUpdate",
}, },
opts = {},
build = ":MasonUpdate", build = ":MasonUpdate",
keys = { keys = {
{ "<leader>vm", ":Mason<cr>", desc = "Mason" }, { "<leader>vm", ":Mason<cr>", desc = "Mason" },
}, },
}, },
{
"williamboman/mason-lspconfig.nvim",
cmd = { "LspInstall", "LspUninstall" }, cmd = { "LspInstall", "LspUninstall" },
}, },
{ "saghen/blink.cmp", optional = true },
}, },
event = { "BufReadPost", "BufNewFile", "BufWritePre" }, event = { "BufReadPost", "BufNewFile", "BufWritePre" },
config = function() opts = { servers = servers },
vim.diagnostic.config({ virtual_text = true }) config = function(_, lspconfig_opts)
vim.fn.sign_define("DiagnosticSignError", { text = "", texthl = "DiagnosticSignError" }) local lspconfig = require("lspconfig")
vim.fn.sign_define("DiagnosticSignWarn", { text = "", texthl = "DiagnosticSignWarn" })
vim.fn.sign_define("DiagnosticSignInfo", { text = "", texthl = "DiagnosticSignInfo" })
vim.fn.sign_define("DiagnosticSignHint", { text = "", texthl = "DiagnosticSignHint" })
local lsp = require("lsp-setup")
local function on_attach(_, bufnr)
local map = vim.keymap.set
map(
"n",
"[d",
"<cmd>lua vim.diagnostic.goto_prev()<cr>",
{ buffer = bufnr, desc = "Previous diagnostic" }
)
map("n", "]d", "<cmd>lua vim.diagnostic.goto_next()<cr>", { buffer = bufnr, desc = "Next diagnostic" })
map(
"n",
"[D",
"<cmd>lua vim.diagnostic.goto_prev({severity = vim.diagnostic.severity.ERROR})<cr>",
{ buffer = bufnr, desc = "Previous error" }
)
map(
"n",
"]D",
"<cmd>lua vim.diagnostic.goto_next({severity = vim.diagnostic.severity.ERROR})<cr>",
{ buffer = bufnr, desc = "Next error" }
)
if require("core.util").is_available("which-key") then
require("which-key").add({ "<localleader>l", group = "language" })
end
map(
"n",
"<localleader>ld",
"<cmd>lua vim.diagnostic.open_float()<cr>",
{ buffer = bufnr, desc = "Line diagnostics" }
)
map("n", "<localleader>li", function()
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled())
end, { buffer = bufnr, desc = "Inlay hints" })
map(
"n",
"<localleader>la",
"<cmd>lua vim.lsp.buf.code_action()<cr>",
{ buffer = bufnr, desc = "Codeactions" }
)
map(
"n",
"<localleader>ln",
"<cmd>lua vim.lsp.buf.rename()<cr>",
{ buffer = bufnr, desc = "Rename element" }
)
if vim.fn.exists(":Glance") then
map("n", "<localleader>lr", "<cmd>Glance references<cr>", { buffer = bufnr, desc = "References" })
map("n", "<localleader>lf", "<cmd>Glance definitions<cr>", { buffer = bufnr, desc = "Definition" })
map(
"n",
"<localleader>lt",
"<cmd>Glance type_definitions<cr>",
{ buffer = bufnr, desc = "Type definition" }
)
map(
"n",
"<localleader>lm",
"<cmd>Glance implementations<cr>",
{ buffer = bufnr, desc = "Implementation" }
)
elseif vim.fn.exists(":Telescope") then
map(
"n",
"<localleader>lr",
"<cmd>Telescope lsp_references<cr>",
{ buffer = bufnr, desc = "References" }
)
map(
"n",
"<localleader>lf",
"<cmd>Telescope lsp_definitions<cr>",
{ buffer = bufnr, desc = "Definition" }
)
map(
"n",
"<localleader>lt",
"<cmd>Telescope lsp_type_definitions<cr>",
{ buffer = bufnr, desc = "Type definition" }
)
map(
"n",
"<localleader>lm",
"<cmd>Telescope lsp_implementations<cr>",
{ buffer = bufnr, desc = "Implementation" }
)
else
map(
"n",
"<localleader>lr",
"<cmd>lua vim.lsp.buf.references()<cr>",
{ buffer = bufnr, desc = "References" }
)
map(
"n",
"<localleader>lf",
"<cmd>lua vim.lsp.buf.definition()<cr>",
{ buffer = bufnr, desc = "Definition" }
)
map(
"n",
"<localleader>lt",
"<cmd>lua vim.lsp.buf.type_definition()<cr>",
{ buffer = bufnr, desc = "Type definition" }
)
map(
"n",
"<localleader>lm",
"<cmd>lua vim.lsp.buf.implementation()<cr>",
{ buffer = bufnr, desc = "Implementation" }
)
end
map("n", "K", "<cmd>lua vim.lsp.buf.hover()<cr>", { buffer = bufnr, desc = "Hover definition" })
map(
"n",
"<localleader>lc",
"<cmd>lua vim.lsp.buf.declaration()<cr>",
{ buffer = bufnr, desc = "Declaration" }
)
map(
"n",
"<localleader>ls",
"<cmd>lua vim.lsp.buf.signature_help()<cr>",
{ buffer = bufnr, desc = "Signature help" }
)
map("n", "<localleader>lo", function()
vim.diagnostic.enable(not vim.diagnostic.is_enabled())
end, { buffer = bufnr, desc = "Toggle Diagnostics" })
end
-- Display diagnostics as virtual text only if not in insert mode -- Display diagnostics as virtual text only if not in insert mode
-- /r/neovim/comments/12inp4c/disable_diagnostics_virtual_text_when_in_insert/jqqifwk/ -- /r/neovim/comments/12inp4c/disable_diagnostics_virtual_text_when_in_insert/jqqifwk/
vim.diagnostic.config({ virtual_text = true })
vim.api.nvim_create_autocmd("InsertEnter", { vim.api.nvim_create_autocmd("InsertEnter", {
callback = function() callback = function()
vim.diagnostic.config({ virtual_text = false }) vim.diagnostic.config({ virtual_text = false })
@ -223,16 +95,19 @@ return {
end, end,
}) })
lsp.setup({ vim.fn.sign_define("DiagnosticSignError", { text = "", texthl = "DiagnosticSignError" })
default_mappings = false, vim.fn.sign_define("DiagnosticSignWarn", { text = "", texthl = "DiagnosticSignWarn" })
servers = servers, vim.fn.sign_define("DiagnosticSignInfo", { text = "", texthl = "DiagnosticSignInfo" })
on_attach = on_attach, vim.fn.sign_define("DiagnosticSignHint", { text = "", texthl = "DiagnosticSignHint" })
inlay_hints = {
enabled = vim.fn.has("nvim-0.10") == true and true or false, for server, config in pairs(lspconfig_opts.servers) do
}, -- TODO: Check if it actually can be ignored in Nvim 0.11+, see https://cmp.saghen.dev/installation.html#lazy-nvim
}) if vim.fn.has("nvim-0.11") == false then
config.capabilities = require("blink.cmp").get_lsp_capabilities(config.capabilities)
end
lspconfig[server].setup(config)
end
local lspconfig = require("lspconfig")
lspconfig.nushell.setup({}) lspconfig.nushell.setup({})
lspconfig.marksman.setup({ lspconfig.marksman.setup({
@ -275,7 +150,6 @@ return {
end, end,
} }
end end
on_attach(client, bufnr)
end, end,
on_new_config = function(conf, new_root) on_new_config = function(conf, new_root)
if require("lspconfig.util").root_pattern(".zk")(new_root) then if require("lspconfig.util").root_pattern(".zk")(new_root) then
@ -291,12 +165,10 @@ return {
-- we primarily use pyright for cmp lsp completion & hover info -- we primarily use pyright for cmp lsp completion & hover info
lspconfig.basedpyright.setup({ lspconfig.basedpyright.setup({
on_attach = function(client, bufnr) on_attach = function(client, bufnr)
on_attach(client, bufnr)
require("core.util").set_python_env() require("core.util").set_python_env()
if python_path == nil then if python_path == nil then
python_path, _ = vim.fn.expand(require("core.util").get_python_venv_bin(client.config.root_dir)) python_path, _ = vim.fn.expand(require("core.util").get_python_venv_bin(client.config.root_dir))
end end
-- print(string.format("[PYTHON VENV]: %s", vim.inspect(python_path)))
client.config.settings.python = {} or client.config.settings.python client.config.settings.python = {} or client.config.settings.python
client.config.settings.python.pythonPath = python_path client.config.settings.python.pythonPath = python_path
end, end,
@ -315,7 +187,6 @@ return {
}) })
lspconfig.ruff.setup({ lspconfig.ruff.setup({
on_attach = function(client, bufnr) on_attach = function(client, bufnr)
on_attach(client, bufnr)
require("core.util").set_python_env() require("core.util").set_python_env()
client.server_capabilities.hoverProvider = false -- we use pyright for hover info client.server_capabilities.hoverProvider = false -- we use pyright for hover info
if python_path == nil then if python_path == nil then
@ -339,7 +210,6 @@ return {
callback = function() callback = function()
lspconfig.ltex.setup({ lspconfig.ltex.setup({
on_attach = function(client, bufnr) on_attach = function(client, bufnr)
on_attach(client, bufnr)
if require("core.util").is_available("ltex_extra") then if require("core.util").is_available("ltex_extra") then
require("ltex_extra").setup() require("ltex_extra").setup()
end end
@ -356,10 +226,98 @@ return {
end, end,
keys = { { "<leader>vs", ":LspInfo<cr>", desc = "LspInfo" } }, keys = { { "<leader>vs", ":LspInfo<cr>", desc = "LspInfo" } },
}, },
-- pretty lsp 'peek' menus
{
"DNLHC/glance.nvim",
opts = { border = { enable = true }, theme = { enable = true, mode = "auto" } },
cmd = { "Glance" },
},
} }
vim.api.nvim_create_autocmd("LspAttach", {
desc = "LSP actions",
callback = function(event)
local o = function(add_opts)
return vim.tbl_extend("force", { buffer = event.buf }, add_opts)
end
local map = vim.keymap.set
map("n", "K", "<cmd>lua vim.lsp.buf.hover()<cr>", o({ desc = "Hover definition" }))
map("n", "[d", "<cmd>lua vim.diagnostic.goto_prev()<cr>", o({ desc = "Previous diagnostic" }))
map("n", "]d", "<cmd>lua vim.diagnostic.goto_next()<cr>", o({ desc = "Next diagnostic" }))
map(
"n",
"[D",
"<cmd>lua vim.diagnostic.goto_prev({severity = vim.diagnostic.severity.ERROR})<cr>",
o({ desc = "Previous error" })
)
map(
"n",
"]D",
"<cmd>lua vim.diagnostic.goto_next({severity = vim.diagnostic.severity.ERROR})<cr>",
o({ desc = "Next error" })
)
if require("core.util").is_available("which-key") then
require("which-key").add({ "<localleader>l", group = "language" })
end
map("n", "<localleader>ld", "<cmd>lua vim.diagnostic.open_float()<cr>", o({ desc = "Show line diagnostics" }))
map("n", "<localleader>lI", function()
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled())
end, o({ desc = "Toggle inlay hints" }))
map("n", "<localleader>la", "<cmd>lua vim.lsp.buf.code_action()<cr>", o({ desc = "Codeactions" }))
map("n", "<localleader>ln", "<cmd>lua vim.lsp.buf.rename()<cr>", o({ desc = "Rename element" }))
map("n", "<localleader>lc", "<cmd>lua vim.lsp.buf.declaration()<cr>", o({ desc = "Declaration" }))
map("n", "<localleader>ls", "<cmd>lua vim.lsp.buf.signature_help()<cr>", o({ desc = "Signature help" }))
map("n", "<localleader>lo", function()
vim.diagnostic.enable(not vim.diagnostic.is_enabled())
end, o({ desc = "Toggle Diagnostics" }))
local pref = function(glances, telescope, fallback)
if glances and vim.fn.exists(":Glance") > 0 then
return glances
elseif telescope and vim.fn.exists(":Telescope") > 0 then
return telescope
else
return fallback
end
end
map(
"n",
"<localleader>lr",
pref(
"<cmd>Glance references<cr>",
"<cmd>Telescope lsp_references<cr>",
"<cmd>lua vim.lsp.buf.references()<cr>"
),
o({ desc = "References" })
)
map(
"n",
"<localleader>lf",
pref(
"<cmd>Glance definitions<cr>",
"<cmd>Telescope lsp_definitions<cr>",
"<cmd>lua vim.lsp.buf.definition()<cr>"
),
o({ desc = "Definition" })
)
map(
"n",
"<localleader>lt",
pref(
"<cmd>Glance type_definitions<cr>",
"<cmd>Telescope lsp_type_definitions<cr>",
"<cmd>lua vim.lsp.buf.type_definition()<cr>"
),
o({ desc = "Type definition" })
)
map(
"n",
"<localleader>lm",
pref(
"<cmd>Glance implementations<cr>",
"<cmd>Telescope lsp_implementations<cr>",
"<cmd>lua vim.lsp.buf.implementation()<cr>"
),
o({ desc = "Implementation" })
)
end,
})
return lsp

View file

@ -28,7 +28,7 @@ return {
keys = { keys = {
{ "<leader>se", "<cmd>Neotree toggle left<cr>", desc = "filetree", silent = true }, { "<leader>se", "<cmd>Neotree toggle left<cr>", desc = "filetree", silent = true },
}, },
lazy = false lazy = false,
}, },
{ "MagicDuck/grug-far.nvim", lazy = false, opts = {} }, { "MagicDuck/grug-far.nvim", lazy = false, opts = {} },
-- fuzzy matching picker -- fuzzy matching picker

View file

@ -72,7 +72,8 @@ local prose_plugs = {
render_modes = { "n", "c", "i" }, render_modes = { "n", "c", "i" },
code = { code = {
sign = false, sign = false,
width = "block", width = "full",
position = "right",
right_pad = 1, right_pad = 1,
}, },
checkbox = { checkbox = {
@ -81,6 +82,11 @@ local prose_plugs = {
removed = { raw = "[_]", rendered = "󱋭 ", highlight = "RenderMarkdownTodo" }, removed = { raw = "[_]", rendered = "󱋭 ", highlight = "RenderMarkdownTodo" },
}, },
}, },
html = {
comment = {
conceal = false,
},
},
}, },
name = "render-markdown", -- Only needed if you have another plugin named markdown.nvim name = "render-markdown", -- Only needed if you have another plugin named markdown.nvim
dependencies = { dependencies = {
@ -91,7 +97,7 @@ local prose_plugs = {
cmd = "RenderMarkdown", cmd = "RenderMarkdown",
keys = { keys = {
{ {
"<leader>pp", "<localleader>pm",
function() function()
require("render-markdown").toggle() require("render-markdown").toggle()
end, end,
@ -100,29 +106,43 @@ local prose_plugs = {
}, },
}, },
}, },
--- PREVIEW SECTION
-- generate an auto-updating html preview for md files -- generate an auto-updating html preview for md files
-- uses the very nice peek if deno is available, otherwise falls back to markdown-preview -- uses the very nice peek if deno is available, otherwise falls back to markdown-preview
{ {
"toppair/peek.nvim", "toppair/peek.nvim",
event = { "VeryLazy" },
cond = vim.fn.executable("deno") == 1, cond = vim.fn.executable("deno") == 1,
build = "deno task --quiet build:fast", build = "deno task --quiet build:fast",
ft = md_like, ft = md_like,
config = function() opts = {},
require("peek").setup()
vim.api.nvim_create_user_command("PeekOpen", require("peek").open, {})
vim.api.nvim_create_user_command("PeekClose", require("peek").close, {})
end,
}, },
{ {
"iamcco/markdown-preview.nvim", "iamcco/markdown-preview.nvim",
event = { "VeryLazy" },
cond = vim.fn.executable("deno") == 0, cond = vim.fn.executable("deno") == 0,
build = function() build = function()
vim.fn["mkdp#util#install"]() vim.fn["mkdp#util#install"]()
end, end,
version = false,
ft = md_like, ft = md_like,
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
}, },
{
"chomosuke/typst-preview.nvim",
ft = { "typst" },
opts = { -- to use mason-managed binary
dependencies_bin = { ["tinymist"] = "tinymist" },
},
cmd = {
"TypstPreview",
"TypstPreviewUpdate",
"TypstPreviewStop",
"TypstPreviewToggle",
"TypstPreviewFollowCursor",
"TypstPreviewNoFollowCursor",
"TypstPreviewFollowCursorToggle",
},
},
--- END PREVIEW SECTION
-- easy copy paste of images into markup files -- easy copy paste of images into markup files
{ {
@ -139,14 +159,14 @@ local prose_plugs = {
}, },
cmd = { "PasteImage" }, cmd = { "PasteImage" },
keys = { keys = {
{ "<leader>pi", "<cmd>PasteImage<cr>", desc = "Paste image from system clipboard" }, { "<localleader>pi", "<cmd>PasteImage<cr>", desc = "Paste image from system clipboard" },
}, },
ft = prose_ft, ft = prose_ft,
}, },
-- bring zettelkasten commands -- bring zettelkasten commands
{ {
"mickael-menu/zk-nvim", "zk-org/zk-nvim",
config = function() config = function()
if require("core.util").is_available("which-key") then if require("core.util").is_available("which-key") then
require("which-key").add({ require("which-key").add({
@ -159,6 +179,24 @@ local prose_plugs = {
opts = vim.tbl_extend("force", { orphan = true }, opts or {}) opts = vim.tbl_extend("force", { orphan = true }, opts or {})
require("zk").edit(opts, { title = "Zk Orphans" }) require("zk").edit(opts, { title = "Zk Orphans" })
end) end)
require("zk.commands").add("ZkGrep", function(opts)
local collection = {}
local list_opts = { select = { "title", "path", "absPath" } }
require("zk.api").list(vim.env.ZK_NOTEBOOK_DIR, list_opts, function(_, notes)
for _, note in ipairs(notes) do
collection[note.absPath] = note.title or note.path
end
end)
local options = vim.tbl_deep_extend("force", {
prompt_title = "Notes",
search_dirs = { vim.env.ZK_NOTEBOOK_DIR },
disable_coordinates = true,
path_display = function(_, path)
return collection[path]
end,
}, opts or {})
require("telescope.builtin").live_grep(options)
end)
end end
require("zk").setup({ require("zk").setup({
picker = "telescope", picker = "telescope",
@ -199,6 +237,7 @@ local prose_plugs = {
desc = "note search", desc = "note search",
}, },
{ "<leader>nf", "<cmd>ZkMatch<cr>", desc = "find note from selection", mode = "v" }, { "<leader>nf", "<cmd>ZkMatch<cr>", desc = "find note from selection", mode = "v" },
{ "<leader>nw", "<cmd>ZkGrep<cr>", desc = "grep notes" },
{ "<leader>nt", "<cmd>ZkTags<cr>", desc = "note tags" }, { "<leader>nt", "<cmd>ZkTags<cr>", desc = "note tags" },
{ "<leader>nc", "<cmd>ZkCd<cr>", desc = "notedir cd" }, { "<leader>nc", "<cmd>ZkCd<cr>", desc = "notedir cd" },
{ "<leader>no", "<cmd>ZkOrphans { sort = { 'modified' } }<cr>", desc = "orphans list" }, { "<leader>no", "<cmd>ZkOrphans { sort = { 'modified' } }<cr>", desc = "orphans list" },
@ -219,22 +258,25 @@ local prose_plugs = {
-- cite as you write from papis databases -- cite as you write from papis databases
-- ADDITIONAL DEPENDENCIES: papis and yq in shell env -- ADDITIONAL DEPENDENCIES: papis and yq in shell env
-- { -- still same issues: slow, buggy, does not work for me
-- "jghauser/papis.nvim", {
-- dependencies = { "jghauser/papis.nvim",
-- "kkharji/sqlite.lua", dependencies = {
-- "MunifTanjim/nui.nvim", "kkharji/sqlite.lua",
-- "pysan3/pathlib.nvim", "MunifTanjim/nui.nvim",
-- "nvim-neotest/nvim-nio", "pysan3/pathlib.nvim",
-- "nvim-treesitter/nvim-treesitter", "nvim-neotest/nvim-nio",
-- }, -- if not already installed, you may also want:
-- cond = vim.fn.executable("papis") == 1 and vim.fn.executable("yq") == 1, { "nvim-telescope/telescope.nvim", optional = true },
-- ft = writing_ft, -- "hrsh7th/nvim-cmp",
-- lazy = false, },
-- config = function() config = function()
-- require("papis").setup({}) require("papis").setup({
-- end, init_filetypes = prose_ft,
-- }, })
end,
lazy = false,
},
{ {
"barreiroleo/ltex_extra.nvim", "barreiroleo/ltex_extra.nvim",
branch = "dev", branch = "dev",

View file

@ -22,14 +22,11 @@ return {
return "" return ""
-- we don't know if we have python yet, start a check -- we don't know if we have python yet, start a check
else else
vim.system({ "poetry", "env", "info", "-p" }, { text = true }, function(obj) if vim.fn.has("python3") == 1 then
if obj.code == 0 then
has_pynvim = 1 has_pynvim = 1
else else
has_pynvim = 0 has_pynvim = 0
end end
end)
has_pynvim = 0
end end
end end

View file

@ -1,68 +1,54 @@
return { return { -- simple programmable terminal toggling for nvim
-- simpler, programmable and multiple terminal toggling for nvim
{ {
"akinsho/nvim-toggleterm.lua", "akinsho/nvim-toggleterm.lua",
init = function(_)
if require("core.util").is_available("which-key") then
require("which-key").add({ "<leader>t", group = "terminal" })
end
end,
config = function() config = function()
require("toggleterm").setup({ require("toggleterm").setup({
open_mapping = [[<leader>=]], open_mapping = [[<leader>tt]],
insert_mappings = false, -- don't map the key in insert mode insert_mappings = false, -- don't map the key in insert mode
terminal_mappings = false, terminal_mappings = false,
}) })
local Terminal = require("toggleterm.terminal").Terminal local Terminal = require("toggleterm.terminal").Terminal
-- need to disable indentlines since they obscure first line of terminal
if require("core.util").is_available("mini.nvim") then
vim.api.nvim_create_autocmd({ "TermOpen" }, {
pattern = "*",
callback = function()
vim.b.miniindentscope_disable = true
end,
})
end
local function custom_term_set_toggle_key(term) local function custom_term_set_toggle_key(term)
vim.keymap.set("t", "<C-\\>", function() vim.keymap.set("t", "<C-\\>", function()
term:toggle() term:toggle()
end, { silent = true, buffer = true }) end, { silent = true, buffer = true, desc = "terminal" })
end end
-- create python window local custom_term_default_style = function(cmd)
local function get_python_cmd() return {
if vim.fn.executable("py") then cmd = cmd,
return "py" hidden = true,
end direction = "float",
if vim.fn.executable("ptipython") then float_opts = { border = "curved" },
return "ptipython" on_open = custom_term_set_toggle_key,
end }
if vim.fn.executable("ipython") then
return "ipython"
end
if vim.fn.executable("ptpython") then
return "ptpython"
end
if vim.fn.executable("python") then
return "python"
end
end end
local terms = { local terms = {
lazygit = Terminal:new({ lazygit = Terminal:new(custom_term_default_style("lazygit")),
cmd = "lazygit", python = Terminal:new(custom_term_default_style(function()
hidden = true, for _, exec in pairs({ "py", "ptipython", "ipython", "ptpython", "python" }) do
direction = "float", if vim.fn.executable(exec) > 0 then
float_opts = { border = "curved" }, return exec
on_open = custom_term_set_toggle_key, end
}), end
python = Terminal:new({ end)),
cmd = get_python_cmd(), euporie = Terminal:new(custom_term_default_style(function()
hidden = true, local kernel = vim.b.sessionfile
direction = "float", if kernel then
float_opts = { border = "curved" }, return "euporie-console --connection-file '" .. kernel .. "'"
on_open = custom_term_set_toggle_key, end
}), return "euporie-console"
end)),
} }
-- create a lazygit window with the lazygit command -- have user decide between floating or split
local function toggle_custom_term(term, bang, vertsize) local function toggle_split_or_float(term, bang, vertsize)
vertsize = vertsize or vim.o.columns * 0.4 vertsize = vertsize or vim.o.columns * 0.4
if not bang then if not bang then
term.direction = "float" term.direction = "float"
@ -74,30 +60,25 @@ return {
end end
end end
local function _Pythonterm_toggle(opts) vim.api.nvim_create_user_command("Lazygit", function(opts)
toggle_custom_term(terms.python, opts.bang) toggle_split_or_float(terms.lazygit, opts.bang, vim.o.columns * 0.6)
end end, { desc = "Toggle floating Lazygit terminal", bang = true })
local function _Lazygit_toggle(opts) vim.api.nvim_create_user_command("Pythonterm", function(opts)
toggle_custom_term(terms.lazygit, opts.bang, vim.o.columns * 0.6) toggle_split_or_float(terms.python, opts.bang)
end end, { desc = "Toggle floating Python terminal", bang = true })
vim.api.nvim_create_user_command("Euporieterm", function(opts)
vim.api.nvim_create_user_command( toggle_split_or_float(terms.euporie, opts.bang)
"Lazygit", end, { desc = "Toggle floating Euporie terminal", bang = true })
_Lazygit_toggle,
{ desc = "Toggle floating Lazygit terminal", bang = true }
)
vim.api.nvim_create_user_command(
"Pythonterm",
_Pythonterm_toggle,
{ desc = "Toggle floating Python terminal", bang = true }
)
end, end,
cmd = { "ToggleTerm", "TermExec", "Lazygit", "Pythonterm" }, cmd = { "ToggleTerm", "TermExec", "Lazygit", "Pythonterm", "Euporieterm" },
keys = { keys = {
{ "<leader>sg", ":Lazygit<cr>", desc = "git floating" }, { "<leader>tt", ":ToggleTerm<cr>", desc = "terminal" },
{ "<leader>sG", ":Lazygit!<cr>", desc = "git buffer" }, { "<leader>tg", ":Lazygit<cr>", desc = "git floating" },
{ "<leader>sp", ":Pythonterm<cr>", desc = "python floating" }, { "<leader>tG", ":Lazygit!<cr>", desc = "git buffer" },
{ "<leader>sP", ":Pythonterm!<cr>", desc = "python buffer" }, { "<leader>tp", ":Pythonterm<cr>", desc = "python floating" },
{ "<leader>tP", ":Pythonterm!<cr>", desc = "python buffer" },
{ "<leader>te", ":Euporieterm<cr>", desc = "euporie floating" },
{ "<leader>tE", ":Euporieterm!<cr>", desc = "euporie buffer" },
}, },
}, },
} }

View file

@ -44,10 +44,10 @@ report.today.sort=urgency-
report.today.columns=id,project,priority,urgency,due,description,tags,scheduled,entry.age,recur report.today.columns=id,project,priority,urgency,due,description,tags,scheduled,entry.age,recur
report.today.labels=,Project,Pri,Urg,Due,Description,Tags,Sched,Age,Recur report.today.labels=,Project,Pri,Urg,Due,Description,Tags,Sched,Age,Recur
# report overview of tasks accomplished today # report overview of tasks accomplished today
report.today.completed.description=Tasks completed today report.donetoday.description=Tasks completed today
report.today.completed.filter=status:completed end.after:tod report.donetoday.filter=status:completed end.after:tod
report.today.completed.columns=id,project,priority,urgency,due,description,tags,scheduled,entry.age,recur report.donetoday.columns=id,project,priority,urgency,due,description,tags,scheduled,entry.age,recur
report.today.completed.labels=,Project,Pri,Urg,Due,Description,Tags,Sched,Age,Recur report.donetoday.labels=,Project,Pri,Urg,Due,Description,Tags,Sched,Age,Recur
# reorder priorities so that explicitly tagged 'Low' items are lower than normal # reorder priorities so that explicitly tagged 'Low' items are lower than normal
uda.priority.values=H,M,,L uda.priority.values=H,M,,L

View file

@ -13,7 +13,7 @@ journals:
default: default:
journal: ~/documents/records/jrnl.md journal: ~/documents/records/jrnl.md
linewrap: 79 linewrap: 79
tagsymbols: '+' tagsymbols: +
template: false template: false
timeformat: '%F %r' timeformat: '%F %r'
version: v4.1 version: v4.2