Initial commit: Neovim config with Fennel via nfnl
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
-- 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",
|
||||
build = ":TSUpdate",
|
||||
config = function()
|
||||
local langs = { "clojure", "fennel", "lua", "vim", "vimdoc", "query" }
|
||||
|
||||
-- Install parsers asynchronously on first load
|
||||
vim.schedule(function()
|
||||
local installed = require("nvim-treesitter").get_installed()
|
||||
for _, lang in ipairs(langs) do
|
||||
if not vim.list_contains(installed, lang) then
|
||||
require("nvim-treesitter").install(lang)
|
||||
end
|
||||
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" },
|
||||
},
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user