Files
nvim-config/fnl/plugins/init.fnl
2026-02-15 01:15:04 -05:00

100 lines
3.8 KiB
Fennel

;; Plugin specs in Fennel
;; This file is compiled to lua/plugins/init.lua by nfnl
(local repo 1) ;; lazy.nvim spec index for the git repo (e.g., "folke/plugin")
(local lhs 1) ;; lazy.nvim/which-key spec index for key sequence
(local rhs 2) ;; lazy.nvim keys spec index for command/action
[;; Tokyonight - Colorscheme
{repo "folke/tokyonight.nvim"
:lazy false
:priority 1000
:config (fn []
(let [tokyonight (require :tokyonight)]
(tokyonight.setup
{:style "night" ; storm, moon, night, or day
:transparent false
:terminal_colors true}))
(vim.cmd.colorscheme "tokyonight"))}
;; Conjure - Interactive REPL for Fennel, Clojure, Lisp, etc.
{repo "Olical/conjure"
:ft ["fennel" "clojure" "lisp" "scheme" "racket" "lua"]
:config (fn []
;; Enable HUD floating window
(set vim.g.conjure#log#hud#enabled true))}
;; nvim-parinfer - Automatic parenthesis balancing
;; See fnl/config/parinfer.fnl for default-enabled flag and toggle logic
{repo "gpanders/nvim-parinfer"
:ft ["fennel" "clojure" "lisp" "scheme" "racket" "carp" "timl"]
:init (fn []
(let [par (require :config.parinfer)]
(set vim.g.parinfer_enabled par.default-enabled)))
:keys [{lhs "<leader>tpi"
rhs (fn [] (let [par (require :config.parinfer)] (par.toggle)))
:desc "Toggle Parinfer"}]}
;; vim-sexp - Structural editing for S-expressions
;; with tpope's vim-sexp-mappings-for-regular-people
{repo "guns/vim-sexp"
:ft ["fennel" "clojure" "lisp" "scheme" "racket"]
:dependencies ["tpope/vim-repeat"
"tpope/vim-sexp-mappings-for-regular-people"]
:init (fn []
(set vim.g.sexp_filetypes "clojure,scheme,lisp,timl,fennel,racket")
;; Sync sexp auto-insert with parinfer default
(let [par (require :config.parinfer)]
(set vim.g.sexp_enable_insert_mode_mappings
(if par.default-enabled 0 1))))}
;; Mason - Package manager for LSP servers, DAP servers, linters, formatters
{repo "williamboman/mason.nvim"
:lazy false
:build ":MasonUpdate"
:opts {:ui {:border "rounded"}}}
;; Auto-install LSP servers and tools via Mason
{repo "WhoIsSethDaniel/mason-tool-installer.nvim"
:lazy false
:dependencies ["williamboman/mason.nvim"]
:opts {:ensure_installed ["clojure-lsp" "clj-kondo" "fennel-ls" "lua-language-server"]}}
;; Hop - EasyMotion-like word jumping
{repo "smoka7/hop.nvim"
:version "*"
:event "VeryLazy"
:config (fn []
(let [hop (require :hop)]
(hop.setup)
(vim.keymap.set :n "gw" (fn [] (hop.hint_words))
{:desc "Hop to word"})))}
;; LispSchool - Interactive structural editing tutorial
;; Source: fnl/lisp-school.fnl (compiled by nfnl)
{:name "lisp-school"
:dir "."
:cmd ["LispSchool" "LispSchoolNext"]
:config (fn []
(vim.api.nvim_create_user_command "LispSchool"
(fn [] (let [ls (require :lisp-school)] (ls.start)))
{:desc "Start LispSchool tutorial"})
(vim.api.nvim_create_user_command "LispSchoolNext"
(fn [] (let [ls (require :lisp-school)] (ls.next)))
{:desc "Next LispSchool lesson"}))}
;; which-key - Shows keybinding hints
;; lhs constant defined at top - which-key specs use index [1] for the key sequence
{repo "folke/which-key.nvim"
:event "VeryLazy"
:opts {}
:config (fn [_ opts]
(local wk (require :which-key))
(wk.setup opts)
(wk.add
[{lhs "<leader>f" :group "find"}
{lhs "<leader>b" :group "buffer"}
{lhs "<leader>r" :group "refactor"}
{lhs "<leader>c" :group "code"}
{lhs "<leader>t" :group "toggle"}]))}]