Skip to content

Commit

Permalink
Make forester autocomplete work and add key bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
utensil committed Nov 1, 2024
1 parent a17c07d commit 44c10b6
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 6 deletions.
2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ nvim PROJ="forest": sync-nvim
lvim PROJ="forest": sync-lvim
#!/usr/bin/env bash
cd ~/projects/{{PROJ}} && lvim .
cd ~/projects/{{PROJ}} && lvim
yazi DIR="{{HOME}}/projects":
#!/usr/bin/env bash
Expand Down
4 changes: 4 additions & 0 deletions trees/uts-0018.tree
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
\subtree[2024-10]{
\title{October, 2024}

\mdblock{10-31}{
- finish writing [[uts-002H]]
}

\mdblock{10-18~10-24}{
- work on native-land, trying to make rust-gpu fully work
- work on formal-land, trying to establish the infrastructure to explore multiple Lean 4 projects with independent toolchains and dependencies
Expand Down
32 changes: 27 additions & 5 deletions uts-plugins.lua
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,34 @@ local plugins = {
ensure_installed = { "toml", "forester" },
sync_install = false,
}
-- local foresterCompletionSource = require "forester.completion"
-- local cmp = require "cmp"
-- cmp.register_source("forester", foresterCompletionSource)
-- cmp.setup.filetype("forester", { sources = { { name = "forester", dup = 0 } } })
-- cmp.setup()

-- require("lspconfig").texlab.setup {
-- filetypes = { "tex", "bib", "forester" },
-- }

local foresterCompletionSource = require "forester.completion"
local cmp = require "cmp"
cmp.register_source("forester", foresterCompletionSource)
cmp.setup.filetype("forester", { sources = { { name = "forester", dup = 0 } } })
cmp.setup()
end,
keys = {
{ "<localleader>n", "<cmd>Forester new<cr>", desc = "Forester - New" },
{ "<localleader>b", "<cmd>Forester browse<cr>", desc = "Forester - Browse" },
-- same for link_new transclude_new
{ "<localleader>l", "<cmd>Forester link_new<cr>", desc = "Forester - Link New" },
{ "<localleader>t", "<cmd>Forester transclude_new<cr>", desc = "Forester - Transclude New" },
-- bind c to run a shell command ./new.sh uts , then get its standard output as a relative file name to the current working directory, then open the file in nvim
{
"<localleader>c",
function()
local cmd = "./new.sh uts"
local file = io.popen(cmd):read "*a"
vim.cmd("e " .. file)
end,
desc = "Forester - New from Command",
},
},
},
-- https://github.com/mrcjkb/rustaceanvim/discussions/94#discussioncomment-7813716 not working:
-- error: lazy.nvim/lua/lazy/core/loader.lua:373: attempt to call field 'setup' (a table value)
Expand Down

0 comments on commit 44c10b6

Please sign in to comment.