nvim-config/fnl/plugins.fnl
2024-03-15 23:39:18 -06:00

106 lines
5.2 KiB
Fennel

;; FIXME: This belongs in personalize.fnl It's also here because it fixes a bug with racket filetypes...
(set vim.g.sexp_filetypes "racket,fennel,scheme,lisp")
(let [lazy (require :lazy)]
(lazy.setup ["https://github.com/rktjmp/hotpot.nvim"
"https://github.com/tpope/vim-sexp-mappings-for-regular-people"
"https://github.com/guns/vim-sexp"
"https://github.com/benknoble/vim-racket"
"https://github.com/preservim/vim-markdown"
{:url "https://github.com/epwalsh/obsidian.nvim"
:version "v3.7.1"}
"https://github.com/nvim-lua/plenary.nvim"
{:url "https://github.com/nvim-treesitter/nvim-treesitter"
:build ":TSUpdate"}
{:url "https://github.com/neovim/nvim-lspconfig"
:dependencies ["https://github.com/williamboman/mason.nvim"
:williamboman/mason-lspconfig.nvim
{:url "https://github.com/j-hui/fidget.nvim"
:tag :legacy
:opts {}}
"https://github.com/folke/neodev.nvim"]}
{:url "https://github.com/hrsh7th/nvim-cmp"
:dependencies ["https://github.com/hrsh7th/cmp-nvim-lsp"
"https://github.com/hrsh7th/cmp-buffer"
"https://github.com/hrsh7th/cmp-path"
"https://github.com/hrsh7th/cmp-cmdline"
"https://github.com/hrsh7th/cmp-cmdline"]}
{:url "https://github.com/L3MON4D3/LuaSnip"
:dependencies ["https://github.com/saadparwaiz1/cmp_luasnip"
"https://github.com/rafamadriz/friendly-snippets"]}
{:url "https://github.com/nvim-telescope/telescope.nvim"
:tag :0.1.2
:dependencies [{:url "https://github.com/nvim-telescope/telescope-fzf-native.nvim"
:build (.. "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release"
" && cmake --build build --config Release"
" && cmake --install build --prefix build")}
"https://github.com/xiyaowong/telescope-emoji.nvim"]}
"https://github.com/tamton-aquib/duck.nvim"]))
;; NOTE: If a value could be considered a preference or is subjective
;; then it should be defined in personalize.fnl
;; Otherwise packaging details and less malleable values, by nature or desire, belong below...
(let [personalize (require :personalize)]
(personalize.options)
(personalize.keymap))
(let [telescope (require :telescope)]
(pcall (telescope.load_extension :fzf))
(pcall (telescope.load_extension :emoji)))
(let [cmp (require :cmp)
luasnip (require :luasnip)
vscode-snips (require :luasnip.loaders.from_vscode)
{: cmp-mapping} (require :personalize)]
(vscode-snips.lazy_load)
(luasnip.config.setup)
(cmp.setup {:snippet {:expand #(luasnip $1)}
:mapping (cmp.mapping.preset.insert cmp-mapping)
:sources (cmp.config.sources [{:name :nvim_lsp}
{:name :luasnip}
{:name :buffer}])})
(cmp.setup.cmdline ["/" "?"]
{:mapping (cmp.mapping.preset.cmdline)
:sources [{:name :buffer}]})
(cmp.setup.cmdline [":"]
{:mapping (cmp.mapping.preset.cmdline)
:sources (cmp.config.sources [{:name :path}
{:name :cmdline}])})
(cmp.setup.filetype [:gitcommit]
{:mapping (cmp.mapping.preset.cmdline)
:sources (cmp.config.sources [{:name :git}
{:name :buffer}])}))
(let [obsidian (require :obsidian)
personalize (require :personalize)]
(obsidian.setup personalize.obsidian))
(let [treesitter (require :nvim-treesitter.configs)
{: treesitter-languages} (require :personalize)]
(treesitter.setup {:ensure_installed treesitter-languages
:sync_install false
:auto_install true
:highlight {:enable true}
:indent {:enable true}}))
(let [neodev (require :neodev)
mason (require :mason)
mason-lspconfig (require :mason-lspconfig)
{: language-servers : lsp-attach} (require :personalize)]
(neodev.setup)
(mason.setup)
(mason-lspconfig.setup {:ensure_installed (vim.tbl_keys language-servers)})
(mason-lspconfig.setup_handlers
[(fn [server_name]
(let [server (. (require :lspconfig)
server_name)
cmp-nvim-lsp (require :cmp_nvim_lsp)
settings (. language-servers
server_name)]
(server.setup {:capabilities (cmp-nvim-lsp.default_capabilities (vim.lsp.protocol.make_client_capabilities))
:on_attach lsp-attach
: settings
:filetypes (or settings.filetypes
[])})))]))