Files
nvim-config/lua/bootstrap.lua
2026-01-29 17:59:31 -10:00

54 lines
2.0 KiB
Lua

-- Core plugins that must be in Lua (nfnl compiles Fennel, so it can't be in Fennel)
return {
{
"Olical/nfnl",
lazy = false,
config = function()
-- Create global commands that work without opening a fennel file first
local api = require("nfnl.api")
vim.api.nvim_create_user_command("NfnlCompileAllFiles", function(opts)
api["compile-all-files"](opts.args ~= "" and opts.args or nil)
end, { desc = "Compile all Fennel files", nargs = "?", complete = "dir" })
vim.api.nvim_create_user_command("NfnlCompileFile", function(opts)
api["compile-file"]({ path = opts.args ~= "" and opts.args or nil })
end, { desc = "Compile current or specified Fennel file", nargs = "?", complete = "file" })
end,
},
{
"nvim-treesitter/nvim-treesitter",
branch = "main",
build = ":TSUpdate",
config = function()
local langs = { "clojure", "fennel", "lua", "vim", "vimdoc", "query" }
-- Install parsers asynchronously on first load
vim.schedule(function()
local ok, ts = pcall(require, "nvim-treesitter")
if ok and ts.install then
ts.install(langs)
end
end)
-- Enable treesitter highlighting for supported filetypes
-- This is required for nvim-paredit to work (needs vim.treesitter.get_node())
vim.api.nvim_create_autocmd("FileType", {
pattern = { "clojure", "fennel", "lua", "vim", "query", "scheme", "lisp" },
callback = function()
pcall(vim.treesitter.start)
end,
})
end,
},
{
"nvim-telescope/telescope.nvim",
tag = "0.1.8",
dependencies = { "nvim-lua/plenary.nvim" },
keys = {
{ "<leader>ff", "<cmd>Telescope find_files<cr>", desc = "Find files" },
{ "<leader>fg", "<cmd>Telescope live_grep<cr>", desc = "Live grep" },
{ "<leader>fb", "<cmd>Telescope buffers<cr>", desc = "Buffers" },
{ "<leader>fh", "<cmd>Telescope help_tags<cr>", desc = "Help tags" },
},
},
}