treesitter

This commit is contained in:
secretspecter 2023-07-27 15:04:46 -06:00
parent df0b939964
commit 37058d1748
3 changed files with 56 additions and 35 deletions

8
README.md Normal file
View file

@ -0,0 +1,8 @@
## Dependencies
- cmake
- cargo
```
:checkhealth
```

View file

@ -19,6 +19,8 @@
:build (.. "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release"
" && cmake --build build --config Release"
" && cmake --install build --prefix build" )}
{:url "https://github.com/nvim-treesitter/nvim-treesitter"
:build ":TSUpdate"}
{:url "https://github.com/neovim/nvim-lspconfig"
:dependencies
["https://github.com/williamboman/mason.nvim"
@ -32,36 +34,45 @@
(let [telescope (require :telescope)]
(pcall (telescope.load_extension :fzf)))
(let
[neodev (require :neodev)
mason (require :mason)
mason-lspconfig (require :mason-lspconfig)
servers
{:lua_ls {:Lua {:workspace {:checkThirdParty false}
:telemetry {:enable false}}}
:fennel_language_server {}
:bashls {}
}
on_attach (fn [_ bufnr]
(let
[nmap #(vim.keymap.set :n $1 $2 {:buffer bufnr :desc (.. "LSP: " $3)})
telescope (require :telescope.builtin)
]
(nmap :gd vim.lsp.buf.definition "[G]o to [D]efiniton")
(nmap :gr telescope.lsp_references "[G]o to [R]eferences")
(nmap :gI vim.lsp.buf.implementation "[G]o to [I]mplementation")
(vim.api.nvim_buf_create_user_command bufnr "Format" #(vim.lsp.buf.format)
"Format current buffer with LSP")))
]
(neodev.setup)
(mason.setup)
(mason-lspconfig.setup {:ensure_installed (vim.tbl_keys servers)})
(mason-lspconfig.setup_handlers
;; TODO require is looking in the wrong spot?
[(fn [server_name] (let [server (. (require :lspconfig) server_name)]
(server.setup
{:capabilities (vim.lsp.protocol.make_client_capabilities)
:on_attach on_attach
:settings (. servers server_name)
:filetypes (or (. servers server_name :filetypes) []) })))
]))
(let [treesitter (require :nvim-treesitter.configs)]
(treesitter.setup
{:ensure_installed [:c :lua :vim :vimdoc :query :fennel]
:sync_install false
:auto_intstall false
:ignore_install []
:highlight {:enable true}
:indent {:enable true}}))
;; TODO fix lua_ls checking .fnl files?
;; (let
;; [neodev (require :neodev)
;; mason (require :mason)
;; mason-lspconfig (require :mason-lspconfig)
;; servers
;; {:lua_ls {:Lua {:workspace {:checkThirdParty false} :telemetry {:enable false}}}
;; :fennel_language_server {:filetypes [:fennel]}
;; :bashls {:filetypes [:bash]}
;; }
;; on_attach (fn [_ bufnr]
;; (let
;; [nmap #(vim.keymap.set :n $1 $2 {:buffer bufnr :desc (.. "LSP: " $3)})
;; telescope (require :telescope.builtin)
;; ]
;; (nmap :gd vim.lsp.buf.definition "[G]o to [D]efiniton")
;; (nmap :gr telescope.lsp_references "[G]o to [R]eferences")
;; (nmap :gI vim.lsp.buf.implementation "[G]o to [I]mplementation")
;; (vim.api.nvim_buf_create_user_command bufnr "Format" #(vim.lsp.buf.format)
;; "Format current buffer with LSP")))
;; ]
;; (neodev.setup)
;; (mason.setup)
;; (mason-lspconfig.setup {:ensure_installed (vim.tbl_keys servers)})
;; (mason-lspconfig.setup_handlers
;; ;; TODO require is looking in the wrong spot?
;; [(fn [server_name] (let [server (. (require :lspconfig) server_name)]
;; (server.setup
;; {:capabilities (vim.lsp.protocol.make_client_capabilities)
;; :on_attach on_attach
;; :settings (. servers server_name)
;; :filetypes (or (. servers server_name :filetypes) []) })))
;; ]))

View file

@ -4,9 +4,11 @@
"lazy.nvim": { "branch": "main", "commit": "3ad55ae678876516156cca2f361c51f7952a924b" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "e86a4c84ff35240639643ffed56ee1c4d55f538e" },
"mason.nvim": { "branch": "main", "commit": "fe9e34a9ab4d64321cdc3ecab4ea1809239bb73f" },
"neodev.nvim": { "branch": "main", "commit": "866b6b6e687a93ba98851a03a74bf6d9211b7299" },
"neodev.nvim": { "branch": "main", "commit": "f57e5210d450b47aa02ea6d9e50a37414f570b4c" },
"nvim-lspconfig": { "branch": "master", "commit": "b6091272422bb0fbd729f7f5d17a56d37499c54f" },
"nvim-treesitter": { "branch": "master", "commit": "6aababfca4e3d72cb1e8fbbdac4115a5f88107d0" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "9e519b6146512c8e2e702faf8ac48420f4f5deec" },
"plenary.nvim": { "branch": "master", "commit": "267282a9ce242bbb0c5dc31445b6d353bed978bb" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "9bc8237565ded606e6c366a71c64c0af25cd7a50" },
"telescope.nvim": { "branch": "master", "commit": "1228f3b15ca3d9b95dcb92efda6a3448871030bd" }
"telescope.nvim": { "branch": "master", "commit": "776b509f80dd49d8205b9b0d94485568236d1192" }
}