summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChloƩ Vulquin <code@toast.bunkerlabs.net>2024-07-24 19:19:26 +0200
committerChloƩ Vulquin <code@toast.bunkerlabs.net>2024-07-24 19:19:26 +0200
commit01586921b3d5f2ac1ccf8196d3ad9b4b3ddd31f3 (patch)
treed740ac5e8943e48ee4132efc4633051d6cdf1d48
parentnvim: ignore lazy-lock.json (diff)
nvim: rewrite config in fennel
One file isn't done, and there's also the question of ftplugin and co. One step at a time though, eh?
Diffstat (limited to '')
-rw-r--r--dot_config/nvim/.gitattributes1
-rw-r--r--dot_config/nvim/dot_nfnl.fnl1
-rw-r--r--dot_config/nvim/fnl/bindings/builtins.fnl5
-rw-r--r--dot_config/nvim/fnl/bindings/init.fnl13
-rw-r--r--dot_config/nvim/fnl/bindings/plugins.fnl4
-rw-r--r--dot_config/nvim/fnl/plugins/bindings/init.fnl5
-rw-r--r--dot_config/nvim/fnl/plugins/flash.fnl19
-rw-r--r--dot_config/nvim/fnl/plugins/init.fnl28
-rw-r--r--dot_config/nvim/fnl/plugins/langs.fnl25
-rw-r--r--dot_config/nvim/fnl/plugins/lsp/capabilities.fnl1
-rw-r--r--dot_config/nvim/fnl/plugins/lsp/init.fnl33
-rw-r--r--dot_config/nvim/fnl/plugins/mini/init.fnl20
-rw-r--r--dot_config/nvim/fnl/plugins/mini/starter.fnl15
-rw-r--r--dot_config/nvim/fnl/plugins/neo-tree.fnl8
-rw-r--r--dot_config/nvim/fnl/plugins/os/init.fnl1
-rw-r--r--dot_config/nvim/fnl/plugins/os/linux.fnl1
-rw-r--r--dot_config/nvim/fnl/plugins/os/osx.fnl1
-rw-r--r--dot_config/nvim/fnl/plugins/surround.fnl5
-rw-r--r--dot_config/nvim/fnl/plugins/telescope.fnl20
-rw-r--r--dot_config/nvim/fnl/toast/core.fnl47
-rw-r--r--dot_config/nvim/fnl/toast/macros.fnl29
-rw-r--r--dot_config/nvim/fnl/toast/table.fnl15
-rw-r--r--dot_config/nvim/lua/bindings/builtins.lua7
-rw-r--r--dot_config/nvim/lua/bindings/init.lua18
-rw-r--r--dot_config/nvim/lua/bindings/plugins.lua6
-rw-r--r--dot_config/nvim/lua/plugins/bindings/init.lua12
-rw-r--r--dot_config/nvim/lua/plugins/flash.lua69
-rw-r--r--dot_config/nvim/lua/plugins/init.lua45
-rw-r--r--dot_config/nvim/lua/plugins/langs.lua52
-rw-r--r--dot_config/nvim/lua/plugins/lsp/attach.lua1
-rw-r--r--dot_config/nvim/lua/plugins/lsp/capabilities.lua1
-rw-r--r--dot_config/nvim/lua/plugins/lsp/init.lua87
-rw-r--r--dot_config/nvim/lua/plugins/mini/init.lua41
-rw-r--r--dot_config/nvim/lua/plugins/mini/starter.lua22
-rw-r--r--dot_config/nvim/lua/plugins/neo-tree.lua26
-rw-r--r--dot_config/nvim/lua/plugins/os/init.lua4
-rw-r--r--dot_config/nvim/lua/plugins/os/linux.lua1
-rw-r--r--dot_config/nvim/lua/plugins/os/osx.lua1
-rw-r--r--dot_config/nvim/lua/plugins/surround.lua10
-rw-r--r--dot_config/nvim/lua/plugins/telescope.lua45
-rw-r--r--dot_config/nvim/lua/toast/core.lua63
-rw-r--r--dot_config/nvim/lua/toast/table.lua16
42 files changed, 489 insertions, 335 deletions
diff --git a/dot_config/nvim/.gitattributes b/dot_config/nvim/.gitattributes
new file mode 100644
index 0000000..a517868
--- /dev/null
+++ b/dot_config/nvim/.gitattributes
@@ -0,0 +1 @@
+lua/**/*.lua linguist-generated
diff --git a/dot_config/nvim/dot_nfnl.fnl b/dot_config/nvim/dot_nfnl.fnl
new file mode 100644
index 0000000..b212ab4
--- /dev/null
+++ b/dot_config/nvim/dot_nfnl.fnl
@@ -0,0 +1 @@
+{:compiler-options {:compilerEnv _G}}
diff --git a/dot_config/nvim/fnl/bindings/builtins.fnl b/dot_config/nvim/fnl/bindings/builtins.fnl
new file mode 100644
index 0000000..8c77e35
--- /dev/null
+++ b/dot_config/nvim/fnl/bindings/builtins.fnl
@@ -0,0 +1,5 @@
+; document missing builtins
+(import-macros {: tbl : recc} :toast.macros)
+(recc :which-key :add
+ [(tbl :gt & :desc "Next tab")
+ (tbl :gT & :desc "Previous tab")])
diff --git a/dot_config/nvim/fnl/bindings/init.fnl b/dot_config/nvim/fnl/bindings/init.fnl
new file mode 100644
index 0000000..c350db4
--- /dev/null
+++ b/dot_config/nvim/fnl/bindings/init.fnl
@@ -0,0 +1,13 @@
+(import-macros {: tbl : recc} :toast.macros)
+
+(each [_ v (ipairs [:builtins
+ :plugins])]
+ (require (.. :bindings. v)))
+
+; general bindings that aren't specific to a plugin
+(recc :which-key :add
+ ; diagnostics
+ [(tbl :<leader>e vim.diagnostic.open_float & :desc "diag float")
+ (tbl :<leader>q vim.diagnostic.setloclist & :desc "diag locations")
+ (tbl "[d" vim.diagnostic.goto_prev & :desc "prev diag")
+ (tbl "]d" vim.diagnostic.goto_next & :desc "next diag")])
diff --git a/dot_config/nvim/fnl/bindings/plugins.fnl b/dot_config/nvim/fnl/bindings/plugins.fnl
new file mode 100644
index 0000000..ae0348d
--- /dev/null
+++ b/dot_config/nvim/fnl/bindings/plugins.fnl
@@ -0,0 +1,4 @@
+; plugin-specific category bindings
+(import-macros {: tbl : recc} :toast.macros)
+(recc :which-key :add
+ [(tbl :<leader>f & :desc :+find)])
diff --git a/dot_config/nvim/fnl/plugins/bindings/init.fnl b/dot_config/nvim/fnl/plugins/bindings/init.fnl
new file mode 100644
index 0000000..4cfb558
--- /dev/null
+++ b/dot_config/nvim/fnl/plugins/bindings/init.fnl
@@ -0,0 +1,5 @@
+(import-macros {: tbl} :toast.macros)
+[(tbl :folke/which-key.nvim &
+ :lazy true
+ :opts {})
+ [:tpope/vim-rsi]]
diff --git a/dot_config/nvim/fnl/plugins/flash.fnl b/dot_config/nvim/fnl/plugins/flash.fnl
new file mode 100644
index 0000000..ece5de4
--- /dev/null
+++ b/dot_config/nvim/fnl/plugins/flash.fnl
@@ -0,0 +1,19 @@
+(import-macros {: tbl : recc} :toast.macros)
+[(tbl :folke/flash.nvim &
+ :opts {:modes {:search {:enabled false}}}
+ :event :VeryLazy
+ :keys [(tbl :s #(recc :flash :jump) &
+ :mode [:n :x :o]
+ :desc :Flash)
+ (tbl :S #(recc :flash :treesitter) &
+ :mode [:n :x :o]
+ :desc "Flash Treesitter")
+ (tbl :r #(recc :flash :remote) &
+ :mode :o
+ :desc "Remote Flash")
+ (tbl :R #(recc :flash :treesitter_search) &
+ :mode [:o :x]
+ :desc "Flash Treesitter Search")
+ (tbl :<c-s> #(recc :flash :toggle) &
+ :mode :c
+ :desc "Toggle Flash Search")])]
diff --git a/dot_config/nvim/fnl/plugins/init.fnl b/dot_config/nvim/fnl/plugins/init.fnl
new file mode 100644
index 0000000..a867ecc
--- /dev/null
+++ b/dot_config/nvim/fnl/plugins/init.fnl
@@ -0,0 +1,28 @@
+(import-macros {: tbl} :toast.macros)
+(local conjureft [:clojure
+ :fennel
+ :hy
+ :janet
+ :julia
+ :lisp
+ :racket
+ :scheme])
+
+; simple stuff that doesn't need any handling
+; and doesn't fit in elsewhere
+[(tbl :folke/lazy.nvim & :version false)
+ (tbl :Olical/nfnl & :ft :fennel)
+ (tbl :stevearc/dressing.nvim &
+ :opts {})
+ (tbl :Olical/conjure &
+ :config (fn [_ opts]
+ (each [k v (pairs opts)]
+ (tset vim.g (.. :conjure# k) v)))
+ :opts {:mapping#prefix :<localleader>e
+ :extract#tree_sitter#enabled true
+ ; disabling lua, python, rust
+ :filetypes conjureft
+ :filetype#fennel :conjure.client.fennel.stdio
+ :filetype#janet :conjure.client.janet.stdio}
+ :ft conjureft)
+ [:tpope/vim-repeat]]
diff --git a/dot_config/nvim/fnl/plugins/langs.fnl b/dot_config/nvim/fnl/plugins/langs.fnl
new file mode 100644
index 0000000..5bfb817
--- /dev/null
+++ b/dot_config/nvim/fnl/plugins/langs.fnl
@@ -0,0 +1,25 @@
+(import-macros {: tbl} :toast.macros)
+; language support
+[(tbl :nvim-treesitter/nvim-treesitter &
+ :version false
+ :build ::TSUpdate
+ :dependnecies [:nvim-treesitter/nvim-treesitter-textobjects]
+ :main :nvim-treesitter.configs
+ :opts {:ensure_installed :all
+ :ignore_install [:norg]
+ :sync_install :true
+ :highlight {:enable true
+ :disable [:markdown]
+ :additional_vim_regex_highlighting [:markdown]}})
+ ; non-treesitter languages
+ (tbl :janet-lang/janet.vim & :ft :janet)
+ (tbl :preservim/vim-markdown &
+ :version false
+ :dependencies [:godlygeek/tabular]
+ :ft :markdown)
+ ; helper for lisps
+ (tbl :gpanders/nvim-parinfer &
+ :ft [:clojure
+ :fennel
+ :janet
+ :scm])]
diff --git a/dot_config/nvim/fnl/plugins/lsp/capabilities.fnl b/dot_config/nvim/fnl/plugins/lsp/capabilities.fnl
new file mode 100644
index 0000000..607602c
--- /dev/null
+++ b/dot_config/nvim/fnl/plugins/lsp/capabilities.fnl
@@ -0,0 +1 @@
+nil
diff --git a/dot_config/nvim/fnl/plugins/lsp/init.fnl b/dot_config/nvim/fnl/plugins/lsp/init.fnl
new file mode 100644
index 0000000..10685d2
--- /dev/null
+++ b/dot_config/nvim/fnl/plugins/lsp/init.fnl
@@ -0,0 +1,33 @@
+(import-macros {: tbl : recc} :toast.macros)
+
+(fn gopts [plist]
+ {:clangd {}
+ :clojure_lsp {:root_dir (plist :project.clj :deps.edn :bb.edn :build.boot :shadow-cljs.edn :.git)}
+ :denols {:autostart false
+ :root_dir (plist :deno.json :deno.jsonc)}
+ :gopls {}
+ :ltex {}
+ :lua_ls {}
+ :texlab {:filetypes [:tex :plaintex :bib :latex]}
+ :tsserver {:autostart false
+ :root_dir (plist :tsconfig.json :package.json)}
+ :zls {}})
+
+(local attach (require :plugins.lsp.attach))
+(local caps (require :plugins.lsp.capabilities))
+
+[(tbl :neovim/nvim-lspconfig &
+ :config (fn [_ opts]
+ (each [k v (pairs opts)]
+ (set v.on_attach (or attach v.on_attach))
+ (when (= :table (type caps))
+ (set v.capabilities (or v.capabilities caps)))
+ (let [s (. (require :lspconfig) k)
+ c (or v.cmd s.document_config.default_config.cmd)]
+ (when (not= 0 (vim.fn.executable (. c 1)))
+ (s.setup v)))))
+ :opts (fn []
+ (let [plist (fn [...]
+ (local p (recc :lspconfig.util :root_pattern ...))
+ #(p $))]
+ (gopts plist))))]
diff --git a/dot_config/nvim/fnl/plugins/mini/init.fnl b/dot_config/nvim/fnl/plugins/mini/init.fnl
new file mode 100644
index 0000000..f175ed7
--- /dev/null
+++ b/dot_config/nvim/fnl/plugins/mini/init.fnl
@@ -0,0 +1,20 @@
+(import-macros {: tbl : recc} :toast.macros)
+[(tbl :echasnovski/mini.nvim &
+ :version false
+ :config (fn [_ opts]
+ (each [k v (pairs opts)]
+ (recc (.. :mini. k) :setup v)))
+ :opts (fn [] {:ai {}
+ :align {}
+ :basics {}
+ :bracketed {:indent {:options {:change_type :diff}}}
+ :comment {}
+ :completion {}
+ :cursorword {}
+ :indentscope {}
+ :move {}
+ :splitjoin {}
+ ; :starter (require :plugins.mini.starter)
+ :statusline {}
+ :tabline {}
+ :trailspace {}}))]
diff --git a/dot_config/nvim/fnl/plugins/mini/starter.fnl b/dot_config/nvim/fnl/plugins/mini/starter.fnl
new file mode 100644
index 0000000..99d71f9
--- /dev/null
+++ b/dot_config/nvim/fnl/plugins/mini/starter.fnl
@@ -0,0 +1,15 @@
+(let [starter (require :mini.starter)
+ telescope [{:action "Telescope commands"
+ :name :Commands}
+ {:action "Telescope find_files"
+ :name :Files}
+ {:action "Telescope help_tags"
+ :name "Help tags"}
+ {:action "Telescope live_grep"
+ :name "Live grep"}
+ {:action "Telescope oldfiles"
+ :name "Old files"}]]
+ (each [_ v (ipairs telescope)]
+ (set v.section :Telescope))
+ {:items [telescope
+ (starter.sections.builtin_actions)]})
diff --git a/dot_config/nvim/fnl/plugins/neo-tree.fnl b/dot_config/nvim/fnl/plugins/neo-tree.fnl
new file mode 100644
index 0000000..396f420
--- /dev/null
+++ b/dot_config/nvim/fnl/plugins/neo-tree.fnl
@@ -0,0 +1,8 @@
+(import-macros {: tbl : recc} :toast.macros)
+[(tbl :nvim-neo-tree/neo-tree.nvim &
+ :cmd :Neotree
+ :dependencies [:nvim-lua/plenary.nvim
+ :MunifTanjim/nui.nvim]
+ :keys [(tbl :<leader>n #(recc :neo-tree.command :execute {:toggle true}) &
+ :desc :Neotree)]
+ :opts {})]
diff --git a/dot_config/nvim/fnl/plugins/os/init.fnl b/dot_config/nvim/fnl/plugins/os/init.fnl
new file mode 100644
index 0000000..44afc2c
--- /dev/null
+++ b/dot_config/nvim/fnl/plugins/os/init.fnl
@@ -0,0 +1 @@
+(require (.. :plugins.os. (jit.os:lower)))
diff --git a/dot_config/nvim/fnl/plugins/os/linux.fnl b/dot_config/nvim/fnl/plugins/os/linux.fnl
new file mode 100644
index 0000000..0967ef4
--- /dev/null
+++ b/dot_config/nvim/fnl/plugins/os/linux.fnl
@@ -0,0 +1 @@
+{}
diff --git a/dot_config/nvim/fnl/plugins/os/osx.fnl b/dot_config/nvim/fnl/plugins/os/osx.fnl
new file mode 100644
index 0000000..0967ef4
--- /dev/null
+++ b/dot_config/nvim/fnl/plugins/os/osx.fnl
@@ -0,0 +1 @@
+{}
diff --git a/dot_config/nvim/fnl/plugins/surround.fnl b/dot_config/nvim/fnl/plugins/surround.fnl
new file mode 100644
index 0000000..6fdb678
--- /dev/null
+++ b/dot_config/nvim/fnl/plugins/surround.fnl
@@ -0,0 +1,5 @@
+(import-macros {: tbl} :toast.macros)
+[(tbl :kylechui/nvim-surround &
+ :version :* ; omit to use main branch for latest features
+ :event :VeryLazy
+ :opts {})]
diff --git a/dot_config/nvim/fnl/plugins/telescope.fnl b/dot_config/nvim/fnl/plugins/telescope.fnl
new file mode 100644
index 0000000..44aa9d5
--- /dev/null
+++ b/dot_config/nvim/fnl/plugins/telescope.fnl
@@ -0,0 +1,20 @@
+(import-macros {: tbl : recc} :toast.macros)
+
+(fn gen [key fun desc]
+ (tbl (.. :<leader>f key) #(recc :telescope.builtin fun) & :desc desc))
+
+[(tbl :nvim-telescope/telescope.nvim &
+ :dependencies [:nvim-lua/plenary.nvim
+ (tbl :nvim-telescope/telescope-fzf-native.nvim &
+ :build :make)]
+ :config (fn [_ opts]
+ (let [ts (require :telescope)]
+ (ts.setup opts)
+ (ts.load_extension :fzf)))
+ :cmd :Telescope
+ :keys [(gen :f :find_files "Find File")
+ (gen :g :live_grep "Live Grep")
+ (gen :b :buffers "Find Buffer")
+ (gen :h :help_tags "Find Help")
+ (gen :c :commands "Find Command")
+ (gen :t :treesitter "Find Treesitter")])]
diff --git a/dot_config/nvim/fnl/toast/core.fnl b/dot_config/nvim/fnl/toast/core.fnl
new file mode 100644
index 0000000..54b0455
--- /dev/null
+++ b/dot_config/nvim/fnl/toast/core.fnl
@@ -0,0 +1,47 @@
+(local {: insert} (require :toast.table))
+
+(fn dec [n]
+ "Decrement n by 1."
+ (- n 1))
+(fn inc [n]
+ "Increment n by 1."
+ (+ n 1))
+(fn drop [n xs]
+ "Returns a table of all but the first n elements in xs."
+ (let [out []]
+ (each [i v (ipairs xs)]
+ (when (> i n) (insert out v)))
+ out))
+(fn first [xs]
+ "The first element in a sequential table."
+ (. xs 1))
+(fn last [xs]
+ "The last element in a sequential table."
+ (. xs (length xs)))
+(fn group [n xs]
+ "Group elements in xs in groups of n.
+ Extra elements at the end will sit in the final group.
+ For example, (group 2 [1 2 3 4 5]) results in [[1 2] [3 4] [5]]."
+ (let [ll #(length (last $))
+ donext #(= (ll $) n)]
+ (accumulate [out [[]]
+ _ v (ipairs xs)]
+ (do (when (donext out)
+ (insert out []))
+ (insert (last out) v)
+ out))))
+(fn map [f xs]
+ "Returns a sequential table consisting of the result of apply f to every item in xs."
+ (accumulate [out []
+ _ v (ipairs xs)]
+ (let [mapped (f v)]
+ (insert out (if (= 0 (select :# mapped))
+ nil
+ mapped)))))
+
+{: dec
+ : inc
+ : drop
+ : group
+ : first
+ : last}
diff --git a/dot_config/nvim/fnl/toast/macros.fnl b/dot_config/nvim/fnl/toast/macros.fnl
new file mode 100644
index 0000000..bb4375b
--- /dev/null
+++ b/dot_config/nvim/fnl/toast/macros.fnl
@@ -0,0 +1,29 @@
+;; [nfnl-macro]
+
+(local {: inc
+ : drop
+ : group} (require :toast.core))
+(local {: from-pairs
+ : insert} (require :toast.table))
+
+(fn tbl [...]
+ "Generate a mixed table.
+ The format is (tbl 1 2 3 & :a :b) to produce {1; 2; 3; a = 'b'}.
+ This macro simply expands to the correct data during compile-time."
+ (let [args [...]
+ pre (accumulate [out []
+ _ v (ipairs args)
+ &until (= v '&)]
+ (insert out v))
+ post (drop (inc (length pre)) args)]
+ (from-pairs (group 2 post) pre)))
+
+(fn recc [reqspec key ...]
+ "A common lua pattern is `require 'something'.call(arg1, arg2)`.
+ The fennel equivalent is ((require :something).call arg1 arg2)
+ This macro makes it easier to do this elegantly.
+ The equivalent call is (recc :something :call arg1 arg2)"
+ `((. (require ,reqspec) ,key) ,...))
+
+{: tbl
+ : recc}
diff --git a/dot_config/nvim/fnl/toast/table.fnl b/dot_config/nvim/fnl/toast/table.fnl
new file mode 100644
index 0000000..a294b14
--- /dev/null
+++ b/dot_config/nvim/fnl/toast/table.fnl
@@ -0,0 +1,15 @@
+(fn from-pairs [t ?mut]
+ "Convert a list of [k v] pairs to a table.
+ If an initial table ?mut is provided, it will be mutated and returned."
+ (let [out (or ?mut {})]
+ (each [_ [k v] (ipairs t)]
+ (tset out k v))
+ out))
+
+(fn insert [t ...]
+ "Like table.insert, but returns the mutated table."
+ (table.insert t ...)
+ t)
+
+{: from-pairs
+ : insert}
diff --git a/dot_config/nvim/lua/bindings/builtins.lua b/dot_config/nvim/lua/bindings/builtins.lua
index 1b13f9b..b6e02d7 100644
--- a/dot_config/nvim/lua/bindings/builtins.lua
+++ b/dot_config/nvim/lua/bindings/builtins.lua
@@ -1,5 +1,2 @@
--- document missing builtins
-require 'which-key'.add {
- { 'gt', desc = 'Next tab' },
- { 'gT', desc = 'Previous tab' },
-}
+-- [nfnl] Compiled from fnl/bindings/builtins.fnl by https://github.com/Olical/nfnl, do not edit.
+return (require("which-key")).add({{"gt", desc = "Next tab"}, {"gT", desc = "Previous tab"}})
diff --git a/dot_config/nvim/lua/bindings/init.lua b/dot_config/nvim/lua/bindings/init.lua
index 4108782..1b8c2b8 100644
--- a/dot_config/nvim/lua/bindings/init.lua
+++ b/dot_config/nvim/lua/bindings/init.lua
@@ -1,15 +1,5 @@
-for _, v in ipairs {
- 'builtins',
- 'plugins',
-} do
- require ('bindings.' .. v)
+-- [nfnl] Compiled from fnl/bindings/init.fnl by https://github.com/Olical/nfnl, do not edit.
+for _, v in ipairs({"builtins", "plugins"}) do
+ require(("bindings." .. v))
end
-
--- general bindings that aren't specific to a plugin
-require 'which-key'.add {
- -- diagnostics
- { '<leader>e', vim.diagnostic.open_float, desc = 'diag float' },
- { '<leader>q', vim.diagnostic.setloclist, desc = 'diag locations' },
- { '[d', vim.diagnostic.goto_prev, desc = 'prev diag' },
- { ']d', vim.diagnostic.goto_next, desc = 'next diag' },
-}
+return (require("which-key")).add({{"<leader>e", vim.diagnostic.open_float, desc = "diag float"}, {"<leader>q", vim.diagnostic.setloclist, desc = "diag locations"}, {"[d", vim.diagnostic.goto_prev, desc = "prev diag"}, {"]d", vim.diagnostic.goto_next, desc = "next diag"}})
diff --git a/dot_config/nvim/lua/bindings/plugins.lua b/dot_config/nvim/lua/bindings/plugins.lua
index 4d4de72..8bebd06 100644
--- a/dot_config/nvim/lua/bindings/plugins.lua
+++ b/dot_config/nvim/lua/bindings/plugins.lua
@@ -1,4 +1,2 @@
--- plugin-specific category bindings
-require 'which-key'.add {
- { '<leader>f', desc = '+find' },
-}
+-- [nfnl] Compiled from fnl/bindings/plugins.fnl by https://github.com/Olical/nfnl, do not edit.
+return (require("which-key")).add({{"<leader>f", desc = "+find"}})
diff --git a/dot_config/nvim/lua/plugins/bindings/init.lua b/dot_config/nvim/lua/plugins/bindings/init.lua
index 56694b0..e4dea1b 100644
--- a/dot_config/nvim/lua/plugins/bindings/init.lua
+++ b/dot_config/nvim/lua/plugins/bindings/init.lua
@@ -1,10 +1,2 @@
-return {
- {
- 'folke/which-key.nvim',
- lazy = true,
- opts = {},
- },
- {
- 'tpope/vim-rsi'
- },
-}
+-- [nfnl] Compiled from fnl/plugins/bindings/init.fnl by https://github.com/Olical/nfnl, do not edit.
+return {{"folke/which-key.nvim", lazy = true, opts = {}}, {"tpope/vim-rsi"}}
diff --git a/dot_config/nvim/lua/plugins/flash.lua b/dot_config/nvim/lua/plugins/flash.lua
index 6791a0a..ad4203e 100644
--- a/dot_config/nvim/lua/plugins/flash.lua
+++ b/dot_config/nvim/lua/plugins/flash.lua
@@ -1,52 +1,17 @@
-return {
- 'folke/flash.nvim',
- opts = {
- -- disable flash search by default
- modes = {
- search = { enabled = false }
- },
- },
- event = "VeryLazy",
- keys = {
- {
- 's';
- mode = { 'n', 'x', 'o' },
- function()
- require 'flash'.jump()
- end,
- desc = 'Flash',
- },
- {
- 'S';
- mode = { 'n', 'x', 'o' },
- function()
- require 'flash'.treesitter()
- end,
- desc = 'Flash Treesitter',
- },
- {
- 'r';
- mode = 'o',
- function()
- require 'flash'.remote()
- end,
- desc = 'Remote Flash',
- },
- {
- 'R';
- mode = { 'o', 'x' },
- function()
- require 'flash'.treesitter_search()
- end,
- desc = 'Flash Treesitter Search',
- },
- {
- '<c-s>',
- mode = 'c',
- function()
- require 'flash'.toggle()
- end,
- desc = 'Toggle Flash Search',
- },
- },
-}
+-- [nfnl] Compiled from fnl/plugins/flash.fnl by https://github.com/Olical/nfnl, do not edit.
+local function _1_()
+ return (require("flash")).jump()
+end
+local function _2_()
+ return (require("flash")).treesitter()
+end
+local function _3_()
+ return (require("flash")).remote()
+end
+local function _4_()
+ return (require("flash")).treesitter_search()
+end
+local function _5_()
+ return (require("flash")).toggle()
+end
+return {{"folke/flash.nvim", event = "VeryLazy", keys = {{"s", _1_, desc = "Flash", mode = {"n", "x", "o"}}, {"S", _2_, desc = "Flash Treesitter", mode = {"n", "x", "o"}}, {"r", _3_, desc = "Remote Flash", mode = "o"}, {"R", _4_, desc = "Flash Treesitter Search", mode = {"o", "x"}}, {"<c-s>", _5_, desc = "Toggle Flash Search", mode = "c"}}, opts = {modes = {search = {enabled = false}}}}}
diff --git a/dot_config/nvim/lua/plugins/init.lua b/dot_config/nvim/lua/plugins/init.lua
index 0e2aec1..15a7d95 100644
--- a/dot_config/nvim/lua/plugins/init.lua
+++ b/dot_config/nvim/lua/plugins/init.lua
@@ -1,36 +1,9 @@
-local conjureft = {
- 'clojure',
- 'fennel',
- 'hy',
- 'janet',
- 'julia',
- 'lisp',
- 'racket',
- 'scheme'
-}
-
--- simple stuff that doesn't need any handling
--- and doesn't fit in elsewhere
-return {
- { 'folke/lazy.nvim', version = false },
- { "Olical/nfnl", ft = "fennel" },
- { 'stevearc/dressing.nvim', opts = {}},
- {
- 'Olical/conjure',
- config = function(_, opts)
- for k, v in pairs(opts) do
- vim.g['conjure#' .. k] = v
- end
- end,
- opts = {
- ['mapping#prefix'] = '<localleader>e',
- ['extract#tree_sitter#enabled'] = true,
- -- disabling lua, python, rust
- filetypes = conjureft,
- ['filetype#fennel'] = 'conjure.client.fennel.stdio',
- ['filetype#janet'] = 'conjure.client.janet.stdio',
- },
- ft = conjureft,
- },
- { 'tpope/vim-repeat' },
-}
+-- [nfnl] Compiled from fnl/plugins/init.fnl by https://github.com/Olical/nfnl, do not edit.
+local conjureft = {"clojure", "fennel", "hy", "janet", "julia", "lisp", "racket", "scheme"}
+local function _1_(_, opts)
+ for k, v in pairs(opts) do
+ vim.g[("conjure#" .. k)] = v
+ end
+ return nil
+end
+return {{"folke/lazy.nvim", version = false}, {"Olical/nfnl", ft = "fennel"}, {"stevearc/dressing.nvim", opts = {}}, {"Olical/conjure", config = _1_, ft = conjureft, opts = {["mapping#prefix"] = "<localleader>e", ["extract#tree_sitter#enabled"] = true, filetypes = conjureft, ["filetype#fennel"] = "conjure.client.fennel.stdio", ["filetype#janet"] = "conjure.client.janet.stdio"}}, {"tpope/vim-repeat"}}
diff --git a/dot_config/nvim/lua/plugins/langs.lua b/dot_config/nvim/lua/plugins/langs.lua
index fd08024..0e49dc6 100644
--- a/dot_config/nvim/lua/plugins/langs.lua
+++ b/dot_config/nvim/lua/plugins/langs.lua
@@ -1,50 +1,2 @@
--- language support
-return {
- -- treesitter
- {
- 'nvim-treesitter/nvim-treesitter',
- version = false,
- build = ':TSUpdate',
- dependencies = {
- 'nvim-treesitter/nvim-treesitter-textobjects',
- },
- main = 'nvim-treesitter.configs',
- opts = {
- ensure_installed = 'all',
- ignore_install = { 'norg' },
- sync_intall = true,
- highlight = {
- enable = true,
- disable = {
- 'markdown',
- },
- additional_vim_regex_highlighting = {
- 'markdown',
- },
- },
- },
- },
-
- -- non-treesitter languages
- {
- 'janet-lang/janet.vim',
- ft = 'janet',
- },
- {
- 'preservim/vim-markdown',
- version = false,
- dependencies = {'godlygeek/tabular'},
- ft = 'markdown',
- },
-
- -- helpers for lisps
- {
- 'gpanders/nvim-parinfer',
- ft = {
- 'clojure',
- 'fennel',
- 'janet',
- 'scm',
- },
- },
-}
+-- [nfnl] Compiled from fnl/plugins/langs.fnl by https://github.com/Olical/nfnl, do not edit.
+return {{"nvim-treesitter/nvim-treesitter", build = ":TSUpdate", dependnecies = {"nvim-treesitter/nvim-treesitter-textobjects"}, main = "nvim-treesitter.configs", opts = {ensure_installed = "all", ignore_install = {"norg"}, sync_install = "true", highlight = {enable = true, disable = {"markdown"}, additional_vim_regex_highlighting = {"markdown"}}}, version = false}, {"janet-lang/janet.vim", ft = "janet"}, {"preservim/vim-markdown", dependencies = {"godlygeek/tabular"}, ft = "markdown", version = false}, {"gpanders/nvim-parinfer", ft = {"clojure", "fennel", "janet", "scm"}}}
diff --git a/dot_config/nvim/lua/plugins/lsp/attach.lua b/dot_config/nvim/lua/plugins/lsp/attach.lua
index e81b154..f81303d 100644
--- a/dot_config/nvim/lua/plugins/lsp/attach.lua
+++ b/dot_config/nvim/lua/plugins/lsp/attach.lua
@@ -1,3 +1,4 @@
+-- TODO: INITIAL PORT
local function helper(opts, ...)
for _, spec in ipairs({...}) do
for _, v in ipairs(spec) do
diff --git a/dot_config/nvim/lua/plugins/lsp/capabilities.lua b/dot_config/nvim/lua/plugins/lsp/capabilities.lua
index 15e53c4..27ef5b2 100644
--- a/dot_config/nvim/lua/plugins/lsp/capabilities.lua
+++ b/dot_config/nvim/lua/plugins/lsp/capabilities.lua
@@ -1 +1,2 @@
+-- [nfnl] Compiled from fnl/plugins/lsp/capabilities.fnl by https://github.com/Olical/nfnl, do not edit.
return nil
diff --git a/dot_config/nvim/lua/plugins/lsp/init.lua b/dot_config/nvim/lua/plugins/lsp/init.lua
index 4c81c54..ce704ec 100644
--- a/dot_config/nvim/lua/plugins/lsp/init.lua
+++ b/dot_config/nvim/lua/plugins/lsp/init.lua
@@ -1,54 +1,35 @@
--- lsp options + runtime bindings
--- technically I could do some tree transforms, but that's a pain and I haven't done fennel stuff yet
--- + I'm not sure how feasible fennel stuff is in bootstrap-phase
--- anyway this is here to be in front of everything, so you can edit the settings you actually care about
-local gopts = function(plist)
- return {
- clangd = {},
- clojure_lsp = {
- root_dir = plist('project.clj', 'deps.edn', 'bb.edn', 'build.boot', 'shadow-cljs.edn', '.git'),
- },
- denols = {
- autostart = false,
- root_dir = plist('deno.json', 'deno.jsonc'),
- },
- gopls = {},
- ltex = {},
- lua_ls = {},
- texlab = {filetypes = {'tex', 'plaintex', 'bib', 'latex'}},
- tsserver = {
- autostart = false,
- root_dir = plist('tsconfig.json', 'package.json'),
- },
- zls = {},
- }
+-- [nfnl] Compiled from fnl/plugins/lsp/init.fnl by https://github.com/Olical/nfnl, do not edit.
+local function gopts(plist)
+ return {clangd = {}, clojure_lsp = {root_dir = plist("project.clj", "deps.edn", "bb.edn", "build.boot", "shadow-cljs.edn", ".git")}, denols = {root_dir = plist("deno.json", "deno.jsonc"), autostart = false}, gopls = {}, ltex = {}, lua_ls = {}, texlab = {filetypes = {"tex", "plaintex", "bib", "latex"}}, tsserver = {root_dir = plist("tsconfig.json", "package.json"), autostart = false}, zls = {}}
end
-
-local attach = require 'plugins.lsp.attach'
-local caps = require 'plugins.lsp.capabilities'
-
-return {
- {
- 'neovim/nvim-lspconfig',
- config = function(_, opts)
- for k, v in pairs(opts) do
- v.on_attach = v.on_attach or attach
- if type(caps) == 'table' then
- v.capabilities = v.capabilities or caps
- end
- local s = require 'lspconfig'[k]
- local c = v.cmd or s.document_config.default_config.cmd
- if vim.fn.executable(c[1]) ~= 0 then
- s.setup(v)
- end
- end
- end,
- opts = function()
- local plist = function(...)
- local p = require 'lspconfig.util'.root_pattern(...)
- return function(f) return p(f) end
- end
- return gopts(plist)
- end
- },
-}
+local attach = require("plugins.lsp.attach")
+local caps = require("plugins.lsp.capabilities")
+local function _1_(_, opts)
+ for k, v in pairs(opts) do
+ v.on_attach = (attach or v.on_attach)
+ if ("table" == type(caps)) then
+ v.capabilities = (v.capabilities or caps)
+ else
+ end
+ local s = (require("lspconfig"))[k]
+ local c = (v.cmd or s.document_config.default_config.cmd)
+ if (0 ~= vim.fn.executable(c[1])) then
+ s.setup(v)
+ else
+ end
+ end
+ return nil
+end
+local function _4_()
+ local plist
+ local function _5_(...)
+ local p = (require("lspconfig.util")).root_pattern(...)
+ local function _6_(_241)
+ return p(_241)
+ end
+ return _6_
+ end
+ plist = _5_
+ return gopts(plist)
+end
+return {{"neovim/nvim-lspconfig", config = _1_, opts = _4_}}
diff --git a/dot_config/nvim/lua/plugins/mini/init.lua b/dot_config/nvim/lua/plugins/mini/init.lua
index 2b61811..d45951e 100644
--- a/dot_config/nvim/lua/plugins/mini/init.lua
+++ b/dot_config/nvim/lua/plugins/mini/init.lua
@@ -1,30 +1,11 @@
-return {
- {
- 'echasnovski/mini.nvim',
- version = false, -- beta
- config = function(_, opts)
- for k, v in pairs(opts) do
- require ("mini." .. k).setup(v)
- end
- end,
- opts = function()
- return {
- ai = {},
- align = {},
- basics = {},
- bracketed = {
- indent = { options = { change_type = 'diff' } },
- },
- comment = {},
- completion = {},
- cursorword = {},
- indentscope = {},
- move = {},
- splitjoin = {},
- -- starter = require 'plugins.mini.starter',
- statusline = {},
- tabline = {},
- trailspace = {},
- }
- end },
-}
+-- [nfnl] Compiled from fnl/plugins/mini/init.fnl by https://github.com/Olical/nfnl, do not edit.
+local function _1_(_, opts)
+ for k, v in pairs(opts) do
+ do end (require(("mini." .. k))).setup(v)
+ end
+ return nil
+end
+local function _2_()
+ return {ai = {}, align = {}, basics = {}, bracketed = {indent = {options = {change_type = "diff"}}}, comment = {}, completion = {}, cursorword = {}, indentscope = {}, move = {}, splitjoin = {}, statusline = {}, tabline = {}, trailspace = {}}
+end
+return {{"echasnovski/mini.nvim", config = _1_, opts = _2_, version = false}}
diff --git a/dot_config/nvim/lua/plugins/mini/starter.lua b/dot_config/nvim/lua/plugins/mini/starter.lua
index 539aa11..4174894 100644
--- a/dot_config/nvim/lua/plugins/mini/starter.lua
+++ b/dot_config/nvim/lua/plugins/mini/starter.lua
@@ -1,19 +1,7 @@
-local starter = require 'mini.starter'
-
-local telescope = {
- {action = 'Telescope commands', name = 'Commands'},
- {action = 'Telescope find_files', name = 'Files'},
- {action = 'Telescope help_tags', name = 'Help tags'},
- {action = 'Telescope live_grep', name = 'Live grep'},
- {action = 'Telescope oldfiles', name = 'Old files'},
-}
+-- [nfnl] Compiled from fnl/plugins/mini/starter.fnl by https://github.com/Olical/nfnl, do not edit.
+local starter = require("mini.starter")
+local telescope = {{action = "Telescope commands", name = "Commands"}, {action = "Telescope find_files", name = "Files"}, {action = "Telescope help_tags", name = "Help tags"}, {action = "Telescope live_grep", name = "Live grep"}, {action = "Telescope oldfiles", name = "Old files"}}
for _, v in ipairs(telescope) do
- v.section = 'Telescope'
+ v.section = "Telescope"
end
-
-return {
- items = {
- telescope,
- starter.sections.builtin_actions(),
- },
-}
+return {items = {telescope, starter.sections.builtin_actions()}}
diff --git a/dot_config/nvim/lua/plugins/neo-tree.lua b/dot_config/nvim/lua/plugins/neo-tree.lua
index 5194d99..e97bfe0 100644
--- a/dot_config/nvim/lua/plugins/neo-tree.lua
+++ b/dot_config/nvim/lua/plugins/neo-tree.lua
@@ -1,21 +1,5 @@
-return {
- {
- 'nvim-neo-tree/neo-tree.nvim',
- cmd = 'Neotree',
- dependencies = {
- 'nvim-lua/plenary.nvim',
- 'MunifTanjim/nui.nvim',
- },
- keys = {
- {
- '<leader>n',
- function()
- require 'neo-tree.command'.execute { toggle = true }
- end,
- desc = 'Neotree',
- },
- },
- opts = {
- },
- },
-}
+-- [nfnl] Compiled from fnl/plugins/neo-tree.fnl by https://github.com/Olical/nfnl, do not edit.
+local function _1_()
+ return (require("neo-tree.command")).execute({toggle = true})
+end
+return {{"nvim-neo-tree/neo-tree.nvim", cmd = "Neotree", dependencies = {"nvim-lua/plenary.nvim", "MunifTanjim/nui.nvim"}, keys = {{"<leader>n", _1_, desc = "Neotree"}}, opts = {}}}
diff --git a/dot_config/nvim/lua/plugins/os/init.lua b/dot_config/nvim/lua/plugins/os/init.lua
index bc0a44e..c9b9cab 100644
--- a/dot_config/nvim/lua/plugins/os/init.lua
+++ b/dot_config/nvim/lua/plugins/os/init.lua
@@ -1,2 +1,2 @@
-local os = jit.os:lower()
-return require('plugins.os.' .. os)
+-- [nfnl] Compiled from fnl/plugins/os/init.fnl by https://github.com/Olical/nfnl, do not edit.
+return require(("plugins.os." .. (jit.os):lower()))
diff --git a/dot_config/nvim/lua/plugins/os/linux.lua b/dot_config/nvim/lua/plugins/os/linux.lua
index a564707..161b61c 100644
--- a/dot_config/nvim/lua/plugins/os/linux.lua
+++ b/dot_config/nvim/lua/plugins/os/linux.lua
@@ -1 +1,2 @@
+-- [nfnl] Compiled from fnl/plugins/os/linux.fnl by https://github.com/Olical/nfnl, do not edit.
return {}
diff --git a/dot_config/nvim/lua/plugins/os/osx.lua b/dot_config/nvim/lua/plugins/os/osx.lua
index a564707..8982211 100644
--- a/dot_config/nvim/lua/plugins/os/osx.lua
+++ b/dot_config/nvim/lua/plugins/os/osx.lua
@@ -1 +1,2 @@
+-- [nfnl] Compiled from fnl/plugins/os/osx.fnl by https://github.com/Olical/nfnl, do not edit.
return {}
diff --git a/dot_config/nvim/lua/plugins/surround.lua b/dot_config/nvim/lua/plugins/surround.lua
index a1c5b52..fc8fec7 100644
--- a/dot_config/nvim/lua/plugins/surround.lua
+++ b/dot_config/nvim/lua/plugins/surround.lua
@@ -1,8 +1,2 @@
-return {
- "kylechui/nvim-surround",
- version = "*", -- Use for stability; omit to use `main` branch for the latest features
- event = "VeryLazy",
- config = function()
- require("nvim-surround").setup {}
- end
-}
+-- [nfnl] Compiled from fnl/plugins/surround.fnl by https://github.com/Olical/nfnl, do not edit.
+return {{"kylechui/nvim-surround", event = "VeryLazy", opts = {}, version = "*"}}
diff --git a/dot_config/nvim/lua/plugins/telescope.lua b/dot_config/nvim/lua/plugins/telescope.lua
index bc760de..683bdd7 100644
--- a/dot_config/nvim/lua/plugins/telescope.lua
+++ b/dot_config/nvim/lua/plugins/telescope.lua
@@ -1,34 +1,13 @@
-local function gen(key, fn, desc)
- return {'<leader>f' .. key,
- function()
- require 'telescope.builtin'[fn]()
- end,
- desc = desc}
+-- [nfnl] Compiled from fnl/plugins/telescope.fnl by https://github.com/Olical/nfnl, do not edit.
+local function gen(key, fun, desc)
+ local function _1_()
+ return (require("telescope.builtin"))[fun]()
+ end
+ return {("<leader>f" .. key), _1_, desc = desc}
end
-
-return {
- {
- 'nvim-telescope/telescope.nvim',
- dependencies = {
- 'nvim-lua/plenary.nvim',
- {
- 'nvim-telescope/telescope-fzf-native.nvim',
- build = 'make',
- },
- },
- config = function(_, opts)
- local ts = require 'telescope'
- ts.setup(opts)
- ts.load_extension 'fzf'
- end,
- cmd = 'Telescope',
- keys = {
- gen('f', 'find_files', 'Find File'),
- gen('g', 'live_grep', 'Live Grep'),
- gen('b', 'buffers', 'Find Buffer'),
- gen('h', 'help_tags', 'Find Help'),
- gen('c', 'commands', 'Find Command'),
- gen('t', 'treesitter', 'Find Treesitter'),
- },
- },
-}
+local function _2_(_, opts)
+ local ts = require("telescope")
+ ts.setup(opts)
+ return ts.load_extension("fzf")
+end
+return {{"nvim-telescope/telescope.nvim", cmd = "Telescope", config = _2_, dependencies = {"nvim-lua/plenary.nvim", {"nvim-telescope/telescope-fzf-native.nvim", build = "make"}}, keys = {gen("f", "find_files", "Find File"), gen("g", "live_grep", "Live Grep"), gen("b", "buffers", "Find Buffer"), gen("h", "help_tags", "Find Help"), gen("c", "commands", "Find Command"), gen("t", "treesitter", "Find Treesitter")}}}
diff --git a/dot_config/nvim/lua/toast/core.lua b/dot_config/nvim/lua/toast/core.lua
new file mode 100644
index 0000000..c666faa
--- /dev/null
+++ b/dot_config/nvim/lua/toast/core.lua
@@ -0,0 +1,63 @@
+-- [nfnl] Compiled from fnl/toast/core.fnl by https://github.com/Olical/nfnl, do not edit.
+local _local_1_ = require("toast.table")
+local insert = _local_1_["insert"]
+local function dec(n)
+ return (n - 1)
+end
+local function inc(n)
+ return (n + 1)
+end
+local function drop(n, xs)
+ local out = {}
+ for i, v in ipairs(xs) do
+ if (i > n) then
+ insert(out, v)
+ else
+ end
+ end
+ return out
+end
+local function first(xs)
+ return xs[1]
+end
+local function last(xs)
+ return xs[#xs]
+end
+local function group(n, xs)
+ local ll
+ local function _3_(_241)
+ return #last(_241)
+ end
+ ll = _3_
+ local donext
+ local function _4_(_241)
+ return (ll(_241) == n)
+ end
+ donext = _4_
+ local out = {{}}
+ for _, v in ipairs(xs) do
+ if donext(out) then
+ insert(out, {})
+ else
+ end
+ insert(last(out), v)
+ out = out
+ end
+ return out
+end
+local function map(f, xs)
+ local out = {}
+ for _, v in ipairs(xs) do
+ local mapped = f(v)
+ local function _6_()
+ if (0 == select("#", mapped)) then
+ return nil
+ else
+ return mapped
+ end
+ end
+ out = insert(out, _6_())
+ end
+ return out
+end
+return {dec = dec, inc = inc, drop = drop, group = group, first = first, last = last}
diff --git a/dot_config/nvim/lua/toast/table.lua b/dot_config/nvim/lua/toast/table.lua
new file mode 100644
index 0000000..b2633a2
--- /dev/null
+++ b/dot_config/nvim/lua/toast/table.lua
@@ -0,0 +1,16 @@
+-- [nfnl] Compiled from fnl/toast/table.fnl by https://github.com/Olical/nfnl, do not edit.
+local function from_pairs(t, _3fmut)
+ local out = (_3fmut or {})
+ for _, _1_ in ipairs(t) do
+ local _each_2_ = _1_
+ local k = _each_2_[1]
+ local v = _each_2_[2]
+ out[k] = v
+ end
+ return out
+end
+local function insert(t, ...)
+ table.insert(t, ...)
+ return t
+end
+return {["from-pairs"] = from_pairs, insert = insert}