diff --git a/nvim/.config/nvim/fnl/dotfiles/plugin/lspconfig.fnl b/nvim/.config/nvim/fnl/dotfiles/plugin/lspconfig.fnl index b9304f8..71556a1 100644 --- a/nvim/.config/nvim/fnl/dotfiles/plugin/lspconfig.fnl +++ b/nvim/.config/nvim/fnl/dotfiles/plugin/lspconfig.fnl @@ -132,3 +132,64 @@ (nu.fn-bridge :LspExecuteCommand :dotfiles.plugin.lspconfig :lsp-execute-command {:return false}) (u.nnoremap :li "LspInfo"))) + + +;; (let [eval (require :conjure.eval) +;; client (require :conjure.client) +;; ts-utils (require :nvim-treesitter.ts_utils) +;; parsers (require :nvim-treesitter.parsers) +;; ] +;; +;; ; client["with-filetype"]("fennel", eval["eval-str"], { +;; ; origin = "my-awesome-plugin", +;; ; code = "(+ 10 20)", +;; ; ["passive?"] = true, +;; ; ["on-result"] = function (r) +;; ; print("RESULT:", r) +;; ; end +;; ; }) +;; +;; (defn ts-node-descendent-of? [node ancestor-type] +;; (print node) +;; (if (= nil node) +;; false +;; (let [node-type (node:type)] +;; (print node-type) +;; (if (= ancestor-type node-type) +;; true +;; (ts-node-descendent-of? (node:parent) ancestor-type))))) +;; +;; (defn in-fenced-code-block? [] +;; (let [cursor (vim.api.nvim_win_get_cursor 0) +;; lnum (a.first cursor) +;; col (a.second cursor) +;; root_lang_tree (parsers.get_parser) +;; range [ lnum - 1 col lnum - 1 col ] +;; (node root lang-tree) (ts-utils.get_root_for_position (- lnum 1) col root_lang_tree) ] +;; (a.pr "language" (a.get lang-tree :_lang :err)) +;; ) +;; (let [node-at-cursor (ts-utils.get_node_at_cursor)] +;; (print "node at cursor" node-at-cursor) +;; (a.pr "root for node at cursor " (ts-utils.get_root_for_node node-at-cursor)) +;; (print (ts-node-descendent-of? node-at-cursor :fenced_code_block)))) +;; +;; (defn markdown-code-to-repl [] +;; ; (let [buf-uri (vim.uri_from_bufnr 0) +;; ; cursor (vim.api.nvim_win_get_cursor 0) +;; ; r (- (a.first cursor) 1) +;; ; c (a.second cursor) +;; ; opts [buf-uri r c] +;; ; args (a.concat opts [...])] +;; ; (vim.lsp.buf.execute_command {:command cmd +;; ; :arguments args})) +;; ) +;; +;; (nu.fn-bridge :MarkdownCodeToRepl :dotfiles.plugin.lspconfig :markdown-code-to-repl {:return false}) +;; +;; (nu.fn-bridge :IsInFencedCodeBlock :dotfiles.plugin.lspconfig :in-fenced-code-block? {:return false}) +;; +;; ;; If file type is Markdown +;; ;(u.nnoremap :ee "call MarkdownCodeToRepl") +;; +;; ) +;; diff --git a/nvim/.config/nvim/fnl/dotfiles/plugin/treesitter.fnl b/nvim/.config/nvim/fnl/dotfiles/plugin/treesitter.fnl index 8fa9905..58dc80a 100644 --- a/nvim/.config/nvim/fnl/dotfiles/plugin/treesitter.fnl +++ b/nvim/.config/nvim/fnl/dotfiles/plugin/treesitter.fnl @@ -18,4 +18,5 @@ :#6c71c4 ; violet / brmagenta ] ; table of hex strings } + :playground {:enable true} }) diff --git a/nvim/.config/nvim/fnl/dotfiles/plugins.fnl b/nvim/.config/nvim/fnl/dotfiles/plugins.fnl index 109aeaa..d9b7004 100644 --- a/nvim/.config/nvim/fnl/dotfiles/plugins.fnl +++ b/nvim/.config/nvim/fnl/dotfiles/plugins.fnl @@ -53,7 +53,8 @@ :neovim/nvim-lspconfig {:mod :lspconfig} ; NeoVim lsp config :norcalli/nvim-colorizer.lua {:mode :colorizer} :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/nvim-treesitter {:run ":TSUpdate" :mod :treesitter :requires [:nvim-treesitter/playground]} + :nvim-treesitter/playground {} :p00f/nvim-ts-rainbow {} :radenling/vim-dispatch-neovim {} ; Clojure :skywind3000/asyncrun.vim {} ; :AsyncRun