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