From 5174167c99b577325415ff497e6b09b8966ffb5a Mon Sep 17 00:00:00 2001 From: Proctor Date: Wed, 30 Apr 2025 09:59:35 -0500 Subject: [PATCH] nvim - further migration to pure fennel from aniseed --- nvim/.config/nvim/fnl/dotfiles/core.fnl | 176 ++++++++-------- nvim/.config/nvim/fnl/dotfiles/init.fnl | 8 +- nvim/.config/nvim/fnl/dotfiles/mapping.fnl | 33 +-- nvim/.config/nvim/fnl/dotfiles/plugin/cmp.fnl | 23 +-- .../nvim/fnl/dotfiles/plugin/colorizer.fnl | 31 +-- .../nvim/fnl/dotfiles/plugin/compe.fnl | 50 +++-- .../nvim/fnl/dotfiles/plugin/conjure.fnl | 17 +- .../nvim/fnl/dotfiles/plugin/dadbodui.fnl | 4 - .../nvim/fnl/dotfiles/plugin/easyalign.fnl | 7 +- .../nvim/fnl/dotfiles/plugin/headlines.fnl | 3 +- nvim/.config/nvim/fnl/dotfiles/plugin/hex.fnl | 6 +- .../nvim/fnl/dotfiles/plugin/luasnip.fnl | 36 ++-- .../nvim/fnl/dotfiles/plugin/mason.fnl | 19 +- .../nvim/fnl/dotfiles/plugin/null-ls.fnl | 21 +- .../nvim/fnl/dotfiles/plugin/orgbullets.fnl | 63 +++--- .../nvim/fnl/dotfiles/plugin/orgmode.fnl | 17 +- .../nvim/fnl/dotfiles/plugin/packer.fnl | 6 +- .../nvim/fnl/dotfiles/plugin/paredit.fnl | 103 +++++----- .../nvim/fnl/dotfiles/plugin/smartsplits.fnl | 46 ++--- .../nvim/fnl/dotfiles/plugin/telescope.fnl | 26 +-- .../nvim/fnl/dotfiles/plugin/whichkey.fnl | 8 +- .../nvim/fnl/dotfiles/plugin/yanky.fnl | 7 +- nvim/.config/nvim/fnl/dotfiles/plugins.fnl | 189 +++++++++--------- .../nvim/fnl/dotfiles/terraform-helpers.fnl | 4 +- nvim/.config/nvim/fnl/dotfiles/ts-utils.fnl | 23 ++- 25 files changed, 444 insertions(+), 482 deletions(-) diff --git a/nvim/.config/nvim/fnl/dotfiles/core.fnl b/nvim/.config/nvim/fnl/dotfiles/core.fnl index 144871b..34a1f07 100644 --- a/nvim/.config/nvim/fnl/dotfiles/core.fnl +++ b/nvim/.config/nvim/fnl/dotfiles/core.fnl @@ -1,101 +1,94 @@ -(module dotfiles.core - {autoload {a aniseed.core} - require {anenv aniseed.env nvim aniseed.nvim}}) - +(local a (require :aniseed.core)) (local u (require :dotfiles.util)) -(nvim.ex.set :shortmess+=c) +(vim.cmd.set :shortmess+=c) ; don't give |ins-completion-menu| messages. -(nvim.ex.set :path+=**) -(nvim.ex.set "wildignore+=*.o,*.obj,.git,*.rbc,*.class,.svn,vendor/gems/*") +(vim.cmd.set :path+=**) +(vim.cmd.set "wildignore+=*.o,*.obj,.git,*.rbc,*.class,.svn,vendor/gems/*") -(defn- safe-source - [filename] - (let [glob (nvim.fn.glob filename)] +(fn safe-source [filename] + (let [glob (vim.fn.glob filename)] (if (not (a.empty? glob)) - (nvim.ex.source filename)))) + (vim.fn.source filename)))) ; (a.map safe-source ["~/.vimrc" "~/.vimrc.local"]) -(def- backup-dir (.. (nvim.fn.glob :$HOME) :/.vim/backup)) -(def- undo-dir (.. (nvim.fn.glob :$HOME) :/.vim/backup)) +(local backup-dir (.. (vim.fn.glob :$HOME) :/.vim/backup)) +(local undo-dir (.. (vim.fn.glob :$HOME) :/.vim/backup)) -(def- on-opts - [:autoindent - :autoread - :expandtab - :exrc - ; allow project level (neo)vim files - :hlsearch - :ignorecase - :incsearch - :number - :ruler - :secure - :shiftround - ; When at 3 spaces and I hit >>, go to 4, not 5. - :showcmd - ; shows (parital) command in the status line - :showmatch - :smartcase - :splitbelow - :splitright - :termguicolors - :title - :undofile - :wildmenu]) +(local on-opts [:autoindent + :autoread + :expandtab + :exrc + ; allow project level (neo)vim files + :hlsearch + :ignorecase + :incsearch + :number + :ruler + :secure + :shiftround + ; When at 3 spaces and I hit >>, go to 4, not 5. + :showcmd + ; shows (parital) command in the status line + :showmatch + :smartcase + :splitbelow + :splitright + :termguicolors + :title + :undofile + :wildmenu]) -(def- val-based-opts - {; :t_Co 256 - :laststatus 2 - :encoding :utf-8 - :history 500 - :redrawtime 5000 - :scrolloff 3 - :guifont :Hasklig - :guifontwide :Hasklig - :background :dark - :backupdir backup-dir - :directory backup-dir - ;Don't clutter my dirs up with swp and tmp files - :grepprg "ag --vimgrep" - ; Use Silver Searcher instead of grep - :tags :tags - :updatetime 300 - ; per coc.vim for diagnostic messages - :signcolumn "auto:1-3" - :colorcolumn [81 100] - :cmdheight 2 - ; Better display for messages - :undodir undo-dir - :undolevels 1000 - :undoreload 10000 - :foldmethod :expr - :foldexpr "nvim_treesitter#foldexpr()" - :foldlevelstart 100 - :foldlevel 99 - :tabstop 2 - :shiftwidth 2 - :softtabstop 2 - :mouse "" - :list true - :listchars "tab:➥\\ ,trail:·,nbsp:■" - :backspace "indent,eol,start" - ;allow backspacing over everything in insert mode - :wildmode "list:longest,list:full" - :wrap false}) +(local val-based-opts {; :t_Co 256 + :laststatus 2 + :encoding :utf-8 + :history 500 + :redrawtime 5000 + :scrolloff 3 + :guifont :Hasklig + :guifontwide :Hasklig + :background :dark + :backupdir backup-dir + :directory backup-dir + ;Don't clutter my dirs up with swp and tmp files + :grepprg "ag --vimgrep" + ; Use Silver Searcher instead of grep + :tags :tags + :updatetime 300 + ; per coc.vim for diagnostic messages + :signcolumn "auto:1-3" + :colorcolumn [81 100] + :cmdheight 2 + ; Better display for messages + :undodir undo-dir + :undolevels 1000 + :undoreload 10000 + :foldmethod :expr + :foldexpr "nvim_treesitter#foldexpr()" + :foldlevelstart 100 + :foldlevel 99 + :tabstop 2 + :shiftwidth 2 + :softtabstop 2 + :mouse "" + :list true + :listchars "tab:➥\\ ,trail:·,nbsp:■" + :backspace "indent,eol,start" + ;allow backspacing over everything in insert mode + :wildmode "list:longest,list:full" + :wrap false}) -(def- append-val-opts {:diffopt "algorithm:patience"}) +(local append-val-opts {:diffopt "algorithm:patience"}) -(defn- set-opt [[opt val]] (tset vim.opt (a.str opt) val)) +(fn set-opt [[opt val]] (tset vim.opt (a.str opt) val)) -(defn- set-opt+ - [[opt val]] - (let [existing-opt-val (a.get nvim.o opt)] +(fn set-opt+ [[opt val]] + (let [existing-opt-val (a.get vim.o opt)] (tset vim.opt (a.str opt) (a.str existing-opt-val "," val)))) -(defn- set-opt-on [opt] (set-opt [opt true])) +(fn set-opt-on [opt] (set-opt [opt true])) (a.map set-opt-on on-opts) @@ -103,12 +96,17 @@ (a.map-indexed set-opt+ append-val-opts) -(nvim.ex.syntax :on) +(vim.cmd.syntax :on) ;; (nvim.ex.colorscheme :soluarized) -(nvim.ex.colorscheme :solarized8) +(vim.cmd.colorscheme :solarized8) ;; (nvim.ex.autocmd "vimenter" "*" "++nested" "colorscheme" "soluarized") -(nvim.ex.autocmd :vimenter "*" :++nested :colorscheme :solarized8) + +(vim.api.nvim_create_autocmd [:vimenter] + {:pattern "*" + :command "colorscheme solarized8" + :nested true}) + ;(nvim.ex.autocmd "vimenter" "*" "luafile" "treesitter.lua") ; ; (nvim.fn.glob "~/.vimrc.local") @@ -120,7 +118,7 @@ (u.nnoremap :fsb ":call FennelScratchBuffer ()") -(fn compile-fnl [] (print :recompiling) - (anenv.init {:force true :init :dotfiles.init})) - -(vim.api.nvim_create_user_command :AniseedCompile compile-fnl {}) +;; (fn compile-fnl [] (print :recompiling) +;; (anenv.init {:force true :init :dotfiles.init})) +;; +;; (vim.api.nvim_create_user_command :AniseedCompile compile-fnl {}) diff --git a/nvim/.config/nvim/fnl/dotfiles/init.fnl b/nvim/.config/nvim/fnl/dotfiles/init.fnl index f3956eb..4eca27c 100644 --- a/nvim/.config/nvim/fnl/dotfiles/init.fnl +++ b/nvim/.config/nvim/fnl/dotfiles/init.fnl @@ -1,9 +1,4 @@ -(module dotfiles.init - {autoload - {a aniseed.core} - require - {nvim aniseed.nvim}}) - +(local a (require :aniseed.core)) (require :dotfiles.core) (require :dotfiles.plugins) @@ -12,5 +7,4 @@ (require :dotfiles.zoom-toggle) ;(nvim.ex.source "~/.vimrc") - (a.println "(re)loaded") diff --git a/nvim/.config/nvim/fnl/dotfiles/mapping.fnl b/nvim/.config/nvim/fnl/dotfiles/mapping.fnl index 7ebfb10..c8fe7e0 100644 --- a/nvim/.config/nvim/fnl/dotfiles/mapping.fnl +++ b/nvim/.config/nvim/fnl/dotfiles/mapping.fnl @@ -1,20 +1,17 @@ -(module dotfiles.mapping - {autoload {nvim aniseed.nvim - nu aniseed.nvim.util - core aniseed.core - util dotfiles.util}}) +(local util (require :dotfiles.util)) -(defn- noremap [mode from to] "Sets a mapping with {:noremap true}." - (nvim.set_keymap mode from to {:noremap true})) +(fn noremap [mode from to] + "Sets a mapping with {:noremap true}." + (vim.keymap.set mode from to {:noremap true})) ; (set nvim.g.mapleader "\\") -(defn aniseed-reload [] - (each [k _ (ipairs package.loaded)] - (when (string.match k "^dotfiles%..+") - (tset package.loaded k nil))) - ((. (require :aniseed.env) :init) {:module :dotfiles.init :compile true}) - (core.println "aniseed reloaded!")) +(fn aniseed-reload [] + (each [k _ (ipairs package.loaded)] + (when (string.match k "^dotfiles%..+") + (tset package.loaded k nil))) + ((. (require :aniseed.env) :init) {:module :dotfiles.init :compile true}) + (print "aniseed reloaded!")) (vim.keymap.set :n "`" aniseed-reload) @@ -67,7 +64,10 @@ (noremap :n :mv ":AsyncRun -mode=bang open -a Marked\\ 2.app '%:p'") ; Run current statement in DadBod-UI -(nvim.ex.autocmd :FileType :sql :nmap :s :vapS) +;; (nvim.ex.autocmd :FileType :sql :nmap :s :vapS) +(vim.api.nvim_create_autocmd [:FileType] + {:pattern :sql + :command "nmap s vapS"}) (noremap :n :Q ":.!bash ") @@ -81,10 +81,11 @@ ; Trim trailing Whitespace in current line (util.lnnoremap :tw ".s/\\s\\+$//ge:nohlsearch/") - ;; in terminal to clear scrollback buffer ;; nmap :set scrollback=1 \| set scrollback=100000 -(util.lnnoremap : ":set scrollback=1 | :set scrollback 100000" {:silent true}) +(util.lnnoremap : ":set scrollback=1 | :set scrollback 100000" + {:silent true}) + ;; tmap i (util.ltnoremap : "i" {:silent true}) diff --git a/nvim/.config/nvim/fnl/dotfiles/plugin/cmp.fnl b/nvim/.config/nvim/fnl/dotfiles/plugin/cmp.fnl index 5188038..0e28e7b 100644 --- a/nvim/.config/nvim/fnl/dotfiles/plugin/cmp.fnl +++ b/nvim/.config/nvim/fnl/dotfiles/plugin/cmp.fnl @@ -1,17 +1,16 @@ -(module dotfiles.plugin.cmp {autoload {nvim aniseed.nvim luasnip luasnip}}) +(local cmp (require :cmp)) +(local luasnip (require :luasnip)) -(module config.plugin.cmp {autoload {nvim aniseed.nvim cmp cmp}}) +(local cmp-src-menu-items {:buffer :buff :conjure :conj :nvim_lsp :lsp}) -(def- cmp-src-menu-items {:buffer :buff :conjure :conj :nvim_lsp :lsp}) - -(def- cmp-srcs [{:name :nvim_lsp} - {:name :nvim_lua} - {:name :luasnip} - {:name :vsnip} - {:name :conjure} - {:name :buffer} - {:name :orgmode} - {:name :emoji :max_item_count 8}]) +(local cmp-srcs [{:name :nvim_lsp} + {:name :nvim_lua} + {:name :luasnip} + {:name :vsnip} + {:name :conjure} + {:name :buffer} + {:name :orgmode} + {:name :emoji :max_item_count 8}]) ;; Setup cmp with desired settings (let [cmp (require :cmp)] diff --git a/nvim/.config/nvim/fnl/dotfiles/plugin/colorizer.fnl b/nvim/.config/nvim/fnl/dotfiles/plugin/colorizer.fnl index 306d7ca..6dd9a1c 100644 --- a/nvim/.config/nvim/fnl/dotfiles/plugin/colorizer.fnl +++ b/nvim/.config/nvim/fnl/dotfiles/plugin/colorizer.fnl @@ -1,13 +1,18 @@ -(module dotfiles.plugin.colorizer - {autoload {colorizer colorizer}}) - -(colorizer.setup [:*] - {:RGB true ; #RGB hex codes, like #F00 - :RRGGBB true ; #RRGGBB hex codes, like #00FF00 - :names true ; "Name" codes like Blue - :RRGGBBAA true ; #RRGGBBAA hex codes - :rgb_fn true ; CSS rgb() and rgba() functions - :hsl_fn true ; CSS hsl() and hsla() functions - :css true ; Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB - :css_fn true ; Enable all CSS *functions*: rgb_fn, hsl_fn - }) +(let [colorizer (require :colorizer)] + (colorizer.setup ["*"] {:RGB true + ; #RGB hex codes, like #F00 + :RRGGBB true + ; #RRGGBB hex codes, like #00FF00 + :names true + ; "Name" codes like Blue + :RRGGBBAA true + ; #RRGGBBAA hex codes + :rgb_fn true + ; CSS rgb() and rgba() functions + :hsl_fn true + ; CSS hsl() and hsla() functions + :css true + ; Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB + :css_fn true + ; Enable all CSS *functions*: rgb_fn, hsl_fn + })) diff --git a/nvim/.config/nvim/fnl/dotfiles/plugin/compe.fnl b/nvim/.config/nvim/fnl/dotfiles/plugin/compe.fnl index f59e5e5..08f11bc 100644 --- a/nvim/.config/nvim/fnl/dotfiles/plugin/compe.fnl +++ b/nvim/.config/nvim/fnl/dotfiles/plugin/compe.fnl @@ -1,33 +1,31 @@ -(module dotfiles.plugin.compe - {autoload {nvim aniseed.nvim}}) +(module dotfiles.plugin.compe {autoload {nvim aniseed.nvim}}) -(set nvim.o.completeopt "menuone,noselect") +(set vim.o.completeopt "menuone,noselect") (let [compe (require :compe)] (when compe - (compe.setup - {:enabled true - :autocomplete true - :debug false - :min_length 1 - :preselect "enable" - :throttle_time 80 - :source_timeout 200 - :incomplete_delay 400 - :max_abbr_width 100 - :max_kind_width 100 - :max_menu_width 100 - :documentation true - :source {:path true - :buffer true - :calc true - :emoji true - :nvim_lsp true - :nvim_lua true - :conjure true - :orgmode true - :vsnip true - :vim_dadbod_completion true}}))) + (compe.setup {:enabled true + :autocomplete true + :debug false + :min_length 1 + :preselect :enable + :throttle_time 80 + :source_timeout 200 + :incomplete_delay 400 + :max_abbr_width 100 + :max_kind_width 100 + :max_menu_width 100 + :documentation true + :source {:path true + :buffer true + :calc true + :emoji true + :nvim_lsp true + :nvim_lua true + :conjure true + :orgmode true + :vsnip true + :vim_dadbod_completion true}}))) (nvim.ex.inoremap " compe#complete()") (nvim.ex.inoremap " compe#confirm('')") diff --git a/nvim/.config/nvim/fnl/dotfiles/plugin/conjure.fnl b/nvim/.config/nvim/fnl/dotfiles/plugin/conjure.fnl index 9fbfbd7..0741b0f 100644 --- a/nvim/.config/nvim/fnl/dotfiles/plugin/conjure.fnl +++ b/nvim/.config/nvim/fnl/dotfiles/plugin/conjure.fnl @@ -1,13 +1,12 @@ -(module dotfiles.plugin.conjure - {autoload {a aniseed.core - conjure-config conjure.config - nvim aniseed.nvim}}) +(local core (require :aniseed.core)) ; (set nvim.g.conjure#eval#result_register "*") ; (set nvim.g.conjure#log#botright true) -(set nvim.g.conjure#mapping#doc_word "gk") -(set nvim.g.conjure#client#clojure#nrepl#mapping#session_clone :sC) -(set nvim.g.conjure#extract#tree_sitter#enabled true) +(set vim.g.conjure#mapping#doc_word :gk) +(set vim.g.conjure#client#clojure#nrepl#mapping#session_clone :sC) +(set vim.g.conjure#extract#tree_sitter#enabled true) -(conjure-config.assoc-in [:filetypes] (a.concat (conjure-config.filetypes) [:markdown] )) -(conjure-config.assoc-in [:filetype :markdown] "conjure.client.clojure.nrepl") +(let [conjure-config (require :conjure.config)] + (conjure-config.assoc-in [:filetypes] + (core.concat (conjure-config.filetypes) [:markdown])) + (conjure-config.assoc-in [:filetype :markdown] :conjure.client.clojure.nrepl)) diff --git a/nvim/.config/nvim/fnl/dotfiles/plugin/dadbodui.fnl b/nvim/.config/nvim/fnl/dotfiles/plugin/dadbodui.fnl index e650200..e69de29 100644 --- a/nvim/.config/nvim/fnl/dotfiles/plugin/dadbodui.fnl +++ b/nvim/.config/nvim/fnl/dotfiles/plugin/dadbodui.fnl @@ -1,4 +0,0 @@ -(module dotfiles.plugin.dadbodui - {autoload { nvim aniseed.nvim }}) - - diff --git a/nvim/.config/nvim/fnl/dotfiles/plugin/easyalign.fnl b/nvim/.config/nvim/fnl/dotfiles/plugin/easyalign.fnl index b8dc5a6..40898e4 100644 --- a/nvim/.config/nvim/fnl/dotfiles/plugin/easyalign.fnl +++ b/nvim/.config/nvim/fnl/dotfiles/plugin/easyalign.fnl @@ -1,5 +1,2 @@ -(module dotfiles.plugin.easyalign - {autoload {nvim aniseed.nvim - util dotfiles.util }}) - -(util.noremap :v : "EasyAlign*") +(let [util (require :dotfiles.util)] + (util.noremap :v : :EasyAlign*)) diff --git a/nvim/.config/nvim/fnl/dotfiles/plugin/headlines.fnl b/nvim/.config/nvim/fnl/dotfiles/plugin/headlines.fnl index dbd54ff..9c9ea3f 100644 --- a/nvim/.config/nvim/fnl/dotfiles/plugin/headlines.fnl +++ b/nvim/.config/nvim/fnl/dotfiles/plugin/headlines.fnl @@ -1,2 +1 @@ -(module dotfiles.plugin.headlines - {autoload {headlines headlines}}) +(local headlines (require :headlines)) diff --git a/nvim/.config/nvim/fnl/dotfiles/plugin/hex.fnl b/nvim/.config/nvim/fnl/dotfiles/plugin/hex.fnl index d323118..13c9d07 100644 --- a/nvim/.config/nvim/fnl/dotfiles/plugin/hex.fnl +++ b/nvim/.config/nvim/fnl/dotfiles/plugin/hex.fnl @@ -1,3 +1,3 @@ -(module dotfiles.plugin.hex {autoload {nvim aniseed.nvim hex hex}}) - -(hex.setup) +(let [hex (require :hex)] + (when hex + (hex.setup))) diff --git a/nvim/.config/nvim/fnl/dotfiles/plugin/luasnip.fnl b/nvim/.config/nvim/fnl/dotfiles/plugin/luasnip.fnl index 3fa71cb..4325f68 100644 --- a/nvim/.config/nvim/fnl/dotfiles/plugin/luasnip.fnl +++ b/nvim/.config/nvim/fnl/dotfiles/plugin/luasnip.fnl @@ -1,19 +1,17 @@ -(module dotfiles.plugin.luasnip - {autoload {nvim aniseed.nvim util dotfiles.util luasnip luasnip} - require {select_choice luasnip.extras.select_choice}}) - -(vim.keymap.set [:i :s] : - (fn [] - (if (luasnip.expand_or_jumpable) - (luasnip.expand_or_jump))) {:silent true}) - -(vim.keymap.set [:i :s] : - (fn [] - (if (luasnip.jumpable -1) - (luasnip.jump -1))) {:silent true}) - -(vim.keymap.set :i : (fn [] - (if (luasnip.choice_active) - (luasnip.choice 1)))) - -(vim.keymap.set :i : select_choice) +(let [luasnip (require :luasnip) + select_choice (require :luasnip.extras.select_choice)] + (when luasnip + (vim.keymap.set [:i :s] : + (fn [] + (if (luasnip.expand_or_jumpable) + (luasnip.expand_or_jump))) + {:silent true}) + (vim.keymap.set [:i :s] : + (fn [] + (if (luasnip.jumpable -1) + (luasnip.jump -1))) {:silent true}) + (vim.keymap.set :i : + (fn [] + (if (luasnip.choice_active) + (luasnip.choice 1)))) + (vim.keymap.set :i : select_choice))) diff --git a/nvim/.config/nvim/fnl/dotfiles/plugin/mason.fnl b/nvim/.config/nvim/fnl/dotfiles/plugin/mason.fnl index 4f92a51..dfe80c7 100644 --- a/nvim/.config/nvim/fnl/dotfiles/plugin/mason.fnl +++ b/nvim/.config/nvim/fnl/dotfiles/plugin/mason.fnl @@ -1,10 +1,11 @@ -(module dotfiles.plugin.mason - {autoload {a aniseed.core - nvim aniseed.nvim mason mason mason-lspconf mason-lspconfig}}) +(fn setup [] + (let [mason (require :mason) + mason-lspconf (require :mason-lspconfig) + lspconfig (require :dotfiles.plugin.lspconfig)] + (when mason + (mason.setup {:ui {:icons {:package_installed "✓"}}}) + (when mason-lspconf + (mason-lspconf.setup {:ensure_installed [:lua_ls]}) + (mason-lspconf.setup_handlers {1 lspconfig.default-server-handler}))))) -(defn setup [] - (when mason - (mason.setup {:ui {:icons {:package_installed "✓"}}}) - (when mason-lspconf - (mason-lspconf.setup {:ensure_installed [:lua_ls]}) - (mason-lspconf.setup_handlers {1 default-server-handler})))) +(setup) diff --git a/nvim/.config/nvim/fnl/dotfiles/plugin/null-ls.fnl b/nvim/.config/nvim/fnl/dotfiles/plugin/null-ls.fnl index 5aaf375..14f951a 100644 --- a/nvim/.config/nvim/fnl/dotfiles/plugin/null-ls.fnl +++ b/nvim/.config/nvim/fnl/dotfiles/plugin/null-ls.fnl @@ -1,13 +1,8 @@ -(module dotfiles.plugin.null-ls - {autoload {nvim aniseed.nvim - a aniseed.core - nu aniseed.nvim.util - null-ls null-ls - lspconfig dotfiles.plugin.lspconfig}}) - -(def null-ls-server-options - {:sources [null-ls.builtins.formatting.stylua - null-ls.builtins.formatting.fnlfmt] - :on_attach lspconfig.on_attach}) - -(null-ls.setup null-ls-server-options) +(let [null-ls (require :null-ls) + lspconfig (require :dotfiles.plugin.lspconfig)] + (when null-ls + (local null-ls-server-options + {:sources [null-ls.builtins.formatting.stylua + null-ls.builtins.formatting.fnlfmt] + :on_attach lspconfig.on_attach}) + (null-ls.setup null-ls-server-options))) diff --git a/nvim/.config/nvim/fnl/dotfiles/plugin/orgbullets.fnl b/nvim/.config/nvim/fnl/dotfiles/plugin/orgbullets.fnl index ff5e499..c83d4d9 100644 --- a/nvim/.config/nvim/fnl/dotfiles/plugin/orgbullets.fnl +++ b/nvim/.config/nvim/fnl/dotfiles/plugin/orgbullets.fnl @@ -1,40 +1,41 @@ -(module dotfiles.plugin.orgbullets - {autoload {nvim aniseed.nvim a aniseed.core ts-utils dotfiles.ts-utils}}) +(module dotfiles.plugin.orgbullets {autoload {nvim aniseed.nvim}}) -(def stars ["◉" "⦾" "○" "✸" "✿" "✶" "•" "‣"]) +(local core (require :aniseed.core)) +(local ts-utils (require :dotfiles.ts-utils)) +(local stars ["◉" "⦾" "○" "✸" "✿" "✶" "•" "‣"]) -(def stars-query "(headline (stars) @stars)") +(local stars-query "(headline (stars) @stars)") -(defn star-index [heading-level] - (let [star-count (a.count stars) - idx (math.fmod heading-level star-count)] - (if (< 0 idx) - idx - star-count))) +(fn star-index [heading-level] + (let [star-count (core.count stars) + idx (math.fmod heading-level star-count)] + (if (< 0 idx) + idx + star-count))) -(defonce extmark-namespace (vim.api.nvim_create_namespace :HeaderStars)) +(local extmark-namespace (vim.api.nvim_create_namespace :HeaderStars)) -(def star-captures (ts-utils.make-query :org stars-query)) +(local star-captures (ts-utils.make-query :org stars-query)) -(defn gen-star-extmarks [] - (when (= :org vim.bo.filetype) - (let [bufnr (vim.api.nvim_get_current_buf) - star-count (a.count stars)] - (vim.api.nvim_buf_clear_namespace bufnr extmark-namespace 0 -1) - (each [id node metadata (star-captures bufnr)] - (let [[start-line start-col end-row end-col] [(node:range)] - heading-level (if (= start-line end-row) - (- end-col start-col)) - star (a.get stars (star-index heading-level)) - replacement (string.format (a.str "%" (+ 2 heading-level) :s) - star)] - (vim.api.nvim_buf_set_extmark bufnr extmark-namespace start-line - start-col - {:end_col end-col - :end_row end-row - :virt_text [[replacement []]] - :virt_text_pos :overlay - :hl_mode :combine})))))) +(fn gen-star-extmarks [] + (when (= :org vim.bo.filetype) + (let [bufnr (vim.api.nvim_get_current_buf) + star-count (core.count stars)] + (vim.api.nvim_buf_clear_namespace bufnr extmark-namespace 0 -1) + (each [id node metadata (star-captures bufnr)] + (let [[start-line start-col end-row end-col] [(node:range)] + heading-level (if (= start-line end-row) + (- end-col start-col)) + star (core.get stars (star-index heading-level)) + replacement (string.format (core.str "%" (+ 2 heading-level) :s) + star)] + (vim.api.nvim_buf_set_extmark bufnr extmark-namespace start-line + start-col + {:end_col end-col + :end_row end-row + :virt_text [[replacement []]] + :virt_text_pos :overlay + :hl_mode :combine})))))) (let [group (nvim.create_augroup :HeaderStars {:clear true})] (nvim.create_autocmd [:FileChangedShellPost diff --git a/nvim/.config/nvim/fnl/dotfiles/plugin/orgmode.fnl b/nvim/.config/nvim/fnl/dotfiles/plugin/orgmode.fnl index 7ca0e55..75768a8 100644 --- a/nvim/.config/nvim/fnl/dotfiles/plugin/orgmode.fnl +++ b/nvim/.config/nvim/fnl/dotfiles/plugin/orgmode.fnl @@ -1,11 +1,6 @@ -(module dotfiles.plugin.orgmode {autoload {orgmode orgmode}}) - -;;(orgmode.setup_ts_grammar) - -(orgmode.setup {:org_agenda_files ["~/Dropbox/org/*" "~/my-orgs/**/*"] - :org_default_notes_file "~/Dropbox/org/refile.org" - :mappings { - :org { - :org_toggle_checkbox :}}}) - -(require :dotfiles.plugin.orgbullets) +(let [orgmode (require :orgmode)] + ;;(orgmode.setup_ts_grammar) + (orgmode.setup {:org_agenda_files ["~/Dropbox/org/*" "~/my-orgs/**/*"] + :org_default_notes_file "~/Dropbox/org/refile.org" + :mappings {:org {:org_toggle_checkbox :}}}) + (require :dotfiles.plugin.orgbullets)) diff --git a/nvim/.config/nvim/fnl/dotfiles/plugin/packer.fnl b/nvim/.config/nvim/fnl/dotfiles/plugin/packer.fnl index b5946ed..020abf5 100644 --- a/nvim/.config/nvim/fnl/dotfiles/plugin/packer.fnl +++ b/nvim/.config/nvim/fnl/dotfiles/plugin/packer.fnl @@ -1,8 +1,4 @@ -(module dotfiles.plugin.packer - {autoload - {u dotfiles.util} - require - {nvim aniseed.nvim}}) +(local u (require :dotfiles.util)) (u.nnoremap :pi :PackerInstall) (u.nnoremap :pu :PackerUpdate) diff --git a/nvim/.config/nvim/fnl/dotfiles/plugin/paredit.fnl b/nvim/.config/nvim/fnl/dotfiles/plugin/paredit.fnl index 1228ad3..f9a485e 100644 --- a/nvim/.config/nvim/fnl/dotfiles/plugin/paredit.fnl +++ b/nvim/.config/nvim/fnl/dotfiles/plugin/paredit.fnl @@ -1,69 +1,76 @@ (module dotfiles.plugin.paredit {autoload {nvim aniseed.nvim - a aniseed.core - nu aniseed.nvim.util paredit paredit ts-parsers nvim-treesitter.parsers ts-utils nvim-treesitter.ts_utils languagetree vim.treesitter.languagetree}}) -(set nvim.g.paredit_smartjump 1) +(local a (require :aniseed.core)) -(defn list-member? [xs x] (a.some #(= x $1) (a.vals xs))) +(set vim.g.paredit_smartjump 1) -(defn bool->int [bool] (if bool 1 0)) +(fn list-member? [xs x] + (a.some #(= x $1) (a.vals xs))) -(defn int->bool [x] (if (= 0 x) false true)) +(fn bool->int [bool] (if bool 1 0)) -(defn toggle-global! [x] (->> (a.get nvim.g x) - (int->bool) - (not) - (bool->int) - (tset nvim.g x))) +(fn int->bool [x] (if (= 0 x) false true)) -(defn language-at-cursor [] (let [parser (ts-parsers.get_parser) - current-node (ts-utils.get_node_at_cursor) - range (if current-node [(current-node:range)]) - lang (if range - (languagetree.language_for_range parser - range))] - (if lang - (lang:lang)))) +(fn toggle-global! [x] + (->> (a.get vim.g x) + (int->bool) + (not) + (bool->int) + (tset vim.g x))) -(defn parser-language [] (let [parser (ts-parsers.get_parser)] - (when parser - (parser:lang)))) +(fn language-at-cursor [] + (let [parser (ts-parsers.get_parser) + current-node (ts-utils.get_node_at_cursor) + range (if current-node [(current-node:range)]) + lang (if range + (languagetree.language_for_range parser range))] + (if lang + (lang:lang)))) -(def- paredit-langs [:clojure - :fennel - :hy - :janet - :julia - :lfe - :lisp - :racket - :scheme - :shen]) +(fn parser-language [] + (let [parser (ts-parsers.get_parser)] + (when parser + (parser:lang)))) -(def- paredit-host-langs [:org :markdown :asciidoc]) +(local paredit-langs [:clojure + :fennel + :hy + :janet + :julia + :lfe + :lisp + :racket + :scheme + :shen]) -(defn- host-lang-in? [langs] (list-member? langs (parser-language))) +(local paredit-host-langs [:org :markdown :asciidoc]) -(defn paredit-lang? [lang] (list-member? paredit-langs lang)) +(fn host-lang-in? [langs] (list-member? langs (parser-language))) -(defn TreeSitterLangParedit [] - (when (host-lang-in? paredit-host-langs) - (when-let [cursor-lang (language-at-cursor)] - (->> cursor-lang - (paredit-lang?) - (bool->int) - (set nvim.g.paredit_mode)) - (nvim.fn.PareditInitBuffer)))) +(fn paredit-lang? [lang] (list-member? paredit-langs lang)) +(fn TreeSitterLangParedit [] + (when (host-lang-in? paredit-host-langs) + (when-let [cursor-lang (language-at-cursor)] + (->> cursor-lang + (paredit-lang?) + (bool->int) + (set nvim.g.paredit_mode)) + (nvim.fn.PareditInitBuffer)))) -(nvim.ex.autocmd :FileType :ruby :call "PareditInitBalancingAllBracketsBuffer()") -(nvim.ex.autocmd :FileType :javascript :call "PareditInitBalancingAllBracketsBuffer()") -(nvim.ex.autocmd :FileType :terraform :call "PareditInitBalancingAllBracketsBuffer()") +(nvim.ex.autocmd :FileType :ruby :call + "PareditInitBalancingAllBracketsBuffer()") + +(nvim.ex.autocmd :FileType :javascript :call + "PareditInitBalancingAllBracketsBuffer()") + +(nvim.ex.autocmd :FileType :terraform :call + "PareditInitBalancingAllBracketsBuffer()") ; (nvim.del_augroup_by_name "BabeliteParedit") ; (nvim.get_autocmds {:group "BabeliteParedit"}) @@ -75,14 +82,14 @@ ;; :callback TreeSitterLangParedit})) ;; -;; (defn paredit-toggle! [] (toggle-global :paredit_mode) +;; (fn paredit-toggle! [] (toggle-global :paredit_mode) ;; (nvim.fn.PareditInitBuffer) ;; nvim.g.paredit_mode ;; ) ;; ;; \ ;; (int->bool 0) -;; (defn test [x] (a.get nvim.g x)) +;; (fn test [x] (a.get nvim.g x)) ;; ;; (test :pareditmode) ;; (a.get nvim.g :paredit_mode) diff --git a/nvim/.config/nvim/fnl/dotfiles/plugin/smartsplits.fnl b/nvim/.config/nvim/fnl/dotfiles/plugin/smartsplits.fnl index 4159d36..f9850ad 100644 --- a/nvim/.config/nvim/fnl/dotfiles/plugin/smartsplits.fnl +++ b/nvim/.config/nvim/fnl/dotfiles/plugin/smartsplits.fnl @@ -1,27 +1,19 @@ -(module dotfiles.plugin.smartsplits - {autoload {nvim aniseed.nvim - a aniseed.core - smart-splits smart-splits - ;; util dotfiles.util - }}) - -(smart-splits.setup) - -;; recommended mappings -;; resizing splits -;; these keymaps will also accept a range, -;; for example `10` will `resize_left` by `(10 * config.default_amount)` -(vim.keymap.set :n : smart-splits.resize_left) -(vim.keymap.set :n : smart-splits.resize_down) -(vim.keymap.set :n : smart-splits.resize_up) -(vim.keymap.set :n : smart-splits.resize_right) -;; moving between splits -(vim.keymap.set :n : smart-splits.move_cursor_left) -(vim.keymap.set :n : smart-splits.move_cursor_down) -(vim.keymap.set :n : smart-splits.move_cursor_up) -(vim.keymap.set :n : smart-splits.move_cursor_right) -;; swapping buffers between windows -(vim.keymap.set :n :h smart-splits.swap_buf_left) -(vim.keymap.set :n :j smart-splits.swap_buf_down) -(vim.keymap.set :n :k smart-splits.swap_buf_up) -(vim.keymap.set :n :l smart-splits.swap_buf_right) +(let [smart-splits (require :smart-splits)] + (when smart-splits + (smart-splits.setup) + ;; recommended mappings + ;; resizing splits + ;; these keymaps will also accept a range, + ;; for example `10` will `resize_left` by `(10 * config.default_amount)` + (vim.keymap.set :n : smart-splits.resize_left) + (vim.keymap.set :n : smart-splits.resize_down) + (vim.keymap.set :n : smart-splits.resize_up) + (vim.keymap.set :n : smart-splits.resize_right) ; ; moving between splits + (vim.keymap.set :n : smart-splits.move_cursor_left) + (vim.keymap.set :n : smart-splits.move_cursor_down) + (vim.keymap.set :n : smart-splits.move_cursor_up) + (vim.keymap.set :n : smart-splits.move_cursor_right) ; ; swapping buffers between windows + (vim.keymap.set :n :h smart-splits.swap_buf_left) + (vim.keymap.set :n :j smart-splits.swap_buf_down) + (vim.keymap.set :n :k smart-splits.swap_buf_up) + (vim.keymap.set :n :l smart-splits.swap_buf_right))) diff --git a/nvim/.config/nvim/fnl/dotfiles/plugin/telescope.fnl b/nvim/.config/nvim/fnl/dotfiles/plugin/telescope.fnl index bc3cbac..faccfb4 100644 --- a/nvim/.config/nvim/fnl/dotfiles/plugin/telescope.fnl +++ b/nvim/.config/nvim/fnl/dotfiles/plugin/telescope.fnl @@ -4,19 +4,19 @@ telescope telescope project-nvim project_nvim}}) -(def vimgrep_arguments [:ag - :--nocolor - :--noheading - :--number - :--column - :--nobreak - :--smart-case - :--hidden - ; "--skip-vcs-ignores" - ; "-g" "!.git/" - :--ignore - :.git - :--follow]) +(local vimgrep_arguments [:ag + :--nocolor + :--noheading + :--number + :--column + :--nobreak + :--smart-case + :--hidden + ; "--skip-vcs-ignores" + ; "-g" "!.git/" + :--ignore + :.git + :--follow]) (telescope.load_extension :projects) (telescope.load_extension :yank_history) diff --git a/nvim/.config/nvim/fnl/dotfiles/plugin/whichkey.fnl b/nvim/.config/nvim/fnl/dotfiles/plugin/whichkey.fnl index 16bf9d8..f7b6f7c 100644 --- a/nvim/.config/nvim/fnl/dotfiles/plugin/whichkey.fnl +++ b/nvim/.config/nvim/fnl/dotfiles/plugin/whichkey.fnl @@ -1,5 +1,3 @@ -(module dotfiles.plugin.whichkey - {autoload {which-key which-key}}) - -(which-key.setup {}) - +(let [which-key (require :which-key)] + (when which-key + (which-key.setup {}))) diff --git a/nvim/.config/nvim/fnl/dotfiles/plugin/yanky.fnl b/nvim/.config/nvim/fnl/dotfiles/plugin/yanky.fnl index 3de52fb..10af9a2 100644 --- a/nvim/.config/nvim/fnl/dotfiles/plugin/yanky.fnl +++ b/nvim/.config/nvim/fnl/dotfiles/plugin/yanky.fnl @@ -1,9 +1,4 @@ -(module dotfiles.plugin.yanky {autoload {nvim aniseed.nvim - a aniseed.core - ;; util dotfiles.util - yanky yanky} - ;; require {minpac minpac} - }) +(local yanky (require :yanky)) (yanky.setup {:ring {:history_length 100 :storage :shada diff --git a/nvim/.config/nvim/fnl/dotfiles/plugins.fnl b/nvim/.config/nvim/fnl/dotfiles/plugins.fnl index 10f74a1..b22df7f 100644 --- a/nvim/.config/nvim/fnl/dotfiles/plugins.fnl +++ b/nvim/.config/nvim/fnl/dotfiles/plugins.fnl @@ -1,104 +1,101 @@ -(module dotfiles.plugins {autoload {nvim aniseed.nvim - a aniseed.core - ;; util dotfiles.util - packer packer} - ;; require {minpac minpac} - }) +(local packer (require :packer)) +(local core (require :aniseed.core)) -(defn safe-require-plugin-config [name] - (let [(ok? val-or-err) (pcall require (.. :dotfiles.plugin. name))] - (when (not ok?) - (print (.. "dotfiles error: " val-or-err))))) +(fn safe-require-plugin-config [name] + (let [(ok? val-or-err) (pcall require (.. :dotfiles.plugin. name))] + (when (not ok?) + (print (.. "dotfiles error: " val-or-err))))) -(defn- use [pkgs] "Iterates through the arguments as pairs and calls packer's use function for +(fn use [pkgs] + "Iterates through the arguments as pairs and calls packer's use function for each of them. Works around Fennel not liking mixed associative and sequential tables as well." - (packer.startup (fn [use] - (each [name opts (pairs pkgs)] - (-?> (. opts :mod) (safe-require-plugin-config)) - (use (a.assoc opts 1 name)))))) + (packer.startup (fn [use] + (each [name opts (pairs pkgs)] + (-?> (. opts :mod) (safe-require-plugin-config)) + (use (core.assoc opts 1 name)))))) -(def- packages {:Olical/aniseed {} - :Olical/conjure {:mod :conjure} - :Olical/fennel.vim {} - :ahmedkhalf/project.nvim {} - :airblade/vim-gitgutter {} - :akinsho/toggleterm.nvim {:mod :toggleterm} - :clojure-vim/vim-jack-in {} - :christianrondeau/vim-base64 {} - :dhruvasagar/vim-table-mode {} - :folke/lsp-colors.nvim {} - :folke/which-key.nvim {:mod :whichkey} - :gbprod/yanky.nvim {:mod :yanky} - :hashivim/vim-terraform {} - :HiPhish/rainbow-delimiters.nvim {} - :hrsh7th/nvim-cmp {:requires [:hrsh7th/cmp-buffer - :hrsh7th/cmp-emoji - :hrsh7th/cmp-nvim-lsp - :hrsh7th/cmp-nvim-lua - :hrsh7th/cmp-path - :hrsh7th/cmp-vsnip - :hrsh7th/vim-vsnip-integ - :L3MON4D3/LuaSnip - :PaterJason/cmp-conjure - :saadparwaiz1/cmp_luasnip] - :mod :cmp} - :hrsh7th/vim-vsnip {} - :hrsh7th/vim-vsnip-integ {} - :Iron-E/nvim-soluarized {} - :jiangmiao/auto-pairs {} - :nvimtools/none-ls.nvim {:mod :null-ls - :requires [:nvim-lua/plenary.nvim]} - :junegunn/vim-easy-align {:mod :easyalign} - :kovisoft/paredit {:mod :paredit} - :kristijanhusak/vim-dadbod-completion {} - :kristijanhusak/vim-dadbod-ui {} - :L3MON4D3/LuaSnip {:mod :luasnip} - :lifepillar/vim-solarized8 {} - :lukas-reineke/headlines.nvim {:mod :headlines} - ; :michaelb/sniprun {:run "bash ./install.sh" :mod :sniprun} - :mrjones2014/smart-splits.nvim {:mod :smartsplits} - :mechatroner/rainbow_csv {} - :neovim/nvim-lspconfig {:mod :lspconfig} - :norcalli/nvim-colorizer.lua {:mod :colorizer} - :nvim-orgmode/orgmode {:mod :orgmode} - :nvim-telescope/telescope.nvim {:requires [[:nvim-lua/popup.nvim] - [:nvim-lua/plenary.nvim]] - :mod :telescope} - :nvim-treesitter/nvim-treesitter {:run ":TSUpdate" - :mod :treesitter} - :nvim-treesitter/playground {} - :radenling/vim-dispatch-neovim {} - :RaafatTurki/hex.nvim { :mod :hex } - :rafamadriz/friendly-snippets {} - :skywind3000/asyncrun.vim {} - ;; :tjdevries/sg.nvim {:run "cargo build --workspace" - ;; :dependencies [:nvim-lua/plenary.nvim]} - ;; :tpope/vim-classpath {} - :tpope/vim-dadbod {} - :tpope/vim-dispatch {} - :tpope/vim-fugitive {:mod :fugitive} - :tpope/vim-git {} - :tpope/vim-pathogen {} - :tpope/vim-rails {} - :tpope/vim-repeat {} - :tpope/vim-rhubarb {} - :tpope/vim-surround {} - :tpope/vim-unimpaired {} - :tpope/vim-vinegar {} - :wbthomason/packer.nvim {:mod :packer} - ;; :williamboman/nvim-lsp-installbuilder {} - :williamboman/mason.nvim {:mod :mason - :requires [:williamboman/mason-lspconfig.nvim]} - ; NeoVim lsp server installs - ; :p00f/nvim-ts-rainbow {} - ; :luochen1990/rainbow {} - ; :thecontinium/asyncomplete-conjure.vim {} - ; :jose-elias-alvarez/null-ls.nvim {:mod :null-ls - ; :requires [:nvim-lua/plenary.nvim]} - } ; :tpope/vim-fireplace {} ; Clojure - ; :tpope/vim-sexp-mappings-for-regular-people {} - ) +(local packages {:Olical/aniseed {} + :Olical/conjure {:mod :conjure} + :Olical/fennel.vim {} + :ahmedkhalf/project.nvim {} + :airblade/vim-gitgutter {} + :akinsho/toggleterm.nvim {:mod :toggleterm} + :clojure-vim/vim-jack-in {} + :christianrondeau/vim-base64 {} + :dhruvasagar/vim-table-mode {} + :folke/lsp-colors.nvim {} + :folke/which-key.nvim {:mod :whichkey} + :gbprod/yanky.nvim {:mod :yanky} + :hashivim/vim-terraform {} + :HiPhish/rainbow-delimiters.nvim {} + :hrsh7th/nvim-cmp {:requires [:hrsh7th/cmp-buffer + :hrsh7th/cmp-emoji + :hrsh7th/cmp-nvim-lsp + :hrsh7th/cmp-nvim-lua + :hrsh7th/cmp-path + :hrsh7th/cmp-vsnip + :hrsh7th/vim-vsnip-integ + :L3MON4D3/LuaSnip + :PaterJason/cmp-conjure + :saadparwaiz1/cmp_luasnip] + :mod :cmp} + :hrsh7th/vim-vsnip {} + :hrsh7th/vim-vsnip-integ {} + :Iron-E/nvim-soluarized {} + :jiangmiao/auto-pairs {} + :nvimtools/none-ls.nvim {:mod :null-ls + :requires [:nvim-lua/plenary.nvim]} + :junegunn/vim-easy-align {:mod :easyalign} + :kovisoft/paredit {:mod :paredit} + :kristijanhusak/vim-dadbod-completion {} + :kristijanhusak/vim-dadbod-ui {} + :L3MON4D3/LuaSnip {:mod :luasnip} + :lifepillar/vim-solarized8 {} + :lukas-reineke/headlines.nvim {:mod :headlines} + ; :michaelb/sniprun {:run "bash ./install.sh" :mod :sniprun} + :mrjones2014/smart-splits.nvim {:mod :smartsplits} + :mechatroner/rainbow_csv {} + :neovim/nvim-lspconfig {:mod :lspconfig} + :norcalli/nvim-colorizer.lua {:mod :colorizer} + :nvim-orgmode/orgmode {:mod :orgmode} + :nvim-telescope/telescope.nvim {:requires [[:nvim-lua/popup.nvim] + [:nvim-lua/plenary.nvim]] + :mod :telescope} + :nvim-treesitter/nvim-treesitter {:run ":TSUpdate" + :mod :treesitter} + :nvim-treesitter/playground {} + :radenling/vim-dispatch-neovim {} + :RaafatTurki/hex.nvim {:mod :hex} + :rafamadriz/friendly-snippets {} + :skywind3000/asyncrun.vim {} + ;; :tjdevries/sg.nvim {:run "cargo build --workspace" + ;; :dependencies [:nvim-lua/plenary.nvim]} + ;; :tpope/vim-classpath {} + :tpope/vim-dadbod {} + :tpope/vim-dispatch {} + :tpope/vim-fugitive {:mod :fugitive} + :tpope/vim-git {} + :tpope/vim-pathogen {} + :tpope/vim-rails {} + :tpope/vim-repeat {} + :tpope/vim-rhubarb {} + :tpope/vim-surround {} + :tpope/vim-unimpaired {} + :tpope/vim-vinegar {} + :wbthomason/packer.nvim {:mod :packer} + ;; :williamboman/nvim-lsp-installbuilder {} + :williamboman/mason.nvim {:mod :mason + :requires [:williamboman/mason-lspconfig.nvim]} + ; NeoVim lsp server installs + ; :p00f/nvim-ts-rainbow {} + ; :luochen1990/rainbow {} + ; :thecontinium/asyncomplete-conjure.vim {} + ; :jose-elias-alvarez/null-ls.nvim {:mod :null-ls + ; :requires [:nvim-lua/plenary.nvim]} + } + ; :tpope/vim-fireplace {} ; Clojure ; :tpope/vim-sexp-mappings-for-regular-people {} + ) (use packages) diff --git a/nvim/.config/nvim/fnl/dotfiles/terraform-helpers.fnl b/nvim/.config/nvim/fnl/dotfiles/terraform-helpers.fnl index fed6bd5..2f6e65d 100644 --- a/nvim/.config/nvim/fnl/dotfiles/terraform-helpers.fnl +++ b/nvim/.config/nvim/fnl/dotfiles/terraform-helpers.fnl @@ -1,6 +1,4 @@ -(module dotfiles.terraform-helpers - {autoload {a aniseed.core} - require {anenv aniseed.env nvim aniseed.nvim u dotfiles.util}}) +(module dotfiles.terraform-helpers {require {nvim aniseed.nvim}}) (fn append-to-buf [bufno lines] (when lines diff --git a/nvim/.config/nvim/fnl/dotfiles/ts-utils.fnl b/nvim/.config/nvim/fnl/dotfiles/ts-utils.fnl index 21dfac8..c4b2964 100644 --- a/nvim/.config/nvim/fnl/dotfiles/ts-utils.fnl +++ b/nvim/.config/nvim/fnl/dotfiles/ts-utils.fnl @@ -1,12 +1,15 @@ -(module dotfiles.ts-utils {autoload {nvim aniseed.nvim a aniseed.core}}) +(local core (require :aniseed.core)) -(defn root [bufnr lang] (let [parser (vim.treesitter.get_parser bufnr lang {}) - tree (a.first (: parser :parse))] - (: tree :root))) +(fn root [bufnr lang] + (let [parser (vim.treesitter.get_parser bufnr lang {}) + tree (core.first (: parser :parse))] + (: tree :root))) -(defn make-query [lang query-string] - (let [query (vim.treesitter.query.parse lang "(headline (stars) @stars)")] - (fn [bufnr] - (let [root-node (root bufnr lang) - iter-captures (query.iter_captures query root-node bufnr 0 -1)] - iter-captures)))) +(fn make-query [lang query-string] + (let [query (vim.treesitter.query.parse lang "(headline (stars) @stars)")] + (fn [bufnr] + (let [root-node (root bufnr lang) + iter-captures (query.iter_captures query root-node bufnr 0 -1)] + iter-captures)))) + +{: root : make-query}