neovim things
change
commit 8929fcd600467bc8ace12c2cbe2eb538b0555a54
author Alpha Chen <alpha.chen@brilliant.org>
date
parent 924c178b
diff --git a/.config/nvim/fnl/init.fnl b/.config/nvim/fnl/init.fnl
index 33121b23..259a6f4f 100644
--- a/.config/nvim/fnl/init.fnl
+++ b/.config/nvim/fnl/init.fnl
@@ -2,7 +2,8 @@
 
 (set vim.o.cmdheight 0)
 
-(set vim.o.foldlevel 2)
+(set vim.o.foldlevel 1)
+(set vim.o.foldminlines 2)
 (set vim.o.linebreak true)
 (set vim.o.list true)
 (set vim.o.listchars "tab:⇥ ,trail:␣,extends:⇉,precedes:⇇,nbsp:·")
@@ -123,8 +124,7 @@
 
 ;;; treesitter
 (let [{: treesitter} vim
-      configs (require :nvim-treesitter.configs)
-      {: setup} configs]
+      {: setup} (require :nvim-treesitter.configs)]
   (setup {:ensure_installed [:fennel
                              :hcl
                              :lua
@@ -168,7 +168,16 @@
                                            :ib "@block.inner"
                                            :aa "@parameter.outer"
                                            :ia "@parameter.inner"}}}})
-  (treesitter.language.register :yaml :yaml.ansible))
+  (treesitter.language.register :yaml :yaml.ansible)
+  (treesitter.query.set :python :folds "[
+  (function_definition)
+  (class_definition)
+  (block)
+] @fold
+[
+  (import_statement)
+  (import_from_statement)
+]+ @fold"))
 
 (let [tscontext (require :treesitter-context)]
   (tscontext.setup))
diff --git a/.config/nvim/fnl/lsp.fnl b/.config/nvim/fnl/lsp.fnl
index 6852d7dc..e75b83f1 100644
--- a/.config/nvim/fnl/lsp.fnl
+++ b/.config/nvim/fnl/lsp.fnl
@@ -33,9 +33,14 @@
 (lspconfig.ansiblels.setup {})
 (lspconfig.fennel_ls.setup {:settings {:fennel-ls {:extra-globals "hs spoon vim"}}})
 (lspconfig.terraformls.setup {})
+(lspconfig.ts_ls.setup {})
+(let [{: setup} lspconfig.yamlls
+      schemas {"https://json.schemastore.org/github-workflow.json" :/.github/workflows/*}]
+  (setup {:settings {:yaml {: schemas}}}))
 
 ;;; python
 
+;; only enable pyright/ruff if they're there
 (lspconfig.pyright.setup {:autostart false})
 (lspconfig.ruff.setup {:autostart false})
 (nvim-create-autocmd :FileType
@@ -44,10 +49,6 @@
                                    (if (= (vim.fn.executable lsp) 1)
                                        (vim.cmd :LspStart lsp)))})
 
-(let [{: setup} lspconfig.yamlls
-      schemas {"https://json.schemastore.org/github-workflow.json" :/.github/workflows/*}]
-  (setup {:settings {:yaml {: schemas}}}))
-
 ;;; efm-langserver
 
 (let [fmt #{:formatCommand $1 :formatStdin true}